Commit 6997d829808b7c5f45ea7fe9d5775f48beb2451c
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 19 changed files
- platform-common/src/main/java/com/lyms/platform/common/utils/AddressUtil.java
- platform-common/src/main/java/com/lyms/platform/common/utils/LymsEncodeUtil.java
- platform-dal/src/main/java/com/lyms/platform/pojo/BabyDeathModel.java
- platform-dal/src/main/java/com/lyms/platform/pojo/CervicalCancerModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyDeathController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyDeathRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/NutritionInfoRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyDeathModelResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/CervicalCancerModelResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyDeathServerImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/CervicalCancerServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/session/SessionProvider.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/session/strategy/ISessionProvider.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/session/strategy/LocalCacheSessionStrategy.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/session/strategy/UserCenterStrategy.java
- platform-operate-api/src/main/resources/database.properties
platform-common/src/main/java/com/lyms/platform/common/utils/AddressUtil.java
View file @
6997d82
| ... | ... | @@ -47,7 +47,7 @@ |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | public static void main(String[] ages) { |
| 50 | - List<String> addrs = AddressUtil.getAddress("山东省荣成市曙光东县26号207室"); | |
| 50 | + List<String> addrs = AddressUtil.getAddress("四川省广安市广安区悦来镇天台村8组23号"); | |
| 51 | 51 | for (String ad : addrs) { |
| 52 | 52 | System.out.println(ad); |
| 53 | 53 | } |
platform-common/src/main/java/com/lyms/platform/common/utils/LymsEncodeUtil.java
View file @
6997d82
| ... | ... | @@ -29,6 +29,10 @@ |
| 29 | 29 | String json = aesDecrypt("26EB0301C4A2410E90985A3E55856E4BC90B764322A576155B201AFB0BC8C94FFAB29197A8B86F592DD2ABABF896EB89", key); |
| 30 | 30 | System.out.println("解密后:" + json); |
| 31 | 31 | |
| 32 | + String key1 = "Lymsh@2020"; | |
| 33 | + | |
| 34 | + String d = aesEncrypt("2020-04-01",key1); | |
| 35 | + System.out.println("加密:" + d); | |
| 32 | 36 | } |
| 33 | 37 | |
| 34 | 38 | /** |
platform-dal/src/main/java/com/lyms/platform/pojo/BabyDeathModel.java
View file @
6997d82
platform-dal/src/main/java/com/lyms/platform/pojo/CervicalCancerModel.java
View file @
6997d82
| ... | ... | @@ -33,6 +33,10 @@ |
| 33 | 33 | |
| 34 | 34 | private String phone; |
| 35 | 35 | |
| 36 | + //编号 | |
| 37 | + private String code; | |
| 38 | + | |
| 39 | + | |
| 36 | 40 | /** |
| 37 | 41 | * 身份证 |
| 38 | 42 | */ |
| 39 | 43 | |
| 40 | 44 | |
| 41 | 45 | |
| ... | ... | @@ -42,13 +46,9 @@ |
| 42 | 46 | * 省市区街道 |
| 43 | 47 | */ |
| 44 | 48 | private String provinceId; |
| 45 | - private String provinceStr; | |
| 46 | 49 | private String cityId; |
| 47 | - private String cityStr; | |
| 48 | 50 | private String areaId; |
| 49 | - private String areaStr; | |
| 50 | 51 | private String streetId; |
| 51 | - private String streetStr; | |
| 52 | 52 | private String address; |
| 53 | 53 | |
| 54 | 54 | /** |
| ... | ... | @@ -80,6 +80,14 @@ |
| 80 | 80 | |
| 81 | 81 | private String hospitalId; |
| 82 | 82 | |
| 83 | + public String getCode() { | |
| 84 | + return code; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public void setCode(String code) { | |
| 88 | + this.code = code; | |
| 89 | + } | |
| 90 | + | |
| 83 | 91 | public String getHospitalId() { |
| 84 | 92 | return hospitalId; |
| 85 | 93 | } |
| 86 | 94 | |
| ... | ... | @@ -168,14 +176,7 @@ |
| 168 | 176 | this.provinceId = provinceId; |
| 169 | 177 | } |
| 170 | 178 | |
| 171 | - public String getProvinceStr() { | |
| 172 | - return provinceStr; | |
| 173 | - } | |
| 174 | 179 | |
| 175 | - public void setProvinceStr(String provinceStr) { | |
| 176 | - this.provinceStr = provinceStr; | |
| 177 | - } | |
| 178 | - | |
| 179 | 180 | public String getCityId() { |
| 180 | 181 | return cityId; |
| 181 | 182 | } |
| 182 | 183 | |
| ... | ... | @@ -184,14 +185,7 @@ |
| 184 | 185 | this.cityId = cityId; |
| 185 | 186 | } |
| 186 | 187 | |
| 187 | - public String getCityStr() { | |
| 188 | - return cityStr; | |
| 189 | - } | |
| 190 | 188 | |
| 191 | - public void setCityStr(String cityStr) { | |
| 192 | - this.cityStr = cityStr; | |
| 193 | - } | |
| 194 | - | |
| 195 | 189 | public String getAreaId() { |
| 196 | 190 | return areaId; |
| 197 | 191 | } |
| ... | ... | @@ -200,14 +194,6 @@ |
| 200 | 194 | this.areaId = areaId; |
| 201 | 195 | } |
| 202 | 196 | |
| 203 | - public String getAreaStr() { | |
| 204 | - return areaStr; | |
| 205 | - } | |
| 206 | - | |
| 207 | - public void setAreaStr(String areaStr) { | |
| 208 | - this.areaStr = areaStr; | |
| 209 | - } | |
| 210 | - | |
| 211 | 197 | public String getStreetId() { |
| 212 | 198 | return streetId; |
| 213 | 199 | } |
| ... | ... | @@ -216,13 +202,6 @@ |
| 216 | 202 | this.streetId = streetId; |
| 217 | 203 | } |
| 218 | 204 | |
| 219 | - public String getStreetStr() { | |
| 220 | - return streetStr; | |
| 221 | - } | |
| 222 | - | |
| 223 | - public void setStreetStr(String streetStr) { | |
| 224 | - this.streetStr = streetStr; | |
| 225 | - } | |
| 226 | 205 | |
| 227 | 206 | public Date getLastMenstrual() { |
| 228 | 207 | return lastMenstrual; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyDeathController.java
View file @
6997d82
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
6997d82
| ... | ... | @@ -1085,7 +1085,52 @@ |
| 1085 | 1085 | return map; |
| 1086 | 1086 | } |
| 1087 | 1087 | |
| 1088 | + public boolean isOpenAutoSaveAntenatal(String hospitalId) | |
| 1089 | + { | |
| 1090 | + String value = ""; | |
| 1091 | + //查询当前医院是否有配置此权限 | |
| 1092 | + ModularFunctionConfigModel functionConfigModel = mongoTemplate.findOne(Query.query(Criteria.where("hospitalId").is(hospitalId)), ModularFunctionConfigModel.class); | |
| 1093 | + if (null != functionConfigModel) { | |
| 1094 | + List<Map<String, Object>> mapList = functionConfigModel.getConfigs(); | |
| 1095 | + if (CollectionUtils.isNotEmpty(mapList)) { | |
| 1096 | + for (Map<String, Object> map : mapList) { | |
| 1097 | + if (map.get("type").toString().equals("88")) { | |
| 1098 | + value = map.get("value").toString(); | |
| 1099 | + } | |
| 1100 | + } | |
| 1101 | + } | |
| 1102 | + } | |
| 1103 | + return value != null && "2".equals(value); | |
| 1104 | + } | |
| 1105 | + | |
| 1106 | + | |
| 1088 | 1107 | /** |
| 1108 | + * | |
| 1109 | + * 如果是体重测量在后,就通过测量体重时候去修改产检中的体重 | |
| 1110 | + * @param hospitalId | |
| 1111 | + * @param pid | |
| 1112 | + * @param currentWeight | |
| 1113 | + */ | |
| 1114 | + public void updateAntenatal(String hospitalId,String pid,Double currentWeight) | |
| 1115 | + { | |
| 1116 | + if (!isOpenAutoSaveAntenatal(hospitalId)) | |
| 1117 | + { | |
| 1118 | + return; | |
| 1119 | + } | |
| 1120 | + List<AntenatalExaminationModel> examinationModel = mongoTemplate.find(Query.query(Criteria.where("pid").is(pid)), AntenatalExaminationModel.class); | |
| 1121 | + if (CollectionUtils.isNotEmpty(examinationModel)) { | |
| 1122 | + for (AntenatalExaminationModel model : examinationModel) { | |
| 1123 | + if (StringUtils.isNotEmpty(DateUtil.getyyyy_MM_dd(model.getCheckDate())) && | |
| 1124 | + DateUtil.getyyyy_MM_dd(new Date()).equals(DateUtil.getyyyy_MM_dd(model.getCheckDate()))) { | |
| 1125 | + model.setWeight(currentWeight); | |
| 1126 | + antenatalExaminationService.updateOneAnt(model, model.getId()); | |
| 1127 | + } | |
| 1128 | + } | |
| 1129 | + } | |
| 1130 | + } | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + /** | |
| 1089 | 1134 | * 小程序创建产检 |
| 1090 | 1135 | * |
| 1091 | 1136 | * @param fuh |
| 1092 | 1137 | |
| ... | ... | @@ -1100,21 +1145,8 @@ |
| 1100 | 1145 | public BaseResponse inputWxData(String fuh, String abdominalGirth, String fhr, String pid, String hospitalId, String nextTime, String doctorId) { |
| 1101 | 1146 | WxMeasureInfoModel wxMeasureInfo = new WxMeasureInfoModel(); |
| 1102 | 1147 | boolean falg = true; |
| 1103 | - String value = null; | |
| 1104 | 1148 | if (StringUtils.isNotEmpty(pid) && StringUtils.isNotEmpty(hospitalId)) { |
| 1105 | - //查询当前医院是否有配置此权限 | |
| 1106 | - ModularFunctionConfigModel functionConfigModel = mongoTemplate.findOne(Query.query(Criteria.where("hospitalId").is(hospitalId)), ModularFunctionConfigModel.class); | |
| 1107 | - if (null != functionConfigModel) { | |
| 1108 | - List<Map<String, Object>> mapList = functionConfigModel.getConfigs(); | |
| 1109 | - if (CollectionUtils.isNotEmpty(mapList)) { | |
| 1110 | - for (Map<String, Object> map : mapList) { | |
| 1111 | - if (map.get("type").toString().equals("88")) { | |
| 1112 | - value = map.get("value").toString(); | |
| 1113 | - } | |
| 1114 | - } | |
| 1115 | - } | |
| 1116 | - } | |
| 1117 | - if (value != null && "2".equals(value)) { | |
| 1149 | + if (isOpenAutoSaveAntenatal(hospitalId)) { | |
| 1118 | 1150 | List<AntenatalExaminationModel> examinationModel = mongoTemplate.find(Query.query(Criteria.where("pid").is(pid)), AntenatalExaminationModel.class); |
| 1119 | 1151 | if (CollectionUtils.isNotEmpty(examinationModel)) { |
| 1120 | 1152 | for (AntenatalExaminationModel model : examinationModel) { |
| ... | ... | @@ -1144,7 +1176,7 @@ |
| 1144 | 1176 | } |
| 1145 | 1177 | if (falg) { |
| 1146 | 1178 | //创建一条复诊记录 |
| 1147 | - Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(pid).and("hospitalId").is(hospitalId).and("type").is(1)), Patients.class); | |
| 1179 | + Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(pid).and("hospitalId").is(hospitalId).and("type").is(1).and("yn").is(1)), Patients.class); | |
| 1148 | 1180 | if (null != patients) { |
| 1149 | 1181 | AntExChuModel antExChuModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(patients.getId())), AntExChuModel.class); |
| 1150 | 1182 | if (null != antExChuModel) { |
| 1151 | 1183 | |
| ... | ... | @@ -1224,16 +1256,24 @@ |
| 1224 | 1256 | } |
| 1225 | 1257 | } |
| 1226 | 1258 | //获取体重记录 |
| 1227 | - PatientWeight patientWeight = mongoTemplate.findOne(Query.query(Criteria.where("hospitalId").is(hospitalId).and("patientId").is(patients.getId()).and("yn").is("1")), PatientWeight.class); | |
| 1228 | - if (patientWeight != null) { | |
| 1229 | - Map<String, String> dayWeights = patientWeight.getDayWeights(); | |
| 1230 | - if (null != dayWeights && dayWeights.size() > 0) { | |
| 1231 | - String valus = dayWeights.get(DateUtil.getyyyy_MM_dd(new Date())); | |
| 1232 | - if (StringUtils.isNotEmpty(valus)) { | |
| 1233 | - antExAddRequest.setWeight(Double.valueOf(valus)); | |
| 1259 | + List<PatientWeight> patientWeights = mongoTemplate.find(Query.query(Criteria.where("pid").is(pid).and("yn").is("1")), PatientWeight.class); | |
| 1260 | + if (CollectionUtils.isNotEmpty(patientWeights)) | |
| 1261 | + { | |
| 1262 | + for (PatientWeight patientWeight : patientWeights) | |
| 1263 | + { | |
| 1264 | + if (patientWeight != null) { | |
| 1265 | + Map<String, String> dayWeights = patientWeight.getDayWeights(); | |
| 1266 | + if (null != dayWeights && dayWeights.size() > 0) { | |
| 1267 | + String valus = dayWeights.get(DateUtil.getyyyy_MM_dd(new Date())); | |
| 1268 | + if (StringUtils.isNotEmpty(valus)) { | |
| 1269 | + antExAddRequest.setWeight(Double.valueOf(valus)); | |
| 1270 | + break; | |
| 1271 | + } | |
| 1272 | + } | |
| 1234 | 1273 | } |
| 1235 | 1274 | } |
| 1236 | 1275 | } |
| 1276 | + | |
| 1237 | 1277 | antenatalExaminationFacade.addOneAntEx(antExAddRequest, Integer.parseInt(doctorId)); |
| 1238 | 1278 | } |
| 1239 | 1279 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
View file @
6997d82
| ... | ... | @@ -61,6 +61,8 @@ |
| 61 | 61 | private DataPermissionService dataPermissionService; |
| 62 | 62 | |
| 63 | 63 | @Autowired |
| 64 | + private AntExRecordFacade antExRecordFacade; | |
| 65 | + @Autowired | |
| 64 | 66 | private OrganizationService organizationService; |
| 65 | 67 | |
| 66 | 68 | @Autowired |
| 67 | 69 | |
| 68 | 70 | |
| ... | ... | @@ -984,31 +986,31 @@ |
| 984 | 986 | public BaseObjectResponse addNutritionInfo(NutritionInfoRequest nutritionInfoRequest) { |
| 985 | 987 | |
| 986 | 988 | Patients patients = patientsService.findOnePatientById(nutritionInfoRequest.getPatientId()); |
| 987 | - List<PatientWeight> patientWeights = patientWeightService2.queryPatientWeight(Query.query(Criteria.where("patientId").is(nutritionInfoRequest.getPatientId()))); | |
| 989 | + List<PatientWeight> patientWeights = patientWeightService2.queryPatientWeight(Query.query(Criteria.where("pid").is(patients.getPid()).and("yn").is("1"))); | |
| 988 | 990 | String hospitalId = nutritionInfoRequest.getHospitalId().trim(); |
| 989 | 991 | |
| 990 | 992 | |
| 991 | 993 | Map<String, String> dayWeights = new LinkedHashMap<>(); |
| 992 | 994 | List<Map<String, Object>> dayWeights2 = new ArrayList<>(); |
| 995 | +// | |
| 996 | +// AntExQuery antExQuery = new AntExQuery(); | |
| 997 | +// antExQuery.setYn(YnEnums.YES.getId()); | |
| 998 | +// antExQuery.setParentId(patients.getId()); | |
| 999 | +// antExQuery.setHospitalId(hospitalId); | |
| 1000 | +// String date = DateUtil.getyyyy_MM_dd(new Date()); | |
| 1001 | +// antExQuery.setStart(DateUtil.parseYMDHMS(date + " 00:00:00")); | |
| 1002 | +// antExQuery.setEnd(DateUtil.parseYMDHMS(date + " 23:59:59")); | |
| 1003 | +// List<AntenatalExaminationModel> antenatalExaminationModels = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
| 1004 | +// if (CollectionUtils.isNotEmpty(antenatalExaminationModels)) { | |
| 1005 | +// AntenatalExaminationModel examinationModel = antenatalExaminationModels.get(0); | |
| 1006 | +// try { | |
| 1007 | +// examinationModel.setWeight(Double.valueOf(nutritionInfoRequest.getCurrentWeight())); | |
| 1008 | +// } catch (Exception e) { | |
| 1009 | +// | |
| 1010 | +// } | |
| 1011 | +// antenatalExaminationService.updateOneAnt(examinationModel, examinationModel.getId()); | |
| 1012 | +// } | |
| 993 | 1013 | |
| 994 | - AntExQuery antExQuery = new AntExQuery(); | |
| 995 | - antExQuery.setYn(YnEnums.YES.getId()); | |
| 996 | - antExQuery.setParentId(patients.getId()); | |
| 997 | - antExQuery.setHospitalId(hospitalId); | |
| 998 | - String date = DateUtil.getyyyy_MM_dd(new Date()); | |
| 999 | - antExQuery.setStart(DateUtil.parseYMDHMS(date + " 00:00:00")); | |
| 1000 | - antExQuery.setEnd(DateUtil.parseYMDHMS(date + " 23:59:59")); | |
| 1001 | - List<AntenatalExaminationModel> antenatalExaminationModels = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
| 1002 | - if (CollectionUtils.isNotEmpty(antenatalExaminationModels)) { | |
| 1003 | - AntenatalExaminationModel examinationModel = antenatalExaminationModels.get(0); | |
| 1004 | - try { | |
| 1005 | - examinationModel.setWeight(Double.valueOf(nutritionInfoRequest.getCurrentWeight())); | |
| 1006 | - } catch (Exception e) { | |
| 1007 | - | |
| 1008 | - } | |
| 1009 | - antenatalExaminationService.updateOneAnt(examinationModel, examinationModel.getId()); | |
| 1010 | - } | |
| 1011 | - | |
| 1012 | 1014 | String currentWeight = nutritionInfoRequest.getCurrentWeight(); |
| 1013 | 1015 | if (CollectionUtils.isNotEmpty(patientWeights)) { |
| 1014 | 1016 | PatientWeight pw = patientWeights.get(0); |
| ... | ... | @@ -1084,6 +1086,9 @@ |
| 1084 | 1086 | patientWeightService2.add(patientWeight); |
| 1085 | 1087 | |
| 1086 | 1088 | } |
| 1089 | + | |
| 1090 | + //更新当天产检记录的体重 | |
| 1091 | + antExRecordFacade.updateAntenatal(hospitalId, patients.getPid(), Double.parseDouble(currentWeight)); | |
| 1087 | 1092 | |
| 1088 | 1093 | MeasureInfoRequest measureInfoRequest = new MeasureInfoRequest(); |
| 1089 | 1094 | measureInfoRequest.setCertNo(patients.getCardNo()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyDeathRequest.java
View file @
6997d82
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/NutritionInfoRequest.java
View file @
6997d82
| 1 | 1 | package com.lyms.platform.operate.web.request; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.common.utils.StringUtils; | |
| 4 | + | |
| 3 | 5 | /** |
| 4 | 6 | * Created by Administrator on 2018-05-07. |
| 5 | 7 | */ |
| ... | ... | @@ -119,6 +121,12 @@ |
| 119 | 121 | } |
| 120 | 122 | |
| 121 | 123 | public void setCurrentWeight(String currentWeight) { |
| 124 | + | |
| 125 | + if (StringUtils.isNotEmpty(currentWeight)) | |
| 126 | + { | |
| 127 | + currentWeight = String.format("%.2f", Double.parseDouble(currentWeight)); | |
| 128 | + } | |
| 129 | + | |
| 122 | 130 | this.currentWeight = currentWeight; |
| 123 | 131 | } |
| 124 | 132 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyDeathModelResult.java
View file @
6997d82
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/CervicalCancerModelResult.java
View file @
6997d82
| ... | ... | @@ -3,6 +3,40 @@ |
| 3 | 3 | import com.lyms.platform.pojo.CervicalCancerModel; |
| 4 | 4 | |
| 5 | 5 | public class CervicalCancerModelResult extends CervicalCancerModel { |
| 6 | + private String addressStr; | |
| 6 | 7 | |
| 8 | + /** | |
| 9 | + * 填写单位 | |
| 10 | + */ | |
| 11 | + private String hospitalStr; | |
| 12 | + | |
| 13 | + /** | |
| 14 | + * 填写人 | |
| 15 | + */ | |
| 16 | + private String createUserStr; | |
| 17 | + | |
| 18 | + public String getAddressStr() { | |
| 19 | + return addressStr; | |
| 20 | + } | |
| 21 | + | |
| 22 | + public void setAddressStr(String addressStr) { | |
| 23 | + this.addressStr = addressStr; | |
| 24 | + } | |
| 25 | + | |
| 26 | + public String getHospitalStr() { | |
| 27 | + return hospitalStr; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public void setHospitalStr(String hospitalStr) { | |
| 31 | + this.hospitalStr = hospitalStr; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public String getCreateUserStr() { | |
| 35 | + return createUserStr; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public void setCreateUserStr(String createUserStr) { | |
| 39 | + this.createUserStr = createUserStr; | |
| 40 | + } | |
| 7 | 41 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java
View file @
6997d82
| ... | ... | @@ -61,6 +61,7 @@ |
| 61 | 61 | urls.put("area-zhucheng-api.healthbaby.com.cn:12356","诸城市妇幼保健院"); |
| 62 | 62 | urls.put("area-weihai-api.healthbaby.com.cn:12356","威海市妇幼"); |
| 63 | 63 | urls.put("area-chengde-api.healthbaby.com.cn:12356","承德"); |
| 64 | + urls.put("area-lingcheng-api.healthbaby.com.cn:12356","陵城"); | |
| 64 | 65 | } |
| 65 | 66 | |
| 66 | 67 | @Autowired |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyDeathServerImpl.java
View file @
6997d82
| ... | ... | @@ -45,11 +45,9 @@ |
| 45 | 45 | @Autowired |
| 46 | 46 | private UsersService usersService; |
| 47 | 47 | |
| 48 | - | |
| 49 | 48 | @Autowired |
| 50 | 49 | private AutoMatchFacade autoMatchFacade; |
| 51 | 50 | |
| 52 | - | |
| 53 | 51 | /** |
| 54 | 52 | * 保存单个 |
| 55 | 53 | * |
| ... | ... | @@ -75,7 +73,7 @@ |
| 75 | 73 | Query query = Query.query(Criteria.where("id").is(param.getId())); |
| 76 | 74 | Update update = MongoConvertHelper |
| 77 | 75 | .convertToNativeUpdate(ReflectionUtils.getUpdateField(param)); |
| 78 | - mongoTemplate.updateFirst(query, update, PregnantDeathModel.class); | |
| 76 | + mongoTemplate.updateFirst(query, update, BabyDeathModel.class); | |
| 79 | 77 | return new BaseResponse(); |
| 80 | 78 | } |
| 81 | 79 | |
| ... | ... | @@ -128,7 +126,7 @@ |
| 128 | 126 | |
| 129 | 127 | // 死亡时间 |
| 130 | 128 | String deathDateStart = param.getDeathDateStart(); |
| 131 | - String deathDateEnd = param.getDeathDatedEnd(); | |
| 129 | + String deathDateEnd = param.getDeathDateEnd(); | |
| 132 | 130 | if (StringUtils.isNotEmpty(deathDateStart) && StringUtils.isNotEmpty(deathDateEnd)) { |
| 133 | 131 | Date startDate = DateUtil.parseYMD(deathDateStart); |
| 134 | 132 | Date dayFirstSecond = DateUtil.getDayFirstSecond(startDate); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/CervicalCancerServiceImpl.java
View file @
6997d82
| 1 | 1 | package com.lyms.platform.operate.web.service.impl; |
| 2 | 2 | |
| 3 | 3 | import java.util.Date; |
| 4 | +import java.util.LinkedList; | |
| 4 | 5 | import java.util.List; |
| 5 | 6 | |
| 6 | 7 | import com.lyms.platform.operate.web.facade.AutoMatchFacade; |
| 8 | +import com.lyms.platform.operate.web.result.PregnantDeathModelResult; | |
| 9 | +import com.lyms.platform.permission.model.Organization; | |
| 10 | +import com.lyms.platform.permission.model.Users; | |
| 11 | +import com.lyms.platform.permission.service.OrganizationService; | |
| 12 | +import com.lyms.platform.permission.service.UsersService; | |
| 13 | +import com.lyms.platform.pojo.PregnantDeathModel; | |
| 7 | 14 | import org.springframework.beans.BeanUtils; |
| 8 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | 16 | import org.springframework.data.domain.Sort; |
| ... | ... | @@ -42,6 +49,12 @@ |
| 42 | 49 | @Autowired |
| 43 | 50 | private AutoMatchFacade autoMatchFacade; |
| 44 | 51 | |
| 52 | + @Autowired | |
| 53 | + private OrganizationService organizationService; | |
| 54 | + | |
| 55 | + @Autowired | |
| 56 | + private UsersService usersService; | |
| 57 | + | |
| 45 | 58 | /** |
| 46 | 59 | * 保存单个 |
| 47 | 60 | * |
| ... | ... | @@ -85,7 +98,8 @@ |
| 85 | 98 | Query query = new Query(); |
| 86 | 99 | String keyword = param.getKeyword(); |
| 87 | 100 | if (StringUtils.isNotEmpty(keyword)) { |
| 88 | - query.addCriteria(Criteria.where("name").is(keyword).orOperator(Criteria.where("phone").is(keyword))); | |
| 101 | + Criteria c = new Criteria().orOperator(Criteria.where("name").is(keyword), Criteria.where("phone").is(keyword)); | |
| 102 | + query.addCriteria(c); | |
| 89 | 103 | } |
| 90 | 104 | String hasAcceptTreatment = param.getHasAcceptTreatment(); |
| 91 | 105 | if (StringUtils.isNotEmpty(hasAcceptTreatment)) { |
| 92 | 106 | |
| 93 | 107 | |
| ... | ... | @@ -118,12 +132,48 @@ |
| 118 | 132 | param.mysqlBuild((int) count); |
| 119 | 133 | query.skip(param.getOffset()).limit(param.getLimit()); |
| 120 | 134 | List<CervicalCancerModel> cervicalCancerModels = mongoTemplate.find(query, CervicalCancerModel.class); |
| 135 | + List<CervicalCancerModelResult> results = new LinkedList<>(); | |
| 136 | + for (CervicalCancerModel model : cervicalCancerModels) { | |
| 137 | + CervicalCancerModelResult result = new CervicalCancerModelResult(); | |
| 138 | + getOtherStr(result, model); | |
| 139 | + results.add(result); | |
| 140 | + } | |
| 141 | + | |
| 142 | + | |
| 121 | 143 | BaseListResponse baseListResponse = new BaseListResponse(); |
| 122 | - baseListResponse.setData(cervicalCancerModels); | |
| 144 | + baseListResponse.setData(results); | |
| 123 | 145 | baseListResponse.setPageInfo(param.getPageInfo()); |
| 124 | 146 | return baseListResponse; |
| 125 | 147 | } |
| 126 | 148 | |
| 149 | + | |
| 150 | + private void getOtherStr(CervicalCancerModelResult result, CervicalCancerModel model) { | |
| 151 | + BeanUtils.copyProperties(model, result); | |
| 152 | + | |
| 153 | + result.setAddressStr(CommonsHelper.getResidence( | |
| 154 | + result.getProvinceId(), | |
| 155 | + result.getCityId(), | |
| 156 | + result.getAreaId(), | |
| 157 | + result.getStreetId(), | |
| 158 | + null, | |
| 159 | + basicConfigService | |
| 160 | + )); | |
| 161 | + String createUser = result.getCreateUser(); | |
| 162 | + if (StringUtils.isNotEmpty(createUser)) { | |
| 163 | + Users users = usersService.getUsers(Integer.parseInt(createUser)); | |
| 164 | + if (users != null) { | |
| 165 | + result.setCreateUserStr(users.getName()); | |
| 166 | + } | |
| 167 | + } | |
| 168 | + String hospitalId = result.getHospitalId(); | |
| 169 | + if (StringUtils.isNotEmpty(hospitalId)) { | |
| 170 | + Organization organization = organizationService.getOrganization(Integer.parseInt(hospitalId)); | |
| 171 | + if (organization != null) { | |
| 172 | + result.setHospitalStr(organization.getName()); | |
| 173 | + } | |
| 174 | + } | |
| 175 | + } | |
| 176 | + | |
| 127 | 177 | /** |
| 128 | 178 | * 单个查询 |
| 129 | 179 | * |
| 130 | 180 | |
| 131 | 181 | |
| 132 | 182 | |
| 133 | 183 | |
| 134 | 184 | |
| ... | ... | @@ -169,21 +219,28 @@ |
| 169 | 219 | String provinceId = model.getProvinceId(); |
| 170 | 220 | // 省市区 |
| 171 | 221 | result.setProvinceId(provinceId); |
| 172 | - result.setProvinceStr(CommonsHelper.getName1(provinceId, basicConfigService)); | |
| 173 | 222 | String cityId = model.getCityId(); |
| 174 | 223 | result.setCityId(cityId); |
| 175 | - result.setCityStr(CommonsHelper.getName1(cityId, basicConfigService)); | |
| 176 | 224 | String areaId = model.getAreaId(); |
| 177 | 225 | result.setAreaId(areaId); |
| 178 | - result.setAreaStr(CommonsHelper.getName1(areaId, basicConfigService)); | |
| 179 | 226 | String streetId = model.getStreetId(); |
| 180 | 227 | result.setStreetId(streetId); |
| 181 | - result.setStreetStr(CommonsHelper.getName1(streetId, basicConfigService)); | |
| 228 | + result.setAddress(model.getAddress()); | |
| 182 | 229 | |
| 230 | + result.setAddressStr(CommonsHelper.getResidence( | |
| 231 | + result.getProvinceId(), | |
| 232 | + result.getCityId(), | |
| 233 | + result.getAreaId(), | |
| 234 | + result.getStreetId(), | |
| 235 | + null, | |
| 236 | + basicConfigService | |
| 237 | + )); | |
| 238 | + | |
| 183 | 239 | result.setLastMenstrual(model.getMcyj()); |
| 184 | 240 | result.setName(model.getUsername()); |
| 185 | 241 | result.setAge(model.getAge()); |
| 186 | 242 | result.setPhone(model.getPhone()); |
| 243 | + result.setParentId(model.getId()); | |
| 187 | 244 | result.setIdCardNo(model.getCertificateNum()); |
| 188 | 245 | BaseResponse baseResponse = new BaseResponse(); |
| 189 | 246 | baseResponse.setObject(result); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/session/SessionProvider.java
View file @
6997d82
| 1 | 1 | package com.lyms.platform.operate.web.session; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.base.LoginContext; |
| 4 | +import com.lyms.platform.common.utils.DateUtil; | |
| 5 | +import com.lyms.platform.common.utils.LymsEncodeUtil; | |
| 4 | 6 | import com.lyms.platform.operate.web.session.strategy.ISessionProvider; |
| 7 | +import org.apache.commons.lang.StringUtils; | |
| 8 | +import org.springframework.beans.factory.annotation.Value; | |
| 5 | 9 | |
| 6 | 10 | import javax.servlet.http.HttpServletRequest; |
| 7 | 11 | import javax.servlet.http.HttpServletResponse; |
| 12 | +import java.util.Date; | |
| 8 | 13 | import java.util.Map; |
| 9 | 14 | |
| 10 | 15 | /** |
| ... | ... | @@ -14,6 +19,12 @@ |
| 14 | 19 | * Created by Administrator on 2016/6/2 0002. |
| 15 | 20 | */ |
| 16 | 21 | public class SessionProvider implements ISessionProvider { |
| 22 | + | |
| 23 | + | |
| 24 | + @Value("#{configProperties['login.licence']}") | |
| 25 | + private String licence; | |
| 26 | + | |
| 27 | + | |
| 17 | 28 | /** |
| 18 | 29 | * 配置 |
| 19 | 30 | */ |
| ... | ... | @@ -52,6 +63,23 @@ |
| 52 | 63 | } |
| 53 | 64 | |
| 54 | 65 | @Override |
| 66 | + public boolean checkLicence() { | |
| 67 | + if (StringUtils.isNotEmpty(licence)) | |
| 68 | + { | |
| 69 | + try { | |
| 70 | + String content = LymsEncodeUtil.aesDecrypt(licence, key); | |
| 71 | + if (StringUtils.isNotEmpty(content)) | |
| 72 | + { | |
| 73 | + Date time = DateUtil.parseYMD(content); | |
| 74 | + return time.getTime() > new Date().getTime(); | |
| 75 | + } | |
| 76 | + } catch (Exception e) { | |
| 77 | + } | |
| 78 | + } | |
| 79 | + return true; | |
| 80 | + } | |
| 81 | + | |
| 82 | + @Override | |
| 55 | 83 | public LoginContext checkSession(HttpServletRequest request, HttpServletResponse response, String token) { |
| 56 | 84 | ISessionProvider iSessionProvider = iSessionProviderMap.get(currentStrateger); |
| 57 | 85 | if (null != iSessionProvider) { |
| ... | ... | @@ -76,6 +104,14 @@ |
| 76 | 104 | |
| 77 | 105 | @Override |
| 78 | 106 | public LoginContext login(String account, String password, String code) { |
| 107 | + | |
| 108 | + if (!checkLicence()) | |
| 109 | + { | |
| 110 | + LoginContext loginContext = new LoginContext(); | |
| 111 | + loginContext.setErrormsg(" License expired!"); | |
| 112 | + return loginContext; | |
| 113 | + } | |
| 114 | + | |
| 79 | 115 | ISessionProvider iSessionProvider = iSessionProviderMap.get(currentStrateger); |
| 80 | 116 | if (null != iSessionProvider) { |
| 81 | 117 | return iSessionProvider.login(account, password, code); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/session/strategy/ISessionProvider.java
View file @
6997d82
platform-operate-api/src/main/java/com/lyms/platform/operate/web/session/strategy/LocalCacheSessionStrategy.java
View file @
6997d82
| ... | ... | @@ -7,6 +7,8 @@ |
| 7 | 7 | import com.lyms.platform.common.enums.YnEnums; |
| 8 | 8 | import com.lyms.platform.common.exception.BusinessException; |
| 9 | 9 | import com.lyms.platform.common.exception.TokenException; |
| 10 | +import com.lyms.platform.common.utils.DateUtil; | |
| 11 | +import com.lyms.platform.common.utils.LymsEncodeUtil; | |
| 10 | 12 | import com.lyms.platform.common.utils.MD5Utils; |
| 11 | 13 | import com.lyms.platform.common.utils.TokenUtils; |
| 12 | 14 | import com.lyms.platform.permission.model.Users; |
| 13 | 15 | |
| ... | ... | @@ -15,9 +17,11 @@ |
| 15 | 17 | import org.apache.commons.collections.CollectionUtils; |
| 16 | 18 | import org.apache.commons.lang.StringUtils; |
| 17 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| 20 | +import org.springframework.beans.factory.annotation.Value; | |
| 18 | 21 | |
| 19 | 22 | import javax.servlet.http.HttpServletRequest; |
| 20 | 23 | import javax.servlet.http.HttpServletResponse; |
| 24 | +import java.util.Date; | |
| 21 | 25 | import java.util.List; |
| 22 | 26 | import java.util.Map; |
| 23 | 27 | import java.util.UUID; |
| ... | ... | @@ -40,6 +44,11 @@ |
| 40 | 44 | public static Cache<String, LoginContext> cache = CacheBuilder.newBuilder() |
| 41 | 45 | .expireAfterAccess(6, TimeUnit.HOURS) |
| 42 | 46 | .build(); |
| 47 | + | |
| 48 | + @Override | |
| 49 | + public boolean checkLicence() { | |
| 50 | + return true; | |
| 51 | + } | |
| 43 | 52 | |
| 44 | 53 | @Override |
| 45 | 54 | public LoginContext checkSession(HttpServletRequest request, HttpServletResponse response, String token) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/session/strategy/UserCenterStrategy.java
View file @
6997d82
| ... | ... | @@ -2,7 +2,9 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.base.LoginContext; |
| 4 | 4 | import com.lyms.platform.common.exception.TokenException; |
| 5 | +import com.lyms.platform.common.utils.DateUtil; | |
| 5 | 6 | import com.lyms.platform.common.utils.LoginUtil; |
| 7 | +import com.lyms.platform.common.utils.LymsEncodeUtil; | |
| 6 | 8 | import com.lyms.platform.permission.model.Users; |
| 7 | 9 | import com.lyms.platform.permission.service.UsersService; |
| 8 | 10 | import org.apache.commons.lang.StringUtils; |
| ... | ... | @@ -11,6 +13,7 @@ |
| 11 | 13 | |
| 12 | 14 | import javax.servlet.http.HttpServletRequest; |
| 13 | 15 | import javax.servlet.http.HttpServletResponse; |
| 16 | +import java.util.Date; | |
| 14 | 17 | |
| 15 | 18 | /** |
| 16 | 19 | * 基于用户中心的登录策略 |
| ... | ... | @@ -25,6 +28,11 @@ |
| 25 | 28 | private String token; |
| 26 | 29 | @Value("#{configProperties['login.typeId']}") |
| 27 | 30 | private String typeId; |
| 31 | + @Override | |
| 32 | + public boolean checkLicence() { | |
| 33 | + return true; | |
| 34 | + } | |
| 35 | + | |
| 28 | 36 | @Override |
| 29 | 37 | public LoginContext checkSession(HttpServletRequest request, HttpServletResponse response,String token) { |
| 30 | 38 | LoginContext loginContext = LoginUtil.checkLoginState(token); |