From d0fc07c9179e5f124659674a6ab9468be84051f9 Mon Sep 17 00:00:00 2001 From: cfl Date: Wed, 6 Dec 2023 13:54:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8=E5=BB=BA?= =?UTF-8?q?=E6=A1=A3=E7=94=9F=E6=88=90=E5=88=9D=E6=A3=80=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=8A=9F=E8=83=BDbug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operate/web/controller/RemoteController.java | 320 +++++++++++---------- 1 file changed, 161 insertions(+), 159 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java index 45fe68d..f571bf8 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java @@ -358,179 +358,181 @@ public class RemoteController extends BaseController { final String cDueWeek = request.getcDueWeek(); BaseObjectResponse baseObjectResponse = bookbuildingFacade.addPregnantBookbuilding(request, Integer.valueOf(archiveUsers.getAssistUserId()), false); - new Thread(new Runnable() { - @Override - public void run() { - System.out.println("start auto generate antexc......"); - try { - //查询预约建档信息 - ArchiveDataQuery query = new ArchiveDataQuery(); - query.setIdCard(idCard); - List list = archiveDataServicer.query(query.convertToQuery()); - if (CollectionUtils.isNotEmpty(list)) { - Map map = JsonUtil.str2Obj(list.get(0).getJsonData(), HashMap.class); - String history1 = JsonUtil.obj2JsonString(map.get("history")); - Map history = JsonUtil.str2Obj(history1,Map.class) ; - - PatientsQuery patientsQuery = new PatientsQuery(); - patientsQuery.setYn(YnEnums.YES.getId()); - patientsQuery.setType(1); - patientsQuery.setCardNo(idCard); - List patientsList = patientsService.queryPatient(patientsQuery); - Patients patients = patientsList.get(0); - - AntExcAddRequest antExcAddRequest = new AntExcAddRequest(); - antExcAddRequest.setOperaterUserId(assistUserId); - antExcAddRequest.setPid(patients.getPid()); - antExcAddRequest.setParentId(patients.getId()); - antExcAddRequest.setName(patients.getUsername()); - antExcAddRequest.setCheckTime(DateUtil.getyyyy_MM_dd_hms(new Date())); - antExcAddRequest.setProdDoctor(assistUserId); - antExcAddRequest.setcDueWeek(cDueWeek); - - if (history.get("bp") != null) { - String bp = JsonUtil.obj2JsonString(history.get("bp")); - antExcAddRequest.setBp(JsonUtil.str2Obj(bp, Map.class)); - } - // 既往史 - if (history.get("pastHistory") != null) { - String pastHistory = JsonUtil.obj2JsonString(history.get("pastHistory")); - if (StringUtils.isNotEmpty(pastHistory)) { - Map pastHistoryMap = JsonUtil.jkstr2Obj(pastHistory, Map.class); - antExcAddRequest.setPastHistory(pastHistoryMap); + System.out.println("confirmArchive return :"+JsonUtil.obj2JsonString(baseObjectResponse)); + if(baseObjectResponse.getErrorcode()==ErrorCodeConstants.SUCCESS){ + new Thread(new Runnable() { + @Override + public void run() { + System.out.println("start auto generate antexc......"); + try { + //查询预约建档信息 + ArchiveDataQuery query = new ArchiveDataQuery(); + query.setIdCard(idCard); + List list = archiveDataServicer.query(query.convertToQuery()); + if (CollectionUtils.isNotEmpty(list)) { + Map map = JsonUtil.str2Obj(list.get(0).getJsonData(), HashMap.class); + String history1 = JsonUtil.obj2JsonString(map.get("history")); + Map history = JsonUtil.str2Obj(history1,Map.class) ; + + PatientsQuery patientsQuery = new PatientsQuery(); + patientsQuery.setYn(YnEnums.YES.getId()); + patientsQuery.setType(1); + patientsQuery.setCardNo(idCard); + patientsQuery.setDesc("true"); + patientsQuery.setSort("created"); + List patientsList = patientsService.queryPatient(patientsQuery); + Patients patients = patientsList.get(0); + + AntExcAddRequest antExcAddRequest = new AntExcAddRequest(); + antExcAddRequest.setOperaterUserId(assistUserId); + antExcAddRequest.setPid(patients.getPid()); + antExcAddRequest.setParentId(patients.getId()); + antExcAddRequest.setName(patients.getUsername()); + antExcAddRequest.setCheckTime(DateUtil.getyyyy_MM_dd_hms(new Date())); + antExcAddRequest.setProdDoctor(assistUserId); + antExcAddRequest.setcDueWeek(cDueWeek); + + if (history.get("bp") != null) { + String bp = JsonUtil.obj2JsonString(history.get("bp")); + antExcAddRequest.setBp(JsonUtil.str2Obj(bp, Map.class)); } - } - // 家族史 - if (history.get("familyHistory") != null) { - String familyHistory = JsonUtil.obj2JsonString(history.get("familyHistory")); - if (StringUtils.isNotEmpty(familyHistory)) { - Map familyHistoryMap = JsonUtil.jkstr2Obj(familyHistory, Map.class); - antExcAddRequest.setFamilyHistory(familyHistoryMap); + // 既往史 + if (history.get("pastHistory") != null) { + String pastHistory = JsonUtil.obj2JsonString(history.get("pastHistory")); + if (StringUtils.isNotEmpty(pastHistory)) { + Map pastHistoryMap = JsonUtil.jkstr2Obj(pastHistory, Map.class); + antExcAddRequest.setPastHistory(pastHistoryMap); + } } - } - //个人史 - if (history.get("personalHistory") != null) { - String personalHistory = JsonUtil.obj2JsonString(history.get("personalHistory")); - if (StringUtils.isNotEmpty(personalHistory)) { - Map personalHistoryMap = JsonUtil.jkstr2Obj(personalHistory, Map.class); - antExcAddRequest.setPersonalHistory(personalHistoryMap); + // 家族史 + if (history.get("familyHistory") != null) { + String familyHistory = JsonUtil.obj2JsonString(history.get("familyHistory")); + if (StringUtils.isNotEmpty(familyHistory)) { + Map familyHistoryMap = JsonUtil.jkstr2Obj(familyHistory, Map.class); + antExcAddRequest.setFamilyHistory(familyHistoryMap); + } } - } - //妇科手术史 - if (history.get("fksxHistory") != null) { - String fksxHistory = JsonUtil.obj2JsonString(history.get("fksxHistory")); - if (StringUtils.isNotEmpty(fksxHistory)) { - Map fksxHistoryMap = JsonUtil.jkstr2Obj(fksxHistory, Map.class); - antExcAddRequest.setFksxHistory(fksxHistoryMap); + //个人史 + if (history.get("personalHistory") != null) { + String personalHistory = JsonUtil.obj2JsonString(history.get("personalHistory")); + if (StringUtils.isNotEmpty(personalHistory)) { + Map personalHistoryMap = JsonUtil.jkstr2Obj(personalHistory, Map.class); + antExcAddRequest.setPersonalHistory(personalHistoryMap); + } } - } - //本次妊娠情况 - if (history.get("cestationInfo") != null) { - String cestationInfo = JsonUtil.obj2JsonString(history.get("cestationInfo")); - if (StringUtils.isNotEmpty(cestationInfo)) { - Map cestationInfoMap = JsonUtil.jkstr2Obj(cestationInfo, Map.class); - antExcAddRequest.setCestationInfo(cestationInfoMap); + //妇科手术史 + if (history.get("fksxHistory") != null) { + String fksxHistory = JsonUtil.obj2JsonString(history.get("fksxHistory")); + if (StringUtils.isNotEmpty(fksxHistory)) { + Map fksxHistoryMap = JsonUtil.jkstr2Obj(fksxHistory, Map.class); + antExcAddRequest.setFksxHistory(fksxHistoryMap); + } } - } - //叶酸服用情况 - if (history.get("ysfyHistory") != null) { - String ysfyHistory = JsonUtil.obj2JsonString(history.get("ysfyHistory")); - if (StringUtils.isNotEmpty(ysfyHistory)) { - Map ysfyHistoryMap = JsonUtil.jkstr2Obj(ysfyHistory, Map.class); - antExcAddRequest.setYsfyHistory(ysfyHistoryMap); + //本次妊娠情况 + if (history.get("cestationInfo") != null) { + String cestationInfo = JsonUtil.obj2JsonString(history.get("cestationInfo")); + if (StringUtils.isNotEmpty(cestationInfo)) { + Map cestationInfoMap = JsonUtil.jkstr2Obj(cestationInfo, Map.class); + antExcAddRequest.setCestationInfo(cestationInfoMap); + } } - } - //传染病史 - if (history.get("infectDiseases") != null) { - String infectDiseases = JsonUtil.obj2JsonString(history.get("infectDiseases")); - if (StringUtils.isNotEmpty(infectDiseases)) { - Map infectDiseasesMap = JsonUtil.jkstr2Obj(infectDiseases, Map.class); - antExcAddRequest.setInfectDiseases(infectDiseasesMap); + //叶酸服用情况 + if (history.get("ysfyHistory") != null) { + String ysfyHistory = JsonUtil.obj2JsonString(history.get("ysfyHistory")); + if (StringUtils.isNotEmpty(ysfyHistory)) { + Map ysfyHistoryMap = JsonUtil.jkstr2Obj(ysfyHistory, Map.class); + antExcAddRequest.setYsfyHistory(ysfyHistoryMap); + } + } + //传染病史 + if (history.get("infectDiseases") != null) { + String infectDiseases = JsonUtil.obj2JsonString(history.get("infectDiseases")); + if (StringUtils.isNotEmpty(infectDiseases)) { + Map infectDiseasesMap = JsonUtil.jkstr2Obj(infectDiseases, Map.class); + antExcAddRequest.setInfectDiseases(infectDiseasesMap); + } } - } - //剖宫产次数 - if (history.get("planedProd") != null) { - antExcAddRequest.setPlanedProd((Integer) history.get("planedProd")); - } - //顺产次数 - if (history.get("delivery") != null) { - antExcAddRequest.setDelivery((Integer) history.get("delivery")); - } - //引产次数 - if (history.get("yinchan") != null) { - antExcAddRequest.setYinchan((Integer) history.get("yinchan")); - } - //流产 - if (history.get("abortion") != null) { - antExcAddRequest.setAbortion((Integer) history.get("abortion")); - } - //自然流产 - if (history.get("abortionZR") != null) { - antExcAddRequest.setAbortionZR((Integer) history.get("abortionZR")); - } - //人工流产 - if (history.get("abortionRG") != null) { - antExcAddRequest.setAbortionRG((Integer) history.get("abortionRG")); - } - //药物流产 - if (history.get("yaowu") != null) { - antExcAddRequest.setYaowu((Integer) history.get("yaowu")); - } + //剖宫产次数 + if (history.get("planedProd") != null) { + antExcAddRequest.setPlanedProd((Integer) history.get("planedProd")); + } + //顺产次数 + if (history.get("delivery") != null) { + antExcAddRequest.setDelivery((Integer) history.get("delivery")); + } + //引产次数 + if (history.get("yinchan") != null) { + antExcAddRequest.setYinchan((Integer) history.get("yinchan")); + } + //流产 + if (history.get("abortion") != null) { + antExcAddRequest.setAbortion((Integer) history.get("abortion")); + } + //自然流产 + if (history.get("abortionZR") != null) { + antExcAddRequest.setAbortionZR((Integer) history.get("abortionZR")); + } + //人工流产 + if (history.get("abortionRG") != null) { + antExcAddRequest.setAbortionRG((Integer) history.get("abortionRG")); + } + //药物流产 + if (history.get("yaowu") != null) { + antExcAddRequest.setYaowu((Integer) history.get("yaowu")); + } - //孕次 - if (history.get("pregnancyTimes") != null) { - antExcAddRequest.setPregnancyTimes((Integer) history.get("pregnancyTimes")); - } - //产次 - antExcAddRequest.setProdTime((antExcAddRequest.getDelivery() != null ? antExcAddRequest.getDelivery() : 0) - + (antExcAddRequest.getPlanedProd() != null ? antExcAddRequest.getPlanedProd() : 0) - + (antExcAddRequest.getYinchan() != null ? antExcAddRequest.getYinchan() : 0) - + (antExcAddRequest.getAbortion() != null ? antExcAddRequest.getAbortion() : 0) - ); - - if (history.get("yqWeight") != null) { - antExcAddRequest.setYqweight(history.get("yqWeight").toString()); - antExcAddRequest.setYqWeight(history.get("yqWeight").toString()); - } - if (history.get("weight") != null) { - antExcAddRequest.setWeight(history.get("weight").toString()); - ; - } - if (history.get("height") != null) { - antExcAddRequest.setHeight(history.get("height").toString()); - } - if (StringUtils.isNotEmpty(antExcAddRequest.getWeight()) && StringUtils.isNotEmpty(antExcAddRequest.getHeight())) { - Double wh = Double.parseDouble(antExcAddRequest.getHeight()) / 100; - Double shen = wh * wh; - Double bmi = Double.parseDouble(antExcAddRequest.getWeight()) / shen; - antExcAddRequest.setBaricIndex(bmi + ""); - } - //指导意见 - GuidelinesQuery guidelinesQuery = new GuidelinesQuery(); - guidelinesQuery.setType(1); - guidelinesQuery.setMaxStart(5); - guidelinesQuery.setMinEnd(5); - List guidelines = guidelinesService.queryGuidelines(guidelinesQuery); - StringBuilder stringBuilder = new StringBuilder(128); - if (CollectionUtils.isNotEmpty(list)) { - for (Guidelines guideline : guidelines) { - stringBuilder.append(guideline.getCategory()).append(" ").append(guideline.getContent()).append("\r\n"); + //孕次 + if (history.get("pregnancyTimes") != null) { + antExcAddRequest.setPregnancyTimes((Integer) history.get("pregnancyTimes")); + } + //产次 + antExcAddRequest.setProdTime((antExcAddRequest.getDelivery() != null ? antExcAddRequest.getDelivery() : 0) + + (antExcAddRequest.getPlanedProd() != null ? antExcAddRequest.getPlanedProd() : 0) + + (antExcAddRequest.getYinchan() != null ? antExcAddRequest.getYinchan() : 0) + + (antExcAddRequest.getAbortion() != null ? antExcAddRequest.getAbortion() : 0) + ); + + if (history.get("yqWeight") != null) { + antExcAddRequest.setYqweight(history.get("yqWeight").toString()); + antExcAddRequest.setYqWeight(history.get("yqWeight").toString()); + } + if (history.get("weight") != null) { + antExcAddRequest.setWeight(history.get("weight").toString()); + ; + } + if (history.get("height") != null) { + antExcAddRequest.setHeight(history.get("height").toString()); + } + if (StringUtils.isNotEmpty(antExcAddRequest.getWeight()) && StringUtils.isNotEmpty(antExcAddRequest.getHeight())) { + Double wh = Double.parseDouble(antExcAddRequest.getHeight()) / 100; + Double shen = wh * wh; + Double bmi = Double.parseDouble(antExcAddRequest.getWeight()) / shen; + antExcAddRequest.setBaricIndex(bmi + ""); + } + //指导意见 + GuidelinesQuery guidelinesQuery = new GuidelinesQuery(); + guidelinesQuery.setType(1); + guidelinesQuery.setMaxStart(5); + guidelinesQuery.setMinEnd(5); + List guidelines = guidelinesService.queryGuidelines(guidelinesQuery); + StringBuilder stringBuilder = new StringBuilder(128); + if (CollectionUtils.isNotEmpty(list)) { + for (Guidelines guideline : guidelines) { + stringBuilder.append(guideline.getCategory()).append(" ").append(guideline.getContent()).append("\r\n"); + } + antExcAddRequest.setGuide(stringBuilder.toString()); } - antExcAddRequest.setGuide(stringBuilder.toString()); - } - BaseResponse baseResponse = antenatalExaminationFacade.addOneAnetExChu(antExcAddRequest, Integer.valueOf(assistUserId)); - System.out.println("auto generate antexc end," + baseResponse.toString()); + BaseResponse baseResponse = antenatalExaminationFacade.addOneAnetExChu(antExcAddRequest, Integer.valueOf(assistUserId)); + System.out.println("auto generate antexc end," + baseResponse.toString()); + } + }catch (Exception e){ + e.printStackTrace(); } - }catch (Exception e){ - e.printStackTrace(); } - } - }).start(); + }).start(); - System.out.println("confirmArchive return :"+JsonUtil.obj2JsonString(baseObjectResponse)); - if(baseObjectResponse.getErrorcode()==ErrorCodeConstants.SUCCESS){ writeString(response,"success"); return; } -- 1.8.3.1