Commit 5ac61254bdb16df6025d4d5761cf0c9eac1a1f49
1 parent
ee5ba36602
Exists in
master
and in
6 other branches
隆化儿童口腔检查-阳性列表和全部儿童模块-添加操作记录,删除同步档案
Showing 5 changed files with 86 additions and 13 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/BabyModel.java
- platform-dal/src/main/java/com/lyms/platform/pojo/BabyOralCheck.java
- platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyOralCheckController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyOralCheckFacade.java
platform-dal/src/main/java/com/lyms/platform/pojo/BabyModel.java
View file @
5ac6125
| ... | ... | @@ -746,6 +746,11 @@ |
| 746 | 746 | |
| 747 | 747 | //隆化-口腔检查同步数据 |
| 748 | 748 | /** |
| 749 | + * 检查记录状态(同步字段,最后一次检查的id) | |
| 750 | + * 这里查询关于口腔的数据必须要这个字段 | |
| 751 | + */ | |
| 752 | + private Integer oralCheckYn; | |
| 753 | + /** | |
| 749 | 754 | * 检查id(同步字段,最后一次检查的id) |
| 750 | 755 | */ |
| 751 | 756 | private String oralCheckId; |
| ... | ... | @@ -799,6 +804,14 @@ |
| 799 | 804 | |
| 800 | 805 | public void setOralCheckMonthAge(String oralCheckMonthAge) { |
| 801 | 806 | this.oralCheckMonthAge = oralCheckMonthAge; |
| 807 | + } | |
| 808 | + | |
| 809 | + public Integer getOralCheckYn() { | |
| 810 | + return oralCheckYn; | |
| 811 | + } | |
| 812 | + | |
| 813 | + public void setOralCheckYn(Integer oralCheckYn) { | |
| 814 | + this.oralCheckYn = oralCheckYn; | |
| 802 | 815 | } |
| 803 | 816 | |
| 804 | 817 | public String getOralCheckId() { |
platform-dal/src/main/java/com/lyms/platform/pojo/BabyOralCheck.java
View file @
5ac6125
platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
View file @
5ac6125
| ... | ... | @@ -1325,6 +1325,11 @@ |
| 1325 | 1325 | |
| 1326 | 1326 | //隆化-口腔模块 |
| 1327 | 1327 | /** |
| 1328 | + * 检查记录状态(同步字段,最后一次检查的id) | |
| 1329 | + * 这里查询关于口腔的数据必须要这个字段 | |
| 1330 | + */ | |
| 1331 | + private Integer oralCheckYn; | |
| 1332 | + /** | |
| 1328 | 1333 | * 检查id(同步字段,最后一次检查的id) |
| 1329 | 1334 | */ |
| 1330 | 1335 | private String oralCheckId; |
| ... | ... | @@ -1388,6 +1393,22 @@ |
| 1388 | 1393 | */ |
| 1389 | 1394 | private Integer queryMonthAgeEnd; |
| 1390 | 1395 | |
| 1396 | + public Integer getOralCheckYn() { | |
| 1397 | + return oralCheckYn; | |
| 1398 | + } | |
| 1399 | + | |
| 1400 | + public void setOralCheckYn(Integer oralCheckYn) { | |
| 1401 | + this.oralCheckYn = oralCheckYn; | |
| 1402 | + } | |
| 1403 | + | |
| 1404 | + public String getOralCheckId() { | |
| 1405 | + return oralCheckId; | |
| 1406 | + } | |
| 1407 | + | |
| 1408 | + public void setOralCheckId(String oralCheckId) { | |
| 1409 | + this.oralCheckId = oralCheckId; | |
| 1410 | + } | |
| 1411 | + | |
| 1391 | 1412 | public Integer getQueryMonthAgeStart() { |
| 1392 | 1413 | return queryMonthAgeStart; |
| 1393 | 1414 | } |
| ... | ... | @@ -1957,6 +1978,9 @@ |
| 1957 | 1978 | } |
| 1958 | 1979 | if (StringUtils.isNotEmpty(oralCheckDoctor)) { |
| 1959 | 1980 | condition = condition.and("oralCheckDoctor", oralCheckDoctor, MongoOper.IS); |
| 1981 | + } | |
| 1982 | + if (null != oralCheckYn) { | |
| 1983 | + condition = condition.and("oralCheckYn", oralCheckYn, MongoOper.IS); | |
| 1960 | 1984 | } |
| 1961 | 1985 | |
| 1962 | 1986 | Criteria c = null; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyOralCheckController.java
View file @
5ac6125
| ... | ... | @@ -57,9 +57,9 @@ |
| 57 | 57 | @ResponseBody |
| 58 | 58 | @TokenRequired |
| 59 | 59 | @RequestMapping(value = "/delDate",method = RequestMethod.DELETE) |
| 60 | - public BaseResponse delDate(@RequestParam("id") String id) { | |
| 61 | - | |
| 62 | - return babyOralCheckFacade.delDate(id); | |
| 60 | + public BaseResponse delDate(@RequestParam("id") String id, HttpServletRequest request) { | |
| 61 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 62 | + return babyOralCheckFacade.delDate(id,loginState.getId()); | |
| 63 | 63 | } |
| 64 | 64 | /** |
| 65 | 65 | * 口腔检查编辑数据获取/单个口腔检查记录 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyOralCheckFacade.java
View file @
5ac6125
| ... | ... | @@ -3,10 +3,7 @@ |
| 3 | 3 | import com.lyms.platform.biz.service.BabyBookbuildingService; |
| 4 | 4 | import com.lyms.platform.biz.service.BabyOralCheckService; |
| 5 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 6 | -import com.lyms.platform.common.enums.CheckMonthEnums; | |
| 7 | -import com.lyms.platform.common.enums.CheckMonthQhdEnums; | |
| 8 | -import com.lyms.platform.common.enums.SexEnum; | |
| 9 | -import com.lyms.platform.common.enums.YnEnums; | |
| 6 | +import com.lyms.platform.common.enums.*; | |
| 10 | 7 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 11 | 8 | import com.lyms.platform.common.result.BaseResponse; |
| 12 | 9 | import com.lyms.platform.common.result.RespBuilder; |
| ... | ... | @@ -20,6 +17,7 @@ |
| 20 | 17 | import com.lyms.platform.permission.dao.master.CouponMapper; |
| 21 | 18 | import com.lyms.platform.permission.model.Organization; |
| 22 | 19 | import com.lyms.platform.permission.service.OrganizationService; |
| 20 | +import com.lyms.platform.pojo.BabyEyeCheck; | |
| 23 | 21 | import com.lyms.platform.pojo.BabyModel; |
| 24 | 22 | import com.lyms.platform.pojo.BabyOralCheck; |
| 25 | 23 | import com.lyms.platform.query.BabyModelQuery; |
| ... | ... | @@ -50,6 +48,8 @@ |
| 50 | 48 | private BabyOralCheckService babyOralCheckService; |
| 51 | 49 | @Autowired |
| 52 | 50 | private CouponMapper couponMapper; |
| 51 | + @Autowired | |
| 52 | + private OperateLogFacade operateLogFacade; | |
| 53 | 53 | |
| 54 | 54 | public BaseResponse addOrUpDate(BabyOralCheck babyOralCheck, Integer userid) { |
| 55 | 55 | //判断阳性检查 |
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | |
| ... | ... | @@ -84,22 +84,27 @@ |
| 84 | 84 | babyOralCheck.setBabyFName(babyModel.getFname()); |
| 85 | 85 | babyOralCheck.setBabyFPhone(babyModel.getFphone()); |
| 86 | 86 | babyOralCheck.setBabyFCertNo(babyModel.getFcertNo()); |
| 87 | + }else { | |
| 88 | + return RespBuilder.buildSuccess(ResponseCode.NEED_BUILD); | |
| 87 | 89 | } |
| 88 | 90 | //添加 |
| 89 | 91 | BabyOralCheck add=new BabyOralCheck(); |
| 90 | 92 | if (StringUtils.isEmpty(babyOralCheck.getId())) { |
| 91 | - if (!mongoUtil.buildArchive(userid, babyOralCheck.getBabyId())) { | |
| 92 | - return RespBuilder.buildSuccess(ResponseCode.NEED_BUILD); | |
| 93 | - } | |
| 94 | 93 | add = babyOralCheckService.add(babyOralCheck); |
| 94 | + operateLogFacade.addDeleteOptLog(userid, Integer.parseInt(hospitalId), add, OptActionEnums.ADD.getId(), "添加口腔检查"); | |
| 95 | 95 | }else {//修改 |
| 96 | 96 | babyOralCheck.setOperaterId(userid+""); |
| 97 | 97 | babyOralCheck.setModified(new Date()); |
| 98 | 98 | babyOralCheckService.update(babyOralCheck); |
| 99 | + BabyOralCheck oralCheck = mongoTemplate.findOne(Query.query(Criteria.where("id").is(babyOralCheck.getId())), BabyOralCheck.class); | |
| 100 | + if (null!=oralCheck) { | |
| 101 | + operateLogFacade.addDeleteOptLog(userid, Integer.parseInt(hospitalId), oralCheck, OptActionEnums.UPDATE.getId(), "修改口腔检查"); | |
| 102 | + } | |
| 99 | 103 | } |
| 100 | 104 | |
| 101 | 105 | //同步数据到儿童档案 |
| 102 | 106 | BabyOralCheckQuery checkQuery=new BabyOralCheckQuery(); |
| 107 | + checkQuery.setYn(YnEnums.YES.getId()); | |
| 103 | 108 | checkQuery.setBabyId(babyOralCheck.getBabyId()); |
| 104 | 109 | List<BabyOralCheck> babyOralChecks=babyOralCheckService.queryList(checkQuery,Sort.Direction.DESC,"created"); |
| 105 | 110 | //修改最新的记录才会同步儿童档案,新增也会同步到儿童档案 |
| ... | ... | @@ -111,6 +116,7 @@ |
| 111 | 116 | }else{ |
| 112 | 117 | babyModel2.setOralCheckId(babyOralCheck.getId()); |
| 113 | 118 | } |
| 119 | + babyModel2.setOralCheckYn(babyOralCheck.getYn()); | |
| 114 | 120 | babyModel2.setPositiveType(babyOralCheck.getPositiveType()); |
| 115 | 121 | babyModel2.setOralCheckTime(babyOralCheck.getOralCheckTime()); |
| 116 | 122 | babyModel2.setNextOralCheckTime(babyOralCheck.getNextOralCheckTime()); |
| 117 | 123 | |
| 118 | 124 | |
| ... | ... | @@ -128,12 +134,41 @@ |
| 128 | 134 | BaseObjectResponse br = new BaseObjectResponse(); |
| 129 | 135 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 130 | 136 | br.setErrormsg("成功"); |
| 131 | - br.setData(add.getId()); | |
| 137 | + br.setData(StringUtils.isNotEmpty(add.getId())?add.getId():babyOralCheck.getId()); | |
| 132 | 138 | return br; |
| 133 | 139 | } |
| 134 | 140 | |
| 135 | - public BaseResponse delDate(String id) { | |
| 141 | + public BaseResponse delDate(String id, Integer userid) { | |
| 136 | 142 | babyOralCheckService.deleteById(id); |
| 143 | + BabyOralCheck oralCheck= mongoTemplate.findOne(Query.query(Criteria.where("id").is(id)), BabyOralCheck.class); | |
| 144 | + if (null!=oralCheck) { | |
| 145 | + String hospitalId = autoMatchFacade.getHospitalId(userid); | |
| 146 | + operateLogFacade.addDeleteOptLog(userid, Integer.parseInt(hospitalId), oralCheck, OptActionEnums.DELETE.getId(), "删除口腔检查"); | |
| 147 | + //同步儿童数据 | |
| 148 | + BabyOralCheckQuery checkQuery=new BabyOralCheckQuery(); | |
| 149 | + checkQuery.setYn(YnEnums.YES.getId()); | |
| 150 | + checkQuery.setBabyId(oralCheck.getBabyId()); | |
| 151 | + List<BabyOralCheck> babyOralChecks=babyOralCheckService.queryList(checkQuery,Sort.Direction.DESC,"created"); | |
| 152 | + BabyModel babyModel = new BabyModel(); | |
| 153 | + //删除唯一的检查记录 | |
| 154 | + if( CollectionUtils.isEmpty(babyOralChecks)){ | |
| 155 | + babyModel.setOralCheckYn(YnEnums.NO.getId()); | |
| 156 | + }else {//儿童档案数据同步为删除后最后一条 | |
| 157 | + BabyOralCheck babyOralCheck=babyOralChecks.get(0); | |
| 158 | + babyModel.setPositiveType(babyOralCheck.getPositiveType()); | |
| 159 | + babyModel.setOralCheckTime(babyOralCheck.getOralCheckTime()); | |
| 160 | + babyModel.setNextOralCheckTime(babyOralCheck.getNextOralCheckTime()); | |
| 161 | + babyModel.setOralCheckDoctor(babyOralCheck.getOralCheckDoctor()); | |
| 162 | + babyModel.setOralHighRisk(babyOralCheck.getOralHighRisk()); | |
| 163 | + babyModel.setOralCheckMonthId(babyOralCheck.getCheckMonthId()); | |
| 164 | + babyModel.setQc(babyOralCheck.getQc()); | |
| 165 | + babyModel.setHc(babyOralCheck.getHc()); | |
| 166 | + babyModel.setWgfb(babyOralCheck.getWgfb()); | |
| 167 | + babyModel.setOralCheckMonthAge(babyOralCheck.getCheckMonthAge()); | |
| 168 | + } | |
| 169 | + Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(babyModel)); | |
| 170 | + mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(oralCheck.getBabyId())), update, BabyModel.class); | |
| 171 | + } | |
| 137 | 172 | BaseObjectResponse br = new BaseObjectResponse(); |
| 138 | 173 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 139 | 174 | br.setErrormsg("成功"); |
| ... | ... | @@ -244,6 +279,7 @@ |
| 244 | 279 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 245 | 280 | babyModelQuery.setNeed("true"); |
| 246 | 281 | babyModelQuery.setYn(YnEnums.YES.getId()); |
| 282 | + babyModelQuery.setOralCheckYn(YnEnums.YES.getId()); | |
| 247 | 283 | babyModelQuery.setHospitalId(hospitalId); |
| 248 | 284 | //结束日期加上时分秒 |
| 249 | 285 | if (babyModelQuery.getOralCheckTimeEnd() != null) { |