Commit 3bf87ebf39b421776dfca8d85c4380e0fb0c6e7e
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 3 changed files
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CouponServiceImpl.java
View file @
3bf87eb
| 1 | 1 | package com.lyms.platform.permission.service.impl; |
| 2 | 2 | |
| 3 | +import com.alibaba.fastjson.JSON; | |
| 3 | 4 | import com.lyms.platform.biz.service.GenSequenceIdService; |
| 4 | 5 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 5 | 6 | import com.lyms.platform.common.result.RespBuilder; |
| 6 | 7 | import com.lyms.platform.common.result.ResponseCode; |
| 7 | 8 | import com.lyms.platform.common.utils.DateUtil; |
| 8 | 9 | import com.lyms.platform.common.utils.HttpClientUtil; |
| 10 | +import com.lyms.platform.common.utils.JsonUtil; | |
| 9 | 11 | import com.lyms.platform.common.utils.PropertiesUtil; |
| 10 | 12 | import com.lyms.platform.permission.dao.master.CouponMapper; |
| 11 | 13 | import com.lyms.platform.permission.model.CouponInfo; |
| ... | ... | @@ -132,6 +134,27 @@ |
| 132 | 134 | /** 记录为已经发放过优惠券 */ |
| 133 | 135 | mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(patientId)), Update.update("isSendCoupon", true), Patients.class); |
| 134 | 136 | |
| 137 | + /** 如果配置了医院打印人数 mongo人数自增1 */ | |
| 138 | + PlantformConfigModel model = mongoTemplate.findOne(Query.query(Criteria.where("key").is(hospitalId)), PlantformConfigModel.class); | |
| 139 | + if(model != null) { | |
| 140 | + String value = model.getValue(); | |
| 141 | + Map<Integer, Integer> map = new HashMap<>(); | |
| 142 | + Integer year = DateUtil.getCurrentYear(); | |
| 143 | + if(StringUtils.isNotEmpty(value)) { | |
| 144 | + map = JSON.parseObject(value, Map.class); | |
| 145 | + Integer code = map.get(year); | |
| 146 | + if(code != null) { | |
| 147 | + map.put(year, ++code); | |
| 148 | + } else { | |
| 149 | + map.put(year, 1); | |
| 150 | + } | |
| 151 | + } else { | |
| 152 | + map.put(year, 1); | |
| 153 | + } | |
| 154 | + mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(model.getId())), | |
| 155 | + Update.update("value", JSON.toJSONString(map)), PlantformConfigModel.class); | |
| 156 | + } | |
| 157 | + | |
| 135 | 158 | return RespBuilder.buildSuccess(); |
| 136 | 159 | } |
| 137 | 160 | |
| ... | ... | @@ -557,6 +580,20 @@ |
| 557 | 580 | |
| 558 | 581 | @Override |
| 559 | 582 | public BaseObjectResponse findList(String userId, String hospitalId, String url,Integer type) { |
| 583 | + Integer year = DateUtil.getCurrentYear(); | |
| 584 | + String peopleNum = null; | |
| 585 | + PlantformConfigModel model = mongoTemplate.findOne(Query.query(Criteria.where("key").is(hospitalId)), PlantformConfigModel.class); | |
| 586 | + if(model != null) { | |
| 587 | + String value = model.getValue(); | |
| 588 | + if(StringUtils.isNotEmpty(value)) { | |
| 589 | + Map<Integer, Integer> map = JSON.parseObject(value, Map.class); | |
| 590 | + Integer code = map.get(year); | |
| 591 | + if(code != null) { | |
| 592 | + peopleNum = String.valueOf(year).substring(2) + "-" + code; | |
| 593 | + } | |
| 594 | + } | |
| 595 | + } | |
| 596 | + | |
| 560 | 597 | Map<String, Object> param = new HashMap<>(); |
| 561 | 598 | param.put("userId", userId); |
| 562 | 599 | param.put("hospitalId", hospitalId); |
| 563 | 600 | |
| ... | ... | @@ -565,8 +602,10 @@ |
| 565 | 602 | restMap.put("topName", couponMapper.findTopName(hospitalId)); |
| 566 | 603 | List<Map<String, Object>> couponInfos = couponMapper.findInfo(param); |
| 567 | 604 | for (Map<String,Object> map : couponInfos) { |
| 568 | -// map.put("url", PropertiesUtil.getInstance().getDefault("or.code.url", map.get("sequence_id").toString())); | |
| 569 | 605 | map.put("url", findUrl(map.get("sequence_id").toString(),type)); |
| 606 | + if(StringUtils.isNotEmpty(peopleNum)) { | |
| 607 | + map.put("peopleNum", peopleNum); | |
| 608 | + } | |
| 570 | 609 | } |
| 571 | 610 | restMap.put("couponInfos", couponInfos); |
| 572 | 611 | return RespBuilder.buildSuccess(restMap); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SmsConfigFacade.java
View file @
3bf87eb
| ... | ... | @@ -1032,17 +1032,17 @@ |
| 1032 | 1032 | { |
| 1033 | 1033 | Map<String, Object> data = new HashMap<>(); |
| 1034 | 1034 | data.put("hospitalName",map.get("hospitalName")); |
| 1035 | - data.put("objType",map.get("objType")); | |
| 1036 | 1035 | data.put("smsType",map.get("smsType")); |
| 1036 | + data.put("objType",map.get("objType")); | |
| 1037 | 1037 | data.put("phone",map.get("phone")); |
| 1038 | - data.put("planTime",map.get("planTime")); | |
| 1039 | - data.put("actualTime",map.get("actualTime")); | |
| 1038 | + data.put("first", map.get("first")); | |
| 1039 | + data.put("keyword1", map.get("keyword1")); | |
| 1040 | + data.put("keyword2",map.get("keyword2")); | |
| 1040 | 1041 | data.put("smsStatus",map.get("smsStatus")); |
| 1041 | 1042 | data.put("timeType",map.get("timeType")); |
| 1042 | - map.put("first", map.get("first")); | |
| 1043 | - map.put("keyword1", map.get("keyword1")); | |
| 1044 | - map.put("keyword2",map.get("keyword2")); | |
| 1045 | - map.put("remark", map.get("remark")); | |
| 1043 | + data.put("planTime",map.get("planTime")); | |
| 1044 | + data.put("actualTime",map.get("actualTime")); | |
| 1045 | + data.put("remark", map.get("remark")); | |
| 1046 | 1046 | datas.add(data); |
| 1047 | 1047 | } |
| 1048 | 1048 | } |
| 1049 | 1049 | |
| 1050 | 1050 | |
| ... | ... | @@ -1051,15 +1051,15 @@ |
| 1051 | 1051 | Map<String, String> cnames = new LinkedHashMap<>(); |
| 1052 | 1052 | cnames.put("hospitalName", "医院"); |
| 1053 | 1053 | cnames.put("smsType", "消息类型"); |
| 1054 | - cnames.put("phone", "电话号码"); | |
| 1055 | 1054 | cnames.put("objType", "对象类型"); |
| 1056 | - cnames.put("planTime", "计划发送时间"); | |
| 1057 | - cnames.put("actualTime", "实际发送时间"); | |
| 1058 | - cnames.put("timeType", "是否及时"); | |
| 1059 | - cnames.put("smsStatus", "推送状态"); | |
| 1055 | + cnames.put("phone", "电话号码"); | |
| 1060 | 1056 | cnames.put("first", "推送内容"); |
| 1061 | 1057 | cnames.put("keyword1","推送关键词"); |
| 1062 | 1058 | cnames.put("keyword2","推送关键词2"); |
| 1059 | + cnames.put("smsStatus", "推送状态"); | |
| 1060 | + cnames.put("timeType", "是否及时"); | |
| 1061 | + cnames.put("planTime", "计划发送时间"); | |
| 1062 | + cnames.put("actualTime", "实际发送时间"); | |
| 1063 | 1063 | cnames.put("remark", "推送备注"); |
| 1064 | 1064 | httpServletResponse.setContentType("application/octet-stream"); |
| 1065 | 1065 | httpServletResponse.setCharacterEncoding("UTF-8"); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/NewbornServiceImpl.java
View file @
3bf87eb
| ... | ... | @@ -83,7 +83,8 @@ |
| 83 | 83 | |
| 84 | 84 | @Override |
| 85 | 85 | public BaseObjectResponse addOrUpdate(Integer userId, NewbornVisit newbornVisit) { |
| 86 | - newbornVisit.setHospitalId(autoMatchFacade.getHospitalId(userId)); | |
| 86 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 87 | + newbornVisit.setHospitalId(hospitalId); | |
| 87 | 88 | if(StringUtils.isEmpty(newbornVisit.getId())) { |
| 88 | 89 | if(!buildArchive(userId, newbornVisit.getPid(), newbornVisit.getBabyId())) { |
| 89 | 90 | return RespBuilder.buildSuccess(ResponseCode.NEED_BUILD); |
| 90 | 91 | |
| ... | ... | @@ -110,8 +111,9 @@ |
| 110 | 111 | newbornVisit.setOperationId(userId.toString()); |
| 111 | 112 | Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(newbornVisit)); |
| 112 | 113 | mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(newbornVisit.getId())), update, NewbornVisit.class); |
| 114 | + return RespBuilder.buildSuccess(newbornVisit.getId()); | |
| 113 | 115 | } |
| 114 | - return RespBuilder.buildSuccess(); | |
| 116 | + | |
| 115 | 117 | } |
| 116 | 118 | |
| 117 | 119 | /** |