Commit 10b27b0eacc2e597c3a3fff50c32cd21226e06ba

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 @ 10b27b0
... ... @@ -74,10 +74,7 @@
74 74 */
75 75 public String handHideBuild(String pid, String parentId, Integer userId) {
76 76 String hospitalId = autoMatchFacade.getHospitalId(userId);
77   - //修改时不为空
78   - if (StringUtils.isNotEmpty(parentId)) {
79   - return parentId;
80   - }
  77 +
81 78 List li = new ArrayList();
82 79 li.add(hospitalId);
83 80 Patients patients = findOnePatient(null, null, null, li, 1, false, pid, true);
... ... @@ -86,6 +83,13 @@
86 83 return patients.getId();
87 84 }
88 85  
  86 + Patients patients1= patientsService.findOnePatientById(parentId);
  87 +
  88 + if(patients1.getHospitalId().equals(hospitalId)){
  89 + return patients1.getId();
  90 + }
  91 +
  92 +
89 93 //表示区域的
90 94 if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospitalId)) && StringUtils.isNotEmpty(pid)) {
91 95 patients = findOnePatient(null, null, null, null, 1, false, pid, false);
92 96  
93 97  
... ... @@ -165,13 +169,25 @@
165 169 */
166 170 public BaseResponse addOneAntEx(AntExAddRequest antExAddRequest, Integer userId) {
167 171 String hospitalId = autoMatchFacade.getHospitalId(userId);
  172 + AntenatalExaminationModel model = antExAddRequest.convertToDataModel();
  173 + //表示区域的
  174 + if (StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(hospitalId))) {
  175 + String parentId = handHideBuild(antExAddRequest.getPid(), antExAddRequest.getParentId(), userId);
  176 + if (StringUtils.isEmpty(parentId)) {
  177 + //打印日志
  178 + }
  179 + model.setParentId(parentId);
  180 + antExAddRequest.setParentId(parentId);
  181 + }
  182 +
  183 +
168 184 if (StringUtils.isNotEmpty(antExAddRequest.getId())) {
169   - AntenatalExaminationModel antenatalExamination = antExAddRequest.convertToDataModel();
170   - antenatalExamination.setHospitalId(hospitalId);
171   - antenatalExamination.setOperator(userId);
172   - antenatalExaminationService.updateOneAnt(antenatalExamination, antExAddRequest.getId());
  185 +
  186 + model.setHospitalId(hospitalId);
  187 + model.setOperator(userId);
  188 + antenatalExaminationService.updateOneAnt(model, antExAddRequest.getId());
173 189 //修改申请单状态
174   - updateApplyOrder(antenatalExamination, antExAddRequest.getParentId());
  190 + updateApplyOrder(model, antExAddRequest.getParentId());
175 191  
176 192 Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId());
177 193  
... ... @@ -191,7 +207,7 @@
191 207 //复诊,修改产检管理
192 208 antenatalExaminationService.updateAntExRecord(antExAddRequest.getId(), 2);
193 209 } else {
194   - AntenatalExaminationModel model = antExAddRequest.convertToDataModel();
  210 +
195 211 model.setOperator(userId);
196 212 model.setYn(YnEnums.YES.getId());
197 213 model.setHospitalId(hospitalId);
... ... @@ -223,7 +239,6 @@
223 239  
224 240 updateLastRisk(antExAddRequest.getParentId());
225 241  
226   -
227 242 //修改本院最后一次定义高危
228 243 updateLastRhTime(patients.getId(), hospitalId);
229 244  
... ... @@ -300,6 +315,8 @@
300 315 //打印日志
301 316 }
302 317 antExChuModel.setParentId(parentId);
  318 + excAddRequest.setParentId(parentId);
  319 +
303 320 }
304 321 antExChuModel.setOperator(userId);
305 322 if (StringUtils.isNotEmpty(antExChuModel.getId()) && StringUtils.isNotEmpty(antExChuModel.getParentId())) {
... ... @@ -1022,6 +1039,7 @@
1022 1039 List listData = new ArrayList();
1023 1040 while (iterator.hasNext()) {
1024 1041 Patients patients = iterator.next();
  1042 +
1025 1043 //处理建档就分娩的情况
1026 1044 Date date = DateUtil.addWeek(patients.getLastMenses(), 42);
1027 1045  
... ... @@ -1032,7 +1050,9 @@
1032 1050 organization = organizationService.getOrganization(Integer.valueOf(patients.getHospitalId()));
1033 1051 }
1034 1052 pid = patients.getPid();
1035   - listData.add(new AntData(patients, null != organization ? organization.getName() : ""));
  1053 + if(!"0".equals(patients.getEnable())){
  1054 + listData.add(new AntData(patients, null != organization ? organization.getName() : ""));
  1055 + }
1036 1056  
1037 1057  
1038 1058 if (null == dueDate && null != patients.getFmDate()) {
... ... @@ -1191,7 +1211,9 @@
1191 1211 organization = organizationService.getOrganization(Integer.valueOf(patients.getHospitalId()));
1192 1212 }
1193 1213 pid = patients.getPid();
1194   - listData.add(new AntData(patients, null != organization ? organization.getName() : ""));
  1214 + if(!"0".equals(patients.getEnable())) {
  1215 + listData.add(new AntData(patients, null != organization ? organization.getName() : ""));
  1216 + }
1195 1217 }
1196 1218  
1197 1219