Commit 414892833efe27bee3b1f9d8b2238408ceeb911a

Authored by liquanyu
1 parent 435f2db211

荣成接口

Showing 3 changed files with 236 additions and 5 deletions

platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java View file @ 4148928
... ... @@ -27,6 +27,7 @@
27 27  
28 28 private Date end;
29 29 private String hospitalId;
  30 + private List<String> hospitalIds;
30 31 private boolean neStart;
31 32  
32 33 private boolean neEnd;
... ... @@ -48,6 +49,14 @@
48 49  
49 50 private Date modifiedEnd;
50 51  
  52 + public List<String> getHospitalIds() {
  53 + return hospitalIds;
  54 + }
  55 +
  56 + public void setHospitalIds(List<String> hospitalIds) {
  57 + this.hospitalIds = hospitalIds;
  58 + }
  59 +
51 60 public Date getModifiedStart() {
52 61 return modifiedStart;
53 62 }
... ... @@ -186,6 +195,10 @@
186 195 }
187 196 if(null!=hospitalId){
188 197 condition= condition.and("hospitalId",hospitalId, MongoOper.IS);
  198 + }
  199 +
  200 + if(null!=hospitalIds && hospitalIds.size() > 0){
  201 + condition= condition.and("hospitalId",hospitalIds, MongoOper.IN);
189 202 }
190 203 if(null!=pid){
191 204 condition= condition.and("pid",pid, MongoOper.IS);
platform-operate-api/src/main/java/com/lyms/hospitalapi/rcfy/RcGlxtService.java View file @ 4148928
... ... @@ -14,6 +14,7 @@
14 14 import com.lyms.platform.operate.web.result.HighScoreResult;
15 15 import com.lyms.platform.operate.web.utils.CollectionUtils;
16 16 import com.lyms.platform.operate.web.utils.CommonsHelper;
  17 +import com.lyms.platform.operate.web.utils.FunvCommonUtil;
17 18 import com.lyms.platform.permission.service.OrganizationService;
18 19 import com.lyms.platform.permission.service.UsersService;
19 20 import com.lyms.platform.pojo.*;
... ... @@ -85,7 +86,7 @@
85 86 private static Map<String,String> CHECK_TYPE = new HashMap<>();
86 87 static{
87 88 hospitalsMap.put("2100001785","371082007011");//荣成市人民医院
88   -// hospitalsMap.put("216","216");//测试用的秦皇岛医院
  89 + hospitalsMap.put("216","216");//测试用的秦皇岛医院
89 90 hospitalsMap.put("2100001818","371082006011");//荣成市石岛人民医院
90 91 hospitalsMap.put("2100001773","371082006011");//荣成市石岛人民医院
91 92 hospitalsMap.put("2100001772","371082007001");//荣成市中医院
92 93  
... ... @@ -124,7 +125,170 @@
124 125 return hids;
125 126 }
126 127  
  128 + public void saveCheckFu(AntenatalExaminationModel model)
  129 + {
  130 + Connection conn = null;
  131 + PreparedStatement ps = null;
  132 + try {
  133 + conn = ConnTools.makeConnection();
127 134  
  135 + String sql = "insert into EARLY_PREGNANCY_RIS(ID,NAME,ID_CARD,MEDICAL_RECORD_NO,PREGNANCY_JUDGMENT,HANDLING_SUGGESTION,VISIT_DOCTIR,VISIT_DATE,FROM_HOSPITAL, OPERATOR,OPERAT_TIME,CREATE_TIME,UPDATE_TIME) " +
  136 + " values(?,?,?,?,?,?,?,?,?,?,?,?,?)";
  137 +
  138 + Patients patients = patientsService.findOnePatientById(model.getParentId());
  139 + if (patients == null)
  140 + {
  141 + return;
  142 + }
  143 +
  144 + ps = conn.prepareStatement("delete from EARLY_PREGNANCY_RIS WHERE ID ='" + model.getId() + "'");
  145 + ps.executeUpdate();
  146 +
  147 + ps = conn.prepareStatement(sql);
  148 + ps.setString(1,model.getId());
  149 + ps.setString(2,patients.getUsername());
  150 + ps.setString(3,patients.getCardNo());
  151 + ps.setString(4,patients.getBlNum());
  152 +
  153 + String diagnosis = "";
  154 + if (org.apache.commons.lang.StringUtils.isNotEmpty(model.getDiagnosis())) {
  155 + List<String> temp = JsonUtil.toList(model.getDiagnosis(), String.class);
  156 + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(temp)) {
  157 + StringBuilder sb = new StringBuilder();
  158 + for (String sId : temp) {
  159 + sb.append(FunvCommonUtil.getBaseicConfigByid(sId, basicConfigService)).append(",");
  160 + }
  161 + if (sb.toString().endsWith(",")) {
  162 + diagnosis = sb.substring(0, sb.length() - 1);
  163 + } else {
  164 + diagnosis = sb.toString();
  165 + }
  166 + }
  167 + }
  168 + if (StringUtils.isNotEmpty(diagnosis) && StringUtils.isNotEmpty(model.getDiagnosisOther()))
  169 + {
  170 + diagnosis+=" "+model.getDiagnosisOther();
  171 + }
  172 + else
  173 + {
  174 + diagnosis+=model.getDiagnosisOther();
  175 + }
  176 + ps.setString(5, diagnosis);
  177 + ps.setString(6, model.getTreatmentOpinion());
  178 + ps.setString(7, StringUtils.isNum(model.getCheckDoctor()) ? CommonsHelper.getUserName(model.getCheckDoctor(), usersService) : model.getCheckDoctor());
  179 + ps.setTimestamp(8, new Timestamp(model.getCheckDate().getTime()));
  180 + ps.setString(9, hospitalsMap.get(model.getHospitalId()));
  181 + ps.setTimestamp(10, new Timestamp(model.getCreated().getTime()));
  182 + ps.setTimestamp(11, new Timestamp(model.getModified().getTime()));
  183 + ps.setString(12, CommonsHelper.getUserName(model.getOperator() + "", usersService));
  184 + ps.setTimestamp(13, new Timestamp(model.getCreated().getTime()));
  185 +
  186 + int saveCheckFuCount = ps.executeUpdate();
  187 + System.out.println("saveCheckFu="+saveCheckFuCount);
  188 +
  189 + }
  190 + catch (Exception e)
  191 + {
  192 + ExceptionUtils.catchException(e,"saveCheckFuCount error.");
  193 + }finally {
  194 + try {
  195 + if (ps != null)
  196 + {
  197 + ps.close();
  198 + }
  199 + if (conn != null)
  200 + {
  201 + conn.close();
  202 + }
  203 + } catch (SQLException e) {
  204 + }
  205 + }
  206 + }
  207 +
  208 +
  209 + public void saveCheckChu(AntExChuModel model)
  210 + {
  211 + Connection conn = null;
  212 + PreparedStatement ps = null;
  213 + try {
  214 + conn = ConnTools.makeConnection();
  215 +
  216 + String sql = "insert into EARLY_PREGNANCY_RIS(ID,NAME,ID_CARD,MEDICAL_RECORD_NO,PREGNANCY_JUDGMENT,HANDLING_SUGGESTION,VISIT_DOCTIR,VISIT_DATE,FROM_HOSPITAL, OPERATOR,OPERAT_TIME,CREATE_TIME,UPDATE_TIME) " +
  217 + " values(?,?,?,?,?,?,?,?,?,?,?,?,?)";
  218 +
  219 + Patients patients = patientsService.findOnePatientById(model.getParentId());
  220 + if (patients == null)
  221 + {
  222 + return;
  223 + }
  224 +
  225 + ps = conn.prepareStatement("delete from EARLY_PREGNANCY_RIS WHERE ID ='" + model.getId() + "'");
  226 + ps.executeUpdate();
  227 +
  228 + ps = conn.prepareStatement(sql);
  229 + ps.setString(1,model.getId());
  230 + ps.setString(2,patients.getUsername());
  231 + ps.setString(3,patients.getCardNo());
  232 + ps.setString(4,patients.getBlNum());
  233 +
  234 + String diagnosis = "";
  235 + if (org.apache.commons.lang.StringUtils.isNotEmpty(model.getDiagnosis())) {
  236 + List<String> temp = JsonUtil.toList(model.getDiagnosis(), String.class);
  237 + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(temp)) {
  238 + StringBuilder sb = new StringBuilder();
  239 + for (String sId : temp) {
  240 + sb.append(FunvCommonUtil.getBaseicConfigByid(sId, basicConfigService)).append(",");
  241 + }
  242 + if (sb.toString().endsWith(",")) {
  243 + diagnosis = sb.substring(0, sb.length() - 1);
  244 + } else {
  245 + diagnosis = sb.toString();
  246 + }
  247 + }
  248 + }
  249 + if (StringUtils.isNotEmpty(diagnosis) && StringUtils.isNotEmpty(model.getDiagnosisOther()))
  250 + {
  251 + diagnosis+=" "+model.getDiagnosisOther();
  252 + }
  253 + else
  254 + {
  255 + diagnosis+=model.getDiagnosisOther();
  256 + }
  257 + ps.setString(5, diagnosis);
  258 +
  259 + ps.setString(6, model.getTreatOpinion());
  260 + ps.setString(7, StringUtils.isNum(model.getProdDoctor()) ? CommonsHelper.getUserName(model.getProdDoctor(), usersService) : model.getProdDoctor());
  261 + ps.setTimestamp(8, new Timestamp(model.getCheckTime().getTime()));
  262 + ps.setString(9, hospitalsMap.get(model.getHospitalId()));
  263 + ps.setTimestamp(10, new Timestamp(model.getCreated().getTime()));
  264 + ps.setTimestamp(11, new Timestamp(model.getModified().getTime()));
  265 + ps.setString(12, CommonsHelper.getUserName(model.getOperator() + "", usersService));
  266 + ps.setTimestamp(13, new Timestamp(model.getCreated().getTime()));
  267 +
  268 + int saveCheckChuCount = ps.executeUpdate();
  269 + System.out.println("saveCheckChuCount="+saveCheckChuCount);
  270 +
  271 + }
  272 + catch (Exception e)
  273 + {
  274 + ExceptionUtils.catchException(e,"saveCheckChuCount error.");
  275 + }finally {
  276 + try {
  277 + if (ps != null)
  278 + {
  279 + ps.close();
  280 + }
  281 + if (conn != null)
  282 + {
  283 + conn.close();
  284 + }
  285 + } catch (SQLException e) {
  286 + }
  287 + }
  288 + }
  289 +
  290 +
  291 +
128 292 /**
129 293 * 孕产妇母婴阻断检查信息
130 294 * @param model
131 295  
132 296  
133 297  
... ... @@ -1481,14 +1645,31 @@
1481 1645 antExChuQuery.setModifiedEnd(end);
1482 1646 List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery);
1483 1647 System.out.println("xxxxxx antExChuModels=" + antExChuModels.size()+"===="+antExChuQuery.convertToQuery().convertToMongoQuery().toString());
1484   - if (org.apache.commons.collections.CollectionUtils.isNotEmpty(antExChuModels))
  1648 + if (CollectionUtils.isNotEmpty(antExChuModels))
1485 1649 {
1486 1650 for (AntExChuModel chuModel : antExChuModels)
1487 1651 {
1488 1652 saveRcZdInfo(chuModel);
  1653 +
  1654 + saveCheckChu(chuModel);
1489 1655 }
1490 1656 }
1491   - }
1492 1657  
  1658 +
  1659 + AntExQuery antExQuery = new AntExQuery();
  1660 + antExQuery.setYn(YnEnums.YES.getId());
  1661 + antExQuery.setHospitalIds(hids);
  1662 + antExQuery.setModifiedStart(start);
  1663 + antExQuery.setModifiedEnd(end);
  1664 + List<AntenatalExaminationModel> antEx = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery());
  1665 + System.out.println("xxxxxx antEx=" + antEx.size()+"===="+antExQuery.convertToQuery().convertToMongoQuery().toString());
  1666 + if (CollectionUtils.isNotEmpty(antEx))
  1667 + {
  1668 + for (AntenatalExaminationModel f : antEx)
  1669 + {
  1670 + saveCheckFu(f);
  1671 + }
  1672 + }
  1673 + }
1493 1674 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java View file @ 4148928
... ... @@ -2513,7 +2513,7 @@
2513 2513 {
2514 2514 for (MatdeliverFollowModel matdeliverFollowModel : matdeliverFollowModels)
2515 2515 {
2516   - rcGlxtService.saveRcMatdeliverFollowInfo(matdeliverFollowModel,rcGlxtService.getHids());
  2516 + rcGlxtService.saveRcMatdeliverFollowInfo(matdeliverFollowModel, rcGlxtService.getHids());
2517 2517 }
2518 2518 }
2519 2519 }
... ... @@ -2619,7 +2619,7 @@
2619 2619 AntExChuQuery antExChuQuery = new AntExChuQuery();
2620 2620 antExChuQuery.setYn(YnEnums.YES.getId());
2621 2621 antExChuQuery.setHospitalList(rcGlxtService.getHids());
2622   - antExChuQuery.setCreatedTimeStart(DateUtil.addMonth(new Date(), -2));
  2622 + antExChuQuery.setCreatedTimeStart(DateUtil.addMonth(new Date(), -50));
2623 2623 antExChuQuery.setCreatedTimeEnd(new Date());
2624 2624 List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery);
2625 2625 if (CollectionUtils.isNotEmpty(antExChuModels))
... ... @@ -2629,6 +2629,43 @@
2629 2629 rcGlxtService.saveRcZdInfo(chuModel);
2630 2630 }
2631 2631 }
  2632 + }
  2633 +
  2634 +
  2635 + /**
  2636 + * 孕产妇早孕诊断信息表
  2637 + */
  2638 + @RequestMapping(value = "/rcDiagnosisInfo", method = RequestMethod.GET)
  2639 + @ResponseBody
  2640 + public void rcDiagnosisInfo() {
  2641 +
  2642 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  2643 + antExChuQuery.setYn(YnEnums.YES.getId());
  2644 + antExChuQuery.setHospitalList(rcGlxtService.getHids());
  2645 + antExChuQuery.setCreatedTimeStart(DateUtil.addMonth(new Date(), -50));
  2646 + antExChuQuery.setCreatedTimeEnd(new Date());
  2647 + List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery);
  2648 + if (com.lyms.platform.operate.web.utils.CollectionUtils.isNotEmpty(antExChuModels)) {
  2649 + for (AntExChuModel chuModel : antExChuModels) {
  2650 +
  2651 + rcGlxtService.saveCheckChu(chuModel);
  2652 + }
  2653 + }
  2654 +
  2655 + AntExQuery antExQuery = new AntExQuery();
  2656 + antExQuery.setYn(YnEnums.YES.getId());
  2657 + antExQuery.setHospitalIds(rcGlxtService.getHids());
  2658 + antExQuery.setModifiedStart(DateUtil.addMonth(new Date(), -50));
  2659 + antExQuery.setModifiedEnd(new Date());
  2660 + List<AntenatalExaminationModel> antEx = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery());
  2661 + if (com.lyms.platform.operate.web.utils.CollectionUtils.isNotEmpty(antEx))
  2662 + {
  2663 + for (AntenatalExaminationModel f : antEx)
  2664 + {
  2665 + rcGlxtService.saveCheckFu(f);
  2666 + }
  2667 + }
  2668 +
2632 2669 }
2633 2670  
2634 2671 /**