Commit 8990c0edbafe49355178d6f6ed8b29a1f75c5018

Authored by liquanyu
1 parent a8a74d6081

操作日志

Showing 4 changed files with 69 additions and 4 deletions

platform-dal/src/main/java/com/lyms/platform/query/DischargeAbstractBabyQuery.java View file @ 8990c0e
... ... @@ -3,7 +3,10 @@
3 3 import com.lyms.platform.common.base.IConvertToNativeQuery;
4 4 import com.lyms.platform.common.dao.BaseQuery;
5 5 import com.lyms.platform.common.dao.operator.MongoCondition;
  6 +import com.lyms.platform.common.dao.operator.MongoOper;
6 7 import com.lyms.platform.common.dao.operator.MongoQuery;
  8 +import com.lyms.platform.common.utils.StringUtils;
  9 +import org.bson.types.ObjectId;
7 10 import org.springframework.data.mongodb.core.query.Criteria;
8 11  
9 12 /**
10 13  
... ... @@ -19,7 +22,16 @@
19 22 * @discription 母亲出院小结表id
20 23 */
21 24 private String motherId;
  25 + private String id;
22 26  
  27 + public String getId() {
  28 + return id;
  29 + }
  30 +
  31 + public void setId(String id) {
  32 + this.id = id;
  33 + }
  34 +
23 35 public String getMotherId() {
24 36 return motherId;
25 37 }
... ... @@ -30,9 +42,17 @@
30 42  
31 43 @Override
32 44 public MongoQuery convertToQuery() {
33   - Criteria criteria = new Criteria();
34   - criteria.and("motherId").is(motherId);
35   - return new MongoCondition(criteria).toMongoQuery();
  45 +
  46 + MongoCondition condition = MongoCondition.newInstance();
  47 + if (null != id) {
  48 + condition = condition.and("id", new ObjectId(id), MongoOper.IS);
  49 + }
  50 +
  51 + if (null != motherId) {
  52 + condition = condition.and("motherId", motherId, MongoOper.IS);
  53 + }
  54 +
  55 + return condition.toMongoQuery();
36 56 }
37 57 }
platform-dal/src/main/java/com/lyms/platform/query/DischargeAbstractMotherQuery.java View file @ 8990c0e
... ... @@ -24,12 +24,21 @@
24 24 private String patientId;
25 25  
26 26 private String pid;
  27 + private String id;
27 28  
28 29 private Date start;
29 30 private Date end;
30 31  
31 32 private int yn=-1;
32 33  
  34 + public String getId() {
  35 + return id;
  36 + }
  37 +
  38 + public void setId(String id) {
  39 + this.id = id;
  40 + }
  41 +
33 42 public Date getStart() {
34 43 return start;
35 44 }
... ... @@ -75,6 +84,10 @@
75 84 MongoCondition condition = new MongoCondition();
76 85 if (patientId != null) {
77 86 condition = condition.and("patientId", patientId, MongoOper.IS);
  87 + }
  88 +
  89 + if (id != null) {
  90 + condition = condition.and("id", id, MongoOper.IS);
78 91 }
79 92 if (yn != -1) {
80 93 condition = condition.and("yn", yn, MongoOper.IS);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/DischargeAbstractFacade.java View file @ 8990c0e
... ... @@ -5,6 +5,7 @@
5 5 import com.lyms.platform.biz.service.DischargeAbstractMotherService;
6 6 import com.lyms.platform.biz.service.PatientsService;
7 7 import com.lyms.platform.common.constants.ErrorCodeConstants;
  8 +import com.lyms.platform.common.enums.OptActionEnums;
8 9 import com.lyms.platform.common.enums.RenShenJieJuEnums;
9 10 import com.lyms.platform.common.enums.YnEnums;
10 11 import com.lyms.platform.common.result.BaseObjectResponse;
... ... @@ -68,6 +69,9 @@
68 69 @Autowired
69 70 private CouponService couponService;
70 71  
  72 + @Autowired
  73 + private OperateLogFacade operateLogFacade;
  74 +
71 75 public DischargeAbstractSaveResult save(DischargeAbstractSaveRequest dischargeAbstractSaveRequest, Integer userId) {
72 76  
73 77 DischargeAbstractSaveResult dischargeAbstractSaveResult = new DischargeAbstractSaveResult();
74 78  
75 79  
... ... @@ -98,13 +102,21 @@
98 102 dischargeAbstractMotherModel.setHospitalId(hId);
99 103 if (StringUtils.isEmpty(dischargeAbstractMotherModel.getId())) {
100 104 dischargeAbstractMotherModel = dischargeAbstractMotherService.save(dischargeAbstractMotherModel);
101   -
  105 + operateLogFacade.addAddOptLog(userId,Integer.parseInt(hId),dischargeAbstractMotherModel, OptActionEnums.ADD.getId(),"添加出院小结母亲内容");
102 106 /** 使用优惠券 */
103 107 if(StringUtils.isNotBlank(dischargeAbstractSaveRequest.getCouponCode()) && dischargeAbstractSaveRequest.getCouponType() != null) {
104 108 couponService.use(hId, dischargeAbstractSaveRequest.getCouponCode(), userId, dischargeAbstractMotherModel.getId());
105 109 }
106 110 } else {
  111 +
  112 + // 查询母亲信息
  113 + DischargeAbstractMotherQuery dischargeAbstractMotherQuery = new DischargeAbstractMotherQuery();
  114 + dischargeAbstractMotherQuery.setId(dischargeAbstractMotherModel.getId());
  115 + dischargeAbstractMotherQuery.setYn(YnEnums.YES.getId());
  116 + List<DischargeAbstractMotherModel> list = dischargeAbstractMotherService.query(dischargeAbstractMotherQuery);
107 117 dischargeAbstractMotherService.update(dischargeAbstractMotherModel);
  118 + operateLogFacade.addModifyOptLog(userId, Integer.parseInt(hId), list.get(0), dischargeAbstractMotherModel, OptActionEnums.UPDATE.getId(), "修改出院小结母亲内容");
  119 +
108 120 }
109 121 // 保存孩子信息
110 122 List<DischargeAbstractSaveRequest.Baby> babyList = dischargeAbstractSaveRequest.getBabyList();
111 123  
112 124  
... ... @@ -120,8 +132,14 @@
120 132 dischargeAbstractBabyModel.setpId(baby.getpId());
121 133 if (StringUtils.isEmpty(dischargeAbstractBabyModel.getId())) {
122 134 dischargeAbstractBabyModelList.add(dischargeAbstractBabyModel);
  135 + operateLogFacade.addAddOptLog(userId, Integer.parseInt(hId), dischargeAbstractBabyModel, OptActionEnums.ADD.getId(), "添加出院小结儿童内容添加");
123 136 } else {
  137 + DischargeAbstractBabyQuery dischargeAbstractBabyQuery = new DischargeAbstractBabyQuery();
  138 + dischargeAbstractBabyQuery.setId(dischargeAbstractBabyModel.getId());
  139 + List<DischargeAbstractBabyModel> list = dischargeAbstractBabyService.query(dischargeAbstractBabyQuery);
124 140 dischargeAbstractBabyService.update(dischargeAbstractBabyModel);
  141 +
  142 + operateLogFacade.addModifyOptLog(userId, Integer.parseInt(hId), list.get(0),dischargeAbstractBabyModel, OptActionEnums.UPDATE.getId(), "修改出院小结儿童内容");
125 143 }
126 144 }
127 145 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ 8990c0e
... ... @@ -89,7 +89,10 @@
89 89 @Autowired
90 90 private CouponService couponService;
91 91  
  92 + @Autowired
  93 + private OperateLogFacade operateLogFacade;
92 94  
  95 +
93 96 private static Map<Integer, String> ONE_ENUMS = new HashMap<>();
94 97  
95 98 private static Map<String, List> babyMap = new HashMap<>();
... ... @@ -267,6 +270,8 @@
267 270 maternalDeliverModel.setYn(YnEnums.YES.getId());
268 271 matDeliverService.addMatDeliver(maternalDeliverModel);
269 272  
  273 + operateLogFacade.addAddOptLog(userId,Integer.parseInt(hospitalId),maternalDeliverModel,OptActionEnums.ADD.getId(),"添加分娩");
  274 +
270 275 /** 使用优惠券 */
271 276 if(StringUtils.isNotBlank(deliverAddRequest.getCouponCode()) && deliverAddRequest.getCouponType() != null) {
272 277 couponService.use(hospitalId, deliverAddRequest.getCouponCode(), userId, maternalDeliverModel.getId());
273 278  
... ... @@ -313,8 +318,15 @@
313 318 maternalDeliverModel.setBaby(updateBaby(deliverAddRequest,list,patients2.getLastMenses()));
314 319 }
315 320  
  321 + MatDeliverQuery query = new MatDeliverQuery();
  322 + query.setId(deliverAddRequest.getId());
  323 + query.setYn(YnEnums.YES.getId());
  324 + List<MaternalDeliverModel> results = matDeliverService.query(matDeliverQuery);
  325 +
316 326 matDeliverService.updateOne(maternalDeliverModel, maternalDeliverModel.getId());
317 327  
  328 + operateLogFacade.addModifyOptLog(userId, Integer.parseInt(hospitalId), maternalDeliverModel,results.get(0), OptActionEnums.UPDATE.getId(), "修改分娩");
  329 +
318 330 if (null != deliverAddRequest.getDueDate()) {
319 331 Date fmDate = DateUtil.parseYMD(deliverAddRequest.getDueDate());
320 332 PatientsQuery patientsQuery = new PatientsQuery();
... ... @@ -842,6 +854,8 @@
842 854 BabyModel babyModel = new BabyModel();
843 855 babyModel.setYn(YnEnums.NO.getId());
844 856 babyService.findAndModify(babyModelQuery.convertToQuery(), babyModel);
  857 +
  858 + operateLogFacade.addDeleteOptLog(userId,Integer.parseInt(hospital),matModel,OptActionEnums.DELETE.getId(),"删除分娩");
845 859  
846 860 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
847 861 }