Commit ca3bf075e8446167444f7f006232e14903b57142

Authored by litao
1 parent b0e6398227

bug修复

Showing 7 changed files with 23 additions and 12 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java View file @ ca3bf07
... ... @@ -81,10 +81,7 @@
81 81 @TokenRequired
82 82 @ResponseBody
83 83 public BaseResponse deleteBabyBuildById(@PathVariable("id") String id, HttpServletRequest request) {
84   - BabyModel babyModel = mongoTemplate.findById(id, BabyModel.class);
85   - if(babyModel != null) {
86   - couponService.del(getUserId(request) +"", autoMatchFacade.getHospitalId(getUserId(request)), babyModel.getPid());
87   - }
  84 +
88 85 return babyBookbuildingFacade.deleteBabyBuildById(id);
89 86  
90 87 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java View file @ ca3bf07
... ... @@ -121,10 +121,7 @@
121 121 @TokenRequired
122 122 public BaseResponse deletePregnantById(@PathVariable("id")String id,HttpServletRequest httpServletRequest){
123 123 LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext");
124   - Patients patients = mongoTemplate.findById(id, Patients.class);
125   - if(patients != null) {
126   - couponService.del(getUserId(httpServletRequest) +"", autoMatchFacade.getHospitalId(getUserId(httpServletRequest)), patients.getPid());
127   - }
  124 +
128 125 return bookbuildingFacade.deletePregnantById(id,loginState.getId());
129 126 }
130 127  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ ca3bf07
... ... @@ -30,6 +30,7 @@
30 30 import org.springframework.beans.factory.annotation.Autowired;
31 31 import org.springframework.beans.factory.annotation.Qualifier;
32 32 import org.springframework.data.domain.Sort;
  33 +import org.springframework.data.mongodb.core.MongoTemplate;
33 34 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
34 35 import org.springframework.stereotype.Component;
35 36  
36 37  
... ... @@ -128,7 +129,10 @@
128 129 @Autowired
129 130 private CouponService couponService;
130 131  
  132 + @Autowired
  133 + private MongoTemplate mongoTemplate;
131 134  
  135 +
132 136 public BaseResponse getBabyBase(String babyId) {
133 137 //查询儿童的基本信息
134 138 BabyBasicResult base = new BabyBasicResult();
... ... @@ -1004,6 +1008,12 @@
1004 1008 }
1005 1009  
1006 1010 babyBookbuildingService.deleteBabyById(id);
  1011 +
  1012 + BabyModel babyModel = mongoTemplate.findById(id, BabyModel.class);
  1013 + if(babyModel != null) {
  1014 + /** 删除儿童建档 未使用的儿保券作废 */
  1015 + couponService.invalid(id, "8");
  1016 + }
1007 1017 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
1008 1018 }
1009 1019  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ ca3bf07
... ... @@ -20,6 +20,7 @@
20 20 import com.lyms.platform.permission.model.Organization;
21 21 import com.lyms.platform.permission.model.OrganizationQuery;
22 22 import com.lyms.platform.permission.model.Users;
  23 +import com.lyms.platform.permission.service.CouponService;
23 24 import com.lyms.platform.permission.service.OrganizationService;
24 25 import com.lyms.platform.permission.service.UsersService;
25 26 import com.lyms.platform.pojo.*;
... ... @@ -118,6 +119,9 @@
118 119 @Autowired
119 120 private GenSequenceIdService genSequenceIdService;
120 121  
  122 + @Autowired
  123 + private CouponService couponService;
  124 +
121 125 /**
122 126 * 根据患者的建档ID,查询还未使用的免费产检查券
123 127 *
... ... @@ -1237,6 +1241,10 @@
1237 1241 patientCheckTicket.setStatus(3);
1238 1242 patientCheckTicket.setPatientId(id);
1239 1243 patientCheckTicketService.findAndModify(patientCheckTicketQuery,patientCheckTicket);
  1244 +
  1245 +
  1246 + /** 删除建档应该是把全部未使用的优惠券状态更新为3【已作废】 */
  1247 + couponService.invalid(id, "1,2,3,4,5,6,7,8");
1240 1248 }
1241 1249  
1242 1250 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ ca3bf07
1 1 package com.lyms.platform.operate.web.facade;
2 2  
3 3 import com.lyms.platform.biz.RemoteService;
4   -import com.lyms.platform.biz.RemoteUrlEnum;
5 4 import com.lyms.platform.biz.service.*;
6 5 import com.lyms.platform.common.constants.ErrorCodeConstants;
7 6 import com.lyms.platform.common.enums.*;
... ... @@ -273,7 +272,7 @@
273 272 couponService.use(hospitalId, deliverAddRequest.getCouponCode(), userId, maternalDeliverModel.getId());
274 273 }
275 274  
276   - /** 儿童建档对应孕妇分娩 【未使用的产检券】要自动作废 */
  275 + /** 分娩后 作废未使用的产检券 */
277 276 couponService.invalid(maternalDeliverModel.getId(), "2");
278 277  
279 278 //作废产检劵
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java View file @ ca3bf07
... ... @@ -111,7 +111,7 @@
111 111 stopPregnancyService.updateStopPreg(model, request.getId());
112 112  
113 113 /** 终止妊娠后 【未使用的产检券和分娩券】要自动作废 */
114   - couponService.invalid(request.getPid(), "2,4");
  114 + couponService.invalid(model.getPid(), "2,4");
115 115  
116 116  
117 117 BaseResponse objectResponse = new BaseResponse();
platform-operate-api/src/main/resources/config.properties View file @ ca3bf07
... ... @@ -73,7 +73,7 @@
73 73 jdbc.6.password=Welcome1
74 74  
75 75 # 远程调用类型 1=本地 2=测试环境 3=线上环境
76   -remote.url.type=1
  76 +remote.url.type=2
77 77 platform.operate.api.1.url=http://localhost:9091/
78 78 platform.operate.api.2.url=https://dev-rp.healthbaby.com.cn/
79 79 platform.operate.api.3.url=https://dev-rp.healthbaby.com.cn/