Commit 9ad1b3fcd7844f770ae438505759d5d40707bc69

Authored by hujiaqi

Merge remote-tracking branch 'origin/master'

Showing 1 changed file

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 9ad1b3f
... ... @@ -75,7 +75,7 @@
75 75 * @param userId
76 76 * @return
77 77 */
78   - public String handHideBuild(String pid, String parentId, Integer userId,int type) {
  78 + public String handHideBuild(String pid, String parentId, Integer userId, int type) {
79 79 String hospitalId = autoMatchFacade.getHospitalId(userId);
80 80  
81 81 List li = new ArrayList();
82 82  
... ... @@ -86,9 +86,9 @@
86 86 return patients.getId();
87 87 }
88 88  
89   - Patients patients1= patientsService.findOnePatientById(parentId);
  89 + Patients patients1 = patientsService.findOnePatientById(parentId);
90 90  
91   - if(patients1.getHospitalId().equals(hospitalId)){
  91 + if (patients1.getHospitalId().equals(hospitalId)) {
92 92 return patients1.getId();
93 93 }
94 94  
... ... @@ -180,7 +180,7 @@
180 180 AntenatalExaminationModel model = antExAddRequest.convertToDataModel();
181 181 //表示区域的
182 182 if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospitalId))) {
183   - String parentId = handHideBuild(antExAddRequest.getPid(), antExAddRequest.getParentId(), userId,1);
  183 + String parentId = handHideBuild(antExAddRequest.getPid(), antExAddRequest.getParentId(), userId, 1);
184 184 if (StringUtils.isEmpty(parentId)) {
185 185 //打印日志
186 186 }
187 187  
188 188  
... ... @@ -231,16 +231,16 @@
231 231 // 修改关联券的使用状态,如果已使用,则返回错误码
232 232 //初诊只能建一次
233 233 if (StringUtils.isNotBlank(model.getBarCode())) {
234   - PatientCheckTicketQuery checkTicketQuery=new PatientCheckTicketQuery();
  234 + PatientCheckTicketQuery checkTicketQuery = new PatientCheckTicketQuery();
235 235 checkTicketQuery.setPid(model.getPid());
236 236 checkTicketQuery.setId(model.getBarCode());
237 237 checkTicketQuery.setStatus(1);
238   - if(patientCheckTicketService.queryTicketCount(checkTicketQuery)>0){
  238 + if (patientCheckTicketService.queryTicketCount(checkTicketQuery) > 0) {
239 239 String code = patientCheckTicketService.updateTicket(model.getBarCode(), 2, model.getHospitalId());
240 240 if (code != null) {
241 241 return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code);
242 242 }
243   - }else{
  243 + } else {
244 244 return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("该产检劵不属于本人");
245 245 }
246 246 }
... ... @@ -336,7 +336,7 @@
336 336  
337 337 //表示区域的
338 338 if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospitalId))) {
339   - String parentId = handHideBuild(excAddRequest.getPid(), excAddRequest.getParentId(), userId,1);
  339 + String parentId = handHideBuild(excAddRequest.getPid(), excAddRequest.getParentId(), userId, 1);
340 340 if (StringUtils.isEmpty(parentId)) {
341 341 //打印日志
342 342 }
343 343  
... ... @@ -384,18 +384,18 @@
384 384 //初诊只能建一次
385 385 // 修改关联券的使用状态,如果已使用,则返回错误码
386 386 if (StringUtils.isNotBlank(antExChuModel.getBarCode())) {
387   - PatientCheckTicketQuery checkTicketQuery=new PatientCheckTicketQuery();
  387 + PatientCheckTicketQuery checkTicketQuery = new PatientCheckTicketQuery();
388 388 checkTicketQuery.setPid(antExChuModel.getPid());
389 389 checkTicketQuery.setId(antExChuModel.getBarCode());
390 390 checkTicketQuery.setStatus(1);
391   - if(patientCheckTicketService.queryTicketCount(checkTicketQuery)>0){
392   - String code = patientCheckTicketService.updateTicket(antExChuModel.getBarCode(), 2, antExChuModel.getHospitalId());
393   - if (code != null) {
394   - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code);
395   - }
396   - }else{
397   - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("该产检劵不属于本人");
398   - }
  391 + if (patientCheckTicketService.queryTicketCount(checkTicketQuery) > 0) {
  392 + String code = patientCheckTicketService.updateTicket(antExChuModel.getBarCode(), 2, antExChuModel.getHospitalId());
  393 + if (code != null) {
  394 + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code);
  395 + }
  396 + } else {
  397 + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("该产检劵不属于本人");
  398 + }
399 399 }
400 400 if (CollectionUtils.isEmpty(data1)) {
401 401 Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId());
... ... @@ -794,7 +794,7 @@
794 794  
795 795 if (CollectionUtils.isNotEmpty(list)) {
796 796 // Patients patients2 = findOnePatient(null, null, null, hospital, -1, true, exListQueryRequest.getPid(),false);
797   - Patients patients2 = findOnePatient(null, null, null, groupsFacade.findGroupHospital(userId,true), -1, true, exListQueryRequest.getPid(), false);
  797 + Patients patients2 = findOnePatient(null, null, null, groupsFacade.findGroupHospital(userId, true), -1, true, exListQueryRequest.getPid(), false);
798 798 antexListResult.convertToResult(null, patients2, null);
799 799  
800 800 HighScoreResult highScoreResult = findLastRisk(list.get(0).getPid(), false);
... ... @@ -836,6 +836,7 @@
836 836 // patientsQuery1.setBookbuildingDateEnd(end);
837 837 patientsQuery1.setLastMensesEnd(end);
838 838 patientsQuery1.setBuildType(1);
  839 + patientsQuery1.setExtEnable(false);
839 840 if (listDate.size() > i + 1) {
840 841 // patientsQuery1.setBookbuildingDateStart(new Date(listDate.get(i + 1).getDate().getTime() + 86398000));
841 842 patientsQuery1.setLastMensesStart(new Date(listDate.get(i + 1).getDate().getTime() + 86398000));
842 843  
... ... @@ -984,14 +985,14 @@
984 985 Date currentDate = DateUtil.formatDate(new Date());
985 986  
986 987  
987   - if ((date.getTime() <= currentDate.getTime() || patients.getBuildType() == 2)||patients.getType()==3&&patients.getFmDate()!=null) {
  988 + if ((date.getTime() <= currentDate.getTime() || patients.getBuildType() == 2) || patients.getType() == 3 && patients.getFmDate() != null) {
988 989 //建档记录
989 990 if (null != patients.getHospitalId()) {
990 991 organization = organizationService.getOrganization(Integer.valueOf(patients.getHospitalId()));
991 992 }
992 993 pid = patients.getPid();
993 994 //当主档案的医院不在group组里需要显示本来的隐藏档案
994   - if(!"2".equals(patients.getEnable())){
  995 + if (!"2".equals(patients.getEnable())) {
995 996 listData.add(new AntData(patients, null != organization ? organization.getName() : ""));
996 997 }
997 998  
... ... @@ -1060,7 +1061,7 @@
1060 1061 }
1061 1062  
1062 1063 PostReviewQuery postReviewQuery = new PostReviewQuery();
1063   - if (list.size() - 1 >i) {
  1064 + if (list.size() - 1 > i) {
1064 1065 postReviewQuery.setStart(dueDate);
1065 1066 if (CollectionUtils.isNotEmpty(listDate)) {
1066 1067 //下次建档记录前都是产后复查,如果没有下个产程的数据就直接显示
... ... @@ -1075,7 +1076,7 @@
1075 1076 //产后复查记录
1076 1077 List<PostReviewModel> reviewModels = postReviewService.findWithList(postReviewQuery);
1077 1078 if (CollectionUtils.isNotEmpty(reviewModels)) {
1078   - if(CollectionUtils.isNotEmpty(listData)){
  1079 + if (CollectionUtils.isNotEmpty(listData)) {
1079 1080 for (PostReviewModel postReviewModel : reviewModels) {
1080 1081 if (postReviewModel.getYn() == YnEnums.YES.getId()) {
1081 1082 if (null != postReviewModel.getHospitalId()) {
... ... @@ -1088,7 +1089,7 @@
1088 1089 }
1089 1090 }
1090 1091 iterator.remove();
1091   - if(CollectionUtils.isNotEmpty(listData)){
  1092 + if (CollectionUtils.isNotEmpty(listData)) {
1092 1093 sort(listData);
1093 1094 updateEditEnable(listData, sortList);
1094 1095 sortList.add(listData);
... ... @@ -1158,7 +1159,7 @@
1158 1159 organization = organizationService.getOrganization(Integer.valueOf(patients.getHospitalId()));
1159 1160 }
1160 1161 pid = patients.getPid();
1161   - if(!"2".equals(patients.getEnable())) {
  1162 + if (!"2".equals(patients.getEnable())) {
1162 1163 listData.add(new AntData(patients, null != organization ? organization.getName() : ""));
1163 1164 }
1164 1165 }
1165 1166  
1166 1167  
1167 1168  
... ... @@ -1679,26 +1680,27 @@
1679 1680 if (CollectionUtils.isNotEmpty(list)) {
1680 1681 patients = list.get(0);
1681 1682 }
1682   - } else if(StringUtils.isNotEmpty(queryRequest.getBarCode())){
1683   -
1684   - String code = patientCheckTicketService.updateTicket(queryRequest.getBarCode(), 2, hospitalId);
1685   - if (code != null) {
1686   - return new BaseResponse().setErrorcode(ErrorCodeConstants.TICKET_USED).setErrormsg(code);
  1683 + } else if (StringUtils.isNotEmpty(queryRequest.getBarCode())) {
  1684 + PatientCheckTicketQuery checkTicketQuery = new PatientCheckTicketQuery();
  1685 + checkTicketQuery.setId(queryRequest.getBarCode());
  1686 + checkTicketQuery.setStatus(1);
  1687 + if (patientCheckTicketService.queryTicketCount(checkTicketQuery) ==0) {
  1688 + return new BaseResponse().setErrorcode(ErrorCodeConstants.TICKET_USED).setErrormsg("不能使用.");
1687 1689 }
1688 1690  
1689   - PatientCheckTicket checkTicket =patientCheckTicketService.getTicket(queryRequest.getBarCode());
1690   - if(null!=checkTicket){
  1691 + PatientCheckTicket checkTicket = patientCheckTicketService.getTicket(queryRequest.getBarCode());
  1692 + if (null != checkTicket) {
1691 1693 Patients patients1 = patientsService.findOnePatientById(checkTicket.getPatientId());
1692   - if(null!=patients1){
1693   - if(StringUtils.isNotEmpty(patients1.getSource())){
1694   - patients= patientsService.findOnePatientById(patients1.getSource());
1695   - }else{
1696   - patients=patients1;
  1694 + if (null != patients1) {
  1695 + if (StringUtils.isNotEmpty(patients1.getSource())) {
  1696 + patients = patientsService.findOnePatientById(patients1.getSource());
  1697 + } else {
  1698 + patients = patients1;
1697 1699 }
1698 1700 }
1699 1701 }
1700   - }else {
1701   - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, groupsFacade.findGroupHospital(userId,false), 1, false, null, og.getbStatus() == 1);
  1702 + } else {
  1703 + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, groupsFacade.findGroupHospital(userId, false), 1, false, null, og.getbStatus() == 1);
1702 1704 //查询产妇数据
1703 1705 // patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospitalId, 1, false, null, false);
1704 1706 }
... ... @@ -1711,7 +1713,7 @@
1711 1713 // //查询是否还有其他记录
1712 1714 // patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, hospitalId, 3, false, null, false);
1713 1715 // }
1714   - patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, groupsFacade.findGroupHospital(userId,false), 3, false, null, og.getbStatus() == 1);
  1716 + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo(), null, groupsFacade.findGroupHospital(userId, false), 3, false, null, og.getbStatus() == 1);
1715 1717  
1716 1718 //原来单机
1717 1719 if (null != patients) {
... ... @@ -1794,7 +1796,7 @@
1794 1796 AntExChuQuery antExChuQuery1 = new AntExChuQuery();
1795 1797 antExChuQuery1.setPid(patients.getPid());
1796 1798 // antExChuQuery1.setHospitalId(hospitalId);
1797   - antExChuQuery1.setHospitalList(groupsFacade.findGroupHospital(userId,false));
  1799 + antExChuQuery1.setHospitalList(groupsFacade.findGroupHospital(userId, false));
1798 1800  
1799 1801 antExChuQuery1.setYn(YnEnums.YES.getId());
1800 1802 antExChuQuery1.setStart(max);
... ... @@ -1808,7 +1810,7 @@
1808 1810 patientsQuery1.setYn(YnEnums.YES.getId());
1809 1811 patientsQuery1.setPid(patients.getPid());
1810 1812 // patientsQuery1.setHospitalId(hospitalId);
1811   - patientsQuery1.setHospitalList(groupsFacade.findGroupHospital(userId,false));
  1813 + patientsQuery1.setHospitalList(groupsFacade.findGroupHospital(userId, false));
1812 1814 List<Patients> patientses = patientsService.queryPatient(patientsQuery1);
1813 1815  
1814 1816 if (CollectionUtils.isNotEmpty(patientses)) {