Commit 6d85bf15818f33fb04010f93043e5568e63579a6
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing 16 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java
- platform-dal/src/main/java/com/lyms/platform/pojo/FolicAcid.java
- platform-dal/src/main/java/com/lyms/platform/query/FolicAcidQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/Test.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FolicAcidController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PremaritalCheckupController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ResidentsArchiveController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/FolicAcidFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PremaritalCheckupFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/FolicAcidAddRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/FolicAcidQueryRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java
View file @
6d85bf1
| ... | ... | @@ -95,17 +95,17 @@ |
| 95 | 95 | |
| 96 | 96 | |
| 97 | 97 | |
| 98 | - private void syncSingle(String parentId){ | |
| 98 | + private void syncSingle(String pid){ | |
| 99 | 99 | AntExQuery antExQuery = new AntExQuery(); |
| 100 | 100 | antExQuery.setYn(YnEnums.YES.getId()); |
| 101 | - antExQuery.setParentId(parentId); | |
| 101 | + antExQuery.setPid(pid); | |
| 102 | 102 | //复诊 |
| 103 | 103 | List<AntenatalExaminationModel> list = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC,"checkDate")); |
| 104 | 104 | for (AntenatalExaminationModel antEx : list) { |
| 105 | 105 | AntExRecordModel record = convert(antEx); |
| 106 | 106 | if (null != record) { |
| 107 | 107 | AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); |
| 108 | - antExRecordQuery.setParentId(record.getParentId()); | |
| 108 | + antExRecordQuery.setPid(record.getPid()); | |
| 109 | 109 | antExRecordQuery.setcId(record.getCheckDoctor()); |
| 110 | 110 | Integer count = count(antExRecordQuery); |
| 111 | 111 | if (null == count || 0 == count) { |
| ... | ... | @@ -118,7 +118,7 @@ |
| 118 | 118 | //初诊 |
| 119 | 119 | AntExChuQuery antExChuQuery = new AntExChuQuery(); |
| 120 | 120 | antExChuQuery.setYn(YnEnums.YES.getId()); |
| 121 | - antExChuQuery.setParentId(parentId); | |
| 121 | + antExChuQuery.setPid(pid); | |
| 122 | 122 | List<AntExChuModel> antExChuModelList = antExService.queryAntExChu(antExChuQuery.convertToQuery()); |
| 123 | 123 | |
| 124 | 124 | if (CollectionUtils.isNotEmpty(antExChuModelList)) { |
| ... | ... | @@ -126,7 +126,7 @@ |
| 126 | 126 | AntExRecordModel record = convert(antEx); |
| 127 | 127 | if (null != record) { |
| 128 | 128 | AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); |
| 129 | - antExRecordQuery.setParentId(record.getParentId()); | |
| 129 | + antExRecordQuery.setPid(record.getPid()); | |
| 130 | 130 | antExRecordQuery.setcId(record.getCheckDoctor()); |
| 131 | 131 | Integer count = count(antExRecordQuery); |
| 132 | 132 | if (null == count || 0 == count) { |
| ... | ... | @@ -147,7 +147,7 @@ |
| 147 | 147 | return; |
| 148 | 148 | } |
| 149 | 149 | AntExRecordQuery antExRecordQuery1 = new AntExRecordQuery(); |
| 150 | - antExRecordQuery1.setParentId(parentId); | |
| 150 | + antExRecordQuery1.setPid(parentId); | |
| 151 | 151 | antExRecordDao.findAndMove(antExRecordQuery1.convertToQuery()); |
| 152 | 152 | |
| 153 | 153 |
platform-dal/src/main/java/com/lyms/platform/pojo/FolicAcid.java
View file @
6d85bf1
| ... | ... | @@ -16,8 +16,6 @@ |
| 16 | 16 | //妇女ID |
| 17 | 17 | private String parentId; |
| 18 | 18 | /* 领取信息 */ |
| 19 | - //高危因素 | |
| 20 | - private String riskFactors; | |
| 21 | 19 | //领取数量 |
| 22 | 20 | private String drawCount; |
| 23 | 21 | //孕期类型 |
| 24 | 22 | |
| 25 | 23 | |
| ... | ... | @@ -25,15 +23,16 @@ |
| 25 | 23 | //孕周 |
| 26 | 24 | private String pregnancyWeeks; |
| 27 | 25 | //高危因素 |
| 28 | - private String hightRisk; | |
| 26 | + private String highRisk; | |
| 29 | 27 | |
| 30 | - /* 院内信息 */ | |
| 28 | + /* 发放信息 */ | |
| 31 | 29 | //发放单位 |
| 32 | 30 | private String hospitalId; |
| 33 | 31 | //发放人 |
| 34 | 32 | private String operator; |
| 35 | 33 | //领取时间 |
| 36 | - private String drawTime; | |
| 34 | + private Date drawTime; | |
| 35 | + | |
| 37 | 36 | //创建时间 |
| 38 | 37 | private Date created; |
| 39 | 38 | //修改时间 |
| ... | ... | @@ -43,6 +42,15 @@ |
| 43 | 42 | //有效标识 |
| 44 | 43 | private Integer yn; |
| 45 | 44 | |
| 45 | + | |
| 46 | + public String getHighRisk() { | |
| 47 | + return highRisk; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public void setHighRisk(String highRisk) { | |
| 51 | + this.highRisk = highRisk; | |
| 52 | + } | |
| 53 | + | |
| 46 | 54 | public Date getCreated() { |
| 47 | 55 | return created; |
| 48 | 56 | } |
| ... | ... | @@ -91,14 +99,6 @@ |
| 91 | 99 | this.parentId = parentId; |
| 92 | 100 | } |
| 93 | 101 | |
| 94 | - public String getRiskFactors() { | |
| 95 | - return riskFactors; | |
| 96 | - } | |
| 97 | - | |
| 98 | - public void setRiskFactors(String riskFactors) { | |
| 99 | - this.riskFactors = riskFactors; | |
| 100 | - } | |
| 101 | - | |
| 102 | 102 | public String getDrawCount() { |
| 103 | 103 | return drawCount; |
| 104 | 104 | } |
| 105 | 105 | |
| ... | ... | @@ -139,11 +139,11 @@ |
| 139 | 139 | this.operator = operator; |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - public String getDrawTime() { | |
| 142 | + public Date getDrawTime() { | |
| 143 | 143 | return drawTime; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - public void setDrawTime(String drawTime) { | |
| 146 | + public void setDrawTime(Date drawTime) { | |
| 147 | 147 | this.drawTime = drawTime; |
| 148 | 148 | } |
| 149 | 149 | } |
platform-dal/src/main/java/com/lyms/platform/query/FolicAcidQuery.java
View file @
6d85bf1
| ... | ... | @@ -2,8 +2,14 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.base.IConvertToNativeQuery; |
| 4 | 4 | import com.lyms.platform.common.dao.BaseQuery; |
| 5 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
| 6 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
| 5 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 8 | +import org.apache.commons.lang.StringUtils; | |
| 9 | +import org.springframework.data.mongodb.core.query.Criteria; | |
| 6 | 10 | |
| 11 | +import java.util.Date; | |
| 12 | + | |
| 7 | 13 | /** |
| 8 | 14 | * Created by Administrator on 2016/12/1 0001. |
| 9 | 15 | */ |
| 10 | 16 | |
| 11 | 17 | |
| 12 | 18 | |
| 13 | 19 | |
| ... | ... | @@ -13,25 +19,72 @@ |
| 13 | 19 | //妇女ID |
| 14 | 20 | private String parentId; |
| 15 | 21 | /* 领取信息 */ |
| 16 | - //领取次数 | |
| 17 | - private String drawNum; | |
| 18 | 22 | //领取数量 |
| 19 | 23 | private String drawCount; |
| 20 | 24 | //孕期类型 |
| 21 | 25 | private Integer pregnancyType; |
| 22 | 26 | //孕周 |
| 23 | 27 | private String pregnancyWeeks; |
| 24 | - /* 院内信息 */ | |
| 28 | + //高危因素 | |
| 29 | + private String highRisk; | |
| 30 | + | |
| 31 | + /* 发放信息 */ | |
| 25 | 32 | //发放单位 |
| 26 | 33 | private String hospitalId; |
| 27 | 34 | //发放人 |
| 28 | 35 | private String operator; |
| 29 | 36 | //领取时间 |
| 30 | - private String drawTime; | |
| 37 | + private Date drawTimeStart; | |
| 38 | + private Date drawTimeEnd; | |
| 31 | 39 | |
| 40 | + //创建时间 | |
| 41 | + private Date created; | |
| 42 | + //修改时间 | |
| 43 | + private Date modified; | |
| 44 | + //创建人ID | |
| 45 | + private Integer publishId; | |
| 46 | + //有效标识 | |
| 47 | + private Integer yn; | |
| 48 | + | |
| 32 | 49 | @Override |
| 33 | 50 | public MongoQuery convertToQuery() { |
| 34 | - return null; | |
| 51 | + MongoCondition condition = MongoCondition.newInstance(); | |
| 52 | + if (StringUtils.isNotBlank(id)) { | |
| 53 | + condition = condition.and("id", id, MongoOper.IS); | |
| 54 | + } | |
| 55 | + if (StringUtils.isNotBlank(parentId)) { | |
| 56 | + condition = condition.and("parentId", parentId, MongoOper.IS); | |
| 57 | + } | |
| 58 | + if (StringUtils.isNotBlank(hospitalId)) { | |
| 59 | + condition = condition.and("hospitalId", hospitalId, MongoOper.IS); | |
| 60 | + } | |
| 61 | + if (created!=null) { | |
| 62 | + condition = condition.and("created", created, MongoOper.IS); | |
| 63 | + } | |
| 64 | + if (modified!=null) { | |
| 65 | + condition = condition.and("modified", modified, MongoOper.IS); | |
| 66 | + } | |
| 67 | + if (yn!=null) { | |
| 68 | + condition = condition.and("yn", yn, MongoOper.IS); | |
| 69 | + } | |
| 70 | + if (highRisk!=null) { | |
| 71 | + condition = condition.and("highRisk", highRisk, MongoOper.IS); | |
| 72 | + } | |
| 73 | + Criteria c1 = null; | |
| 74 | + if(null!=drawTimeStart){ | |
| 75 | + c1 = Criteria.where("drawTime").gte(drawTimeStart); | |
| 76 | + } | |
| 77 | + if(null!=drawTimeEnd){ | |
| 78 | + if (null==c1) { | |
| 79 | + c1 = Criteria.where("drawTime").lte(drawTimeEnd); | |
| 80 | + } else { | |
| 81 | + c1 = c1.lte(drawTimeEnd); | |
| 82 | + } | |
| 83 | + } | |
| 84 | + if (c1!=null) { | |
| 85 | + condition = condition.andCondition(new MongoCondition(c1)); | |
| 86 | + } | |
| 87 | + return condition.toMongoQuery(); | |
| 35 | 88 | } |
| 36 | 89 | |
| 37 | 90 | public String getId() { |
| ... | ... | @@ -50,14 +103,6 @@ |
| 50 | 103 | this.parentId = parentId; |
| 51 | 104 | } |
| 52 | 105 | |
| 53 | - public String getDrawNum() { | |
| 54 | - return drawNum; | |
| 55 | - } | |
| 56 | - | |
| 57 | - public void setDrawNum(String drawNum) { | |
| 58 | - this.drawNum = drawNum; | |
| 59 | - } | |
| 60 | - | |
| 61 | 106 | public String getDrawCount() { |
| 62 | 107 | return drawCount; |
| 63 | 108 | } |
| ... | ... | @@ -82,6 +127,14 @@ |
| 82 | 127 | this.pregnancyWeeks = pregnancyWeeks; |
| 83 | 128 | } |
| 84 | 129 | |
| 130 | + public String getHighRisk() { | |
| 131 | + return highRisk; | |
| 132 | + } | |
| 133 | + | |
| 134 | + public void setHighRisk(String highRisk) { | |
| 135 | + this.highRisk = highRisk; | |
| 136 | + } | |
| 137 | + | |
| 85 | 138 | public String getHospitalId() { |
| 86 | 139 | return hospitalId; |
| 87 | 140 | } |
| 88 | 141 | |
| 89 | 142 | |
| 90 | 143 | |
| ... | ... | @@ -98,14 +151,52 @@ |
| 98 | 151 | this.operator = operator; |
| 99 | 152 | } |
| 100 | 153 | |
| 101 | - public String getDrawTime() { | |
| 102 | - return drawTime; | |
| 154 | + public Date getDrawTimeStart() { | |
| 155 | + return drawTimeStart; | |
| 103 | 156 | } |
| 104 | 157 | |
| 105 | - public void setDrawTime(String drawTime) { | |
| 106 | - this.drawTime = drawTime; | |
| 158 | + public void setDrawTimeStart(Date drawTimeStart) { | |
| 159 | + this.drawTimeStart = drawTimeStart; | |
| 107 | 160 | } |
| 108 | 161 | |
| 162 | + public Date getDrawTimeEnd() { | |
| 163 | + return drawTimeEnd; | |
| 164 | + } | |
| 109 | 165 | |
| 166 | + public void setDrawTimeEnd(Date drawTimeEnd) { | |
| 167 | + this.drawTimeEnd = drawTimeEnd; | |
| 168 | + } | |
| 169 | + | |
| 170 | + public Date getCreated() { | |
| 171 | + return created; | |
| 172 | + } | |
| 173 | + | |
| 174 | + public void setCreated(Date created) { | |
| 175 | + this.created = created; | |
| 176 | + } | |
| 177 | + | |
| 178 | + public Date getModified() { | |
| 179 | + return modified; | |
| 180 | + } | |
| 181 | + | |
| 182 | + public void setModified(Date modified) { | |
| 183 | + this.modified = modified; | |
| 184 | + } | |
| 185 | + | |
| 186 | + public Integer getPublishId() { | |
| 187 | + return publishId; | |
| 188 | + } | |
| 189 | + | |
| 190 | + public void setPublishId(Integer publishId) { | |
| 191 | + this.publishId = publishId; | |
| 192 | + } | |
| 193 | + | |
| 194 | + public Integer getYn() { | |
| 195 | + return yn; | |
| 196 | + } | |
| 197 | + | |
| 198 | + public void setYn(Integer yn) { | |
| 199 | + this.yn = yn; | |
| 200 | + } | |
| 110 | 201 | } |
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
6d85bf1
| ... | ... | @@ -1039,7 +1039,9 @@ |
| 1039 | 1039 | c1 = Criteria.where("dueDate").lte(dueDateEnd); |
| 1040 | 1040 | } |
| 1041 | 1041 | } |
| 1042 | + boolean isBirthStart = false; | |
| 1042 | 1043 | if (null != birthStart) { |
| 1044 | + isBirthStart = true; | |
| 1043 | 1045 | if (null != c1) { |
| 1044 | 1046 | c1 = c1.and("birth").gte(birthStart); |
| 1045 | 1047 | } else { |
| ... | ... | @@ -1049,7 +1051,15 @@ |
| 1049 | 1051 | |
| 1050 | 1052 | if (null != birthEnd) { |
| 1051 | 1053 | if (null != c1) { |
| 1052 | - c1 = c1.lte(birthEnd); | |
| 1054 | + if (isBirthStart) | |
| 1055 | + { | |
| 1056 | + c1 = c1.lte(birthEnd); | |
| 1057 | + } | |
| 1058 | + else | |
| 1059 | + { | |
| 1060 | + c1 = c1.and("birth").lte(birthEnd); | |
| 1061 | + } | |
| 1062 | + | |
| 1053 | 1063 | } else { |
| 1054 | 1064 | c1 = Criteria.where("birth").lte(birthEnd); |
| 1055 | 1065 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/Test.java
View file @
6d85bf1
| ... | ... | @@ -40,33 +40,51 @@ |
| 40 | 40 | // |
| 41 | 41 | // |
| 42 | 42 | // |
| 43 | -// patientsQuery1.setBookbuildingDateStart(DateUtil.parseYMD("1999-11-11")); | |
| 44 | -// patientsQuery1.setBookbuildingDateEnd(DateUtil.parseYMD("2016-12-08")); | |
| 43 | +// PatientsQuery patientsQuery = new PatientsQuery(); | |
| 44 | +// patientsQuery1.setYn(YnEnums.YES.getId()); | |
| 45 | +// | |
| 46 | +// List buildType = new ArrayList(); | |
| 47 | +// buildType.add(0); | |
| 48 | +// buildType.add(2); | |
| 49 | +// patientsQuery1.setBuildTypeList(buildType); | |
| 50 | +// | |
| 51 | +// //1孕妇 | |
| 52 | +//// patientsQuery.setType(1); | |
| 53 | +// // 0未终止妊娠 1终止妊娠 | |
| 54 | +// patientsQuery1.setDueStatus(0); | |
| 55 | +// | |
| 56 | +// | |
| 57 | +// | |
| 58 | +// | |
| 59 | +// patientsQuery1.setHospitalId("242"); | |
| 60 | +// patientsQuery1.setNorFactor(true); | |
| 61 | +// patientsQuery1.setrLevel("315107bd-91fe-42a1-9237-752f3c046a40"); | |
| 62 | +// patientsQuery1.setType(1); | |
| 63 | +// | |
| 45 | 64 | |
| 65 | + patientsQuery1.setYn(YnEnums.YES.getId()); | |
| 66 | + patientsQuery1.setType(1); | |
| 46 | 67 | |
| 47 | -// Date yuYueDate = DateUtil.addDay(new Date(), 2); | |
| 48 | -// if (yuYueDate != null) { | |
| 49 | -// //把时间格式化成 yyyy_MM_dd 的日期 | |
| 50 | -// yuYueDate = DateUtil.formatDate(yuYueDate); | |
| 51 | -// } | |
| 52 | -// AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 53 | -// antExChuQuery.setYn(YnEnums.YES.getId()); | |
| 54 | -// antExChuQuery.setNextCheckTimeStart(yuYueDate); | |
| 55 | -// antExChuQuery.setNextCheckTimeEnd(yuYueDate); | |
| 56 | -// antExChuQuery.setHospitalId("242"); | |
| 68 | +// Date end = DateUtil.addDay(new Date(), 0); | |
| 57 | 69 | |
| 58 | - patientsQuery1.setHospitalId("242"); | |
| 59 | - patientsQuery1.setNorFactor(true); | |
| 60 | - patientsQuery1.setrLevel("49a36aea-c5b6-4162-87d2-9eb3c6ec00c2"); | |
| 61 | -// patientsQuery1.setType(1); | |
| 62 | -// | |
| 63 | -// Date yuYueDate = DateUtil.addDay(new Date(), 2); | |
| 64 | -// if (yuYueDate != null) { | |
| 65 | -// //把时间格式化成 yyyy_MM_dd 的日期 | |
| 66 | -// yuYueDate = DateUtil.formatDate(yuYueDate); | |
| 67 | -// } | |
| 68 | -// patientsQuery1.setDueDateStart(yuYueDate); | |
| 69 | -// patientsQuery1.setDueDateEnd(yuYueDate); | |
| 70 | + Date start = DateUtil.addDay(new Date(), -100); | |
| 71 | + | |
| 72 | + | |
| 73 | + patientsQuery1.setLastMensesStart(start); | |
| 74 | +// patientsQuery1.setLastMensesEnd(end); | |
| 75 | + | |
| 76 | + | |
| 77 | + Date date1 = DateUtil.addYear(new Date(), -18); | |
| 78 | +// patientsQuery1.setBirthEnd(date1); | |
| 79 | + Date date2 = DateUtil.addYear(new Date(), -30); | |
| 80 | + date2 = DateUtil.addYear(date2, -1); | |
| 81 | + | |
| 82 | + patientsQuery1.setBirthStart(DateUtil.addDay(date2, 1)); | |
| 83 | + List buildType = new ArrayList(); | |
| 84 | + buildType.add(0); | |
| 85 | + buildType.add(2); | |
| 86 | + patientsQuery1.setBuildTypeList(buildType); | |
| 87 | + | |
| 70 | 88 | |
| 71 | 89 | System.out.println(patientsQuery1.convertToQuery().convertToMongoQuery()); |
| 72 | 90 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FolicAcidController.java
View file @
6d85bf1
| 1 | +package com.lyms.platform.operate.web.controller; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.annotation.TokenRequired; | |
| 4 | +import com.lyms.platform.common.base.BaseController; | |
| 5 | +import com.lyms.platform.common.base.LoginContext; | |
| 6 | +import com.lyms.platform.common.result.BaseListResponse; | |
| 7 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 8 | +import com.lyms.platform.common.result.BaseResponse; | |
| 9 | +import com.lyms.platform.operate.web.facade.FolicAcidFacade; | |
| 10 | +import com.lyms.platform.operate.web.request.FolicAcidAddRequest; | |
| 11 | +import com.lyms.platform.operate.web.request.FolicAcidQueryRequest; | |
| 12 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 13 | +import org.springframework.stereotype.Controller; | |
| 14 | +import org.springframework.web.bind.annotation.*; | |
| 15 | + | |
| 16 | +import javax.servlet.http.HttpServletRequest; | |
| 17 | +import javax.validation.Valid; | |
| 18 | + | |
| 19 | +/** | |
| 20 | + * 叶酸发放接口 | |
| 21 | + * | |
| 22 | + * Created by Administrator on 2016/12/1 0001. | |
| 23 | + */ | |
| 24 | +@Controller | |
| 25 | +public class FolicAcidController extends BaseController{ | |
| 26 | + | |
| 27 | + @Autowired | |
| 28 | + private FolicAcidFacade folicAcidFacade; | |
| 29 | + | |
| 30 | + //发放 | |
| 31 | + @RequestMapping(value = "/addOrUpdateFolicAcid", method = RequestMethod.POST) | |
| 32 | + @ResponseBody | |
| 33 | +// @TokenRequired | |
| 34 | + public BaseResponse addOrUpdateFolicAcid(@RequestBody FolicAcidAddRequest folicAcidAddRequest, | |
| 35 | + HttpServletRequest request) { | |
| 36 | + //获取当前登录用户ID | |
| 37 | +// LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 38 | + | |
| 39 | + return folicAcidFacade.addOrUpdateFolicAcid(folicAcidAddRequest,1); | |
| 40 | + } | |
| 41 | + | |
| 42 | + //获取单个发放记录 | |
| 43 | + @RequestMapping(value = "/getFolicAcid", method = RequestMethod.GET) | |
| 44 | + @ResponseBody | |
| 45 | +// @TokenRequired | |
| 46 | + public BaseObjectResponse getFolicAcid(@Valid FolicAcidQueryRequest folicAcidQueryRequest, | |
| 47 | + HttpServletRequest request) { | |
| 48 | + | |
| 49 | + return folicAcidFacade.getFolicAcid(folicAcidQueryRequest); | |
| 50 | + } | |
| 51 | + | |
| 52 | + //叶酸发放管理 | |
| 53 | + @RequestMapping(value = "/queryFolicAcid", method = RequestMethod.GET) | |
| 54 | + @ResponseBody | |
| 55 | +// @TokenRequired | |
| 56 | + public BaseListResponse queryFolicAcid(@Valid FolicAcidQueryRequest folicAcidQueryRequest, | |
| 57 | + HttpServletRequest request) { | |
| 58 | + | |
| 59 | + return folicAcidFacade.queryFolicAcid(folicAcidQueryRequest); | |
| 60 | + } | |
| 61 | + | |
| 62 | + // | |
| 63 | + @RequestMapping(value = "/folicAcidExport", method = RequestMethod.GET) | |
| 64 | + @ResponseBody | |
| 65 | +// @TokenRequired | |
| 66 | + public BaseListResponse folicAcidExport(@Valid FolicAcidQueryRequest folicAcidQueryRequest, | |
| 67 | + HttpServletRequest request) { | |
| 68 | + | |
| 69 | + return folicAcidFacade.queryFolicAcid(folicAcidQueryRequest); | |
| 70 | + } | |
| 71 | + | |
| 72 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PremaritalCheckupController.java
View file @
6d85bf1
| 1 | 1 | package com.lyms.platform.operate.web.controller; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.annotation.TokenRequired; |
| 4 | +import com.lyms.platform.common.base.BaseController; | |
| 4 | 5 | import com.lyms.platform.common.base.LoginContext; |
| 5 | 6 | import com.lyms.platform.common.result.BaseListResponse; |
| 6 | 7 | import com.lyms.platform.common.result.BaseObjectResponse; |
| ... | ... | @@ -22,7 +23,7 @@ |
| 22 | 23 | * Created by Administrator on 2016/11/23 0023. |
| 23 | 24 | */ |
| 24 | 25 | @Controller |
| 25 | -public class PremaritalCheckupController { | |
| 26 | +public class PremaritalCheckupController extends BaseController{ | |
| 26 | 27 | |
| 27 | 28 | @Autowired |
| 28 | 29 | private PremaritalCheckupFacade premaritalCheckupFacade; |
| ... | ... | @@ -41,6 +42,7 @@ |
| 41 | 42 | HttpServletRequest request){ |
| 42 | 43 | //获取当前登录用户ID |
| 43 | 44 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 45 | + | |
| 44 | 46 | return premaritalCheckupFacade.addPremaritalCheckup(addRequest , loginState.getId()); |
| 45 | 47 | } |
| 46 | 48 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ResidentsArchiveController.java
View file @
6d85bf1
| ... | ... | @@ -15,6 +15,7 @@ |
| 15 | 15 | import org.springframework.web.bind.annotation.*; |
| 16 | 16 | |
| 17 | 17 | import javax.servlet.http.HttpServletRequest; |
| 18 | +import javax.servlet.http.HttpServletResponse; | |
| 18 | 19 | import javax.validation.Valid; |
| 19 | 20 | |
| 20 | 21 | /** |
| ... | ... | @@ -81,6 +82,7 @@ |
| 81 | 82 | */ |
| 82 | 83 | @RequestMapping(value = "/queryResidentsArchiveById/{id}", method = RequestMethod.GET) |
| 83 | 84 | @ResponseBody |
| 85 | +// @TokenRequired | |
| 84 | 86 | public BaseObjectResponse queryResidentsArchiveById(@PathVariable("id")String id){ |
| 85 | 87 | BaseObjectResponse objectResponse = residentsArchiveFacade.queryResidentsArchiveById(id); |
| 86 | 88 | return objectResponse; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
6d85bf1
| ... | ... | @@ -272,7 +272,9 @@ |
| 272 | 272 | |
| 273 | 273 | //初诊,修改产检管理 |
| 274 | 274 | // antenatalExaminationService.updateAntExRecord(antExChuModel.getId(), 1); |
| 275 | - recordService.handExRecord(antExChuModel.getParentId()); | |
| 275 | + if(StringUtils.isNotEmpty(antExChuModel.getPid())) { | |
| 276 | + recordService.handExRecord(antExChuModel.getPid()); | |
| 277 | + } | |
| 276 | 278 | } else { |
| 277 | 279 | AntExChuQuery antExChuQuery1 = new AntExChuQuery(); |
| 278 | 280 | antExChuQuery1.setParentId(excAddRequest.getParentId()); |
| ... | ... | @@ -313,7 +315,9 @@ |
| 313 | 315 | //修改本院最后一次定义高危 |
| 314 | 316 | updateLastRhTime(patients.getId(), hospitalId); |
| 315 | 317 | setLashCTimes(hospitalId, antExChuModel.getParentId(), 1); |
| 316 | - recordService.handExRecord(antExChuModel.getParentId()); | |
| 318 | + if(StringUtils.isNotEmpty(antExChuModel.getPid())){ | |
| 319 | + recordService.handExRecord(antExChuModel.getPid()); | |
| 320 | + } | |
| 317 | 321 | if (null != patients.getBuildType() && patients.getBuildType() == 3) { |
| 318 | 322 | Patients patients1 = new Patients(); |
| 319 | 323 | patients1.setEnable("1"); |
| ... | ... | @@ -962,7 +966,8 @@ |
| 962 | 966 | Patients patients = iterator.next(); |
| 963 | 967 | //处理建档就分娩的情况 |
| 964 | 968 | Date date = DateUtil.addWeek(patients.getLastMenses(), 42); |
| 965 | - Date currentDate = DateUtil.formatDate(patients.getCreated()); | |
| 969 | + | |
| 970 | + Date currentDate = DateUtil.formatDate(new Date()); | |
| 966 | 971 | if (date.getTime() <= currentDate.getTime() || patients.getBuildType() == 2) { |
| 967 | 972 | //建档记录 |
| 968 | 973 | if (null != patients.getHospitalId()) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
6d85bf1
| ... | ... | @@ -1623,15 +1623,8 @@ |
| 1623 | 1623 | babyQuery.setName(request.getName()); |
| 1624 | 1624 | babyQuery.setMphone(request.getMphone()); |
| 1625 | 1625 | Date currentDate = DateUtil.formatDate(new Date()); |
| 1626 | - if (request.getMonthAgeStart() != null) { | |
| 1627 | - Date start = DateUtil.addMonth(currentDate, -request.getMonthAgeStart()); | |
| 1628 | - babyQuery.setBirthEnd(start); | |
| 1629 | - } | |
| 1630 | - if(request.getMonthAgeEnd() != null){ | |
| 1631 | - Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -request.getMonthAgeEnd() - 1), 1); | |
| 1632 | - babyQuery.setBirthStart(end); | |
| 1633 | - } | |
| 1634 | 1626 | |
| 1627 | + | |
| 1635 | 1628 | // if (StringUtils.isNotEmpty(request.getDiagnose())) |
| 1636 | 1629 | // { |
| 1637 | 1630 | // BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); |
| 1638 | 1631 | |
| 1639 | 1632 | |
| 1640 | 1633 | |
| ... | ... | @@ -1663,12 +1656,94 @@ |
| 1663 | 1656 | } |
| 1664 | 1657 | } |
| 1665 | 1658 | |
| 1666 | - if (StringUtils.isNotEmpty(request.getBirth())) { | |
| 1659 | + if(StringUtils.isNotEmpty(request.getBirth()) && request.getMonthAgeStart() != null && request.getMonthAgeEnd() != null) | |
| 1660 | + { | |
| 1661 | + | |
| 1662 | + Date start = DateUtil.addMonth(currentDate, -request.getMonthAgeStart()); | |
| 1667 | 1663 | String birthStr = request.getBirth(); |
| 1668 | 1664 | String[] dates = birthStr.split(" - "); |
| 1665 | + | |
| 1666 | + if (DateUtil.parseYMD(dates[1]).getTime() < start.getTime()) | |
| 1667 | + { | |
| 1668 | + babyQuery.setBirthEnd(DateUtil.parseYMD(dates[1])); | |
| 1669 | + | |
| 1670 | + } | |
| 1671 | + else | |
| 1672 | + { | |
| 1673 | + babyQuery.setBirthEnd(start); | |
| 1674 | + } | |
| 1675 | + | |
| 1676 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -request.getMonthAgeEnd() - 1), 1); | |
| 1677 | + | |
| 1678 | + if (DateUtil.parseYMD(dates[0]).getTime() < end.getTime()) | |
| 1679 | + { | |
| 1680 | + babyQuery.setBirthStart(end); | |
| 1681 | + } | |
| 1682 | + else | |
| 1683 | + { | |
| 1684 | + babyQuery.setBirthStart(DateUtil.parseYMD(dates[0])); | |
| 1685 | + } | |
| 1686 | + } | |
| 1687 | + else if (StringUtils.isNotEmpty(request.getBirth()) && request.getMonthAgeStart() != null ) | |
| 1688 | + { | |
| 1689 | + | |
| 1690 | + Date start = DateUtil.addMonth(currentDate, -request.getMonthAgeStart()); | |
| 1691 | + String birthStr = request.getBirth(); | |
| 1692 | + String[] dates = birthStr.split(" - "); | |
| 1693 | + | |
| 1694 | + if (DateUtil.parseYMD(dates[1]).getTime() < start.getTime()) | |
| 1695 | + { | |
| 1696 | + babyQuery.setBirthEnd(DateUtil.parseYMD(dates[1])); | |
| 1697 | + } | |
| 1698 | + else | |
| 1699 | + { | |
| 1700 | + babyQuery.setBirthEnd(start); | |
| 1701 | + } | |
| 1702 | + | |
| 1669 | 1703 | babyQuery.setBirthStart(DateUtil.parseYMD(dates[0])); |
| 1704 | + | |
| 1705 | + } | |
| 1706 | + else if (StringUtils.isNotEmpty(request.getBirth())) | |
| 1707 | + { | |
| 1708 | + String birthStr = request.getBirth(); | |
| 1709 | + String[] dates = birthStr.split(" - "); | |
| 1710 | + babyQuery.setBirthStart(DateUtil.parseYMD(dates[0])); | |
| 1670 | 1711 | babyQuery.setBirthEnd(DateUtil.parseYMD(dates[1])); |
| 1671 | 1712 | } |
| 1713 | + else if (request.getMonthAgeStart() != null && request.getMonthAgeEnd() != null) | |
| 1714 | + { | |
| 1715 | + Date start = DateUtil.addMonth(currentDate, -request.getMonthAgeStart()); | |
| 1716 | + babyQuery.setBirthEnd(start); | |
| 1717 | + | |
| 1718 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -request.getMonthAgeEnd() - 1), 1); | |
| 1719 | + babyQuery.setBirthStart(end); | |
| 1720 | + } | |
| 1721 | + else if (request.getMonthAgeStart() != null) | |
| 1722 | + { | |
| 1723 | + Date start = DateUtil.addMonth(currentDate, -request.getMonthAgeStart()); | |
| 1724 | + babyQuery.setBirthEnd(start); | |
| 1725 | + } | |
| 1726 | + else if (request.getMonthAgeEnd() != null) | |
| 1727 | + { | |
| 1728 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -request.getMonthAgeEnd() - 1), 1); | |
| 1729 | + babyQuery.setBirthStart(end); | |
| 1730 | + } | |
| 1731 | + | |
| 1732 | +// if (request.getMonthAgeStart() != null) { | |
| 1733 | +// Date start = DateUtil.addMonth(currentDate, -request.getMonthAgeStart()); | |
| 1734 | +// babyQuery.setBirthEnd(start); | |
| 1735 | +// } | |
| 1736 | +// if(request.getMonthAgeEnd() != null){ | |
| 1737 | +// Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -request.getMonthAgeEnd() - 1), 1); | |
| 1738 | +// babyQuery.setBirthStart(end); | |
| 1739 | +// } | |
| 1740 | + | |
| 1741 | +// if (StringUtils.isNotEmpty(request.getBirth())) { | |
| 1742 | +// String birthStr = request.getBirth(); | |
| 1743 | +// String[] dates = birthStr.split(" - "); | |
| 1744 | +// babyQuery.setBirthStart(DateUtil.parseYMD(dates[0])); | |
| 1745 | +// babyQuery.setBirthEnd(DateUtil.parseYMD(dates[1])); | |
| 1746 | +// } | |
| 1672 | 1747 | |
| 1673 | 1748 | |
| 1674 | 1749 | if (request.getServiceType() != null && request.getServiceType() != 100) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/FolicAcidFacade.java
View file @
6d85bf1
| 1 | +package com.lyms.platform.operate.web.facade; | |
| 2 | + | |
| 3 | +import com.lyms.platform.biz.service.FolicAcidService; | |
| 4 | +import com.lyms.platform.biz.service.ResidentsArchiveService; | |
| 5 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 6 | +import com.lyms.platform.common.enums.YnEnums; | |
| 7 | +import com.lyms.platform.common.result.BaseListResponse; | |
| 8 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 9 | +import com.lyms.platform.common.result.BaseResponse; | |
| 10 | +import com.lyms.platform.operate.web.request.FolicAcidAddRequest; | |
| 11 | +import com.lyms.platform.operate.web.request.FolicAcidQueryRequest; | |
| 12 | +import com.lyms.platform.permission.model.Organization; | |
| 13 | +import com.lyms.platform.permission.model.OrganizationQuery; | |
| 14 | +import com.lyms.platform.permission.service.OrganizationService; | |
| 15 | +import com.lyms.platform.pojo.FolicAcid; | |
| 16 | +import com.lyms.platform.pojo.ResidentsArchiveModel; | |
| 17 | +import com.lyms.platform.query.FolicAcidQuery; | |
| 18 | +import com.lyms.platform.query.ResidentsArchiveQuery; | |
| 19 | +import org.apache.commons.collections.CollectionUtils; | |
| 20 | +import org.apache.commons.lang.StringUtils; | |
| 21 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 22 | +import org.springframework.stereotype.Component; | |
| 23 | + | |
| 24 | +import java.util.*; | |
| 25 | + | |
| 26 | +/** | |
| 27 | + * Created by Administrator on 2016/12/5 0005. | |
| 28 | + */ | |
| 29 | +@Component | |
| 30 | +public class FolicAcidFacade { | |
| 31 | + | |
| 32 | + @Autowired | |
| 33 | + private ResidentsArchiveService residentsArchiveService; | |
| 34 | + @Autowired | |
| 35 | + private FolicAcidService folicAcidService; | |
| 36 | + @Autowired | |
| 37 | + private OrganizationService organizationService; | |
| 38 | + | |
| 39 | + public BaseResponse addOrUpdateFolicAcid(FolicAcidAddRequest addRequest,Integer userId){ | |
| 40 | + | |
| 41 | + String id = null; | |
| 42 | + if (StringUtils.isNotEmpty(addRequest.getParentId())){ | |
| 43 | + id = addOrUpdate(addRequest,userId,addRequest.getParentId()); | |
| 44 | + } | |
| 45 | + BaseObjectResponse br = new BaseObjectResponse(); | |
| 46 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 47 | + br.setErrormsg("成功"); | |
| 48 | + br.setData(id); | |
| 49 | + return br; | |
| 50 | + } | |
| 51 | + | |
| 52 | + | |
| 53 | + private String addOrUpdate(FolicAcidAddRequest addRequest,Integer userId,String parentId){ | |
| 54 | + | |
| 55 | + String id = null; | |
| 56 | + | |
| 57 | + FolicAcid folicAcid = new FolicAcid(); | |
| 58 | + folicAcid.setHospitalId(addRequest.getHospitalId()); | |
| 59 | + folicAcid.setParentId(parentId); | |
| 60 | + folicAcid.setDrawCount(addRequest.getDrawCount()); | |
| 61 | + folicAcid.setPregnancyType(addRequest.getPregnancyType()); | |
| 62 | + folicAcid.setPregnancyWeeks(addRequest.getPregnancyWeeks()); | |
| 63 | + folicAcid.setHighRisk(addRequest.getHighRisk()); | |
| 64 | + folicAcid.setOperator(addRequest.getOperator()); | |
| 65 | + folicAcid.setDrawTime(addRequest.getDrawTime()); | |
| 66 | + folicAcid.setYn(YnEnums.YES.getId()); | |
| 67 | + folicAcid.setModified(new Date()); | |
| 68 | + if (StringUtils.isNotEmpty(addRequest.getId())){ | |
| 69 | + folicAcid.setId(addRequest.getId()); | |
| 70 | + folicAcidService.updateFolicAcid(folicAcid,addRequest.getId()); | |
| 71 | + id = addRequest.getId(); | |
| 72 | + }else { | |
| 73 | + folicAcid.setCreated(new Date()); | |
| 74 | + folicAcid.setPublishId(userId); | |
| 75 | + id = folicAcidService.addFolicAcid(folicAcid).getId(); | |
| 76 | + } | |
| 77 | + return id; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public BaseObjectResponse getFolicAcid(FolicAcidQueryRequest queryRequest){ | |
| 81 | + Map<String, Object> archiveMap = null; | |
| 82 | + FolicAcid folicAcid = null; | |
| 83 | + ResidentsArchiveModel archiveModel = null; | |
| 84 | + Map<String, Object> resultMap = new HashMap<>(); | |
| 85 | + | |
| 86 | + //查询妇女信息 | |
| 87 | + if (StringUtils.isNotEmpty(queryRequest.getId())){ | |
| 88 | + folicAcid = folicAcidService.getFolicAcid(queryRequest.getId()); | |
| 89 | + if (folicAcid!=null && folicAcid.getYn()== YnEnums.YES.getId() && folicAcid.getParentId()!=null){ | |
| 90 | + archiveModel = residentsArchiveService.getResident(folicAcid.getParentId()); | |
| 91 | + } | |
| 92 | + }else { | |
| 93 | + ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery(); | |
| 94 | + archiveQuery.setYn(1); | |
| 95 | + archiveQuery.setHospitalId(queryRequest.getHospitalId()); | |
| 96 | + if (StringUtils.isNotEmpty(queryRequest.getCardNo())){ | |
| 97 | + archiveQuery.setCertificateNum(queryRequest.getCardNo()); | |
| 98 | + List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(archiveQuery); | |
| 99 | + if (CollectionUtils.isNotEmpty(modelList)){ | |
| 100 | + archiveModel = modelList.get(0); | |
| 101 | + } | |
| 102 | + }else if (StringUtils.isNotEmpty(queryRequest.getVcCardNo())){ | |
| 103 | + archiveQuery.setVcCardNo(queryRequest.getVcCardNo()); | |
| 104 | + List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(archiveQuery); | |
| 105 | + if (CollectionUtils.isNotEmpty(modelList)){ | |
| 106 | + archiveModel = modelList.get(0); | |
| 107 | + } | |
| 108 | + } | |
| 109 | + } | |
| 110 | + | |
| 111 | + if (archiveModel!=null){ | |
| 112 | + //妇女信息 | |
| 113 | + archiveMap = new HashMap<>(); | |
| 114 | + archiveMap.put("certificateNum", archiveModel.getCertificateNum()); | |
| 115 | + archiveMap.put("certificateTypeId", archiveModel.getCertificateTypeId()); | |
| 116 | + archiveMap.put("username", archiveModel.getUsername()); | |
| 117 | + archiveMap.put("birthday",archiveModel.getBirthday()); | |
| 118 | + archiveMap.put("age", archiveModel.getAge()); | |
| 119 | + archiveMap.put("phone", archiveModel.getPhone()); | |
| 120 | + | |
| 121 | + } | |
| 122 | + resultMap.put("folicAcidResult",folicAcid); | |
| 123 | + resultMap.put("archiveResult",archiveMap); | |
| 124 | + BaseObjectResponse response = new BaseObjectResponse(); | |
| 125 | + response.setData(resultMap); | |
| 126 | + response.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 127 | + response.setErrormsg("成功"); | |
| 128 | + return response; | |
| 129 | + } | |
| 130 | + | |
| 131 | + public BaseListResponse queryFolicAcid(FolicAcidQueryRequest queryRequest){ | |
| 132 | + | |
| 133 | + List<FolicAcid> list = new ArrayList<>(); | |
| 134 | + | |
| 135 | + List<Organization> organizationList = new ArrayList<>(); | |
| 136 | + | |
| 137 | + FolicAcidQuery folicAcidQuery = new FolicAcidQuery(); | |
| 138 | + folicAcidQuery.setYn(YnEnums.YES.getId()); | |
| 139 | + folicAcidQuery.setPage(queryRequest.getPage()); | |
| 140 | + folicAcidQuery.setLimit(queryRequest.getLimit()); | |
| 141 | + folicAcidQuery.setNeed("y"); | |
| 142 | + | |
| 143 | + folicAcidQuery.setHospitalId(queryRequest.getHospitalId()); | |
| 144 | + folicAcidQuery.setDrawTimeStart(queryRequest.getDrawTimeStart()); | |
| 145 | + folicAcidQuery.setDrawTimeEnd(queryRequest.getDrawTimeEnd()); | |
| 146 | + folicAcidQuery.setHighRisk(queryRequest.getHighRisk()); | |
| 147 | + | |
| 148 | + //省市区筛选机构 | |
| 149 | + if (StringUtils.isNotEmpty(queryRequest.getProvinceId()) || StringUtils.isNotEmpty(queryRequest.getCityId()) || | |
| 150 | + StringUtils.isNotEmpty(queryRequest.getAreaId())){ | |
| 151 | + OrganizationQuery organizationQuery = new OrganizationQuery(); | |
| 152 | + organizationQuery.setYn(YnEnums.YES.getId()); | |
| 153 | + organizationQuery.setProvinceId(queryRequest.getProvinceId()); | |
| 154 | + organizationQuery.setCityId(queryRequest.getCityId()); | |
| 155 | + organizationQuery.setAreaId(queryRequest.getAreaId()); | |
| 156 | + organizationList = organizationService.queryHospitals(organizationQuery); | |
| 157 | + } | |
| 158 | + if (CollectionUtils.isNotEmpty(organizationList)){ | |
| 159 | + for (Organization hospital : organizationList){ | |
| 160 | + folicAcidQuery.setHospitalId(String.valueOf(hospital.getId())); | |
| 161 | + List<FolicAcid> folicAcidList = folicAcidService.queryFolicAcid(folicAcidQuery); | |
| 162 | + list.addAll(folicAcidList); | |
| 163 | + } | |
| 164 | + }else { | |
| 165 | + List<FolicAcid> folicAcidList = folicAcidService.queryFolicAcid(folicAcidQuery); | |
| 166 | + list.addAll(folicAcidList); | |
| 167 | + } | |
| 168 | + BaseListResponse baseListResponse = new BaseListResponse(); | |
| 169 | + baseListResponse.setErrormsg("成功"); | |
| 170 | + baseListResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 171 | + baseListResponse.setData(list); | |
| 172 | + baseListResponse.setPageInfo(folicAcidQuery.getPageInfo()); | |
| 173 | + return baseListResponse; | |
| 174 | + } | |
| 175 | + | |
| 176 | + //叶酸发放导出 | |
| 177 | + | |
| 178 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PremaritalCheckupFacade.java
View file @
6d85bf1
| ... | ... | @@ -245,7 +245,7 @@ |
| 245 | 245 | //就诊卡不为空 |
| 246 | 246 | archiveQuery.setVcCardNo(addRequest.getVcCardNo()); |
| 247 | 247 | } |
| 248 | - List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResidentWithSort(archiveQuery, "created", Sort.Direction.DESC); | |
| 248 | + List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(archiveQuery); | |
| 249 | 249 | if (CollectionUtils.isNotEmpty(modelList)){ |
| 250 | 250 | ResidentsArchiveModel archiveModel = modelList.get(0); |
| 251 | 251 | id = addOrUpdate(addRequest,userId,archiveModel); |
| ... | ... | @@ -265,7 +265,7 @@ |
| 265 | 265 | PremaritalCheckup checkup = new PremaritalCheckup(); |
| 266 | 266 | |
| 267 | 267 | /* 配偶信息 */ |
| 268 | - if (addRequest.getDeliverStatus()==1){ | |
| 268 | + if (addRequest.getDeliverStatus()!=null && addRequest.getDeliverStatus()==1){ | |
| 269 | 269 | checkup.setSpouseName(addRequest.getSpouseName()); |
| 270 | 270 | checkup.setSpouseCertificateTypeId(addRequest.getSpouseCertificateTypeId()); |
| 271 | 271 | checkup.setSpouseCertificateNum(addRequest.getSpouseCertificateNum()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
View file @
6d85bf1
| ... | ... | @@ -9,6 +9,7 @@ |
| 9 | 9 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 10 | 10 | import com.lyms.platform.common.result.BaseResponse; |
| 11 | 11 | import com.lyms.platform.common.utils.DateUtil; |
| 12 | +import com.lyms.platform.common.utils.ExcelUtil; | |
| 12 | 13 | import com.lyms.platform.common.utils.JsonUtil; |
| 13 | 14 | import com.lyms.platform.common.utils.SystemConfig; |
| 14 | 15 | import com.lyms.platform.operate.web.request.ResidentsArchiveAddRequest; |
| 15 | 16 | |
| ... | ... | @@ -21,8 +22,10 @@ |
| 21 | 22 | import com.lyms.platform.permission.model.Users; |
| 22 | 23 | import com.lyms.platform.permission.service.OrganizationService; |
| 23 | 24 | import com.lyms.platform.permission.service.UsersService; |
| 25 | +import com.lyms.platform.pojo.BasicConfig; | |
| 24 | 26 | import com.lyms.platform.pojo.PremaritalCheckup; |
| 25 | 27 | import com.lyms.platform.pojo.ResidentsArchiveModel; |
| 28 | +import com.lyms.platform.query.BasicConfigQuery; | |
| 26 | 29 | import com.lyms.platform.query.PremaritalCheckupQuery; |
| 27 | 30 | import com.lyms.platform.query.ResidentsArchiveQuery; |
| 28 | 31 | import com.mongodb.util.JSON; |
| ... | ... | @@ -32,6 +35,8 @@ |
| 32 | 35 | import org.springframework.beans.factory.annotation.Autowired; |
| 33 | 36 | import org.springframework.stereotype.Component; |
| 34 | 37 | |
| 38 | +import javax.servlet.http.HttpServletResponse; | |
| 39 | +import java.io.OutputStream; | |
| 35 | 40 | import java.util.*; |
| 36 | 41 | |
| 37 | 42 | /** |
| 38 | 43 | |
| 39 | 44 | |
| 40 | 45 | |
| ... | ... | @@ -327,19 +332,54 @@ |
| 327 | 332 | return objectResponse; |
| 328 | 333 | } |
| 329 | 334 | |
| 335 | + ResidentsArchiveModel model = null; | |
| 336 | + | |
| 330 | 337 | ResidentsArchiveResult result = new ResidentsArchiveResult(); |
| 331 | 338 | |
| 332 | - | |
| 333 | 339 | ResidentsArchiveQuery query = new ResidentsArchiveQuery(); |
| 334 | 340 | query.setYn(YnEnums.YES.getId()); |
| 335 | 341 | query.setId(id); |
| 336 | 342 | List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(query); |
| 337 | 343 | if (CollectionUtils.isNotEmpty(modelList)){ |
| 338 | - ResidentsArchiveModel model = modelList.get(0); | |
| 344 | + model = modelList.get(0); | |
| 345 | + //建档详情 | |
| 339 | 346 | result = getResult(model); |
| 340 | 347 | } |
| 341 | 348 | |
| 342 | - objectResponse.setData(result); | |
| 349 | + List<ResidentsArchiveHistoryResult> historyResults = new ArrayList<>(); | |
| 350 | + | |
| 351 | + //历史记录 | |
| 352 | + if (model!=null){ | |
| 353 | + ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery(); | |
| 354 | + archiveQuery.setHospitalId(model.getHospitalId()); | |
| 355 | + archiveQuery.setYn(YnEnums.YES.getId()); | |
| 356 | + if (StringUtils.isNotEmpty(model.getCertificateNum())){ | |
| 357 | + archiveQuery.setCertificateNum(model.getCertificateNum()); | |
| 358 | + }else if (StringUtils.isNotEmpty(model.getVcCardNo())){ | |
| 359 | + archiveQuery.setVcCardNo(model.getVcCardNo()); | |
| 360 | + } | |
| 361 | + List<ResidentsArchiveModel> archiveModelList = residentsArchiveService.queryResident(archiveQuery); | |
| 362 | + if (CollectionUtils.isNotEmpty(archiveModelList)){ | |
| 363 | + for (ResidentsArchiveModel archiveModel : archiveModelList){ | |
| 364 | + ResidentsArchiveHistoryResult temp = new ResidentsArchiveHistoryResult(); | |
| 365 | + //查询医院机构 | |
| 366 | + if (StringUtils.isNotEmpty(archiveModel.getHospitalId())){ | |
| 367 | + Organization org = organizationService.getOrganization(Integer.valueOf(archiveModel.getHospitalId())); | |
| 368 | + if (org != null){ | |
| 369 | + temp.setBookBuildHospital(org.getName()); | |
| 370 | + temp.setHospitalId(String.valueOf(org.getId())); | |
| 371 | + } | |
| 372 | + } | |
| 373 | + temp.setBookBuildDate(archiveModel.getBuildDay()); | |
| 374 | + temp.setId(archiveModel.getId()); | |
| 375 | + historyResults.add(temp); | |
| 376 | + } | |
| 377 | + } | |
| 378 | + } | |
| 379 | + Map<String,Object> map = new HashMap<>(); | |
| 380 | + map.put("ResidentsArchiveResult",result); | |
| 381 | + map.put("historyResult",historyResults); | |
| 382 | + objectResponse.setData(map); | |
| 343 | 383 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 344 | 384 | objectResponse.setErrormsg("成功"); |
| 345 | 385 | return objectResponse; |
| ... | ... | @@ -470,5 +510,102 @@ |
| 470 | 510 | return response; |
| 471 | 511 | } |
| 472 | 512 | |
| 513 | + //数据导出 | |
| 514 | + public void residentsArchiveExport(ResidentsArchiveQueryRequest queryRequest,Integer userId,HttpServletResponse response){ | |
| 515 | + | |
| 516 | + OutputStream out = null; | |
| 517 | + | |
| 518 | + List<Map<String,Object>> list = new ArrayList<>(); | |
| 519 | + | |
| 520 | + try { | |
| 521 | + ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery(); | |
| 522 | + archiveQuery.setYn(YnEnums.YES.getId()); | |
| 523 | + String hospital = autoMatchFacade.getHospitalId(userId); | |
| 524 | + archiveQuery.setSex(SystemConfig.WOMAN_ID); | |
| 525 | + archiveQuery.setHospitalId(hospital); | |
| 526 | + archiveQuery.setProvinceId(queryRequest.getProvinceId()); | |
| 527 | + archiveQuery.setCityId(queryRequest.getCityId()); | |
| 528 | + archiveQuery.setAreaId(queryRequest.getAreaId()); | |
| 529 | + archiveQuery.setUsername(queryRequest.getUsername()); | |
| 530 | + archiveQuery.setCertificateNum(queryRequest.getCardNo()); | |
| 531 | + archiveQuery.setPhone(queryRequest.getPhone()); | |
| 532 | + List<ResidentsArchiveModel> archiveModelList = residentsArchiveService.queryResident(archiveQuery); | |
| 533 | + if (CollectionUtils.isNotEmpty(archiveModelList)){ | |
| 534 | + for (ResidentsArchiveModel data : archiveModelList){ | |
| 535 | + Map<String,Object> map = new HashMap<>(); | |
| 536 | + map.put("username",data.getUsername()); | |
| 537 | + map.put("sex","女"); | |
| 538 | + map.put("birthday",getBirthday(data.getBirthday())); | |
| 539 | + map.put("countryId",getBaseicConfigByid(data.getCountryId())); | |
| 540 | + map.put("nationId",getBaseicConfigByid(data.getNationId())); | |
| 541 | + map.put("marriageId",getBaseicConfigByid(data.getMarriageId())); | |
| 542 | + map.put("certificateTypeId",getBaseicConfigByid(data.getCertificateTypeId())); | |
| 543 | + map.put("certificateNum",data.getCertificateNum()); | |
| 544 | + map.put("censusTypeId",getBaseicConfigByid(data.getCensusTypeId())); | |
| 545 | + map.put("liveTypeId",getBaseicConfigByid(data.getLiveTypeId())); | |
| 546 | + map.put("levelTypeId",getBaseicConfigByid(data.getLevelTypeId())); | |
| 547 | + map.put("professionTypeId", getBaseicConfigByid(data.getProfessionTypeId())); | |
| 548 | + if (StringUtils.isNotEmpty(data.getHospitalId())){ | |
| 549 | + Organization organization = organizationService.getOrganization(Integer.valueOf(data.getHospitalId())); | |
| 550 | + if (organization != null && organization.getYn()==YnEnums.YES.getId()){ | |
| 551 | + map.put("hospital", organization.getName()); | |
| 552 | + } | |
| 553 | + } | |
| 554 | + map.put("age",data.getAge()); | |
| 555 | + map.put("phone",data.getPhone()); | |
| 556 | + map.put("workUnit",data.getWorkUnit()); | |
| 557 | + map.put("residence",CommonsHelper.getResidence(data.getProvinceId(), data.getCityId(), | |
| 558 | + data.getAreaId(), data.getStreetId(), data.getAddress(), basicConfigService)); | |
| 559 | + map.put("residenceRegister",CommonsHelper.getResidence(data.getProvinceRegisterId(), data.getCityRegisterId(), | |
| 560 | + data.getAreaRegisterId(), data.getStreetRegisterId(), | |
| 561 | + data.getAddressRegister(), basicConfigService)); | |
| 562 | + | |
| 563 | + //病史 | |
| 564 | + map.put("pastHistory", data.getPastHistory()); | |
| 565 | + map.put("familyHistory", data.getFamilyHistory()); | |
| 566 | + map.put("personalHistory", data.getPersonalHistory()); | |
| 567 | + map.put("ywgmHistory", data.getYwgmHistory()); | |
| 568 | + map.put("presentHistory", data.getPresentHistory()); | |
| 569 | + | |
| 570 | + map.put("vcCardNo", data.getVcCardNo()); | |
| 571 | + map.put("buildDoctor", data.getBuildDoctor()); | |
| 572 | + map.put("buildDay", data.getBuildDay()); | |
| 573 | + } | |
| 574 | + } | |
| 575 | + out = response.getOutputStream(); | |
| 576 | + Map<String, String> cnames = new LinkedHashMap<>(); | |
| 577 | + cnames.put("username","姓名"); | |
| 578 | + | |
| 579 | + | |
| 580 | + response.setContentType("application/octet-stream"); | |
| 581 | + response.setHeader("Content-Disposition", "attachment;fileName=" + "juming.xls"); | |
| 582 | + ExcelUtil.toExcel(out, list, cnames); | |
| 583 | + }catch (Exception e){ | |
| 584 | + e.printStackTrace(); | |
| 585 | + } | |
| 586 | + } | |
| 587 | + | |
| 588 | + //获取生日 | |
| 589 | + public String getBirthday(String b){ | |
| 590 | + if (b!=null){ | |
| 591 | + String year = b.substring(0,4); | |
| 592 | + String mouth = b.substring(5,7); | |
| 593 | + String day = b.substring(8,10); | |
| 594 | + return year + "年" + mouth + "月" + day + "日"; | |
| 595 | + } | |
| 596 | + return null; | |
| 597 | + } | |
| 598 | + | |
| 599 | + //获取基础基础名称 | |
| 600 | + public String getBaseicConfigByid(String id) { | |
| 601 | + | |
| 602 | + if (StringUtils.isNotEmpty(id)){ | |
| 603 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(id); | |
| 604 | + if (basicConfig!=null && basicConfig.getYn()!=YnEnums.NO.getId()){ | |
| 605 | + return basicConfig.getName(); | |
| 606 | + } | |
| 607 | + } | |
| 608 | + return ""; | |
| 609 | + } | |
| 473 | 610 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/FolicAcidAddRequest.java
View file @
6d85bf1
| 1 | +package com.lyms.platform.operate.web.request; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * Created by Administrator on 2016/12/5 0005. | |
| 7 | + */ | |
| 8 | +public class FolicAcidAddRequest { | |
| 9 | + | |
| 10 | + private String id; | |
| 11 | + | |
| 12 | + private String parentId; | |
| 13 | + /* 领取信息 */ | |
| 14 | + //领取数量 | |
| 15 | + private String drawCount; | |
| 16 | + //孕期类型 | |
| 17 | + private Integer pregnancyType; | |
| 18 | + //孕周 | |
| 19 | + private String pregnancyWeeks; | |
| 20 | + //高危因素 | |
| 21 | + private String highRisk; | |
| 22 | + | |
| 23 | + /* 发放信息 */ | |
| 24 | + //发放单位 | |
| 25 | + private String hospitalId; | |
| 26 | + //发放人 | |
| 27 | + private String operator; | |
| 28 | + //领取时间 | |
| 29 | + private Date drawTime; | |
| 30 | + | |
| 31 | + public String getId() { | |
| 32 | + return id; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public void setId(String id) { | |
| 36 | + this.id = id; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public String getParentId() { | |
| 40 | + return parentId; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public void setParentId(String parentId) { | |
| 44 | + this.parentId = parentId; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public String getDrawCount() { | |
| 48 | + return drawCount; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public void setDrawCount(String drawCount) { | |
| 52 | + this.drawCount = drawCount; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public Integer getPregnancyType() { | |
| 56 | + return pregnancyType; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public void setPregnancyType(Integer pregnancyType) { | |
| 60 | + this.pregnancyType = pregnancyType; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public String getPregnancyWeeks() { | |
| 64 | + return pregnancyWeeks; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public void setPregnancyWeeks(String pregnancyWeeks) { | |
| 68 | + this.pregnancyWeeks = pregnancyWeeks; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public String getHighRisk() { | |
| 72 | + return highRisk; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public void setHighRisk(String highRisk) { | |
| 76 | + this.highRisk = highRisk; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public String getHospitalId() { | |
| 80 | + return hospitalId; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public void setHospitalId(String hospitalId) { | |
| 84 | + this.hospitalId = hospitalId; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public String getOperator() { | |
| 88 | + return operator; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public void setOperator(String operator) { | |
| 92 | + this.operator = operator; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public Date getDrawTime() { | |
| 96 | + return drawTime; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public void setDrawTime(Date drawTime) { | |
| 100 | + this.drawTime = drawTime; | |
| 101 | + } | |
| 102 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/FolicAcidQueryRequest.java
View file @
6d85bf1
| 1 | +package com.lyms.platform.operate.web.request; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.core.annotation.form.Form; | |
| 4 | + | |
| 5 | +import java.util.Date; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * Created by Administrator on 2016/12/5 0005. | |
| 9 | + */ | |
| 10 | +@Form | |
| 11 | +public class FolicAcidQueryRequest extends BasePageQueryRequest { | |
| 12 | + | |
| 13 | + private String id; | |
| 14 | + | |
| 15 | + //证件号 | |
| 16 | + private String cardNo; | |
| 17 | + //证件号类型 | |
| 18 | + private String certificateTypeId; | |
| 19 | + //就诊卡号 | |
| 20 | + private String vcCardNo; | |
| 21 | + //医院ID | |
| 22 | + private String hospitalId; | |
| 23 | + //省 | |
| 24 | + private String provinceId; | |
| 25 | + //市 | |
| 26 | + private String cityId; | |
| 27 | + //区县 | |
| 28 | + private String areaId; | |
| 29 | + //发放开始时间 | |
| 30 | + private Date drawTimeStart; | |
| 31 | + //结束时间 | |
| 32 | + private Date drawTimeEnd; | |
| 33 | + //高危因素 | |
| 34 | + private String highRisk; | |
| 35 | + | |
| 36 | + public String getId() { | |
| 37 | + return id; | |
| 38 | + } | |
| 39 | + | |
| 40 | + public void setId(String id) { | |
| 41 | + this.id = id; | |
| 42 | + } | |
| 43 | + | |
| 44 | + public String getCardNo() { | |
| 45 | + return cardNo; | |
| 46 | + } | |
| 47 | + | |
| 48 | + public void setCardNo(String cardNo) { | |
| 49 | + this.cardNo = cardNo; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public String getCertificateTypeId() { | |
| 53 | + return certificateTypeId; | |
| 54 | + } | |
| 55 | + | |
| 56 | + public void setCertificateTypeId(String certificateTypeId) { | |
| 57 | + this.certificateTypeId = certificateTypeId; | |
| 58 | + } | |
| 59 | + | |
| 60 | + public String getVcCardNo() { | |
| 61 | + return vcCardNo; | |
| 62 | + } | |
| 63 | + | |
| 64 | + public void setVcCardNo(String vcCardNo) { | |
| 65 | + this.vcCardNo = vcCardNo; | |
| 66 | + } | |
| 67 | + | |
| 68 | + public String getHospitalId() { | |
| 69 | + return hospitalId; | |
| 70 | + } | |
| 71 | + | |
| 72 | + public void setHospitalId(String hospitalId) { | |
| 73 | + this.hospitalId = hospitalId; | |
| 74 | + } | |
| 75 | + | |
| 76 | + public String getProvinceId() { | |
| 77 | + return provinceId; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public void setProvinceId(String provinceId) { | |
| 81 | + this.provinceId = provinceId; | |
| 82 | + } | |
| 83 | + | |
| 84 | + public String getCityId() { | |
| 85 | + return cityId; | |
| 86 | + } | |
| 87 | + | |
| 88 | + public void setCityId(String cityId) { | |
| 89 | + this.cityId = cityId; | |
| 90 | + } | |
| 91 | + | |
| 92 | + public String getAreaId() { | |
| 93 | + return areaId; | |
| 94 | + } | |
| 95 | + | |
| 96 | + public void setAreaId(String areaId) { | |
| 97 | + this.areaId = areaId; | |
| 98 | + } | |
| 99 | + | |
| 100 | + public Date getDrawTimeStart() { | |
| 101 | + return drawTimeStart; | |
| 102 | + } | |
| 103 | + | |
| 104 | + public void setDrawTimeStart(Date drawTimeStart) { | |
| 105 | + this.drawTimeStart = drawTimeStart; | |
| 106 | + } | |
| 107 | + | |
| 108 | + public Date getDrawTimeEnd() { | |
| 109 | + return drawTimeEnd; | |
| 110 | + } | |
| 111 | + | |
| 112 | + public void setDrawTimeEnd(Date drawTimeEnd) { | |
| 113 | + this.drawTimeEnd = drawTimeEnd; | |
| 114 | + } | |
| 115 | + | |
| 116 | + public String getHighRisk() { | |
| 117 | + return highRisk; | |
| 118 | + } | |
| 119 | + | |
| 120 | + public void setHighRisk(String highRisk) { | |
| 121 | + this.highRisk = highRisk; | |
| 122 | + } | |
| 123 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/worker/QuanChanPatientWorker.java
View file @
6d85bf1
| ... | ... | @@ -92,8 +92,8 @@ |
| 92 | 92 | } |
| 93 | 93 | chanResult.setbTime(DateUtil.getyyyy_MM_dd(patients.getBookbuildingDate())); |
| 94 | 94 | //注册地址 |
| 95 | - chanResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
| 96 | - chanResult.setAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); | |
| 95 | + chanResult.setRegisterAddr(CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService)); | |
| 96 | + chanResult.setAddr(CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
| 97 | 97 | try { |
| 98 | 98 | chanResult.setFirstBH(organizationService.getOrganization(Integer.valueOf(patients.getHospitalId())).getName()); |
| 99 | 99 | } catch (Exception e) { |