Commit dab1bfbb2bb1d0700e401810ab4baa6708dc1f9a
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 8 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/SequenceConstant.java
- platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
- platform-common/src/main/java/com/lyms/platform/common/enums/BasisEnums.java
- platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.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/ViewFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/SequenceConstant.java
View file @
dab1bfb
platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
View file @
dab1bfb
| ... | ... | @@ -685,16 +685,24 @@ |
| 685 | 685 | <select id="findMulitPatienInfo" parameterType="map" resultType="map"> |
| 686 | 686 | select count(1) as count, a.user_id as user_id from ( |
| 687 | 687 | select a.ymd, a.user_id from ( |
| 688 | - select DATE_FORMAT(create_date, '%Y-%m-%d') as ymd, user_id | |
| 689 | - from coupon_info | |
| 690 | - where user_id in | |
| 688 | + select DATE_FORMAT(a.create_date, '%Y-%m-%d') as ymd, a.user_id | |
| 689 | + from coupon_info a, coupon_template b, coupon_type c | |
| 690 | + where a.user_id in | |
| 691 | 691 | <foreach collection="userIds" open="(" close=")" separator="," item="uid"> |
| 692 | 692 | #{uid} |
| 693 | 693 | </foreach> |
| 694 | 694 | <if test="startDate != null"> |
| 695 | - and create_date > #{startDate} | |
| 695 | + and a.create_date >= #{startDate} | |
| 696 | 696 | </if> |
| 697 | - order by create_date desc | |
| 697 | + <if test="endDate != null"> | |
| 698 | + and a.create_date <![CDATA[ < ]]> #{endDate} | |
| 699 | + </if> | |
| 700 | + and a.coupon_template_id = b.id and b.type_id = c.id | |
| 701 | + and c.type in | |
| 702 | + <foreach collection="couponType" open="(" close=")" separator="," item="type"> | |
| 703 | + #{type} | |
| 704 | + </foreach> | |
| 705 | + order by a.create_date desc | |
| 698 | 706 | ) a group by a.ymd, a.user_id |
| 699 | 707 | ) a group by a.user_id |
| 700 | 708 | </select> |
platform-common/src/main/java/com/lyms/platform/common/enums/BasisEnums.java
View file @
dab1bfb
platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java
View file @
dab1bfb
| ... | ... | @@ -17,13 +17,32 @@ |
| 17 | 17 | private static final long serialVersionUID = SerialIdEnum.Patients.getCid(); |
| 18 | 18 | |
| 19 | 19 | |
| 20 | - | |
| 20 | + // 纠正末次月经 | |
| 21 | + private String fuckLastMens; | |
| 21 | 22 | // 末次月经纠正依据 |
| 22 | 23 | private String lastMenstrualPeriodBasis; |
| 24 | + // 末次月经纠正依据 | |
| 25 | + private String lastMenstrualPeriodBasisOther; | |
| 23 | 26 | // 末次月经纠正医生ID |
| 24 | 27 | private String lastMenstrualPeriodBasisDoctorId; |
| 25 | 28 | // 末次月经纠正时间 |
| 26 | 29 | private String lastMenstrualPeriodBasisDate; |
| 30 | + | |
| 31 | + public String getFuckLastMens() { | |
| 32 | + return fuckLastMens; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public String getLastMenstrualPeriodBasisOther() { | |
| 36 | + return lastMenstrualPeriodBasisOther; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public void setLastMenstrualPeriodBasisOther(String lastMenstrualPeriodBasisOther) { | |
| 40 | + this.lastMenstrualPeriodBasisOther = lastMenstrualPeriodBasisOther; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public void setFuckLastMens(String fuckLastMens) { | |
| 44 | + this.fuckLastMens = fuckLastMens; | |
| 45 | + } | |
| 27 | 46 | |
| 28 | 47 | public String getLastMenstrualPeriodBasis() { |
| 29 | 48 | return lastMenstrualPeriodBasis; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java
View file @
dab1bfb
| ... | ... | @@ -35,15 +35,14 @@ |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | - * 获取初诊复诊是否打印过 | |
| 38 | + * 获取数据是否打印过 | |
| 39 | 39 | * type = 1 初诊 |
| 40 | 40 | * type = 2 复诊 |
| 41 | 41 | */ |
| 42 | 42 | @RequestMapping(value = "/get/prient", method = RequestMethod.GET) |
| 43 | 43 | @ResponseBody |
| 44 | - @TokenRequired | |
| 45 | - public BaseObjectResponse getIsPrient(@RequestParam String id, @RequestParam Integer type) { | |
| 46 | - return viewFacade.getIsPrient(id, type); | |
| 44 | + public BaseObjectResponse getIsPrient(@RequestParam String id) { | |
| 45 | + return viewFacade.getIsPrient(id); | |
| 47 | 46 | } |
| 48 | 47 | |
| 49 | 48 | /** |
| ... | ... | @@ -53,9 +52,8 @@ |
| 53 | 52 | */ |
| 54 | 53 | @RequestMapping(value = "/prient", method = RequestMethod.GET) |
| 55 | 54 | @ResponseBody |
| 56 | - @TokenRequired | |
| 57 | - public BaseObjectResponse prient(@RequestParam String id, @RequestParam Integer type) { | |
| 58 | - return viewFacade.prient(id, type); | |
| 55 | + public BaseObjectResponse prient(@RequestParam String id) { | |
| 56 | + return viewFacade.prient(id); | |
| 59 | 57 | } |
| 60 | 58 | |
| 61 | 59 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
dab1bfb
| ... | ... | @@ -1070,6 +1070,10 @@ |
| 1070 | 1070 | List expYunEnums = ExpYunEnums.getExpYunEnums(); |
| 1071 | 1071 | typeMap.put("expYunEnums", expYunEnums); |
| 1072 | 1072 | |
| 1073 | + // 末次月经纠正依据 | |
| 1074 | + List<Map<String, Object>> basis = EnumUtil.toJson(BasisEnums.class); | |
| 1075 | + typeMap.put("basisEnmus", basis); | |
| 1076 | + | |
| 1073 | 1077 | list.add(typeMap); |
| 1074 | 1078 | |
| 1075 | 1079 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
dab1bfb
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.biz.SequenceConstant; | |
| 3 | 4 | import com.lyms.platform.biz.service.*; |
| 4 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 5 | 6 | import com.lyms.platform.common.enums.*; |
| ... | ... | @@ -29,6 +30,7 @@ |
| 29 | 30 | import org.apache.commons.collections.map.HashedMap; |
| 30 | 31 | import org.apache.commons.lang.StringUtils; |
| 31 | 32 | import org.apache.commons.lang.math.NumberUtils; |
| 33 | +import org.bson.types.ObjectId; | |
| 32 | 34 | import org.springframework.beans.factory.annotation.Autowired; |
| 33 | 35 | import org.springframework.data.domain.Sort; |
| 34 | 36 | import org.springframework.data.mongodb.core.MongoTemplate; |
| 35 | 37 | |
| 36 | 38 | |
| ... | ... | @@ -3699,27 +3701,20 @@ |
| 3699 | 3701 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("未查询到数据"); |
| 3700 | 3702 | } |
| 3701 | 3703 | |
| 3702 | - public BaseObjectResponse getIsPrient(String id, Integer type) { | |
| 3703 | - if(type == 1) { | |
| 3704 | - AntExChuModel chuModel = mongoTemplate.findById(id, AntExChuModel.class); | |
| 3705 | - if(chuModel != null) { | |
| 3706 | - return RespBuilder.buildSuccess("isPrient", chuModel.getIsPrient() == null ? false : true); | |
| 3707 | - } | |
| 3708 | - } else if (type == 2){ | |
| 3709 | - AntenatalExaminationModel examinationModel = mongoTemplate.findById(id, AntenatalExaminationModel.class); | |
| 3710 | - if(examinationModel != null) { | |
| 3711 | - return RespBuilder.buildSuccess("isPrient", examinationModel.getIsPrient() == null ? false : true); | |
| 3712 | - } | |
| 3713 | - } | |
| 3714 | - return RespBuilder.buildSuccess((type == 1 ? "初诊" : "复诊") + "数据未找到"); | |
| 3704 | + public BaseObjectResponse getIsPrient(String id) { | |
| 3705 | + return RespBuilder.buildSuccess(mongoTemplate.exists(Query.query(Criteria.where("value").is(id).and("type").is(SequenceConstant.PRIENT_TYPE)), PlantformConfigModel.class)); | |
| 3715 | 3706 | } |
| 3716 | 3707 | |
| 3717 | - public BaseObjectResponse prient(String id, Integer type) { | |
| 3718 | - if(type == 1) { | |
| 3719 | - mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(id)), Update.update("isPrient", 1), AntExChuModel.class); | |
| 3720 | - } else if (type == 2){ | |
| 3721 | - mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(id)), Update.update("isPrient", 1), AntenatalExaminationModel.class); | |
| 3708 | + public BaseObjectResponse prient(String id) { | |
| 3709 | + if(mongoTemplate.exists(Query.query(Criteria.where("value").is(id).and("type").is(SequenceConstant.PRIENT_TYPE)), PlantformConfigModel.class)) { | |
| 3710 | + return RespBuilder.buildSuccess("已经打印过"); | |
| 3722 | 3711 | } |
| 3712 | + PlantformConfigModel plantformConfigModel = new PlantformConfigModel(); | |
| 3713 | + plantformConfigModel.setType(SequenceConstant.PRIENT_TYPE); | |
| 3714 | + plantformConfigModel.setRemark(SequenceConstant.PRIENT_REMARK); | |
| 3715 | + plantformConfigModel.setCreateDate(new Date()); | |
| 3716 | + plantformConfigModel.setValue(id); | |
| 3717 | + mongoTemplate.save(plantformConfigModel); | |
| 3723 | 3718 | return RespBuilder.buildSuccess(); |
| 3724 | 3719 | } |
| 3725 | 3720 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
dab1bfb
| ... | ... | @@ -902,8 +902,9 @@ |
| 902 | 902 | map.put("week", DateUtil.getWeekDesc(p.getLastMenses(), new Date())); |
| 903 | 903 | map.put("doctorName", couponMapper.getUserName(p.getBookbuildingDoctor())); |
| 904 | 904 | String hName = hospitalNameCache.get(p.getHospitalId()); |
| 905 | - if(StringUtils.isNotEmpty(hName)) { | |
| 905 | + if(StringUtils.isEmpty(hName)) { | |
| 906 | 906 | hName = couponMapper.findHospitalNameById(p.getHospitalId()); |
| 907 | + hospitalNameCache.put(p.getHospitalId(), hName); | |
| 907 | 908 | } |
| 908 | 909 | map.put("hospitalName", hName); |
| 909 | 910 | map.put("checkTime", getCheckTimeByUsedId(patients, antExChuModels, antenatalExaminationModels, maternalDeliverModels, deliverModels, postReviewModels, usedId)); |
| 910 | 911 | |
| ... | ... | @@ -1193,9 +1194,9 @@ |
| 1193 | 1194 | if(param.get("hospitalId") instanceof ArrayList) { |
| 1194 | 1195 | List<String> hids = (List<String>) param.get("hospitalId"); |
| 1195 | 1196 | if(CollectionUtils.isEmpty(hids)) { |
| 1196 | - param.put("hospitalId", accessPermissionFacade.getCurrentUserHospPermissions(Integer.parseInt(param.get("userId") + ""))); /** 模拟根据登陆人id 查询出来的医院 */ | |
| 1197 | + param.put("hospitalId", accessPermissionFacade.getCurrentUserHospPermissions(Integer.parseInt(param.get("userId") + ""))); | |
| 1197 | 1198 | } |
| 1198 | - param.put("hospitalId", hids); /** 模拟根据登陆人id 查询出来的医院 */ | |
| 1199 | + param.put("hospitalId", hids); | |
| 1199 | 1200 | } else { |
| 1200 | 1201 | if(StringUtils.isBlank((String) param.get("hospitalId"))) { |
| 1201 | 1202 | param.put("hospitalId", accessPermissionFacade.getCurrentUserHospPermissions(Integer.parseInt(param.get("userId") + ""))); /** 模拟根据登陆人id 查询出来的医院 */ |
| ... | ... | @@ -1204,7 +1205,6 @@ |
| 1204 | 1205 | } |
| 1205 | 1206 | } |
| 1206 | 1207 | |
| 1207 | - | |
| 1208 | 1208 | /* |
| 1209 | 1209 | if(StringUtils.isBlank((String) param.get("hospitalId"))) { |
| 1210 | 1210 | param.put("hospitalId", accessPermissionFacade.getCurrentUserHospPermissions(Integer.parseInt(param.get("userId") + ""))); *//** 模拟根据登陆人id 查询出来的医院 *//* |
| ... | ... | @@ -1285,7 +1285,9 @@ |
| 1285 | 1285 | List<String> sendUserIds2 = new ArrayList<>(); |
| 1286 | 1286 | if(CollectionUtils.isNotEmpty(sendUserIds)) { |
| 1287 | 1287 | // List<Map<String, Object>> mulitPatienInfo = couponMapper.findMulitPatienInfo(sendUserIds); /** 查询需要添加人数的总数, 例如A发了两次优惠券 那么这里返回需要加的值为1 */ |
| 1288 | - List<Map<String, Object>> mulitPatienInfo = couponMapper.findMulitPatienInfo(CollectionUtils.createMap("userIds", sendUserIds, "startDate", param.get("startDate"))); /** 查询需要添加人数的总数, 例如A发了两次优惠券 那么这里返回需要加的值为1 */ | |
| 1288 | + param.put("userIds", sendUserIds); | |
| 1289 | + List<Map<String, Object>> mulitPatienInfo = couponMapper.findMulitPatienInfo(param); /** 查询需要添加人数的总数, 例如A发了两次优惠券 那么这里返回需要加的值为1 */ | |
| 1290 | + System.out.println(sendUserIds); | |
| 1289 | 1291 | for (Map<String, Object> m : mulitPatienInfo) { |
| 1290 | 1292 | Long count = (Long) m.get("count"); |
| 1291 | 1293 | sendUserIds2.add((String) m.get("user_id")); |
| ... | ... | @@ -1302,7 +1304,9 @@ |
| 1302 | 1304 | List<String> usedUserIds = (List<String>) map.get("usedUserIds"); |
| 1303 | 1305 | List<String> usedUserIds2 = new ArrayList<>(); |
| 1304 | 1306 | if(CollectionUtils.isNotEmpty(usedUserIds)) { |
| 1305 | - List<Map<String, Object>> mulitPatienInfo = couponMapper.findMulitPatienInfo(CollectionUtils.createMap("userIds", usedUserIds, "startDate", param.get("startDate"))); /** 查询需要添加人数的总数, 例如A发了两次优惠券 那么这里返回需要加的值为1 */ | |
| 1307 | +// List<Map<String, Object>> mulitPatienInfo = couponMapper.findMulitPatienInfo(CollectionUtils.createMap("userIds", usedUserIds, "startDate", param.get("startDate"))); /** 查询需要添加人数的总数, 例如A发了两次优惠券 那么这里返回需要加的值为1 */ | |
| 1308 | + param.put("userIds", usedUserIds); | |
| 1309 | + List<Map<String, Object>> mulitPatienInfo = couponMapper.findMulitPatienInfo(param); /** 查询需要添加人数的总数, 例如A发了两次优惠券 那么这里返回需要加的值为1 */ | |
| 1306 | 1310 | for (Map<String, Object> m : mulitPatienInfo) { |
| 1307 | 1311 | Long count = (Long) m.get("count"); |
| 1308 | 1312 | usedUserIds2.add((String) m.get("user_id")); |
| ... | ... | @@ -1684,7 +1688,7 @@ |
| 1684 | 1688 | param2.put("hid", param.get("hospitalId")); |
| 1685 | 1689 | param2.put("uids", ids); |
| 1686 | 1690 | List<Map<String,Object>> userSendInfo = couponMapper.findUserSendInfoByUids(param2); |
| 1687 | - | |
| 1691 | + System.out.println(ids); | |
| 1688 | 1692 | // Integer count = couponMapper.findUserSendInfoCount(param); |
| 1689 | 1693 | for (Map<String, Object> map : userSendInfo) { |
| 1690 | 1694 | String userId = (String) map.get("user_id"); |