Commit 922bb27af9c910b486dee5eac0094f2a129a6ff3

Authored by hujiaqi
Exists in master

Merge remote-tracking branch 'origin/master'

Showing 16 changed files

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java View file @ 922bb27
... ... @@ -63,6 +63,7 @@
63 63 AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
64 64 antExRecordQuery.setParentId(record.getParentId());
65 65 antExRecordQuery.setcId(record.getCheckDoctor());
  66 + antExRecordQuery.setfId(record.getfId());
66 67 Integer count = count(antExRecordQuery);
67 68 if (null == count || 0 == count) {
68 69 antExRecordDao.addOneRecord(record);
... ... @@ -84,6 +85,7 @@
84 85 AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
85 86 antExRecordQuery.setParentId(record.getParentId());
86 87 antExRecordQuery.setcId(record.getCheckDoctor());
  88 + antExRecordQuery.setfId(record.getfId());
87 89 Integer count = count(antExRecordQuery);
88 90 if (null == count || 0 == count) {
89 91 antExRecordDao.addOneRecord(record);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java View file @ 922bb27
... ... @@ -22,6 +22,7 @@
22 22 import org.springframework.web.bind.annotation.ResponseBody;
23 23  
24 24 import javax.servlet.http.HttpServletRequest;
  25 +import javax.servlet.http.HttpServletResponse;
25 26 import javax.validation.Valid;
26 27  
27 28 /**
28 29  
29 30  
... ... @@ -181,10 +182,27 @@
181 182 @TokenRequired
182 183 public BaseResponse findAntEx(@Valid AntExManagerQueryRequest antExManagerQueryRequest,HttpServletRequest request){
183 184 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
184   - return antExRecordFacade.findList(antExManagerQueryRequest, loginState.getId(), false);
  185 + return antExRecordFacade.findList(antExManagerQueryRequest, loginState.getId(), false, "true");
185 186 }
186 187  
  188 +
187 189 /**
  190 + * 导出产检管理接口
  191 + * @param antExManagerQueryRequest
  192 + * @param request
  193 + * @return
  194 + */
  195 + @RequestMapping(method = RequestMethod.GET, value = "/antex/exportAntexrecordlist")
  196 + @TokenRequired
  197 + public void exportFindAntEx(@Valid AntExManagerQueryRequest antExManagerQueryRequest,HttpServletRequest request,HttpServletResponse httpServletResponse){
  198 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  199 + antExRecordFacade.exportFindAntEx(antExManagerQueryRequest, loginState.getId(), false, httpServletResponse);
  200 + }
  201 +
  202 +
  203 +
  204 +
  205 + /**
188 206 * 产检区域管理接口
189 207 *
190 208 * @return
... ... @@ -194,7 +212,20 @@
194 212 @TokenRequired
195 213 public BaseResponse findRegionAntEx(@Valid AntExManagerQueryRequest antExManagerQueryRequest,HttpServletRequest request){
196 214 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
197   - return antExRecordFacade.findList(antExManagerQueryRequest,loginState.getId(),true);
  215 + return antExRecordFacade.findList(antExManagerQueryRequest, loginState.getId(), true, "true");
  216 + }
  217 +
  218 +
  219 + /**
  220 + * 产检区域管理接口导出
  221 + *
  222 + * @return
  223 + */
  224 + @RequestMapping(method = RequestMethod.GET, value = "/antex/exportrantexrecordlist")
  225 + @TokenRequired
  226 + public void exportfindRegionAntEx(@Valid AntExManagerQueryRequest antExManagerQueryRequest,HttpServletRequest request,HttpServletResponse httpServletResponse){
  227 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  228 + antExRecordFacade.exportfindRegionAntEx(antExManagerQueryRequest, loginState.getId(), true, httpServletResponse);
198 229 }
199 230 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java View file @ 922bb27
... ... @@ -483,8 +483,10 @@
483 483 users.setOrganization(organization);
484 484 //是否是建档医院
485 485 users.setbStatus(organization.getbStatus());
  486 +
  487 + String hospital=autoMatchFacade.getHospitalId(loginContext.getId());
486 488 //设置建档方式
487   - String groupId= groupsFacade.findByCurrentUserId(loginContext.getId()+"");
  489 + String groupId= groupsFacade.findByCurrentUserId(hospital);
488 490 Integer bType= GroupEnums.BuildType.SINGLE.getbType();
489 491 if(StringUtils.isNotEmpty(groupId)){
490 492 OrganizationGroups groups= groupsService.findById(groupId);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java View file @ 922bb27
... ... @@ -6,10 +6,7 @@
6 6 import com.lyms.platform.common.enums.YnEnums;
7 7 import com.lyms.platform.common.result.BaseListResponse;
8 8 import com.lyms.platform.common.result.BaseResponse;
9   -import com.lyms.platform.common.utils.DateUtil;
10   -import com.lyms.platform.common.utils.ExceptionUtils;
11   -import com.lyms.platform.common.utils.JsonUtil;
12   -import com.lyms.platform.common.utils.StringUtils;
  9 +import com.lyms.platform.common.utils.*;
13 10 import com.lyms.platform.operate.web.request.AntExManagerQueryRequest;
14 11 import com.lyms.platform.operate.web.request.CjStatisticsQueryRequest;
15 12 import com.lyms.platform.operate.web.result.AntExManagerResult;
... ... @@ -30,6 +27,9 @@
30 27 import org.springframework.data.domain.Sort;
31 28 import org.springframework.stereotype.Component;
32 29  
  30 +import javax.servlet.http.HttpServletResponse;
  31 +import java.io.IOException;
  32 +import java.io.OutputStream;
33 33 import java.util.*;
34 34  
35 35 /**
36 36  
... ... @@ -70,10 +70,10 @@
70 70 * @param antExManagerQueryRequest
71 71 * @param isRegion
72 72 */
73   - private AntExRecordQuery complayRequest(Integer userId, AntExManagerQueryRequest antExManagerQueryRequest, boolean isRegion) {
  73 + private AntExRecordQuery complayRequest(Integer userId, AntExManagerQueryRequest antExManagerQueryRequest, boolean isRegion,String isPage) {
74 74  
75 75 AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
76   - antExRecordQuery.setNeed("1");
  76 + antExRecordQuery.setNeed(isPage);
77 77 antExRecordQuery.setPage(antExManagerQueryRequest.getPage());
78 78 antExRecordQuery.setLimit(antExManagerQueryRequest.getLimit());
79 79 antExRecordQuery.setName(antExManagerQueryRequest.getName());
... ... @@ -174,8 +174,8 @@
174 174 *
175 175 * @return
176 176 */
177   - public BaseResponse findList(AntExManagerQueryRequest antExManagerQueryRequest, Integer userId, boolean isRegion) {
178   - AntExRecordQuery antExRecordQuery = complayRequest(userId, antExManagerQueryRequest, isRegion);
  177 + public BaseResponse findList(AntExManagerQueryRequest antExManagerQueryRequest, Integer userId, boolean isRegion,String isPage) {
  178 + AntExRecordQuery antExRecordQuery = complayRequest(userId, antExManagerQueryRequest, isRegion,isPage);
179 179 String hospital = autoMatchFacade.getHospitalId(userId);
180 180 List<AntExManagerResult> data = new ArrayList<>();
181 181 List<AntExRecordModel> antExRecordModelList = recordService.queryAntExRecords(antExRecordQuery);
... ... @@ -408,6 +408,130 @@
408 408 Collections.sort(data, new CjStatisticsResult());
409 409 }
410 410 return baseListResponse.setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setPageInfo(antExRecordQuery.getPageInfo());
  411 + }
  412 +
  413 + public void exportFindAntEx(AntExManagerQueryRequest antExManagerQueryRequest, Integer id, boolean b,HttpServletResponse httpServletResponse) {
  414 +
  415 + BaseListResponse listRep = (BaseListResponse)findList(antExManagerQueryRequest, id, b, null);
  416 + List<Map<String, Object>> datas = new ArrayList<>();
  417 + try {
  418 + Map<String, Object> data = new HashMap<>();
  419 + if (listRep != null)
  420 + {
  421 + List<AntExManagerResult> list = listRep.getData();
  422 + if (CollectionUtils.isNotEmpty(list))
  423 + {
  424 + for (AntExManagerResult aer : list)
  425 + {
  426 + data.put("checkTime",aer.getCheckTime());
  427 + data.put("barCode",aer.getBarCode());
  428 + data.put("name",aer.getName());
  429 + data.put("age",aer.getAge());
  430 + data.put("cDueWeek",aer.getcDueWeek());
  431 + data.put("rLevel",getLevel(aer.getrLevel()));
  432 + data.put("riskFactor",aer.getRiskFactor());
  433 + data.put("riskScore",aer.getRiskScore());
  434 + data.put("chTimes",aer.getChTimes());
  435 + data.put("tTimes",aer.gettTimes());
  436 + data.put("nextCheckTime",aer.getNextCheckTime());
  437 + data.put("dueDate",aer.getDueDate());
  438 + data.put("checkDoctor",aer.getCheckDoctor());
  439 + data.put("lName",aer.getlName());
  440 + data.put("phone",aer.getPhone());
  441 + }
  442 + }
  443 +
  444 + }
  445 +
  446 + OutputStream out = httpServletResponse.getOutputStream();
  447 + Map<String, String> cnames = new LinkedHashMap<>();
  448 + cnames.put("checkTime", "产检日期");
  449 + cnames.put("barCode", "条形码");
  450 + cnames.put("name", "姓名");
  451 + cnames.put("age", "年龄");
  452 + cnames.put("cDueWeek", "产检孕周");
  453 + cnames.put("rLevel", "高危等级");
  454 + cnames.put("riskFactor", "高危因素");
  455 + cnames.put("riskScore", "高危评分");
  456 + cnames.put("chTimes", "本院产检次数");
  457 + cnames.put("tTimes", "总产检次数");
  458 + cnames.put("nextCheckTime", "预约产检日期");
  459 + cnames.put("dueDate", "预产期");
  460 + cnames.put("checkDoctor", "产检医生");
  461 + cnames.put("lName", "登记人");
  462 + cnames.put("phone", "联系电话");
  463 + httpServletResponse.setContentType("application/octet-stream");
  464 + httpServletResponse.setCharacterEncoding("UTF-8");
  465 + httpServletResponse.setHeader("Content-Disposition", "attachment;fileName=" + "data.xls");
  466 + ExcelUtil.toExcel(out, datas, cnames);
  467 + } catch (IOException e) {
  468 + e.printStackTrace();
  469 + }
  470 + }
  471 +
  472 +
  473 + private String getLevel(List<Map> levels) {
  474 +
  475 + String str = "";
  476 + if (CollectionUtils.isNotEmpty(levels)) {
  477 + for (Map map : levels) {
  478 + str += map.get("name") + ";";
  479 + }
  480 + }
  481 +
  482 + return str;
  483 + }
  484 +
  485 + public void exportfindRegionAntEx(AntExManagerQueryRequest antExManagerQueryRequest, Integer id, boolean b, HttpServletResponse httpServletResponse) {
  486 + BaseListResponse listRep = (BaseListResponse)findList(antExManagerQueryRequest, id, b, null);
  487 + List<Map<String, Object>> datas = new ArrayList<>();
  488 + try {
  489 + Map<String, Object> data = new HashMap<>();
  490 + if (listRep != null)
  491 + {
  492 + List<AntExManagerResult> list = listRep.getData();
  493 + if (CollectionUtils.isNotEmpty(list))
  494 + {
  495 + for (AntExManagerResult aer : list)
  496 + {
  497 + data.put("checkTime",aer.getCheckTime());
  498 + data.put("barCode",aer.getBarCode());
  499 + data.put("name",aer.getName());
  500 + data.put("age",aer.getAge());
  501 + data.put("cDueWeek",aer.getcDueWeek());
  502 + data.put("rLevel",getLevel(aer.getrLevel()));
  503 + data.put("riskFactor",aer.getRiskFactor());
  504 + data.put("riskScore",aer.getRiskScore());
  505 + data.put("cTimes",aer.getcTimes());
  506 + data.put("dueDate",aer.getDueDate());
  507 + data.put("addr",aer.getAddr());
  508 + data.put("checkHospital",aer.getCheckHospital());
  509 + }
  510 + }
  511 + }
  512 +
  513 + OutputStream out = httpServletResponse.getOutputStream();
  514 + Map<String, String> cnames = new LinkedHashMap<>();
  515 + cnames.put("checkTime", "产检日期");
  516 + cnames.put("barCode", "条形码");
  517 + cnames.put("name", "姓名");
  518 + cnames.put("age", "年龄");
  519 + cnames.put("cDueWeek", "产检孕周");
  520 + cnames.put("rLevel", "高危等级");
  521 + cnames.put("riskFactor", "高危因素");
  522 + cnames.put("riskScore", "高危评分");
  523 + cnames.put("cTimes", "产检第次");
  524 + cnames.put("dueDate", "预产期");
  525 + cnames.put("addr", "居住地");
  526 + cnames.put("checkHospital", "产检医院");
  527 + httpServletResponse.setContentType("application/octet-stream");
  528 + httpServletResponse.setCharacterEncoding("UTF-8");
  529 + httpServletResponse.setHeader("Content-Disposition", "attachment;fileName=" + "data.xls");
  530 + ExcelUtil.toExcel(out, datas, cnames);
  531 + } catch (IOException e) {
  532 + e.printStackTrace();
  533 + }
  534 +
411 535 }
412 536 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 922bb27
... ... @@ -72,12 +72,12 @@
72 72 * @param userId
73 73 * @return
74 74 */
75   - public String handHideBuild(String pid, String parentId, Integer userId) {
  75 + public String handHideBuild(String pid, String parentId, Integer userId,int type) {
76 76 String hospitalId = autoMatchFacade.getHospitalId(userId);
77 77  
78 78 List li = new ArrayList();
79 79 li.add(hospitalId);
80   - Patients patients = findOnePatient(null, null, null, li, 1, false, pid, true);
  80 + Patients patients = findOnePatient(null, null, null, li, type, false, pid, true);
81 81 //表示本院已经有隐藏建档
82 82 if (null != patients) {
83 83 return patients.getId();
84 84  
... ... @@ -92,11 +92,11 @@
92 92  
93 93 //表示区域的
94 94 if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospitalId)) && StringUtils.isNotEmpty(pid)) {
95   - patients = findOnePatient(null, null, null, null, 1, false, pid, false);
  95 + patients = findOnePatient(null, null, null, null, type, false, pid, false);
96 96 patients.setSource(patients.getId());
97 97 patients.setId(null);
98 98 patients.setHospitalId(hospitalId);
99   - patients.setType(1);
  99 +// patients.setType(1);
100 100 patients.setCreated(new Date());
101 101 patients.setBookbuildingDoctor(userId + "");
102 102 patients.setEnable("2");
... ... @@ -149,7 +149,7 @@
149 149  
150 150 if (StringUtils.isNotEmpty(patients.getSource())) {
151 151 Patients masterPatients = patientsService.findOnePatientById(patients.getSource());
152   -
  152 + masterPatients.setModified(patients.getModified());
153 153 masterPatients.setoRiskFactor(patients.getoRiskFactor());
154 154 masterPatients.setLastCTime(patients.getLastCTime());
155 155 masterPatients.setPostViewTimes(patients.getPostViewTimes());
... ... @@ -157,7 +157,10 @@
157 157 masterPatients.setRiskFactorId(patients.getRiskFactorId());
158 158 masterPatients.setRiskLevelId(patients.getRiskLevelId());
159 159 masterPatients.setRiskScore(patients.getRiskScore());
160   -
  160 + masterPatients.setNextCheckTime(patients.getNextCheckTime());
  161 + masterPatients.setFmDate(patients.getFmDate());
  162 + masterPatients.setServiceStatus(patients.getServiceStatus());
  163 + masterPatients.setLastCheckEmployeeId(patients.getLastCheckEmployeeId());
161 164 patientsService.updatePatient(masterPatients);
162 165 }
163 166 }
... ... @@ -174,7 +177,7 @@
174 177 AntenatalExaminationModel model = antExAddRequest.convertToDataModel();
175 178 //表示区域的
176 179 if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospitalId))) {
177   - String parentId = handHideBuild(antExAddRequest.getPid(), antExAddRequest.getParentId(), userId);
  180 + String parentId = handHideBuild(antExAddRequest.getPid(), antExAddRequest.getParentId(), userId,1);
178 181 if (StringUtils.isEmpty(parentId)) {
179 182 //打印日志
180 183 }
... ... @@ -312,7 +315,7 @@
312 315  
313 316 //表示区域的
314 317 if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospitalId))) {
315   - String parentId = handHideBuild(excAddRequest.getPid(), excAddRequest.getParentId(), userId);
  318 + String parentId = handHideBuild(excAddRequest.getPid(), excAddRequest.getParentId(), userId,1);
316 319 if (StringUtils.isEmpty(parentId)) {
317 320 //打印日志
318 321 }
... ... @@ -1671,7 +1674,7 @@
1671 1674 patientsQuery.setYn(YnEnums.YES.getId());
1672 1675 patientsQuery.setBuildType(1);
1673 1676 if (isEnable) {
1674   - patientsQuery.setEnable("0");
  1677 + patientsQuery.setEnable("2");
1675 1678 }
1676 1679 Patients patients = null;
1677 1680 List<Patients> list = patientsService.queryPatient1(patientsQuery, "modified");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java View file @ 922bb27
... ... @@ -64,6 +64,8 @@
64 64  
65 65 @Autowired
66 66 private BabyCheckFacade babyCheckFacade;
  67 + @Autowired
  68 + private OrganizationGroupsFacade groupsFacade;
67 69  
68 70 /**
69 71 * 增加转诊申请
70 72  
... ... @@ -79,9 +81,19 @@
79 81 PatientsQuery patientsQuery = new PatientsQuery();
80 82 patientsQuery.setId(referralApplyOrderModel.getParentId());
81 83  
  84 + String hospital = autoMatchFacade.getHospitalId(userId);
  85 + //表示区域的
  86 + if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospital))) {
  87 + String parentId = antenatalExaminationFacade.handHideBuild(referralApplyOrderAddRequest.getPid(), referralApplyOrderAddRequest.getParentId(), userId,-1);
  88 + if (StringUtils.isEmpty(parentId)) {
  89 + //打印日志
  90 + }
  91 + referralApplyOrderModel.setParentId(parentId);
  92 + referralApplyOrderAddRequest.setParentId(parentId);
  93 + }
  94 +
82 95 ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery();
83 96 referralApplyOrderQuery.setParentId(referralApplyOrderModel.getParentId());
84   - String hospital = autoMatchFacade.getHospitalId(userId);
85 97 referralApplyOrderQuery.setOutHospitalId(hospital);
86 98 //如果填写的汉字,并且改医院在我们系统存在则把他转成id
87 99 if (StringUtils.isNotEmpty(referralApplyOrderModel.getTransferredHospital()) && !NumberUtils.isNumber(referralApplyOrderModel.getTransferredHospital())) {
88 100  
... ... @@ -279,8 +291,20 @@
279 291 */
280 292 public BaseResponse addOneSieveApplyOrder(SieveApplyOrderAddRequest sieveApplyOrderAddRequest, Integer userId) {
281 293 SieveApplyOrderModel sieveApplyOrderModel = sieveApplyOrderAddRequest.convertToDataModel();
282   - sieveApplyOrderModel.setCreated(new Date());
283 294 String hospitalId = autoMatchFacade.getHospitalId(userId);
  295 +
  296 + //表示区域的
  297 + if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospitalId))) {
  298 + String parentId = antenatalExaminationFacade.handHideBuild(sieveApplyOrderAddRequest.getPid(), sieveApplyOrderAddRequest.getParentId(), userId,-1);
  299 + if (StringUtils.isEmpty(parentId)) {
  300 + //打印日志
  301 + }
  302 + sieveApplyOrderModel.setParentId(parentId);
  303 + sieveApplyOrderModel.setParentId(parentId);
  304 + }
  305 +
  306 +
  307 + sieveApplyOrderModel.setCreated(new Date());
284 308 sieveApplyOrderModel.setHospitalId(hospitalId);
285 309  
286 310 SieveApplyOrderQuery sieveApplyOrderQuery1 = new SieveApplyOrderQuery();
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ 922bb27
... ... @@ -2274,7 +2274,7 @@
2274 2274 {
2275 2275 BabyModel model = getBabyModelById(checkModel.getBuildId());
2276 2276 Map<String,String> map = new HashMap<>();
2277   - map.put("babyId",model.getId()); //儿童主键
  2277 + map.put("id",model.getId()); //儿童主键
2278 2278 map.put("checkId",checkModel.getId()); //检查主键
2279 2279 map.put("sex", StringUtils.emptyDeal(SexEnum.getTextById(model.getSex()))); //性别
2280 2280 map.put("babyName", StringUtils.emptyDeal(model.getName())); //儿童名称
... ... @@ -2283,7 +2283,7 @@
2283 2283 map.put("height",checkModel.getHeight()); //身长
2284 2284 map.put("weight", checkModel.getWeight()); //体重
2285 2285 StringBuffer sb = new StringBuffer();
2286   - if (StringUtils.isNotEmpty(checkModel.getGrowthEvaluate()))
  2286 + if (StringUtils.isNotEmpty(checkModel.getGrowthEvaluate()) && "[null]".equals(checkModel.getGrowthEvaluate()))
2287 2287 {
2288 2288 List<String> items = JsonUtil.toList(checkModel.getGrowthEvaluate(),String.class);
2289 2289 if (CollectionUtils.isNotEmpty(items))
2290 2290  
2291 2291  
2292 2292  
2293 2293  
2294 2294  
... ... @@ -2367,37 +2367,37 @@
2367 2367 list1.add(growH);
2368 2368  
2369 2369 BabyGrowthCountResult growH1 = new BabyGrowthCountResult();
2370   - growH1.setBzc("+2SD - +3SD");
  2370 + growH1.setBzc("+2SD ~ +3SD");
2371 2371 growH1.setEvaluate("中上");
2372 2372 list1.add(growH1);
2373 2373  
2374 2374  
2375 2375 BabyGrowthCountResult growH2 = new BabyGrowthCountResult();
2376   - growH2.setBzc("+1SD > +2SD");
  2376 + growH2.setBzc("+1SD ~ +2SD");
2377 2377 growH2.setEvaluate("中+");
2378 2378 list1.add(growH2);
2379 2379  
2380 2380 BabyGrowthCountResult growH3 = new BabyGrowthCountResult();
2381   - growH3.setBzc("-1SD - +1SD");
  2381 + growH3.setBzc("-1SD ~ +1SD");
2382 2382 growH3.setEvaluate("中");
2383 2383 list1.add(growH3);
2384 2384  
2385 2385  
2386 2386 BabyGrowthCountResult growH4 = new BabyGrowthCountResult();
2387   - growH4.setBzc("-2SD> -1SD");
  2387 + growH4.setBzc("-2SD ~ -1SD");
2388 2388 growH4.setEvaluate("中-");
2389 2389 list1.add(growH4);
2390 2390  
2391 2391  
2392 2392 BabyGrowthCountResult growH5 = new BabyGrowthCountResult();
2393   - growH5.setBzc("-3SD - -2SD");
  2393 + growH5.setBzc("-3SD ~ -2SD");
2394 2394 growH5.setEvaluate("中下");
2395 2395 list1.add(growH5);
2396 2396  
2397 2397 BabyGrowthCountResult growH6 = new BabyGrowthCountResult();
2398 2398 growH6.setBzc("< -3SD");
2399 2399 growH6.setEvaluate("下");
2400   - list1.add(growH5);
  2400 + list1.add(growH6);
2401 2401  
2402 2402  
2403 2403  
2404 2404  
2405 2405  
2406 2406  
2407 2407  
... ... @@ -2408,30 +2408,30 @@
2408 2408 list2.add(growW);
2409 2409  
2410 2410 BabyGrowthCountResult growW1 = new BabyGrowthCountResult();
2411   - growW1.setBzc("+2SD - +3SD");
  2411 + growW1.setBzc("+2SD ~ +3SD");
2412 2412 growW1.setEvaluate("中上");
2413 2413 list2.add(growW1);
2414 2414  
2415 2415  
2416 2416 BabyGrowthCountResult growW2 = new BabyGrowthCountResult();
2417   - growW2.setBzc("+1SD > +2SD");
  2417 + growW2.setBzc("+1SD ~ +2SD");
2418 2418 growW2.setEvaluate("中+");
2419 2419 list2.add(growW2);
2420 2420  
2421 2421 BabyGrowthCountResult growW3 = new BabyGrowthCountResult();
2422   - growW3.setBzc("-1SD - +1SD");
  2422 + growW3.setBzc("-1SD ~ +1SD");
2423 2423 growW3.setEvaluate("中");
2424 2424 list2.add(growW3);
2425 2425  
2426 2426  
2427 2427 BabyGrowthCountResult growW4 = new BabyGrowthCountResult();
2428   - growW4.setBzc("-2SD> -1SD");
  2428 + growW4.setBzc("-2SD ~ -1SD");
2429 2429 growW4.setEvaluate("中-");
2430 2430 list2.add(growW4);
2431 2431  
2432 2432  
2433 2433 BabyGrowthCountResult growW5 = new BabyGrowthCountResult();
2434   - growW5.setBzc("-3SD - -2SD");
  2434 + growW5.setBzc("-3SD ~ -2SD");
2435 2435 growW5.setEvaluate("中下");
2436 2436 list2.add(growW5);
2437 2437  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ 922bb27
... ... @@ -134,7 +134,7 @@
134 134  
135 135 //表示区域的
136 136 if (StringUtils.isNotEmpty(organizationGroupsFacade.findByCurrentUserId(hospitalId))) {
137   - String parentId =antenatalExaminationFacade.handHideBuild(deliverAddRequest.getPid(), deliverAddRequest.getParentId(), userId);
  137 + String parentId =antenatalExaminationFacade.handHideBuild(deliverAddRequest.getPid(), deliverAddRequest.getParentId(), userId,-1);
138 138 if (StringUtils.isEmpty(parentId)) {
139 139 logger.warn("get handHideBuild parentId is null.");
140 140 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ 922bb27
... ... @@ -335,6 +335,7 @@
335 335 List<String> hospitalList = null;
336 336 //区域范围内孕妇
337 337 if (isRegion) {
  338 + patientsQuery.setExtEnable(false);
338 339 //王平说的 必须要给区域医院权限,不然他就是蠢逼 201611124 16:41
339 340 hospitalList = new ArrayList<>();
340 341 String hospital = autoMatchFacade.getHospitalId(userId);
... ... @@ -763,6 +764,7 @@
763 764 patientsQuery.setLimit(patientManagerRequest.getLimit());
764 765 patientsQuery.setPage(patientManagerRequest.getPage());
765 766 }
  767 +
766 768 patientsQuery.setHospitalId(autoMatchFacade.getHospitalId(patientManagerRequest.getOperatorId()));
767 769 patientsQuery.setProvinceRegisterId(StringUtils.isEmpty(patientManagerRequest.getProvinceRegisterId()) ? null : patientManagerRequest.getProvinceRegisterId());
768 770 patientsQuery.setCityRegisterId(StringUtils.isEmpty(patientManagerRequest.getCityRegisterId()) ? null : patientManagerRequest.getCityRegisterId());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java View file @ 922bb27
... ... @@ -81,11 +81,12 @@
81 81 if(StringUtils.isNotEmpty(groupId)){
82 82 OrganizationGroups gorp= groupsService.findById(groupId);
83 83 if (gorp.getbType()!=1) {
84   - String parentId = examinationFacade.handHideBuild(postReviewRequest.getPid(), postReviewRequest.getParentId(), userId);
  84 + String parentId = examinationFacade.handHideBuild(postReviewRequest.getPid(), postReviewRequest.getParentId(), userId,3);
85 85 if (StringUtils.isEmpty(parentId)) {
86 86 //打印日志
87 87 }
88 88 postReviewModel.setParentId(parentId);
  89 + postReviewRequest.setParentId(parentId);
89 90 }
90 91 }
91 92  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java View file @ 922bb27
... ... @@ -53,9 +53,12 @@
53 53 private AutoMatchFacade autoMatchFacade;
54 54 @Autowired
55 55 private MatDeliverService matDeliverService;
  56 + @Autowired
  57 + private OrganizationGroupsFacade groupsFacade;
56 58  
57 59 /**
58 60 * 更新终止妊娠
  61 + *
59 62 * @param request
60 63 * @return
61 64 */
... ... @@ -76,7 +79,7 @@
76 79 matDeliverQuery.setPid(request.getPid());
77 80 matDeliverQuery.setYn(YnEnums.YES.getId());
78 81 matDeliverQuery.setDueDate(request.getStopDate());
79   - List<MaternalDeliverModel> list2 = matDeliverService.query(matDeliverQuery);
  82 + List<MaternalDeliverModel> list2 = matDeliverService.query(matDeliverQuery);
80 83  
81 84 StopPregQuery stopPregQuery = new StopPregQuery();
82 85 stopPregQuery.setYn(YnEnums.YES.getId());
... ... @@ -88,7 +91,7 @@
88 91 return new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("同一天只能建一次分娩/终止妊娠");
89 92 }
90 93  
91   - List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  94 + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
92 95 if (CollectionUtils.isNotEmpty(patients)) {
93 96  
94 97 for (Patients patient : patients) {
95 98  
... ... @@ -108,10 +111,11 @@
108 111  
109 112 /**
110 113 * 添加终止妊娠
  114 + *
111 115 * @param request
112 116 * @return
113 117 */
114   - public BaseResponse addStopPreg(StopPregRequest request,Integer userId) {
  118 + public BaseResponse addStopPreg(StopPregRequest request, Integer userId) {
115 119  
116 120 // String hospitalId = "";
117 121 // //得到当前登录的医院id
118 122  
... ... @@ -130,16 +134,15 @@
130 134 patientsQuery.setPid(request.getPid());
131 135  
132 136 Patients pat = null;
133   - List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
134   - if (CollectionUtils.isNotEmpty(patients))
135   - {
  137 + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery);
  138 + if (CollectionUtils.isNotEmpty(patients)) {
136 139  
137 140 MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
138 141  
139 142 matDeliverQuery.setPid(request.getPid());
140 143 matDeliverQuery.setYn(YnEnums.YES.getId());
141 144 matDeliverQuery.setDueDate(request.getStopDate());
142   - List<MaternalDeliverModel> list2 = matDeliverService.query(matDeliverQuery);
  145 + List<MaternalDeliverModel> list2 = matDeliverService.query(matDeliverQuery);
143 146  
144 147 StopPregQuery stopPregQuery = new StopPregQuery();
145 148 stopPregQuery.setYn(YnEnums.YES.getId());
146 149  
147 150  
148 151  
... ... @@ -151,15 +154,17 @@
151 154 return new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("同一天只能建一次分娩/终止妊娠");
152 155 }
153 156  
154   - for (Patients patient : patients)
155   - {
156   - if (patient != null)
157   - {
158 157  
  158 + String groupId = groupsFacade.findByCurrentUserId(request.getHospitalId());
  159 + List<String> hos = groupsFacade.findGroupHospital(userId);
  160 + String hospital = autoMatchFacade.getHospitalId(userId);
  161 + for (Patients patient : patients) {
  162 + if (patient != null) {
159 163 String hid = patient.getHospitalId();
160   - if (StringUtils.isNotEmpty(hid) && hid.equals(request.getHospitalId()))
161   - {
  164 + if (StringUtils.isNotEmpty(groupId) && hos.contains(hospital)) {
162 165 pat = patient;
  166 + } else if (StringUtils.isNotEmpty(hid) && hid.equals(request.getHospitalId())) {
  167 + pat = patient;
163 168 }
164 169  
165 170 patient.setModified(new Date());
166 171  
167 172  
168 173  
... ... @@ -168,19 +173,16 @@
168 173  
169 174 //更新状态为过期
170 175 //判断其为增值服务还是 标准服务
171   - if (patient.getServiceType() == ServiceTypeEnums.STANDARD_SERVICE.getId())
172   - {
  176 + if (patient.getServiceType() == ServiceTypeEnums.STANDARD_SERVICE.getId()) {
173 177 patient.setServiceStatus(ServiceStatusEnums.STANDARD_OVERDUE.getId());
174   - }
175   - else if (patient.getServiceType() == ServiceTypeEnums.ADD_SERVICE.getId())
176   - {
  178 + } else if (patient.getServiceType() == ServiceTypeEnums.ADD_SERVICE.getId()) {
177 179 patient.setServiceStatus(ServiceStatusEnums.ADD_OVERDUE.getId());
178 180 }
179 181 patient.setFmDate(DateUtil.parseYMD(request.getStopDate()));
180 182 patient.setType(3);
181   -
  183 + sieveService.deleteSieve(pat.getId(), hospital, pat.getLastMenses());
182 184 //分娩状态 0未终止妊娠 1终止妊娠
183   - yunBookbuildingService.updatePregnant(patient,patient.getId());
  185 + yunBookbuildingService.updatePregnant(patient, patient.getId());
184 186 }
185 187 }
186 188  
... ... @@ -192,8 +194,7 @@
192 194 personService.updatePerson(pmodel, request.getPid());
193 195 }
194 196  
195   - if (pat == null)
196   - {
  197 + if (pat == null) {
197 198 BaseResponse objectResponse = new BaseResponse();
198 199 objectResponse.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
199 200 objectResponse.setErrormsg("数据异常");
... ... @@ -204,8 +205,7 @@
204 205 model.setPatientId(pat.getId());
205 206 model.setCreated(new Date());
206 207 model.setModified(new Date());
207   - String hospital=autoMatchFacade.getHospitalId(userId);
208   - sieveService.deleteSieve(pat.getId(),hospital,pat.getLastMenses());
  208 +
209 209 stopPregnancyService.addStopPreg(model);
210 210 BaseResponse objectResponse = new BaseResponse();
211 211 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
212 212  
213 213  
... ... @@ -229,19 +229,19 @@
229 229  
230 230 /**
231 231 * 查询终止妊娠
  232 + *
232 233 * @param id
233 234 * @return
234 235 */
235 236 public BaseResponse queryStopPreg(String id) {
236 237  
237 238 Map map = new HashMap();
238   - StopPregQuery query = new StopPregQuery();
  239 + StopPregQuery query = new StopPregQuery();
239 240 query.setYn(YnEnums.YES.getId());
240 241 query.setId(id);
241 242 StopPregResult result = null;
242   - List<StopPregModel> stopPregs = stopPregnancyService.queryStopPreg(query);
243   - if (CollectionUtils.isNotEmpty(stopPregs))
244   - {
  243 + List<StopPregModel> stopPregs = stopPregnancyService.queryStopPreg(query);
  244 + if (CollectionUtils.isNotEmpty(stopPregs)) {
245 245 StopPregModel model = stopPregs.get(0);
246 246 result = new StopPregResult();
247 247 result.setPatientId(model.getPatientId());
248 248  
... ... @@ -252,13 +252,11 @@
252 252  
253 253 String inperson = model.getInPerson();
254 254 Map pmap = new HashMap();
255   - if (!StringUtils.isEmpty(inperson))
256   - {
  255 + if (!StringUtils.isEmpty(inperson)) {
257 256  
258 257 Users users = usersService.getUsers(Integer.parseInt(inperson));
259   - if (users != null)
260   - {
261   - pmap.put("id",inperson);
  258 + if (users != null) {
  259 + pmap.put("id", inperson);
262 260 pmap.put("name", users.getName());
263 261 }
264 262 result.setInPerson(pmap);
265 263  
266 264  
... ... @@ -268,18 +266,17 @@
268 266  
269 267 //查询孕妇的基本信息
270 268 AntexListResult antexListResult = null;
271   - if(!StringUtils.isEmpty(result.getPatientId()))
272   - {
  269 + if (!StringUtils.isEmpty(result.getPatientId())) {
273 270 Patients patients = null;
274 271  
275   - PatientsQuery patientsQuery = new PatientsQuery();
276   - patientsQuery.setId(result.getPatientId());
277   - patientsQuery.setYn(YnEnums.YES.getId());
  272 + PatientsQuery patientsQuery = new PatientsQuery();
  273 + patientsQuery.setId(result.getPatientId());
  274 + patientsQuery.setYn(YnEnums.YES.getId());
278 275  
279   - List<Patients> listPatiens = patientsService.queryPatient(patientsQuery);
280   - if (CollectionUtils.isNotEmpty(listPatiens)) {
281   - patients = listPatiens.get(0);
282   - }
  276 + List<Patients> listPatiens = patientsService.queryPatient(patientsQuery);
  277 + if (CollectionUtils.isNotEmpty(listPatiens)) {
  278 + patients = listPatiens.get(0);
  279 + }
283 280  
284 281 if (null != patients) {
285 282 antexListResult = new AntexListResult();
... ... @@ -318,7 +315,7 @@
318 315 map.put("stopPregDate", DateUtil.getyyyy_MM_dd(new Date()));
319 316  
320 317 //孕妇基本信息
321   - map.put("patientInfo",antexListResult);
  318 + map.put("patientInfo", antexListResult);
322 319 BaseObjectResponse objectResponse = new BaseObjectResponse();
323 320 objectResponse.setData(map);
324 321 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
325 322  
326 323  
... ... @@ -340,20 +337,19 @@
340 337  
341 338 /**
342 339 * 返回该医院可选择的录入人
  340 + *
343 341 * @return
344 342 */
345 343 public BaseResponse queryInPerson(Integer id) {
346 344 List<Map> list = new ArrayList<>();
347   - if (id != null)
348   - {
349   - UsersQuery query = new UsersQuery();
  345 + if (id != null) {
  346 + UsersQuery query = new UsersQuery();
350 347 query.setYn(YnEnums.YES.getId());
351 348 query.setEnable(1);
352 349 query.setId(id);
353 350 List<Users> dbusers = usersService.queryUsers(query);
354 351  
355   - if (CollectionUtils.isNotEmpty(dbusers))
356   - {
  352 + if (CollectionUtils.isNotEmpty(dbusers)) {
357 353 Users dbuser = dbusers.get(0);
358 354 UsersQuery usersQuery = new UsersQuery();
359 355 usersQuery.setYn(YnEnums.YES.getId());
360 356  
... ... @@ -365,13 +361,11 @@
365 361 // }
366 362 List<Users> users = usersService.queryUsers(usersQuery);
367 363  
368   - if (CollectionUtils.isNotEmpty(users))
369   - {
370   - for(Users user : users)
371   - {
  364 + if (CollectionUtils.isNotEmpty(users)) {
  365 + for (Users user : users) {
372 366 Map pmap = new HashMap();
373   - pmap.put("id",user.getId());
374   - pmap.put("name",user.getName());
  367 + pmap.put("id", user.getId());
  368 + pmap.put("name", user.getName());
375 369 list.add(pmap);
376 370 }
377 371 }
... ... @@ -379,8 +373,8 @@
379 373  
380 374 }
381 375 Map map = new HashMap();
382   - map.put("id","a9e5507f-e7da-4ec6-b8db-9a1e4d1b7c29");
383   - map.put("name","产科病房");
  376 + map.put("id", "a9e5507f-e7da-4ec6-b8db-9a1e4d1b7c29");
  377 + map.put("name", "产科病房");
384 378 list.add(map);
385 379 BaseObjectResponse objectResponse = new BaseObjectResponse();
386 380 objectResponse.setData(list);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ReferralApplyOrderAddRequest.java View file @ 922bb27
... ... @@ -12,6 +12,10 @@
12 12 */
13 13 @Form
14 14 public class ReferralApplyOrderAddRequest implements IBasicRequestConvert<ReferralApplyOrderModel> {
  15 +
  16 + private
  17 + String pid;
  18 +
15 19 @FormParam
16 20 private String parentId;
17 21 @FormParam
... ... @@ -29,6 +33,13 @@
29 33 @FormParam
30 34 private String applyDoctor;
31 35  
  36 + public String getPid() {
  37 + return pid;
  38 + }
  39 +
  40 + public void setPid(String pid) {
  41 + this.pid = pid;
  42 + }
32 43  
33 44 public String getApplyDoctor() {
34 45 return applyDoctor;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/SieveApplyOrderAddRequest.java View file @ 922bb27
... ... @@ -24,6 +24,15 @@
24 24 private String checkDate;
25 25 @FormParam
26 26 private String applyDoctor;
  27 + private String pid;
  28 +
  29 + public String getPid() {
  30 + return pid;
  31 + }
  32 +
  33 + public void setPid(String pid) {
  34 + this.pid = pid;
  35 + }
27 36  
28 37 @Override
29 38 public SieveApplyOrderModel convertToDataModel() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java View file @ 922bb27
... ... @@ -126,7 +126,7 @@
126 126 if (CollectionUtils.isNotEmpty(withList)) {
127 127 chanResult.setcTimes(withList.size());
128 128 if (null != withList.get(0).getNextCheckTime()) {
129   - nextCheckTime = DateUtil.getyyyy_MM_dd(withList.get(0).getNextCheckTime());
  129 + nextCheckTime = DateUtil.getyyyy_MM_dd(patients.getNextCheckTime());
130 130 }
131 131 postReviewQuery.setHospitalId(hospital);
132 132  
... ... @@ -138,8 +138,8 @@
138 138 }else{
139 139 chanResult.setcHTimes(withList.size());
140 140 }
141   - if (StringUtils.isNotEmpty(withList.get(0).getProdDoctor())) {
142   - Users users = usersService.getUsers(NumberUtils.toInt(withList.get(0).getProdDoctor()));
  141 + if (StringUtils.isNotEmpty(patients.getLastCheckEmployeeId())) {
  142 + Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId()));
143 143 if (null != users) {
144 144 chanResult.setCheckDoctor(users.getName());
145 145 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanPatientWorker.java View file @ 922bb27
... ... @@ -177,41 +177,41 @@
177 177 patientsService.updatePatient(patients1);
178 178 }
179 179  
180   - nextCheckTime = DateUtil.getyyyy_MM_dd(examinationModels.get(0).getNextCheckTime());
  180 + nextCheckTime = DateUtil.getyyyy_MM_dd(patients.getNextCheckTime());
181 181  
182   - if (StringUtils.isNotEmpty(examinationModels.get(0).getCheckDoctor())) {
183   - if (NumberUtils.isNumber(examinationModels.get(0).getCheckDoctor())) {
184   - Users users = usersService.getUsers(NumberUtils.toInt(examinationModels.get(0).getCheckDoctor()));
  182 + if (StringUtils.isNotEmpty(patients.getLastCheckEmployeeId())) {
  183 + if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) {
  184 + Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId()));
185 185 if (null != users) {
186 186 quanPatientsResult.setCheckDoctor(users.getName());
187 187 } else {
188   - quanPatientsResult.setCheckDoctor(examinationModels.get(0).getCheckDoctor());
  188 + quanPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId());
189 189 }
190 190 } else {
191   - quanPatientsResult.setCheckDoctor(examinationModels.get(0).getCheckDoctor());
  191 + quanPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId());
192 192 }
193 193 }
194 194  
195 195 } else {
196 196 List<AntExChuModel> list = antExService.queryAntExChu(antExChuQuery);
197 197 if (CollectionUtils.isNotEmpty(list)) {
198   - nextCheckTime = DateUtil.getyyyy_MM_dd(list.get(0).getNextCheckTime());
199   - if (StringUtils.isNotEmpty(list.get(0).getProdDoctor())) {
200   - if (NumberUtils.isNumber(list.get(0).getProdDoctor())) {
201   - Users users = usersService.getUsers(NumberUtils.toInt(list.get(0).getProdDoctor()));
  198 + nextCheckTime = DateUtil.getyyyy_MM_dd(patients.getNextCheckTime());
  199 + if (StringUtils.isNotEmpty(patients.getLastCheckEmployeeId())) {
  200 + if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) {
  201 + Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId()));
202 202 if (null != users) {
203 203 quanPatientsResult.setCheckDoctor(users.getName());
204 204 } else {
205   - quanPatientsResult.setCheckDoctor(list.get(0).getProdDoctor());
  205 + quanPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId());
206 206 }
207 207 } else {
208   - quanPatientsResult.setCheckDoctor(list.get(0).getProdDoctor());
  208 + quanPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId());
209 209 }
210 210 }
211   - Patients patients1=new Patients();
  211 + /*Patients patients1=new Patients();
212 212 patients1.setId(patients.getId());
213 213 patients1.setLastCTime(list.get(0).getCheckTime());
214   - patientsService.updatePatient(patients1);
  214 + patientsService.updatePatient(patients1);*/
215 215 }
216 216 }
217 217 stopWatch.stop();
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/WorkHR.java View file @ 922bb27
... ... @@ -127,7 +127,6 @@
127 127 }
128 128 }
129 129  
130   -
131 130 riskPatientsResult.setbTime(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate()));
132 131 antExChuQuery.setPid(patients.getPid());
133 132 antExChuQuery.setYn(YnEnums.YES.getId());
134 133  
135 134  
136 135  
137 136  
138 137  
... ... @@ -149,56 +148,27 @@
149 148 List<AntenatalExaminationModel> examinationModels = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "created"));
150 149 if (CollectionUtils.isNotEmpty(examinationModels)) {
151 150  
152   - //设置最后一次检查时间
153   - if (null == patients.getLastCTime()) {
154   - List<Date> list = new ArrayList<>();
155   - for (AntenatalExaminationModel antEx : examinationModels) {
156   - list.add(antEx.getCheckDate());
157   - }
158   -
159   - Collections.sort(list, new Comparator<Date>() {
160   - @Override
161   - public int compare(Date o1, Date o2) {
162   - if (o1 != null && o1.after(o2)) {
163   - return -1;
164   - }
165   - if (o1 != null && o1.before(o2)) {
166   - return 1;
167   - }
168   - return 0;
169   - }
170   - });
171   - Patients patients1 = new Patients();
172   - patients1.setId(patients.getId());
173   - patients1.setLastCTime(list.get(0));
174   - patientsService.updatePatient(patients1);
175   - }
176   -
177   - if (NumberUtils.isNumber(examinationModels.get(0).getCheckDoctor())) {
178   - Users users = usersService.getUsers(NumberUtils.toInt(examinationModels.get(0).getCheckDoctor()));
  151 + if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) {
  152 + Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId()));
179 153 if (null != users) {
180 154 riskPatientsResult.setCheckDoctor(users.getName());
181 155 } else {
182   - riskPatientsResult.setCheckDoctor(examinationModels.get(0).getCheckDoctor());
  156 + riskPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId());
183 157 }
184 158 }
185   - nextCheckTime = DateUtil.getyyyy_MM_dd(examinationModels.get(0).getNextCheckTime());
  159 + nextCheckTime = DateUtil.getyyyy_MM_dd(patients.getNextCheckTime());
186 160 } else {
187 161 List<AntExChuModel> list = antExService.queryAntExChu(antExChuQuery);
188 162 if (CollectionUtils.isNotEmpty(list)) {
189   - nextCheckTime = DateUtil.getyyyy_MM_dd(list.get(0).getNextCheckTime());
190   - if (NumberUtils.isNumber(list.get(0).getProdDoctor())) {
191   - Users users = usersService.getUsers(NumberUtils.toInt(list.get(0).getProdDoctor()));
  163 + nextCheckTime = DateUtil.getyyyy_MM_dd(patients.getNextCheckTime());
  164 + if (NumberUtils.isNumber(patients.getLastCheckEmployeeId())) {
  165 + Users users = usersService.getUsers(NumberUtils.toInt(patients.getLastCheckEmployeeId()));
192 166 if (null != users) {
193 167 riskPatientsResult.setCheckDoctor(users.getName());
194 168 } else {
195   - riskPatientsResult.setCheckDoctor(list.get(0).getProdDoctor());
  169 + riskPatientsResult.setCheckDoctor(patients.getLastCheckEmployeeId());
196 170 }
197 171 }
198   - Patients patients1 = new Patients();
199   - patients1.setId(patients.getId());
200   - patients1.setLastCTime(list.get(0).getCheckTime());
201   - patientsService.updatePatient(patients1);
202 172 }
203 173 }
204 174 stopWatch.stop();