Commit 9566a20b138b570012cfe9302bea208c1311532e
Exists in
master
and in
7 other branches
Merge remote-tracking branch 'origin/master'
Showing 6 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
- platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/FolicAcidFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java
View file @
9566a20
| ... | ... | @@ -220,6 +220,9 @@ |
| 220 | 220 | patients.setBuildType(2); |
| 221 | 221 | patients.setFmDate(DateUtil.addDay(patients.getLastMenses(), 294)); |
| 222 | 222 | patients.setModified(new Date()); |
| 223 | + // hujiaqi添加,是否自动分娩 | |
| 224 | + patients.setIsAutoFm(YnEnums.YES.getId()); | |
| 225 | + // hujiaqi添加结束 | |
| 223 | 226 | updatePatient(patients); |
| 224 | 227 | PersonModelQuery personYunModelQuery = new PersonModelQuery(); |
| 225 | 228 | personYunModelQuery.setYn(YnEnums.YES.getId()); |
platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
View file @
9566a20
| ... | ... | @@ -245,6 +245,16 @@ |
| 245 | 245 | // 分娩方式 |
| 246 | 246 | private String fmType; |
| 247 | 247 | |
| 248 | + private Integer isAutoFm; | |
| 249 | + | |
| 250 | + public Integer getIsAutoFm() { | |
| 251 | + return isAutoFm; | |
| 252 | + } | |
| 253 | + | |
| 254 | + public void setIsAutoFm(Integer isAutoFm) { | |
| 255 | + this.isAutoFm = isAutoFm; | |
| 256 | + } | |
| 257 | + | |
| 248 | 258 | public String getFmHospital() { |
| 249 | 259 | return fmHospital; |
| 250 | 260 | } |
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
9566a20
| ... | ... | @@ -382,8 +382,17 @@ |
| 382 | 382 | private Integer fmWeekEnd; |
| 383 | 383 | // 分娩方式 |
| 384 | 384 | private String fmType; |
| 385 | + // 是否自动分娩 | |
| 386 | + private Integer isAutoFm = -1; | |
| 385 | 387 | |
| 388 | + public Integer getIsAutoFm() { | |
| 389 | + return isAutoFm; | |
| 390 | + } | |
| 386 | 391 | |
| 392 | + public void setIsAutoFm(Integer isAutoFm) { | |
| 393 | + this.isAutoFm = isAutoFm; | |
| 394 | + } | |
| 395 | + | |
| 387 | 396 | public String getFileCode() { |
| 388 | 397 | return fileCode; |
| 389 | 398 | } |
| ... | ... | @@ -1040,6 +1049,9 @@ |
| 1040 | 1049 | } |
| 1041 | 1050 | if (-1 != yn) { |
| 1042 | 1051 | condition = condition.and("yn", yn, MongoOper.IS); |
| 1052 | + } | |
| 1053 | + if (-1 != isAutoFm) { | |
| 1054 | + condition = condition.and("isAutoFm", isAutoFm, MongoOper.IS); | |
| 1043 | 1055 | } |
| 1044 | 1056 | if (null != isNull) { |
| 1045 | 1057 | condition = condition.and("communityId", null, MongoOper.IS); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
9566a20
| ... | ... | @@ -550,7 +550,11 @@ |
| 550 | 550 | System.out.println(patients.getId() + ":这条数据的末日月经和分娩时间异常"); |
| 551 | 551 | // 跳过 |
| 552 | 552 | } |
| 553 | - | |
| 553 | + if(StringUtils.isNotEmpty(patients.getFmHospital())){ | |
| 554 | + patients.setIsAutoFm(YnEnums.NO.getId()); | |
| 555 | + }else{ | |
| 556 | + patients.setIsAutoFm(YnEnums.YES.getId()); | |
| 557 | + } | |
| 554 | 558 | |
| 555 | 559 | System.out.println(patients.getFmAge()); |
| 556 | 560 | System.out.println(patients.getFmWeek()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/FolicAcidFacade.java
View file @
9566a20
| ... | ... | @@ -33,6 +33,7 @@ |
| 33 | 33 | import org.springframework.beans.factory.annotation.Autowired; |
| 34 | 34 | import org.springframework.stereotype.Component; |
| 35 | 35 | |
| 36 | +import javax.jws.Oneway; | |
| 36 | 37 | import javax.servlet.http.HttpServletResponse; |
| 37 | 38 | import java.io.OutputStream; |
| 38 | 39 | import java.util.*; |
| ... | ... | @@ -198,6 +199,7 @@ |
| 198 | 199 | } |
| 199 | 200 | } |
| 200 | 201 | } |
| 202 | + List<Map> list = new ArrayList<>(); | |
| 201 | 203 | |
| 202 | 204 | if (archiveModel!=null){ |
| 203 | 205 | //妇女信息 |
| ... | ... | @@ -206,7 +208,7 @@ |
| 206 | 208 | archiveMap.put("certificateTypeId", archiveModel.getCertificateTypeId()); |
| 207 | 209 | archiveMap.put("username", archiveModel.getUsername()); |
| 208 | 210 | archiveMap.put("birthday",archiveModel.getBirthday() != null ? DateUtil.getyyyy_MM_dd(archiveModel.getBirthday()) : null); |
| 209 | - archiveMap.put("age", archiveModel.getBirthday() != null ? "" : DateUtil.getAge(archiveModel.getBirthday())); | |
| 211 | + archiveMap.put("age", archiveModel.getBirthday() == null ? "" : DateUtil.getAge(archiveModel.getBirthday())); | |
| 210 | 212 | archiveMap.put("phone", archiveModel.getPhone()); |
| 211 | 213 | archiveMap.put("id", archiveModel.getId()); |
| 212 | 214 | if (StringUtils.isEmpty(archiveModel.getSex()) || archiveModel.getSex().equals(SystemConfig.WOMAN_ID )){ |
| 213 | 215 | |
| ... | ... | @@ -220,9 +222,63 @@ |
| 220 | 222 | archiveMap.put("workUnit",archiveModel.getWorkUnit()); |
| 221 | 223 | archiveMap.put("buildDay",archiveModel.getBuildDay()); |
| 222 | 224 | |
| 225 | + //获取历史发放记录 | |
| 226 | + FolicAcidQuery folicAcidQuery = new FolicAcidQuery(); | |
| 227 | + folicAcidQuery.setYn(YnEnums.YES.getId()); | |
| 228 | + folicAcidQuery.setParentId(archiveModel.getId()); | |
| 229 | + | |
| 230 | + List<String> hospitalList = null; | |
| 231 | + //判断当前用户是否有区域权限 | |
| 232 | + if (userId!=null){ | |
| 233 | + hospitalList = new ArrayList<>(); | |
| 234 | + String hospital = autoMatchFacade.getHospitalId(userId); | |
| 235 | + if(null!=hospital){ | |
| 236 | + //本院 | |
| 237 | + hospitalList.add(hospital); | |
| 238 | + } | |
| 239 | + //查询用户是否有区域权限 | |
| 240 | + DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); | |
| 241 | + dataPermissionsModelQuery.setUserId(userId); | |
| 242 | + List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery); | |
| 243 | + if (CollectionUtils.isNotEmpty(permissionsModels)) { | |
| 244 | + Set<String> set = permissionsModels.get(0).getData().keySet(); | |
| 245 | + Iterator<String> it = set.iterator(); | |
| 246 | + while (it.hasNext()) { | |
| 247 | + String id = it.next(); | |
| 248 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(id) && !hospitalList.contains(id)) { | |
| 249 | + hospitalList.add(id); | |
| 250 | + } | |
| 251 | + } | |
| 252 | + } | |
| 253 | + folicAcidQuery.setHospitalList(hospitalList); | |
| 254 | + } | |
| 255 | + List<FolicAcid> folicAcidList = folicAcidService.queryFolicAcid(folicAcidQuery); | |
| 256 | + if (CollectionUtils.isNotEmpty(folicAcidList)){ | |
| 257 | + for (FolicAcid data: folicAcidList){ | |
| 258 | + Map<String,Object> acidMap = new HashMap<>(); | |
| 259 | + if (data.getPregnancyType()!=null){ | |
| 260 | + if (data.getPregnancyType()==1){ | |
| 261 | + acidMap.put("pregnancyType","孕前"); | |
| 262 | + }else if (data.getPregnancyType()==2){ | |
| 263 | + acidMap.put("pregnancyType",data.getPregnancyWeeks()); | |
| 264 | + } | |
| 265 | + } | |
| 266 | + acidMap.put("drawCount",data.getDrawCount()); | |
| 267 | + acidMap.put("drawTime",DateUtil.getyyyy_MM_dd(data.getDrawTime())); | |
| 268 | + if (StringUtils.isNotEmpty(data.getHospitalId())){ | |
| 269 | + if (data.getHospitalId().equals(hospitalId)){ | |
| 270 | + acidMap.put("other",1); | |
| 271 | + }else { | |
| 272 | + acidMap.put("other",2); | |
| 273 | + } | |
| 274 | + } | |
| 275 | + list.add(acidMap); | |
| 276 | + } | |
| 277 | + } | |
| 223 | 278 | } |
| 224 | 279 | resultMap.put("folicAcidResult",folicAcid); |
| 225 | 280 | resultMap.put("archiveResult",archiveMap); |
| 281 | + resultMap.put("folicAcidHistory",list); | |
| 226 | 282 | BaseObjectResponse response = new BaseObjectResponse(); |
| 227 | 283 | response.setData(resultMap); |
| 228 | 284 | response.setErrorcode(ErrorCodeConstants.SUCCESS); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
9566a20
| ... | ... | @@ -191,6 +191,7 @@ |
| 191 | 191 | patientsLocal.setId(deliverAddRequest.getParentId()); |
| 192 | 192 | patientsLocal.setFmDate(fmDate); |
| 193 | 193 | // HuJiaqi添加开始,这里冗余了分娩分娩医院,分娩年龄,分娩孕周,分娩方式,并将状态更改为产妇 |
| 194 | + patientsLocal.setIsAutoFm(YnEnums.NO.getId()); | |
| 194 | 195 | patientsLocal.setType(3); |
| 195 | 196 | patientsLocal.setFmHospital(deliverAddRequest.getFmHospital()); |
| 196 | 197 | patientsLocal.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode())?null:deliverAddRequest.getDeliveryMode().toString()); |
| ... | ... | @@ -315,6 +316,7 @@ |
| 315 | 316 | patients1.setFmDate(fmDate); |
| 316 | 317 | // HuJiaqi添加开始,这里冗余了分娩分娩医院,分娩年龄,分娩孕周,分娩方式,并将状态更改为产妇 |
| 317 | 318 | patients1.setType(3); |
| 319 | + patients1.setIsAutoFm(YnEnums.NO.getId()); | |
| 318 | 320 | patients1.setFmHospital(deliverAddRequest.getFmHospital()); |
| 319 | 321 | patients1.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode())?null:deliverAddRequest.getDeliveryMode().toString()); |
| 320 | 322 | try { |
| ... | ... | @@ -960,6 +962,7 @@ |
| 960 | 962 | } |
| 961 | 963 | |
| 962 | 964 | patientsQuery.setYn(YnEnums.YES.getId()); |
| 965 | + patientsQuery.setIsAutoFm(YnEnums.NO.getId()); | |
| 963 | 966 | patientsQuery.setType(3); |
| 964 | 967 | // 构造医院id集合 |
| 965 | 968 | List<String> hospitalList = new ArrayList<>(); |