diff --git a/platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java b/platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java index 6db064a..e09f333 100644 --- a/platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java +++ b/platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java @@ -228,6 +228,23 @@ public class DateUtil { } } + public static Date parseYMDEnd(String s) { + if (s == null) { + return null; + } + + try { + lock.lock(); + Date d = y_m_d.parse(s); + long resultMis = d.getTime() + (1000 * 60 * 60 * 24 - 1); + return new Date(resultMis); + } catch (Exception e) { + return null; + } finally { + lock.unlock(); + } + } + public static Date parseMD(String s) { if (s == null) { @@ -864,10 +881,10 @@ public class DateUtil { /** * @auther HuJiaqi * @createTime 2016年12月13日 17时10分 - * @discription 格式化传入时间的方法,这个方法很苛刻,必须前后都传了值,而且是2016-12-15+-+2016-12-25格式 + * @discription 格式化传入时间的方法,注意这里是获取的前面时间的00和后面时间的59,这个方法很苛刻,必须前后都传了值,而且是2016-12-15+-+2016-12-25格式 */ public static Date[] getSNDate(String snDateString) { - return new Date[]{parseYMD(snDateString.substring(0, 10)), parseYMD(snDateString.substring(13, 23))}; + return new Date[]{parseYMD(snDateString.substring(0, 10)), parseYMDEnd(snDateString.substring(13, 23))}; } } diff --git a/platform-common/src/main/java/com/lyms/platform/common/utils/DefenceUtils.java b/platform-common/src/main/java/com/lyms/platform/common/utils/DefenceUtils.java new file mode 100644 index 0000000..3f40a47 --- /dev/null +++ b/platform-common/src/main/java/com/lyms/platform/common/utils/DefenceUtils.java @@ -0,0 +1,43 @@ +package com.lyms.platform.common.utils; + +/** + * @auther HuJiaqi + * @createTime 2016年12月26日 14时24分 + * @discription + */ +public class DefenceUtils { + + /** + * @auther HuJiaqi + * @createTime 2016年12月26日 14时25分 + * @discription 加密手机号:17381968107:173****8107 + */ + public static String getPhone(String phone) { + if (org.apache.commons.lang.StringUtils.isEmpty(phone)) { + return ""; + } + if (phone.length() == 11) { + return phone.substring(0, 3) + "****" + phone.substring(7); + } + return ""; + } + + /** + * @auther HuJiaqi + * @createTime 2016年12月26日 14时28分 + * @discription 加密身份证号,屏蔽出生年月及后四位中的中间两位(王平规则) + */ + public static String getId(String id) { + if (org.apache.commons.lang.StringUtils.isEmpty(id)) { + return ""; + } + if (id.length() == 15) { + return id.substring(0, 6) + "****" + id.substring(10, 13) + "*" + id.substring(14); + } + if (id.length() == 18) { + return id.substring(0, 6) + "******" + id.substring(12, 15) + "**" + id.substring(17); + } + return ""; + } + +} diff --git a/platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java b/platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java index 965a8a3..3e5e28e 100644 --- a/platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java +++ b/platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java @@ -190,9 +190,6 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { //查询号 private String queryNo; - //另一个查询号 - private String queryNo1; - public String getQueryNo() { return queryNo; } @@ -201,14 +198,6 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { this.queryNo = queryNo; } - public String getQueryNo1() { - return queryNo1; - } - - public void setQueryNo1(String queryNo1) { - this.queryNo1 = queryNo1; - } - public Integer getPostViewTimes() { return postViewTimes; } @@ -383,7 +372,8 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { // 分娩相关信息 // 分娩医院 private String fmHospital; - private List fmHospitalList; + // 这个是分娩医院+建档医院的综合查询 + private List fmHospitalQueryList; // 分娩年龄 private Integer fmAgeStart; private Integer fmAgeEnd; @@ -972,12 +962,11 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { c1= c.orCondition(new MongoCondition[]{con1, con2, con3,con4}).getCriteria(); } - if (org.apache.commons.lang.StringUtils.isNotEmpty(queryNo1)) { + if (CollectionUtils.isNotEmpty(fmHospitalQueryList)) { MongoCondition c = MongoCondition.newInstance(); - MongoCondition con1 = MongoCondition.newInstance("phone", queryNo1, MongoOper.IS); - MongoCondition con2 = MongoCondition.newInstance("username", queryNo1, MongoOper.IS); - MongoCondition con3 = MongoCondition.newInstance("cardNo", queryNo1, MongoOper.IS); - c1= c.orCondition(new MongoCondition[]{con1, con2, con3}).getCriteria(); + MongoCondition con1 = MongoCondition.newInstance("hospitalId", fmHospitalQueryList, MongoOper.IN); + MongoCondition con2 = MongoCondition.newInstance("fmHospital", fmHospitalQueryList, MongoOper.IN); + c1= c.orCondition(new MongoCondition[]{con1, con2}).getCriteria(); } if (lastCheckEmployeeId != null) { @@ -1236,10 +1225,6 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { condition = condition.and("fmHospital", fmHospital, MongoOper.IS); } - if (null != fmHospitalList) { - condition = condition.and("fmHospital", fmHospitalList, MongoOper.IN); - } - if (null != fmType) { condition = condition.and("fmType", fmType, MongoOper.LIKE); } @@ -1251,15 +1236,6 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { return condition.toMongoQuery(); } - - public List getFmHospitalList() { - return fmHospitalList; - } - - public void setFmHospitalList(List fmHospitalList) { - this.fmHospitalList = fmHospitalList; - } - public Integer gethScoreEnd() { return hScoreEnd; } @@ -1315,4 +1291,12 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { public void setBookbuildingDoctorList(List bookbuildingDoctorList) { this.bookbuildingDoctorList = bookbuildingDoctorList; } + + public List getFmHospitalQueryList() { + return fmHospitalQueryList; + } + + public void setFmHospitalQueryList(List fmHospitalQueryList) { + this.fmHospitalQueryList = fmHospitalQueryList; + } } \ No newline at end of file diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java index 32f8e52..b587618 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java @@ -1017,7 +1017,7 @@ public class MatDeliverFacade { patientsQuery.setAreaId(StringUtils.isEmpty(childbirthManagerRequest.getLivingAreaId()) ? null : childbirthManagerRequest.getLivingAreaId()); patientsQuery.setHusbandPhone(StringUtils.isEmpty(childbirthManagerRequest.getHusbandPhone()) ? null : childbirthManagerRequest.getHusbandPhone()); patientsQuery.setQueryNo(StringUtils.isEmpty(childbirthManagerRequest.getQueryNo()) ? null : childbirthManagerRequest.getQueryNo()); - patientsQuery.setFmHospitalList(hospitalList); + patientsQuery.setFmHospitalQueryList(hospitalList); String deliveryModeQueryJson = "fmfs\\\":\\\"" + childbirthManagerRequest.getDeliveryMode(); patientsQuery.setFmType(StringUtils.isEmpty(childbirthManagerRequest.getDeliveryMode()) ? null : deliveryModeQueryJson); patientsQuery.setFmAgeStart(StringUtils.isEmpty(childbirthManagerRequest.getStartAge()) ? null : Integer.valueOf(childbirthManagerRequest.getStartAge())); @@ -1065,8 +1065,8 @@ public class MatDeliverFacade { // 居住地 childbirthManagerQueryModel.setAddress(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); // 电话转换 - childbirthManagerQueryModel.setPhone(StringUtils.isEmpty(patients.getPhone()) ? "" : patients.getPhone().substring(0, 3) + "****" + patients.getPhone().substring(7)); - childbirthManagerQueryModel.setHusbandPhone(StringUtils.isEmpty(patients.getHusbandPhone()) ? "" : patients.getHusbandPhone().substring(0, 3) + "****" + patients.getHusbandPhone().substring(7)); + childbirthManagerQueryModel.setPhone(DefenceUtils.getPhone(patients.getPhone())); + childbirthManagerQueryModel.setHusbandPhone(DefenceUtils.getPhone(patients.getHusbandPhone())); // 查询分娩方式 String deliveryModeJson = maternalDeliverModel.getDeliveryMode(); Map deliveryModeMap = JsonUtil.getMap(deliveryModeJson); @@ -1100,16 +1100,13 @@ public class MatDeliverFacade { BabyModelQuery babyModelQuery = new BabyModelQuery(); babyModelQuery.setYn(YnEnums.YES.getId()); babyModelQuery.setParentId(patients.getId()); + babyModelQuery.setPregnancyOut(RenShenJieJuEnums.O.getId()); List babyModelList = babyService.queryBabyWithQuery(babyModelQuery); - int i = 0; if (CollectionUtils.isNotEmpty(babyModelList)) { - for (BabyModel babyModel : babyModelList) { - if (RenShenJieJuEnums.O.getId().equals(babyModel.getPregnancyOut())) { - i++; - } - } + childbirthManagerQueryModel.setLivingNumber(babyModelList.size()); + }else{ + childbirthManagerQueryModel.setLivingNumber(0); } - childbirthManagerQueryModel.setLivingNumber(i); // 开始拼装自定义查询结果 // 胎方位,胎心率,胎先露 @@ -1328,7 +1325,7 @@ public class MatDeliverFacade { newBabyManagerQueryModel.setAge(DateUtil.getAge(babyModel.getMbirth())); newBabyManagerQueryModel.setBirthYMD(DateUtil.getyyyy_MM_dd(babyModel.getBirth())); newBabyManagerQueryModel.setBirthHM(new SimpleDateFormat("HH:mm").format(babyModel.getBirth())); - newBabyManagerQueryModel.setMphone(StringUtils.isEmpty(babyModel.getMphone()) ? "" : babyModel.getMphone().substring(0, 3) + "****" + babyModel.getMphone().substring(7)); + newBabyManagerQueryModel.setMphone(DefenceUtils.getPhone(babyModel.getMphone())); newBabyManagerQueryModel.setBirthDays(DateUtil.getDays(babyModel.getBirth(), new Date())); newBabyManagerQueryModel.setBabyId(babyModel.getId()); newBabyManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModel.getDeliverDoctor())).getName());