diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java index 6284e86..37673d3 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java @@ -1657,51 +1657,50 @@ public class TestController extends BaseController { - @RequestMapping(value = "/updateRecordOpinion", method = RequestMethod.GET) + @RequestMapping(value = "/updateRecordOpinionFu", method = RequestMethod.GET) @ResponseBody - public String updateRecordOpinion(@RequestParam(required = false) String hospitalId, @RequestParam(required = false) String cid - , @RequestParam(required = false) String fid) { + public String updateRecordOpinionFu(@RequestParam(required = false) String hospitalId + , @RequestParam(required = false) String id) { - - AntExChuQuery antExChuQuery = new AntExChuQuery(); - antExChuQuery.setIsOpinion(true); + // 查询复诊 + AntExQuery antExQuery = new AntExQuery(); + antExQuery.setIsOpinion(true); if (StringUtils.isNotEmpty(hospitalId)) { - antExChuQuery.setHospitalId(hospitalId); + antExQuery.setHospitalId(hospitalId); } - if (StringUtils.isNotEmpty(cid)) + if (StringUtils.isNotEmpty(id)) { - antExChuQuery.setId(cid); + antExQuery.setId(id); } - List antExChuModelList = antenatalExaminationService.queryAntExChu(antExChuQuery); - - if (CollectionUtils.isNotEmpty(antExChuModelList)) { + List antenatalExaminationModelList = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); + if (CollectionUtils.isNotEmpty(antenatalExaminationModelList)) { int batchSize = 100; int end = 0; - for (int i = 0; i < antExChuModelList.size(); i += batchSize) { + for (int i = 0; i < antenatalExaminationModelList.size(); i += batchSize) { end = (end + batchSize); - if (end > antExChuModelList.size()) { - end = antExChuModelList.size(); + if (end > antenatalExaminationModelList.size()) { + end = antenatalExaminationModelList.size(); } - System.out.println("start:" + i + ",end:" + end); - final List tempList = antExChuModelList.subList(i, end); + System.out.println("fstart:" + i + ",fend:" + end); + final List tempList = antenatalExaminationModelList.subList(i, end); commonThreadPool.execute(new Runnable() { @Override public void run() { if (CollectionUtils.isNotEmpty(tempList)) { - for (AntExChuModel chuModel : tempList) { + for (AntenatalExaminationModel fuModel : tempList) { AntExRecordQuery pageAntExRecordsQuery = new AntExRecordQuery(); - pageAntExRecordsQuery.setfId(chuModel.getId()); + pageAntExRecordsQuery.setfId(fuModel.getId()); List recordModels = recordService.queryAntExRecords(pageAntExRecordsQuery); if (CollectionUtils.isNotEmpty(recordModels)) { - if (StringUtils.isNotEmpty(chuModel.getTreatOpinion())) + if (StringUtils.isNotEmpty(fuModel.getTreatmentOpinion())) { - System.out.println("chuId=" + chuModel.getId()+";chuModel.getTreatOpinion()"); + System.out.println("fId=" + fuModel.getId()+";"+fuModel.getTreatmentOpinion()); AntExRecordModel recordModel = recordModels.get(0); - recordModel.setTreatOpinion(chuModel.getTreatOpinion()); + recordModel.setTreatOpinion(fuModel.getTreatmentOpinion()); recordService.updateOne(recordModel,recordModel.getId()); } } @@ -1712,45 +1711,54 @@ public class TestController extends BaseController { } } - // 查询复诊 - AntExQuery antExQuery = new AntExQuery(); - antExQuery.setIsOpinion(true); + return "updateRecordOpinionFu finish"; + } + + + @RequestMapping(value = "/updateRecordOpinionChu", method = RequestMethod.GET) + @ResponseBody + public String updateRecordOpinionChu(@RequestParam(required = false) String hospitalId, @RequestParam(required = false) String id) { + + + AntExChuQuery antExChuQuery = new AntExChuQuery(); + antExChuQuery.setIsOpinion(true); if (StringUtils.isNotEmpty(hospitalId)) { - antExQuery.setHospitalId(hospitalId); + antExChuQuery.setHospitalId(hospitalId); } - if (StringUtils.isNotEmpty(fid)) + if (StringUtils.isNotEmpty(id)) { - antExQuery.setId(fid); + antExChuQuery.setId(id); } - List antenatalExaminationModelList = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); - if (CollectionUtils.isNotEmpty(antenatalExaminationModelList)) { + List antExChuModelList = antenatalExaminationService.queryAntExChu(antExChuQuery); + + if (CollectionUtils.isNotEmpty(antExChuModelList)) { int batchSize = 100; int end = 0; - for (int i = 0; i < antenatalExaminationModelList.size(); i += batchSize) { + for (int i = 0; i < antExChuModelList.size(); i += batchSize) { end = (end + batchSize); - if (end > antenatalExaminationModelList.size()) { - end = antenatalExaminationModelList.size(); + if (end > antExChuModelList.size()) { + end = antExChuModelList.size(); } - System.out.println("fstart:" + i + ",fend:" + end); - final List tempList = antenatalExaminationModelList.subList(i, end); + System.out.println("start:" + i + ",end:" + end); + final List tempList = antExChuModelList.subList(i, end); commonThreadPool.execute(new Runnable() { @Override public void run() { if (CollectionUtils.isNotEmpty(tempList)) { - for (AntenatalExaminationModel fuModel : tempList) { + for (AntExChuModel chuModel : tempList) { AntExRecordQuery pageAntExRecordsQuery = new AntExRecordQuery(); - pageAntExRecordsQuery.setfId(fuModel.getId()); + pageAntExRecordsQuery.setfId(chuModel.getId()); List recordModels = recordService.queryAntExRecords(pageAntExRecordsQuery); if (CollectionUtils.isNotEmpty(recordModels)) { - if (StringUtils.isNotEmpty(fuModel.getTreatmentOpinion())) + if (StringUtils.isNotEmpty(chuModel.getTreatOpinion())) { - System.out.println("fId=" + fuModel.getId()+";chuModel.getTreatOpinion()"); + System.out.println("chuId=" + chuModel.getId()+";"+chuModel.getTreatOpinion()); AntExRecordModel recordModel = recordModels.get(0); - recordModel.setTreatOpinion(fuModel.getTreatmentOpinion()); + recordModel.setTreatOpinion(chuModel.getTreatOpinion()); recordService.updateOne(recordModel,recordModel.getId()); } } @@ -1760,11 +1768,12 @@ public class TestController extends BaseController { }); } } - - return "updateRecordOpinion finish"; + return "updateRecordOpinionChu finish"; } + + @Autowired private CommonService commonService; @Autowired