Commit 5725a3838714013597866b6b2ccc7a1b87b9ed03
Exists in
master
and in
7 other branches
Merge remote-tracking branch 'origin/master'
Showing 5 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PermissionsController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.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/AntExRecordService.java
View file @
5725a38
| ... | ... | @@ -312,7 +312,7 @@ |
| 312 | 312 | antExRecordQuery.mysqlBuild(antExRecordDao.count(query)); |
| 313 | 313 | query.start(antExRecordQuery.getOffset()).end(antExRecordQuery.getLimit()); |
| 314 | 314 | } |
| 315 | - return antExRecordDao.queryRecord(query.addOrder(Sort.Direction.DESC, "modified")); | |
| 315 | + return antExRecordDao.queryRecord(query.addOrder(Sort.Direction.DESC, "checkTime")); | |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PermissionsController.java
View file @
5725a38
| ... | ... | @@ -6,6 +6,7 @@ |
| 6 | 6 | import com.lyms.platform.common.base.ContextHolder; |
| 7 | 7 | import com.lyms.platform.common.base.LoginContext; |
| 8 | 8 | import com.lyms.platform.common.enums.PermissionTypeEnums; |
| 9 | +import com.lyms.platform.common.enums.UserTypeEnum; | |
| 9 | 10 | import com.lyms.platform.common.enums.YnEnums; |
| 10 | 11 | import com.lyms.platform.common.exception.BusinessException; |
| 11 | 12 | import com.lyms.platform.common.result.BaseResponse; |
| 12 | 13 | |
| ... | ... | @@ -13,10 +14,12 @@ |
| 13 | 14 | import com.lyms.platform.common.utils.JsonUtil; |
| 14 | 15 | import com.lyms.platform.common.utils.ResultUtils; |
| 15 | 16 | import com.lyms.platform.operate.web.facade.AccessPermissionFacade; |
| 17 | +import com.lyms.platform.operate.web.facade.AutoMatchFacade; | |
| 16 | 18 | import com.lyms.platform.operate.web.request.AccessPermissionAddRequest; |
| 17 | 19 | import com.lyms.platform.permission.model.*; |
| 18 | 20 | import com.lyms.platform.permission.service.*; |
| 19 | 21 | import com.lyms.platform.pojo.DataPermissionsModel; |
| 22 | +import org.apache.commons.collections.CollectionUtils; | |
| 20 | 23 | import org.apache.commons.lang.StringUtils; |
| 21 | 24 | import org.apache.commons.lang.math.NumberUtils; |
| 22 | 25 | import org.springframework.beans.factory.annotation.Autowired; |
| 23 | 26 | |
| 24 | 27 | |
| 25 | 28 | |
| ... | ... | @@ -38,22 +41,12 @@ |
| 38 | 41 | private Permissions2Service permissions2Service; |
| 39 | 42 | @Autowired |
| 40 | 43 | private UsersService usersService; |
| 41 | - | |
| 42 | 44 | @Autowired |
| 43 | - private DepartmentsService departmentsService; | |
| 44 | - @Autowired | |
| 45 | - private TokenService tokenService; | |
| 46 | - @Autowired | |
| 47 | 45 | private UserRoleMapsService userRoleMapsService; |
| 48 | 46 | @Autowired |
| 49 | - private RolePermissionMapsService rolePermissionMapsService; | |
| 50 | - | |
| 51 | - private static String NODE="children"; | |
| 52 | - private static String CHECK="check"; | |
| 53 | - | |
| 54 | - private Integer TYPE = 1; | |
| 55 | - @Autowired | |
| 56 | 47 | private AccessPermissionFacade accessPermissionFacade; |
| 48 | + @Autowired | |
| 49 | + private RolesService rolesService; | |
| 57 | 50 | |
| 58 | 51 | |
| 59 | 52 | /** |
| ... | ... | @@ -63,8 +56,8 @@ |
| 63 | 56 | @TokenRequired |
| 64 | 57 | public void getPermissions(HttpServletResponse response, |
| 65 | 58 | @RequestParam(value = "id", required = false) Integer id, |
| 66 | - @RequestParam(value = "page",required = false) Integer page, | |
| 67 | - @RequestParam(value = "limit",required = false) Integer limit) { | |
| 59 | + @RequestParam(value = "page", required = false) Integer page, | |
| 60 | + @RequestParam(value = "limit", required = false) Integer limit) { | |
| 68 | 61 | Permissions2Query permissionsQuery = new Permissions2Query(); |
| 69 | 62 | page = null == page ? 1 : page; |
| 70 | 63 | limit = null == limit ? 10 : limit; |
| 71 | 64 | |
| 72 | 65 | |
| ... | ... | @@ -79,17 +72,68 @@ |
| 79 | 72 | } |
| 80 | 73 | |
| 81 | 74 | |
| 75 | + /** | |
| 76 | + * 获取权限列表 | |
| 77 | + */ | |
| 78 | + @RequestMapping(value = "/current/permissions", method = RequestMethod.GET) | |
| 79 | + @TokenRequired | |
| 80 | + public void getCurrentPermissions(HttpServletResponse response, HttpServletRequest request) { | |
| 81 | + /* Permissions2Query permissionsQuery = new Permissions2Query(); | |
| 82 | + page = null == page ? 1 : page; | |
| 83 | + limit = null == limit ? 10 : limit; | |
| 84 | + permissionsQuery.setNeed("true"); | |
| 85 | + permissionsQuery.setPage(page); | |
| 86 | + permissionsQuery.setId(id); | |
| 87 | + permissionsQuery.setLimit(limit); | |
| 88 | + permissionsQuery.setYn(YnEnums.YES.getId()); | |
| 89 | + List<Permissions2> permissionses = permissions2Service.queryPermissions2(permissionsQuery); | |
| 90 | +*/ | |
| 91 | + LoginContext loginContext = (LoginContext) request.getAttribute("loginContext"); | |
| 92 | + Users users = null; | |
| 93 | + if (null != loginContext) { | |
| 94 | + users = usersService.getUsers(loginContext.getId()); | |
| 95 | + } | |
| 96 | + List permissions = new ArrayList<>(); | |
| 97 | + //超级管理员拥有所有角色和权限 | |
| 98 | + if (users.getType().equals(UserTypeEnum.SUPPER_ADMIN.getId())) { | |
| 99 | + Permissions2Query permissionsQuery = new Permissions2Query(); | |
| 100 | + permissionsQuery.setYn(YnEnums.YES.getId()); | |
| 101 | + permissions = permissions2Service.queryPermissions2(permissionsQuery); | |
| 102 | + } | |
| 103 | + //其他用户 | |
| 104 | + else if (users.getType().equals(UserTypeEnum.PLATFORM_ADMIN.getId()) || users.getType().equals(UserTypeEnum.NORMAL_USER.getId())) { | |
| 105 | + //获取用户角色信息 | |
| 106 | + UserRoleMapsQuery query = new UserRoleMapsQuery(); | |
| 107 | + query.setUserId(users.getId()); | |
| 108 | + query.setYn(YnEnums.YES.getId()); | |
| 109 | + List<Integer> userRoleMapses = userRoleMapsService.queryUserRoleList(query); | |
| 110 | + List<Integer> permissionIds = new ArrayList<>(); | |
| 82 | 111 | |
| 83 | 112 | |
| 113 | + List<Permissions2> local = permissions2Service.queryPermissionByRoleIds(userRoleMapses); | |
| 114 | + if (CollectionUtils.isNotEmpty(local)) { | |
| 115 | + for (Permissions2 permissions1 : local) { | |
| 116 | + if (!permissionIds.contains(permissions1.getId())) { | |
| 117 | + permissionIds.add(permissions1.getId()); | |
| 118 | + permissions.add(permissions1); | |
| 119 | + } | |
| 120 | + } | |
| 121 | + } | |
| 122 | + } | |
| 123 | + | |
| 124 | + ResultUtils.buildSuccessResultAndWrite(response, permissions); | |
| 125 | + } | |
| 126 | + | |
| 127 | + | |
| 84 | 128 | @TokenRequired |
| 85 | 129 | @RequestMapping(value = "/accesspermissions", method = RequestMethod.GET) |
| 86 | 130 | @ResponseBody |
| 87 | - public List getAccessPermission(){ | |
| 88 | - List<Map<String,Object>> list = new ArrayList<>(); | |
| 89 | - for(PermissionTypeEnums permissionTypeEnums:PermissionTypeEnums.values()){ | |
| 90 | - Map<String,Object> data = new HashMap<String,Object>(); | |
| 91 | - data.put("id",permissionTypeEnums.getId()); | |
| 92 | - data.put("title",permissionTypeEnums.getTitle()); | |
| 131 | + public List getAccessPermission() { | |
| 132 | + List<Map<String, Object>> list = new ArrayList<>(); | |
| 133 | + for (PermissionTypeEnums permissionTypeEnums : PermissionTypeEnums.values()) { | |
| 134 | + Map<String, Object> data = new HashMap<String, Object>(); | |
| 135 | + data.put("id", permissionTypeEnums.getId()); | |
| 136 | + data.put("title", permissionTypeEnums.getTitle()); | |
| 93 | 137 | list.add(data); |
| 94 | 138 | } |
| 95 | 139 | return list; |
| 96 | 140 | |
| ... | ... | @@ -98,10 +142,9 @@ |
| 98 | 142 | @TokenRequired |
| 99 | 143 | @RequestMapping(value = "/accesspermissions", method = RequestMethod.POST) |
| 100 | 144 | @ResponseBody |
| 101 | - public BaseResponse addDataAccessPermission(@Valid AccessPermissionAddRequest accessPermissionAddRequest){ | |
| 145 | + public BaseResponse addDataAccessPermission(@Valid AccessPermissionAddRequest accessPermissionAddRequest) { | |
| 102 | 146 | return accessPermissionFacade.addAccessPermission(accessPermissionAddRequest); |
| 103 | 147 | } |
| 104 | - | |
| 105 | 148 | |
| 106 | 149 | |
| 107 | 150 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
5725a38
| ... | ... | @@ -156,19 +156,47 @@ |
| 156 | 156 | |
| 157 | 157 | if (StringUtils.isNotEmpty(patients.getSource())) { |
| 158 | 158 | Patients masterPatients = patientsService.findOnePatientById(patients.getSource()); |
| 159 | - masterPatients.setModified(patients.getModified()); | |
| 160 | - masterPatients.setoRiskFactor(patients.getoRiskFactor()); | |
| 161 | - masterPatients.setLastCTime(patients.getLastCTime()); | |
| 162 | - masterPatients.setPostViewTimes(patients.getPostViewTimes()); | |
| 163 | - masterPatients.setLastRhTime(patients.getLastRhTime()); | |
| 164 | - masterPatients.setRiskFactorId(patients.getRiskFactorId()); | |
| 165 | - masterPatients.setRiskLevelId(patients.getRiskLevelId()); | |
| 166 | - masterPatients.setRiskScore(patients.getRiskScore()); | |
| 167 | - masterPatients.setNextCheckTime(patients.getNextCheckTime()); | |
| 168 | - masterPatients.setFmDate(patients.getFmDate()); | |
| 169 | - masterPatients.setServiceStatus(patients.getServiceStatus()); | |
| 170 | - masterPatients.setLastCheckEmployeeId(patients.getLastCheckEmployeeId()); | |
| 171 | - patientsService.updatePatient(masterPatients); | |
| 159 | + Patients p1 = new Patients(); | |
| 160 | + p1.setId(masterPatients.getId()); | |
| 161 | + p1.setModified(patients.getModified()); | |
| 162 | + p1.setoRiskFactor(patients.getoRiskFactor()); | |
| 163 | + p1.setLastCTime(patients.getLastCTime()); | |
| 164 | + p1.setPostViewTimes(patients.getPostViewTimes()); | |
| 165 | + p1.setLastRhTime(patients.getLastRhTime()); | |
| 166 | + p1.setRiskFactorId(patients.getRiskFactorId()); | |
| 167 | + p1.setRiskLevelId(patients.getRiskLevelId()); | |
| 168 | + p1.setRiskScore(patients.getRiskScore()); | |
| 169 | + p1.setNextCheckTime(patients.getNextCheckTime()); | |
| 170 | + p1.setFmDate(patients.getFmDate()); | |
| 171 | + p1.setServiceStatus(patients.getServiceStatus()); | |
| 172 | + p1.setLastCheckEmployeeId(patients.getLastCheckEmployeeId()); | |
| 173 | + patientsService.updatePatient(p1); | |
| 174 | + patientsService.updatePatientOneCol(masterPatients.getId(), patients.getNextCheckTime()); | |
| 175 | + }else{ | |
| 176 | + PatientsQuery patientsQuery1=new PatientsQuery(); | |
| 177 | + patientsQuery1.setSource(parentId); | |
| 178 | + patientsQuery1.setYn(YnEnums.YES.getId()); | |
| 179 | + List<Patients> list= patientsService.queryPatient(patientsQuery1); | |
| 180 | + if(CollectionUtils.isNotEmpty(list)){ | |
| 181 | + for(Patients p:list){ | |
| 182 | + Patients p1 = new Patients(); | |
| 183 | + p1.setId(p.getId()); | |
| 184 | + p1.setModified(patients.getModified()); | |
| 185 | + p1.setoRiskFactor(patients.getoRiskFactor()); | |
| 186 | + p1.setLastCTime(patients.getLastCTime()); | |
| 187 | + p1.setPostViewTimes(patients.getPostViewTimes()); | |
| 188 | + p1.setLastRhTime(patients.getLastRhTime()); | |
| 189 | + p1.setRiskFactorId(patients.getRiskFactorId()); | |
| 190 | + p1.setRiskLevelId(patients.getRiskLevelId()); | |
| 191 | + p1.setRiskScore(patients.getRiskScore()); | |
| 192 | + p1.setNextCheckTime(patients.getNextCheckTime()); | |
| 193 | + p1.setFmDate(patients.getFmDate()); | |
| 194 | + p1.setServiceStatus(patients.getServiceStatus()); | |
| 195 | + p1.setLastCheckEmployeeId(patients.getLastCheckEmployeeId()); | |
| 196 | + patientsService.updatePatient(p1); | |
| 197 | + patientsService.updatePatientOneCol(p.getId(), patients.getNextCheckTime()); | |
| 198 | + } | |
| 199 | + } | |
| 172 | 200 | } |
| 173 | 201 | } |
| 174 | 202 | |
| 175 | 203 | |
| ... | ... | @@ -384,9 +412,11 @@ |
| 384 | 412 | |
| 385 | 413 | //初诊,修改产检管理 |
| 386 | 414 | // antenatalExaminationService.updateAntExRecord(antExChuModel.getId(), 1); |
| 387 | - if (StringUtils.isNotEmpty(antExChuModel.getPid())) { | |
| 415 | + /* if (StringUtils.isNotEmpty(antExChuModel.getPid())) { | |
| 388 | 416 | recordService.handExRecord(antExChuModel.getPid()); |
| 389 | - } | |
| 417 | + }*/ | |
| 418 | + antenatalExaminationService.updateAntExRecord(antExChuModel.getId(), 1); | |
| 419 | + | |
| 390 | 420 | } else { |
| 391 | 421 | AntExChuQuery antExChuQuery1 = new AntExChuQuery(); |
| 392 | 422 | antExChuQuery1.setParentId(excAddRequest.getParentId()); |
| ... | ... | @@ -444,9 +474,8 @@ |
| 444 | 474 | //修改本院最后一次定义高危 |
| 445 | 475 | updateLastRhTime(patients.getId(), hospitalId); |
| 446 | 476 | setLashCTimes(antExChuModel.getParentId()); |
| 447 | - if (StringUtils.isNotEmpty(antExChuModel.getPid())) { | |
| 448 | - recordService.handExRecord(antExChuModel.getPid()); | |
| 449 | - } | |
| 477 | + | |
| 478 | + antenatalExaminationService.updateAntExRecord(antExChuModel.getId(), 1); | |
| 450 | 479 | if (null != patients.getBuildType() && patients.getBuildType() == 3) { |
| 451 | 480 | Patients patients1 = new Patients(); |
| 452 | 481 | patients1.setEnable("1"); |
| ... | ... | @@ -1463,27 +1492,6 @@ |
| 1463 | 1492 | |
| 1464 | 1493 | parentId = localAntModel.getParentId(); |
| 1465 | 1494 | |
| 1466 | - /*AntExQuery antExQuery = new AntExQuery(); | |
| 1467 | - antExQuery.setId(antExQueryRequest.getId()); | |
| 1468 | - antExQuery.setYn(YnEnums.YES.getId()); | |
| 1469 | - antExQuery.setHospitalId(hospital); | |
| 1470 | - List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
| 1471 | - //TODO 需要根据时间去查询是否是本院最后一条记录 | |
| 1472 | - if (CollectionUtils.isNotEmpty(list)) { | |
| 1473 | - antExQuery.setStart(new Date(list.get(0).getCheckDate().getTime() + 40000)); | |
| 1474 | - antExQuery.setParentId(list.get(0).getParentId()); | |
| 1475 | - } | |
| 1476 | - antExQuery.setId(null); | |
| 1477 | - list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
| 1478 | - if (CollectionUtils.isNotEmpty(list)) { | |
| 1479 | - for (int i = 0; i < list.size(); i++) { | |
| 1480 | - if (list.get(i).getId().equals(antExQueryRequest.getId())) { | |
| 1481 | - list.remove(i); | |
| 1482 | - } | |
| 1483 | - } | |
| 1484 | - }*/ | |
| 1485 | - | |
| 1486 | -// if (CollectionUtils.isEmpty(list)) { | |
| 1487 | 1495 | if (deleteProcessHandler.deleteAntEx(localAntModel.getPid(), localAntModel.getCheckDate(), hospital, true)) { |
| 1488 | 1496 | antenatalExaminationService.updateOneAnt(antEx, antExQueryRequest.getId()); |
| 1489 | 1497 | |
| ... | ... | @@ -1508,33 +1516,6 @@ |
| 1508 | 1516 | |
| 1509 | 1517 | parentId = antExChuModel11.getParentId(); |
| 1510 | 1518 | |
| 1511 | - | |
| 1512 | - /*AntExChuQuery antExQuery = new AntExChuQuery(); | |
| 1513 | - antExQuery.setId(antExQueryRequest.getId()); | |
| 1514 | - antExQuery.setYn(YnEnums.YES.getId()); | |
| 1515 | - antExQuery.setHospitalId(hospital); | |
| 1516 | - | |
| 1517 | - List<AntExChuModel> list = antenatalExaminationService.queryAntExChu(antExQuery); | |
| 1518 | - | |
| 1519 | - //TODO 需要根据时间去查询是否是本院最后一条记录 | |
| 1520 | - if (CollectionUtils.isNotEmpty(list)) { | |
| 1521 | - antExQuery.setStart(new Date(list.get(0).getCheckTime().getTime() + 40000)); | |
| 1522 | - antExQuery.setParentId(list.get(0).getParentId()); | |
| 1523 | - } | |
| 1524 | - | |
| 1525 | - antExQuery.setId(null); | |
| 1526 | - | |
| 1527 | - list = antenatalExaminationService.queryAntExChu(antExQuery); | |
| 1528 | - | |
| 1529 | - if (CollectionUtils.isNotEmpty(list)) { | |
| 1530 | - for (int i = 0; i < list.size(); i++) { | |
| 1531 | - if (list.get(i).getId().equals(antExQueryRequest.getId())) { | |
| 1532 | - list.remove(i); | |
| 1533 | - } | |
| 1534 | - } | |
| 1535 | - }*/ | |
| 1536 | - | |
| 1537 | -// if (CollectionUtils.isEmpty(list)) { | |
| 1538 | 1519 | if (deleteProcessHandler.deleteAntExChu(antExChuModel11.getPid(), antExChuModel11.getCheckTime(), hospital, true, antExQueryRequest.getId())) { |
| 1539 | 1520 | antenatalExaminationService.updateAntExChu(antExChuModel, antExQueryRequest.getId()); |
| 1540 | 1521 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
5725a38
| ... | ... | @@ -119,7 +119,7 @@ |
| 119 | 119 | * @return |
| 120 | 120 | */ |
| 121 | 121 | public BaseListResponse getTicketList(String patientId) { |
| 122 | - List<PatientCheckTicket> list = patientCheckTicketService.queryTicket(patientId, null, null, 1); | |
| 122 | + List<PatientCheckTicket> list = patientCheckTicketService.queryTicket(patientId, null, null, null); | |
| 123 | 123 | return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(list).setPageInfo(new PageInfo()); |
| 124 | 124 | } |
| 125 | 125 | |
| ... | ... | @@ -529,6 +529,11 @@ |
| 529 | 529 | |
| 530 | 530 | //如果身份证号码不为空就以身份证号码查询 |
| 531 | 531 | if (!StringUtils.isEmpty(bookbuildingQueryRequest.getCardNo())) { |
| 532 | + | |
| 533 | + /* if(StringUtils.isNotEmpty(group)){ | |
| 534 | + //区域模式 | |
| 535 | + patientsQuery.setHospitalList(groupsFacade.findGroupHospital(userId, false)); | |
| 536 | + }*/ | |
| 532 | 537 | patientsQuery.setCardNo(bookbuildingQueryRequest.getCardNo()); |
| 533 | 538 | patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery, "bookbuildingDate", Sort.Direction.DESC); |
| 534 | 539 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
5725a38
| ... | ... | @@ -76,6 +76,8 @@ |
| 76 | 76 | |
| 77 | 77 | @Autowired |
| 78 | 78 | private OrganizationGroupsFacade organizationGroupsFacade; |
| 79 | + @Autowired | |
| 80 | + private PatientCheckTicketService patientCheckTicketService; | |
| 79 | 81 | |
| 80 | 82 | @Autowired |
| 81 | 83 | private BasicConfigService basicConfigService; |
| ... | ... | @@ -195,7 +197,7 @@ |
| 195 | 197 | // HuJiaqi添加开始,这里冗余了分娩分娩医院,分娩年龄,分娩孕周,分娩方式,并将状态更改为产妇 |
| 196 | 198 | patientsLocal.setIsAutoFm(YnEnums.NO.getId()); |
| 197 | 199 | patientsLocal.setType(3); |
| 198 | - patientsLocal.setFmHospital(deliverAddRequest.getFmHospital()); | |
| 200 | + patientsLocal.setFmHospital(hospitalId); | |
| 199 | 201 | patientsLocal.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode())?null:deliverAddRequest.getDeliveryMode().toString()); |
| 200 | 202 | try { |
| 201 | 203 | patientsLocal.setFmAge(DateUtil.getAge(patients1.getBirth(), fmDate)); |
| ... | ... | @@ -246,6 +248,8 @@ |
| 246 | 248 | |
| 247 | 249 | maternalDeliverModel.setYn(YnEnums.YES.getId()); |
| 248 | 250 | matDeliverService.addMatDeliver(maternalDeliverModel); |
| 251 | + //作废产检劵 | |
| 252 | + patientCheckTicketService.cancelCheckTicket(hospitalId,deliverAddRequest.getParentId()); | |
| 249 | 253 | //修改 |
| 250 | 254 | } else if (StringUtils.isNotEmpty(deliverAddRequest.getId()) && StringUtils.isNotEmpty(deliverAddRequest.getParentId())) { |
| 251 | 255 | |
| ... | ... | @@ -296,7 +300,7 @@ |
| 296 | 300 | // HuJiaqi添加开始,这里冗余了分娩分娩医院,分娩年龄,分娩孕周,分娩方式,并将状态更改为产妇 |
| 297 | 301 | patients1.setType(3); |
| 298 | 302 | patients1.setIsAutoFm(YnEnums.NO.getId()); |
| 299 | - patients1.setFmHospital(deliverAddRequest.getFmHospital()); | |
| 303 | + patients1.setFmHospital(hospitalId); | |
| 300 | 304 | patients1.setFmType(MapUtils.isNotEmpty(deliverAddRequest.getDeliveryMode())?null:deliverAddRequest.getDeliveryMode().toString()); |
| 301 | 305 | try { |
| 302 | 306 | patients1.setFmAge(DateUtil.getAge(patients.getBirth(), fmDate)); |
| 303 | 307 | |
| ... | ... | @@ -433,27 +437,29 @@ |
| 433 | 437 | List<MaternalDeliverModel.Baby> babyList = new ArrayList<>(); |
| 434 | 438 | for (MatDeliverAddRequest.Baby baby : list) { |
| 435 | 439 | MaternalDeliverModel.Baby babyModel = baby.convertToDataModel(); |
| 436 | - //判断妊娠结局是活产才添加数据 | |
| 437 | - BabyModel babyModel1=new BabyModel(); | |
| 438 | - MatDeliverQuery query=new MatDeliverQuery(); | |
| 439 | - query.setId(deliverAddRequest.getId()); | |
| 440 | - babyModel1.setParentId(deliverAddRequest.getParentId()); | |
| 441 | - if ((RenShenJieJuEnums.O.getId() + "").equals(baby.getPregnancyOut())) { | |
| 442 | - babyModel1.setYn(YnEnums.YES.getId()); | |
| 443 | - }else{ | |
| 444 | - babyModel1.setYn(YnEnums.NO.getId()); | |
| 440 | + if(com.lyms.platform.common.utils.StringUtils.isNotEmpty(babyModel.getId())){ | |
| 441 | + //判断妊娠结局是活产才添加数据 | |
| 442 | + BabyModel babyModel1=new BabyModel(); | |
| 443 | + BabyModelQuery query=new BabyModelQuery(); | |
| 444 | + query.setId(babyModel.getId()); | |
| 445 | + babyModel1.setParentId(deliverAddRequest.getParentId()); | |
| 446 | + if ((RenShenJieJuEnums.O.getId() + "").equals(baby.getPregnancyOut())) { | |
| 447 | + babyModel1.setYn(YnEnums.YES.getId()); | |
| 448 | + }else{ | |
| 449 | + babyModel1.setYn(YnEnums.NO.getId()); | |
| 450 | + } | |
| 451 | + babyModel1.setBirth(DateUtil.parseYMD(baby.getDueTime())); | |
| 452 | + babyModel1.setSex(Integer.valueOf(baby.getBabyGender())); | |
| 453 | + Map map = deliverAddRequest.getDeliveryMode(); | |
| 454 | + String fmfs = null; | |
| 455 | + if (!map.isEmpty()) { | |
| 456 | + fmfs = map.get("fmfs").toString(); | |
| 457 | + } | |
| 458 | + babyModel1.setDueType(fmfs); | |
| 459 | + babyModel1.setBabyHeight(baby.getBabyHeight()); | |
| 460 | + babyModel1.setBabyWeight(baby.getBabyWeight()); | |
| 461 | + babyService.findAndModify(query.convertToQuery(), babyModel1); | |
| 445 | 462 | } |
| 446 | - babyModel1.setBirth(DateUtil.parseYMD(baby.getDueTime())); | |
| 447 | - babyModel1.setSex(Integer.valueOf(baby.getBabyGender())); | |
| 448 | - Map map = deliverAddRequest.getDeliveryMode(); | |
| 449 | - String fmfs = null; | |
| 450 | - if (!map.isEmpty()) { | |
| 451 | - fmfs = map.get("fmfs").toString(); | |
| 452 | - } | |
| 453 | - babyModel1.setDueType(fmfs); | |
| 454 | - babyModel1.setBabyHeight(baby.getBabyHeight()); | |
| 455 | - babyModel1.setBabyWeight(baby.getBabyWeight()); | |
| 456 | - babyService.findAndModify(query.convertToQuery(), babyModel1); | |
| 457 | 463 | babyList.add(babyModel); |
| 458 | 464 | } |
| 459 | 465 | return babyList; |
| ... | ... | @@ -675,7 +681,6 @@ |
| 675 | 681 | } |
| 676 | 682 | } |
| 677 | 683 | |
| 678 | - | |
| 679 | 684 | AntExQuery antExQuery = new AntExQuery(); |
| 680 | 685 | antExQuery.setParentId(patients.getId()); |
| 681 | 686 | antExQuery.setYn(YnEnums.YES.getId()); |
| ... | ... | @@ -720,6 +725,14 @@ |
| 720 | 725 | maternalDeliverModel.setYn(YnEnums.NO.getId()); |
| 721 | 726 | maternalDeliverModel.setId(id); |
| 722 | 727 | matDeliverService.updateOne(maternalDeliverModel, id); |
| 728 | + //删除分娩记录的时候删除分娩的小孩信息 | |
| 729 | + BabyModelQuery babyModelQuery=new BabyModelQuery(); | |
| 730 | + babyModelQuery.setParentId(matModel.getParentId()); | |
| 731 | + babyModelQuery.setYn(YnEnums.YES.getId()); | |
| 732 | + | |
| 733 | + BabyModel babyModel=new BabyModel(); | |
| 734 | + babyModel.setYn(YnEnums.NO.getId()); | |
| 735 | + babyService.findAndModify(babyModelQuery.convertToQuery(),babyModel); | |
| 723 | 736 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 724 | 737 | } |
| 725 | 738 | return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("不能删除该条数据"); |