Commit 03a9ab50643d8060aa9f893cc14b2ff21b71955f

Authored by hujiaqi
1 parent 33fff8193c
Exists in master

bug

Showing 4 changed files with 84 additions and 43 deletions

platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java View file @ 03a9ab5
... ... @@ -228,7 +228,24 @@
228 228 }
229 229 }
230 230  
  231 + public static Date parseYMDEnd(String s) {
  232 + if (s == null) {
  233 + return null;
  234 + }
231 235  
  236 + try {
  237 + lock.lock();
  238 + Date d = y_m_d.parse(s);
  239 + long resultMis = d.getTime() + (1000 * 60 * 60 * 24 - 1);
  240 + return new Date(resultMis);
  241 + } catch (Exception e) {
  242 + return null;
  243 + } finally {
  244 + lock.unlock();
  245 + }
  246 + }
  247 +
  248 +
232 249 public static Date parseMD(String s) {
233 250 if (s == null) {
234 251 return null;
235 252  
... ... @@ -864,10 +881,10 @@
864 881 /**
865 882 * @auther HuJiaqi
866 883 * @createTime 2016年12月13日 17时10分
867   - * @discription 格式化传入时间的方法,这个方法很苛刻,必须前后都传了值,而且是2016-12-15+-+2016-12-25格式
  884 + * @discription 格式化传入时间的方法,注意这里是获取的前面时间的00和后面时间的59,这个方法很苛刻,必须前后都传了值,而且是2016-12-15+-+2016-12-25格式
868 885 */
869 886 public static Date[] getSNDate(String snDateString) {
870   - return new Date[]{parseYMD(snDateString.substring(0, 10)), parseYMD(snDateString.substring(13, 23))};
  887 + return new Date[]{parseYMD(snDateString.substring(0, 10)), parseYMDEnd(snDateString.substring(13, 23))};
871 888 }
872 889  
873 890 }
platform-common/src/main/java/com/lyms/platform/common/utils/DefenceUtils.java View file @ 03a9ab5
  1 +package com.lyms.platform.common.utils;
  2 +
  3 +/**
  4 + * @auther HuJiaqi
  5 + * @createTime 2016年12月26日 14时24分
  6 + * @discription
  7 + */
  8 +public class DefenceUtils {
  9 +
  10 + /**
  11 + * @auther HuJiaqi
  12 + * @createTime 2016年12月26日 14时25分
  13 + * @discription 加密手机号:17381968107:173****8107
  14 + */
  15 + public static String getPhone(String phone) {
  16 + if (org.apache.commons.lang.StringUtils.isEmpty(phone)) {
  17 + return "";
  18 + }
  19 + if (phone.length() == 11) {
  20 + return phone.substring(0, 3) + "****" + phone.substring(7);
  21 + }
  22 + return "";
  23 + }
  24 +
  25 + /**
  26 + * @auther HuJiaqi
  27 + * @createTime 2016年12月26日 14时28分
  28 + * @discription 加密身份证号,屏蔽出生年月及后四位中的中间两位(王平规则)
  29 + */
  30 + public static String getId(String id) {
  31 + if (org.apache.commons.lang.StringUtils.isEmpty(id)) {
  32 + return "";
  33 + }
  34 + if (id.length() == 15) {
  35 + return id.substring(0, 6) + "****" + id.substring(10, 13) + "*" + id.substring(14);
  36 + }
  37 + if (id.length() == 18) {
  38 + return id.substring(0, 6) + "******" + id.substring(12, 15) + "**" + id.substring(17);
  39 + }
  40 + return "";
  41 + }
  42 +
  43 +}
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java View file @ 03a9ab5
... ... @@ -190,9 +190,6 @@
190 190 //查询号
191 191 private String queryNo;
192 192  
193   - //另一个查询号
194   - private String queryNo1;
195   -
196 193 public String getQueryNo() {
197 194 return queryNo;
198 195 }
... ... @@ -201,14 +198,6 @@
201 198 this.queryNo = queryNo;
202 199 }
203 200  
204   - public String getQueryNo1() {
205   - return queryNo1;
206   - }
207   -
208   - public void setQueryNo1(String queryNo1) {
209   - this.queryNo1 = queryNo1;
210   - }
211   -
212 201 public Integer getPostViewTimes() {
213 202 return postViewTimes;
214 203 }
... ... @@ -383,7 +372,8 @@
383 372 // 分娩相关信息
384 373 // 分娩医院
385 374 private String fmHospital;
386   - private List<String> fmHospitalList;
  375 + // 这个是分娩医院+建档医院的综合查询
  376 + private List<String> fmHospitalQueryList;
387 377 // 分娩年龄
388 378 private Integer fmAgeStart;
389 379 private Integer fmAgeEnd;
390 380  
... ... @@ -972,12 +962,11 @@
972 962 c1= c.orCondition(new MongoCondition[]{con1, con2, con3,con4}).getCriteria();
973 963 }
974 964  
975   - if (org.apache.commons.lang.StringUtils.isNotEmpty(queryNo1)) {
  965 + if (CollectionUtils.isNotEmpty(fmHospitalQueryList)) {
976 966 MongoCondition c = MongoCondition.newInstance();
977   - MongoCondition con1 = MongoCondition.newInstance("phone", queryNo1, MongoOper.IS);
978   - MongoCondition con2 = MongoCondition.newInstance("username", queryNo1, MongoOper.IS);
979   - MongoCondition con3 = MongoCondition.newInstance("cardNo", queryNo1, MongoOper.IS);
980   - c1= c.orCondition(new MongoCondition[]{con1, con2, con3}).getCriteria();
  967 + MongoCondition con1 = MongoCondition.newInstance("hospitalId", fmHospitalQueryList, MongoOper.IN);
  968 + MongoCondition con2 = MongoCondition.newInstance("fmHospital", fmHospitalQueryList, MongoOper.IN);
  969 + c1= c.orCondition(new MongoCondition[]{con1, con2}).getCriteria();
981 970 }
982 971  
983 972 if (lastCheckEmployeeId != null) {
... ... @@ -1236,10 +1225,6 @@
1236 1225 condition = condition.and("fmHospital", fmHospital, MongoOper.IS);
1237 1226 }
1238 1227  
1239   - if (null != fmHospitalList) {
1240   - condition = condition.and("fmHospital", fmHospitalList, MongoOper.IN);
1241   - }
1242   -
1243 1228 if (null != fmType) {
1244 1229 condition = condition.and("fmType", fmType, MongoOper.LIKE);
1245 1230 }
... ... @@ -1251,15 +1236,6 @@
1251 1236  
1252 1237 return condition.toMongoQuery();
1253 1238 }
1254   -
1255   - public List<String> getFmHospitalList() {
1256   - return fmHospitalList;
1257   - }
1258   -
1259   - public void setFmHospitalList(List<String> fmHospitalList) {
1260   - this.fmHospitalList = fmHospitalList;
1261   - }
1262   -
1263 1239 public Integer gethScoreEnd() {
1264 1240 return hScoreEnd;
1265 1241 }
... ... @@ -1314,6 +1290,14 @@
1314 1290  
1315 1291 public void setBookbuildingDoctorList(List<String> bookbuildingDoctorList) {
1316 1292 this.bookbuildingDoctorList = bookbuildingDoctorList;
  1293 + }
  1294 +
  1295 + public List<String> getFmHospitalQueryList() {
  1296 + return fmHospitalQueryList;
  1297 + }
  1298 +
  1299 + public void setFmHospitalQueryList(List<String> fmHospitalQueryList) {
  1300 + this.fmHospitalQueryList = fmHospitalQueryList;
1317 1301 }
1318 1302 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ 03a9ab5
... ... @@ -1017,7 +1017,7 @@
1017 1017 patientsQuery.setAreaId(StringUtils.isEmpty(childbirthManagerRequest.getLivingAreaId()) ? null : childbirthManagerRequest.getLivingAreaId());
1018 1018 patientsQuery.setHusbandPhone(StringUtils.isEmpty(childbirthManagerRequest.getHusbandPhone()) ? null : childbirthManagerRequest.getHusbandPhone());
1019 1019 patientsQuery.setQueryNo(StringUtils.isEmpty(childbirthManagerRequest.getQueryNo()) ? null : childbirthManagerRequest.getQueryNo());
1020   - patientsQuery.setFmHospitalList(hospitalList);
  1020 + patientsQuery.setFmHospitalQueryList(hospitalList);
1021 1021 String deliveryModeQueryJson = "fmfs\\\":\\\"" + childbirthManagerRequest.getDeliveryMode();
1022 1022 patientsQuery.setFmType(StringUtils.isEmpty(childbirthManagerRequest.getDeliveryMode()) ? null : deliveryModeQueryJson);
1023 1023 patientsQuery.setFmAgeStart(StringUtils.isEmpty(childbirthManagerRequest.getStartAge()) ? null : Integer.valueOf(childbirthManagerRequest.getStartAge()));
... ... @@ -1065,8 +1065,8 @@
1065 1065 // 居住地
1066 1066 childbirthManagerQueryModel.setAddress(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService));
1067 1067 // 电话转换
1068   - childbirthManagerQueryModel.setPhone(StringUtils.isEmpty(patients.getPhone()) ? "" : patients.getPhone().substring(0, 3) + "****" + patients.getPhone().substring(7));
1069   - childbirthManagerQueryModel.setHusbandPhone(StringUtils.isEmpty(patients.getHusbandPhone()) ? "" : patients.getHusbandPhone().substring(0, 3) + "****" + patients.getHusbandPhone().substring(7));
  1068 + childbirthManagerQueryModel.setPhone(DefenceUtils.getPhone(patients.getPhone()));
  1069 + childbirthManagerQueryModel.setHusbandPhone(DefenceUtils.getPhone(patients.getHusbandPhone()));
1070 1070 // 查询分娩方式
1071 1071 String deliveryModeJson = maternalDeliverModel.getDeliveryMode();
1072 1072 Map<String, String> deliveryModeMap = JsonUtil.getMap(deliveryModeJson);
1073 1073  
1074 1074  
1075 1075  
... ... @@ -1100,16 +1100,13 @@
1100 1100 BabyModelQuery babyModelQuery = new BabyModelQuery();
1101 1101 babyModelQuery.setYn(YnEnums.YES.getId());
1102 1102 babyModelQuery.setParentId(patients.getId());
  1103 + babyModelQuery.setPregnancyOut(RenShenJieJuEnums.O.getId());
1103 1104 List<BabyModel> babyModelList = babyService.queryBabyWithQuery(babyModelQuery);
1104   - int i = 0;
1105 1105 if (CollectionUtils.isNotEmpty(babyModelList)) {
1106   - for (BabyModel babyModel : babyModelList) {
1107   - if (RenShenJieJuEnums.O.getId().equals(babyModel.getPregnancyOut())) {
1108   - i++;
1109   - }
1110   - }
  1106 + childbirthManagerQueryModel.setLivingNumber(babyModelList.size());
  1107 + }else{
  1108 + childbirthManagerQueryModel.setLivingNumber(0);
1111 1109 }
1112   - childbirthManagerQueryModel.setLivingNumber(i);
1113 1110  
1114 1111 // 开始拼装自定义查询结果
1115 1112 // 胎方位,胎心率,胎先露
... ... @@ -1328,7 +1325,7 @@
1328 1325 newBabyManagerQueryModel.setAge(DateUtil.getAge(babyModel.getMbirth()));
1329 1326 newBabyManagerQueryModel.setBirthYMD(DateUtil.getyyyy_MM_dd(babyModel.getBirth()));
1330 1327 newBabyManagerQueryModel.setBirthHM(new SimpleDateFormat("HH:mm").format(babyModel.getBirth()));
1331   - newBabyManagerQueryModel.setMphone(StringUtils.isEmpty(babyModel.getMphone()) ? "" : babyModel.getMphone().substring(0, 3) + "****" + babyModel.getMphone().substring(7));
  1328 + newBabyManagerQueryModel.setMphone(DefenceUtils.getPhone(babyModel.getMphone()));
1332 1329 newBabyManagerQueryModel.setBirthDays(DateUtil.getDays(babyModel.getBirth(), new Date()));
1333 1330 newBabyManagerQueryModel.setBabyId(babyModel.getId());
1334 1331 newBabyManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModel.getDeliverDoctor())).getName());