From 32480a181fe52c79729fca70eabc268ff5bde238 Mon Sep 17 00:00:00 2001 From: hujiaqi Date: Thu, 22 Dec 2016 10:49:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E5=88=86=E5=A8=A9=E3=80=81?= =?UTF-8?q?=E8=B7=91=E5=88=86=E5=A8=A9=E6=95=B0=E6=8D=AE=E5=88=B0patient?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/lyms/platform/pojo/Patients.java | 53 ++++- .../com/lyms/platform/query/MatDeliverQuery.java | 12 + .../com/lyms/platform/query/PatientsQuery.java | 116 ++++++++++ .../operate/web/controller/TestController.java | 83 ++++++- .../operate/web/facade/MatDeliverFacade.java | 162 +++++++++---- .../web/request/ChildbirthManagerRequest.java | 256 ++++++++++++++++++++- 6 files changed, 609 insertions(+), 73 deletions(-) diff --git a/platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java b/platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java index aeb5649..0ed9f61 100644 --- a/platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java +++ b/platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java @@ -1,15 +1,14 @@ package com.lyms.platform.pojo; -import java.util.Date; -import java.util.List; -import java.util.Objects; - import com.lyms.platform.beans.SerialIdEnum; +import com.lyms.platform.common.result.BaseModel; +import com.lyms.platform.common.utils.DateUtil; import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Field; -import com.lyms.platform.common.result.BaseModel; -import com.lyms.platform.common.utils.DateUtil; +import java.util.Date; +import java.util.List; +import java.util.Objects; @Document(collection="lyms_patient") @@ -236,6 +235,48 @@ public class Patients extends BaseModel { //操作人 private Integer operator; + // 分娩相关信息 + // 分娩医院 + private String fmHospital; + // 分娩年龄 + private Integer fmAge; + // 分娩孕周 + private Integer fmWeek; + // 分娩方式 + private String fmType; + + public String getFmHospital() { + return fmHospital; + } + + public void setFmHospital(String fmHospital) { + this.fmHospital = fmHospital; + } + + public Integer getFmAge() { + return fmAge; + } + + public void setFmAge(Integer fmAge) { + this.fmAge = fmAge; + } + + public Integer getFmWeek() { + return fmWeek; + } + + public void setFmWeek(Integer fmWeek) { + this.fmWeek = fmWeek; + } + + public String getFmType() { + return fmType; + } + + public void setFmType(String fmType) { + this.fmType = fmType; + } + public String getSource() { return source; } diff --git a/platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java b/platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java index 6aac5c7..f234f08 100644 --- a/platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java +++ b/platform-dal/src/main/java/com/lyms/platform/query/MatDeliverQuery.java @@ -32,6 +32,15 @@ public class MatDeliverQuery extends BaseQuery implements IConvertToNativeQuery private boolean neEnd; private String deliveryModeQueryJson; + private String fmHospital; + + public String getFmHospital() { + return fmHospital; + } + + public void setFmHospital(String fmHospital) { + this.fmHospital = fmHospital; + } public boolean isNeEnd() { return neEnd; @@ -129,6 +138,9 @@ public class MatDeliverQuery extends BaseQuery implements IConvertToNativeQuery if (null != hospitalId) { condition = condition.and("hospitalId", hospitalId, MongoOper.IS); } + if (null != fmHospital) { + condition = condition.and("fmHospital", fmHospital, MongoOper.IS); + } if (null != deliveryModeQueryJson) { condition = condition.and("deliveryMode", deliveryModeQueryJson, MongoOper.LIKE); } 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 3303596..61ce10a 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 @@ -371,6 +371,19 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { //档案编号 private String fileCode; + // 分娩相关信息 + // 分娩医院 + private String fmHospital; + private List fmHospitalList; + // 分娩年龄 + private Integer fmAgeStart; + private Integer fmAgeEnd; + // 分娩孕周 + private Integer fmWeekStart; + private Integer fmWeekEnd; + // 分娩方式 + private String fmType; + public String getFileCode() { return fileCode; @@ -741,6 +754,54 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { this.phone = phone; } + public String getFmHospital() { + return fmHospital; + } + + public void setFmHospital(String fmHospital) { + this.fmHospital = fmHospital; + } + + public Integer getFmAgeStart() { + return fmAgeStart; + } + + public void setFmAgeStart(Integer fmAgeStart) { + this.fmAgeStart = fmAgeStart; + } + + public Integer getFmAgeEnd() { + return fmAgeEnd; + } + + public void setFmAgeEnd(Integer fmAgeEnd) { + this.fmAgeEnd = fmAgeEnd; + } + + public Integer getFmWeekStart() { + return fmWeekStart; + } + + public void setFmWeekStart(Integer fmWeekStart) { + this.fmWeekStart = fmWeekStart; + } + + public Integer getFmWeekEnd() { + return fmWeekEnd; + } + + public void setFmWeekEnd(Integer fmWeekEnd) { + this.fmWeekEnd = fmWeekEnd; + } + + public String getFmType() { + return fmType; + } + + public void setFmType(String fmType) { + this.fmType = fmType; + } + public String getAddress() { return address; } @@ -840,6 +901,8 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { condition = condition.and("areaRegisterId", areaRegisterId, MongoOper.IS); } + // 分娩信息 + /* //户籍地 private String provinceRegisterId; @@ -1121,6 +1184,51 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { c1 = Criteria.where("birth").lte(birthEnd); } } + + if (null != fmAgeStart) { + if (null != c1) { + c1 = c1.and("fmAge").gte(fmAgeStart); + } else { + c1 = Criteria.where("fmAge").gte(fmAgeStart); + } + } + + if (null != fmAgeEnd) { + if (null != fmAgeStart) { + c1 = c1.lte(fmAgeEnd); + } else { + c1 = Criteria.where("fmAge").lte(fmAgeEnd); + } + } + + if (null != fmWeekStart) { + if (null != c1) { + c1 = c1.and("fmWeek").gte(fmWeekStart); + } else { + c1 = Criteria.where("fmWeek").gte(fmWeekStart); + } + } + + if (null != fmWeekEnd) { + if (null != fmWeekStart) { + c1 = c1.lte(fmWeekEnd); + } else { + c1 = Criteria.where("fmWeek").lte(fmWeekEnd); + } + } + + if (null != fmHospital) { + 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); + } + if (null != c1) { condition = condition.andCondition(new MongoCondition(c1)); @@ -1129,6 +1237,14 @@ 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; } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java index 68465d0..217fb2d 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java @@ -1,10 +1,7 @@ package com.lyms.platform.operate.web.controller; import com.lyms.hospitalapi.qhdfy.QhdfyHisService; -import com.lyms.platform.biz.service.AntenatalExaminationService; -import com.lyms.platform.biz.service.AssayConfigService; -import com.lyms.platform.biz.service.PatientsService; -import com.lyms.platform.biz.service.SieveService; +import com.lyms.platform.biz.service.*; import com.lyms.platform.common.enums.YnEnums; import com.lyms.platform.common.utils.CompressEncodeingUtil; import com.lyms.platform.common.utils.DateUtil; @@ -13,12 +10,10 @@ import com.lyms.platform.operate.web.facade.AntenatalExaminationFacade; import com.lyms.platform.operate.web.result.HighScoreResult; import com.lyms.platform.operate.web.service.SyncDataTaskService; import com.lyms.platform.permission.service.OrganizationService; -import com.lyms.platform.pojo.AntExChuModel; -import com.lyms.platform.pojo.AntenatalExaminationModel; -import com.lyms.platform.pojo.AssayConfig; -import com.lyms.platform.pojo.Patients; +import com.lyms.platform.pojo.*; import com.lyms.platform.query.AntExChuQuery; import com.lyms.platform.query.AntExQuery; +import com.lyms.platform.query.MatDeliverQuery; import com.lyms.platform.query.PatientsQuery; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.io.FileUtils; @@ -67,6 +62,9 @@ public class TestController { @Autowired private AntenatalExaminationFacade antenatalExaminationFacade; + @Autowired + private MatDeliverService matDeliverService; + /** * 获取科室 */ @@ -364,6 +362,11 @@ public class TestController { return "syncPatNextTime finish"; } + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 15时56分 + * @discription 冗余最后一次产检 + */ @ResponseBody @RequestMapping(value = "/syncPatientsLastCheckEmployeeId", method = RequestMethod.GET) public String syncPatientsLastCheckEmployeeId(@RequestParam String hospitalId, @@ -431,6 +434,70 @@ public class TestController { return "syncPatientsLastCheckEmployeeId start......"; } + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 15时56分 + * @discription 冗余分娩分娩医院,分娩年龄,分娩孕周,分娩方式 + */ + @ResponseBody + @RequestMapping(value = "/syncPatientsFmInfo", method = RequestMethod.GET) + public String syncPatientsFmInfo(@RequestParam(required = false) String size,@RequestParam(required = false) String hospitalId) { + MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); + matDeliverQuery.setYn(YnEnums.YES.getId()); + if (StringUtils.isNotEmpty(hospitalId)) { + matDeliverQuery.setFmHospital(hospitalId); + } + // 查询 + List maternalDeliverModelList = matDeliverService.query(matDeliverQuery); + System.out.println("本次读取了【" + maternalDeliverModelList.size() + "】条数据"); + int batchSize = StringUtils.isEmpty(size) ? 1000 : Integer.valueOf(size); + int end = 0; + for (int i = 0; i < maternalDeliverModelList.size(); i += batchSize) { + end = (end + batchSize); + if (end > maternalDeliverModelList.size()) { + end = maternalDeliverModelList.size(); + } + final List tempList = maternalDeliverModelList.subList(i, end); + new Thread(new Runnable() { + @Override + public void run() { + if (CollectionUtils.isNotEmpty(tempList)) { + for (MaternalDeliverModel maternalDeliverModel : tempList) { + Patients patients = patientsService.findOnePatientById(maternalDeliverModel.getParentId()); + if (patients != null) { + // 顺便跑成产妇 + patients.setType(3); + patients.setFmHospital(maternalDeliverModel.getFmHospital()); + patients.setFmType(maternalDeliverModel.getDeliveryMode()); + try { + patients.setFmAge(DateUtil.getAge(patients.getBirth(), patients.getFmDate())); + } catch (Exception e) { + System.out.println(patients.getId() + ":这条数据的生日和分娩时间异常"); + // 跳过 + } + try { + patients.setFmWeek(DateUtil.getDays(patients.getLastMenses(), patients.getFmDate())); + } catch (Exception e) { + System.out.println(patients.getId() + ":这条数据的末日月经和分娩时间异常"); + // 跳过 + } + + System.out.println(patients.getFmHospital()); + System.out.println(patients.getFmType()); + System.out.println(patients.getFmAge()); + System.out.println(patients.getFmWeek()); + System.out.println(patients.toString()); + + patientsService.updatePatient(patients); + } + } + } + } + }).start(); + } + return "syncPatientsLastCheckEmployeeId start......"; + } + @RequestMapping(value = "/initCardNo", method = RequestMethod.GET) @ResponseBody public String initCardNo() { 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 65583a8..0384525 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 @@ -15,6 +15,7 @@ import com.lyms.platform.operate.web.request.MatDeliverQueryRequest; import com.lyms.platform.operate.web.request.NewBabyManagerRequest; import com.lyms.platform.operate.web.result.*; import com.lyms.platform.permission.model.Organization; +import com.lyms.platform.permission.model.OrganizationQuery; import com.lyms.platform.permission.model.Users; import com.lyms.platform.permission.service.OrganizationService; import com.lyms.platform.permission.service.UsersService; @@ -70,6 +71,10 @@ public class MatDeliverFacade { private BabyBookbuildingFacade babyBookbuildingFacade; @Autowired private DeleteProcessHandler deleteProcessHandler; + + @Autowired + private DataPermissionService dataPermissionService; + @Value(("#{configProperties['run.region']}")) private String runType; @@ -914,9 +919,64 @@ public class MatDeliverFacade { patientsQuery.setYn(YnEnums.YES.getId()); patientsQuery.setType(3); - patientsQuery.setHospitalId(autoMatchFacade.getHospitalId(childbirthManagerRequest.getOperatorId())); + // 构造医院id集合 + List hospitalList = new ArrayList<>(); + if (StringUtils.isEmpty(childbirthManagerRequest.getIsArea())) { + // 非区域 + hospitalList.add(autoMatchFacade.getHospitalId(childbirthManagerRequest.getOperatorId())); + } else { + // 区域 + if (StringUtils.isNotEmpty(childbirthManagerRequest.getHospitalId())) { + // 传入了医院id + hospitalList.add(childbirthManagerRequest.getHospitalId()); + } else { + // 没传入医院id + // 先判断是否传入了传条件 + // 未传入查询条件 + if (StringUtils.isEmpty(childbirthManagerRequest.getHospitalProvinceId()) && StringUtils.isEmpty(childbirthManagerRequest.getHospitalProvinceId()) && StringUtils.isEmpty(childbirthManagerRequest.getHospitalAreaId()) && StringUtils.isEmpty(childbirthManagerRequest.getHospitalId())) { + hospitalList.add(autoMatchFacade.getHospitalId(childbirthManagerRequest.getOperatorId())); + DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); + dataPermissionsModelQuery.setUserId(childbirthManagerRequest.getOperatorId()); + List dataPermissionsModelList = dataPermissionService.queryPermission(dataPermissionsModelQuery); + if (CollectionUtils.isNotEmpty(dataPermissionsModelList)) { + Map data = dataPermissionsModelList.get(0).getData(); + for (Object hospitalId : data.keySet()) { + if (StringUtils.isNotEmpty(hospitalId.toString()) && !hospitalList.contains(hospitalId.toString())) { + hospitalList.add(hospitalId.toString()); + } + } + } + } else { + // 传入了查询条件 + OrganizationQuery organizationQuery = new OrganizationQuery(); + organizationQuery.setProvinceId(childbirthManagerRequest.getHospitalProvinceId()); + organizationQuery.setCityId(childbirthManagerRequest.getHospitalCityId()); + organizationQuery.setAreaId(childbirthManagerRequest.getHospitalAreaId()); + organizationQuery.setYn(YnEnums.YES.getId()); + List organizationList = organizationService.queryHospitals(organizationQuery); + if (CollectionUtils.isNotEmpty(organizationList)) { + for (Organization organization : organizationList) { + hospitalList.add(organization.getId().toString()); + } + } + } + } + } + patientsQuery.setProvinceRegisterId(StringUtils.isEmpty(childbirthManagerRequest.getRegisterProvinceId())?null:childbirthManagerRequest.getRegisterProvinceId()); + patientsQuery.setCityRegisterId(StringUtils.isEmpty(childbirthManagerRequest.getRegisterCityId())?null:childbirthManagerRequest.getRegisterCityId()); + patientsQuery.setAreaRegisterId(StringUtils.isEmpty(childbirthManagerRequest.getRegisterAreaId())?null:childbirthManagerRequest.getRegisterAreaId()); + patientsQuery.setProvinceId(StringUtils.isEmpty(childbirthManagerRequest.getLivingProvinceId())?null:childbirthManagerRequest.getLivingProvinceId()); + patientsQuery.setCityId(StringUtils.isEmpty(childbirthManagerRequest.getLivingCityId())?null:childbirthManagerRequest.getLivingCityId()); + patientsQuery.setAreaId(StringUtils.isEmpty(childbirthManagerRequest.getLivingAreaId())?null:childbirthManagerRequest.getLivingAreaId()); patientsQuery.setHusbandPhone(StringUtils.isEmpty(childbirthManagerRequest.getHusbandPhone()) ? null : childbirthManagerRequest.getHusbandPhone()); - patientsQuery.setQueryNo1(childbirthManagerRequest.getQueryNo()); + patientsQuery.setQueryNo1(StringUtils.isEmpty(childbirthManagerRequest.getQueryNo())?null:childbirthManagerRequest.getQueryNo()); + patientsQuery.setFmHospitalList(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())); + patientsQuery.setFmAgeEnd(StringUtils.isEmpty(childbirthManagerRequest.getEndAge()) ? null : Integer.valueOf(childbirthManagerRequest.getEndAge())); + patientsQuery.setFmWeekStart(StringUtils.isEmpty(childbirthManagerRequest.getStartDueWeek()) ? null : Integer.valueOf(childbirthManagerRequest.getStartDueWeek())); + patientsQuery.setFmWeekEnd(StringUtils.isEmpty(childbirthManagerRequest.getEndDueWeek()) ? null : Integer.valueOf(childbirthManagerRequest.getEndDueWeek())); // 分娩方式去另外一张表查 List patientsList = patientsService.queryPatient(patientsQuery); List parentIdList = new ArrayList<>(); @@ -931,12 +991,7 @@ public class MatDeliverFacade { } MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); - String deliveryModeQueryJson = "fmfs\\\":\\\"" + childbirthManagerRequest.getDeliveryMode(); - matDeliverQuery.setDeliveryModeQueryJson(StringUtils.isEmpty(childbirthManagerRequest.getDeliveryMode()) ? null : deliveryModeQueryJson); matDeliverQuery.setParentIdList(parentIdList); - matDeliverQuery.setPage(childbirthManagerRequest.getPage()); - matDeliverQuery.setLimit(childbirthManagerRequest.getLimit()); - matDeliverQuery.setNeed("Need"); List maternalDeliverModelList = matDeliverService.pageQuery(matDeliverQuery); if (CollectionUtils.isEmpty(maternalDeliverModelList)) { // 没有查到,直接抛出 @@ -1180,7 +1235,6 @@ public class MatDeliverFacade { public NewBabyManagerResult newBabyManager(NewBabyManagerRequest newBabyManagerRequest) { NewBabyManagerResult newBabyManagerResult = new NewBabyManagerResult(); - BabyModelQuery babyModelQuery = new BabyModelQuery(); babyModelQuery.setYn(YnEnums.YES.getId()); babyModelQuery.setQueryNo(StringUtils.isEmpty(newBabyManagerRequest.getQueryNo()) ? null : newBabyManagerRequest.getQueryNo()); @@ -1197,55 +1251,61 @@ public class MatDeliverFacade { babyModelQuery.setLimit(newBabyManagerRequest.getLimit()); babyModelQuery.setHospitalId(autoMatchFacade.getHospitalId(newBabyManagerRequest.getOperatorId())); babyModelQuery.setNeed("Need"); - + babyModelQuery.setBuildType(2); List babyModelList = babyService.queryBabyWithQuery(babyModelQuery); + if (CollectionUtils.isEmpty(babyModelList)) { + newBabyManagerResult.setPageInfo(babyModelQuery.getPageInfo()); + newBabyManagerResult.setErrorcode(ErrorCodeConstants.SUCCESS); + newBabyManagerResult.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); + return newBabyManagerResult; + } + List parentIdList = new ArrayList<>(); + for (BabyModel babyModel : babyModelList) { + parentIdList.add(babyModel.getParentId()); + } + MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); + matDeliverQuery.setYn(YnEnums.YES.getId()); + matDeliverQuery.setParentIdList(parentIdList); + List maternalDeliverModelList = matDeliverService.query(matDeliverQuery); List newBabyManagerQueryModelList = new ArrayList<>(); - if (babyModelList != null && babyModelList.size() > 0) { + for (MaternalDeliverModel maternalDeliverModel : maternalDeliverModelList) { for (BabyModel babyModel : babyModelList) { - NewBabyManagerQueryModel newBabyManagerQueryModel = new NewBabyManagerQueryModel(); - BeanUtils.copy(babyModel, newBabyManagerQueryModel); - 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.setBirthDays(DateUtil.getDays(babyModel.getBirth(), new Date())); - newBabyManagerQueryModel.setBabyId(babyModel.getId()); - try { - MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); - matDeliverQuery.setYn(YnEnums.YES.getId()); - matDeliverQuery.setParentId(babyModel.getParentId()); - List maternalDeliverModelList = matDeliverService.query(matDeliverQuery); - if (maternalDeliverModelList != null && maternalDeliverModelList.size() == 1) { - MaternalDeliverModel maternalDeliverModel = maternalDeliverModelList.get(0); - newBabyManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModel.getDeliverDoctor())).getName()); - newBabyManagerQueryModel.setMaternalDeliverId(maternalDeliverModel.getId()); - newBabyManagerQueryModel.setPatientId(maternalDeliverModel.getParentId()); - newBabyManagerQueryModel.setpId(maternalDeliverModel.getPid()); + if (maternalDeliverModel.getParentId().equals(babyModel.getParentId())) { + NewBabyManagerQueryModel newBabyManagerQueryModel = new NewBabyManagerQueryModel(); + BeanUtils.copy(babyModel, newBabyManagerQueryModel); + 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.setBirthDays(DateUtil.getDays(babyModel.getBirth(), new Date())); + newBabyManagerQueryModel.setBabyId(babyModel.getId()); + newBabyManagerQueryModel.setDeliverDoctor(usersService.getUsers(Integer.valueOf(maternalDeliverModel.getDeliverDoctor())).getName()); + newBabyManagerQueryModel.setMaternalDeliverId(maternalDeliverModel.getId()); + newBabyManagerQueryModel.setPatientId(maternalDeliverModel.getParentId()); + newBabyManagerQueryModel.setpId(maternalDeliverModel.getPid()); + + for (SexEnum sexEnum : SexEnum.values()) { + if (sexEnum.getId().equals(babyModel.getSex())) { + newBabyManagerQueryModel.setSex(sexEnum.getText()); + break; + } } - } catch (Exception e) { - // 什么都不干,这么干是为了避开原始数据的问题 - } - for (SexEnum sexEnum : SexEnum.values()) { - if (sexEnum.getId().equals(babyModel.getSex())) { - newBabyManagerQueryModel.setSex(sexEnum.getText()); - break; + Integer highRisk = babyModel.getHighRisk(); + if (new Integer(0).equals(highRisk)) { + newBabyManagerQueryModel.setHighRisk("健康"); } + if (new Integer(1).equals(highRisk)) { + newBabyManagerQueryModel.setHighRisk("高危"); + } + String dueType = newBabyManagerQueryModel.getDueType(); + if ("1".equals(dueType)) { + newBabyManagerQueryModel.setDueType("顺产"); + } + if ("2".equals(dueType)) { + newBabyManagerQueryModel.setDueType("刨宫产"); + } + newBabyManagerQueryModelList.add(newBabyManagerQueryModel); } - Integer highRisk = babyModel.getHighRisk(); - if (new Integer(0).equals(highRisk)) { - newBabyManagerQueryModel.setHighRisk("健康"); - } - if (new Integer(1).equals(highRisk)) { - newBabyManagerQueryModel.setHighRisk("高危"); - } - String dueType = newBabyManagerQueryModel.getDueType(); - if ("1".equals(dueType)) { - newBabyManagerQueryModel.setDueType("顺产"); - } - if ("2".equals(dueType)) { - newBabyManagerQueryModel.setDueType("刨宫产"); - } - newBabyManagerQueryModelList.add(newBabyManagerQueryModel); } } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java index 168bd7c..a13dc6f 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ChildbirthManagerRequest.java @@ -37,6 +37,118 @@ public class ChildbirthManagerRequest extends BasePageQueryRequest { // TODO 高帆说条码号暂时先不管 + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时41分 + * @discription 是否区域 + */ + private String isArea; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时56分 + * @discription 户籍地省 + */ + private String registerProvinceId; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时56分 + * @discription 户籍地市 + */ + private String registerCityId; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时56分 + * @discription 户籍地区县 + */ + private String registerAreaId; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时56分 + * @discription 居住地省 + */ + private String livingProvinceId; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时56分 + * @discription 居住地市 + */ + private String livingCityId; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时56分 + * @discription 居住地区县 + */ + private String livingAreaId; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时56分 + * @discription 分娩医院省 + */ + private String hospitalProvinceId; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时56分 + * @discription 分娩医院市 + */ + private String hospitalCityId; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时56分 + * @discription 分娩医院区县 + */ + private String hospitalAreaId; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时56分 + * @discription 分娩医院id + */ + private String hospitalId; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时56分 + * @discription 分娩年龄start + */ + private String startAge; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时56分 + * @discription 分娩年龄end + */ + private String endAge; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时56分 + * @discription 分娩孕周start + */ + private String startDueWeek; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时56分 + * @discription 分娩孕周end + */ + private String endDueWeek; + + /** + * @auther HuJiaqi + * @createTime 2016年12月21日 10时41分 + * @discription 自定义查询 + */ + private String initQuery; + private Integer operatorId; public String getQueryNo() { @@ -63,14 +175,6 @@ public class ChildbirthManagerRequest extends BasePageQueryRequest { this.deliveryMode = deliveryMode; } - public Integer getOperatorId() { - return operatorId; - } - - public void setOperatorId(Integer operatorId) { - this.operatorId = operatorId; - } - public String getHusbandPhone() { return husbandPhone; } @@ -78,4 +182,140 @@ public class ChildbirthManagerRequest extends BasePageQueryRequest { public void setHusbandPhone(String husbandPhone) { this.husbandPhone = husbandPhone; } + + public String getIsArea() { + return isArea; + } + + public void setIsArea(String isArea) { + this.isArea = isArea; + } + + public String getRegisterProvinceId() { + return registerProvinceId; + } + + public void setRegisterProvinceId(String registerProvinceId) { + this.registerProvinceId = registerProvinceId; + } + + public String getRegisterCityId() { + return registerCityId; + } + + public void setRegisterCityId(String registerCityId) { + this.registerCityId = registerCityId; + } + + public String getRegisterAreaId() { + return registerAreaId; + } + + public void setRegisterAreaId(String registerAreaId) { + this.registerAreaId = registerAreaId; + } + + public String getLivingProvinceId() { + return livingProvinceId; + } + + public void setLivingProvinceId(String livingProvinceId) { + this.livingProvinceId = livingProvinceId; + } + + public String getLivingCityId() { + return livingCityId; + } + + public void setLivingCityId(String livingCityId) { + this.livingCityId = livingCityId; + } + + public String getLivingAreaId() { + return livingAreaId; + } + + public void setLivingAreaId(String livingAreaId) { + this.livingAreaId = livingAreaId; + } + + public String getHospitalProvinceId() { + return hospitalProvinceId; + } + + public void setHospitalProvinceId(String hospitalProvinceId) { + this.hospitalProvinceId = hospitalProvinceId; + } + + public String getHospitalCityId() { + return hospitalCityId; + } + + public void setHospitalCityId(String hospitalCityId) { + this.hospitalCityId = hospitalCityId; + } + + public String getHospitalAreaId() { + return hospitalAreaId; + } + + public void setHospitalAreaId(String hospitalAreaId) { + this.hospitalAreaId = hospitalAreaId; + } + + public String getHospitalId() { + return hospitalId; + } + + public void setHospitalId(String hospitalId) { + this.hospitalId = hospitalId; + } + + public String getStartAge() { + return startAge; + } + + public void setStartAge(String startAge) { + this.startAge = startAge; + } + + public String getEndAge() { + return endAge; + } + + public void setEndAge(String endAge) { + this.endAge = endAge; + } + + public String getStartDueWeek() { + return startDueWeek; + } + + public void setStartDueWeek(String startDueWeek) { + this.startDueWeek = startDueWeek; + } + + public String getEndDueWeek() { + return endDueWeek; + } + + public void setEndDueWeek(String endDueWeek) { + this.endDueWeek = endDueWeek; + } + + public String getInitQuery() { + return initQuery; + } + + public void setInitQuery(String initQuery) { + this.initQuery = initQuery; + } + + public Integer getOperatorId() { + return operatorId; + } + + public void setOperatorId(Integer operatorId) { + this.operatorId = operatorId; + } } -- 1.8.3.1