Commit 446581b9839a95d0cb9ffe4210d2fca51d465c8f
1 parent
56c61c1101
Exists in
master
and in
6 other branches
孕妇死亡卡
Showing 13 changed files with 1068 additions and 49 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/PregnantDeathModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CervicalCancerController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PreEugenicsBaseController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantDeathController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/CommonParamRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PregnantDeathListRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PregnantDeathRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PregnantDeathModelResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IFormReportService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IPregnantDeathServer.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/CervicalCancerServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PreEugebicsServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PregnantDeathServerImpl.java
platform-dal/src/main/java/com/lyms/platform/pojo/PregnantDeathModel.java
View file @
446581b
| 1 | +package com.lyms.platform.pojo; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | +import java.util.Map; | |
| 5 | + | |
| 6 | +import org.springframework.data.mongodb.core.mapping.Document; | |
| 7 | + | |
| 8 | +import com.lyms.platform.common.result.BaseModel; | |
| 9 | + | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * @author dongqin | |
| 13 | + * @description 孕妇死亡报告单 | |
| 14 | + * @date 15:41 2019/11/29 | |
| 15 | + **/ | |
| 16 | +@Document(collection = "lyms_pregnant_death") | |
| 17 | +public class PregnantDeathModel extends BaseModel { | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * 主键 | |
| 21 | + */ | |
| 22 | + private String id; | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 死亡报告的的编号 | |
| 26 | + */ | |
| 27 | + private String number; | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 孕妇姓名 | |
| 31 | + */ | |
| 32 | + private String name; | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 手机号 | |
| 36 | + */ | |
| 37 | + private String phone; | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 孕次 | |
| 41 | + */ | |
| 42 | + private String yunSize; | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * 产次 | |
| 46 | + */ | |
| 47 | + private String chanSize; | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 末次月经 | |
| 51 | + */ | |
| 52 | + private Date lastMenstruation; | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 分娩方式 | |
| 56 | + */ | |
| 57 | + private String fmType; | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 填写人 | |
| 61 | + */ | |
| 62 | + private String createUser; | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * 医院id | |
| 66 | + */ | |
| 67 | + private String hospitalId; | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * 创建时间 | |
| 71 | + */ | |
| 72 | + private Date created; | |
| 73 | + | |
| 74 | + /** | |
| 75 | + * 居住地址 省市区街道详细地址 | |
| 76 | + */ | |
| 77 | + private String resideProvince; | |
| 78 | + private String resideCity; | |
| 79 | + private String resideArea; | |
| 80 | + private String resideStreet; | |
| 81 | + private String resideAddress; | |
| 82 | + | |
| 83 | + /** | |
| 84 | + * 暂住地址 省市区街道详细地址 | |
| 85 | + */ | |
| 86 | + private String temporaryProvince; | |
| 87 | + private String temporaryCity; | |
| 88 | + private String temporaryArea; | |
| 89 | + private String temporaryStreet; | |
| 90 | + private String temporaryAddress; | |
| 91 | + | |
| 92 | + /** | |
| 93 | + * 表单数据,前端同事自定义 | |
| 94 | + */ | |
| 95 | + private Map<String, Object> formData; | |
| 96 | + | |
| 97 | + public Map<String, Object> getFormData() { | |
| 98 | + return formData; | |
| 99 | + } | |
| 100 | + | |
| 101 | + public void setFormData(Map<String, Object> formData) { | |
| 102 | + this.formData = formData; | |
| 103 | + } | |
| 104 | + | |
| 105 | + public String getId() { | |
| 106 | + return id; | |
| 107 | + } | |
| 108 | + | |
| 109 | + public void setId(String id) { | |
| 110 | + this.id = id; | |
| 111 | + } | |
| 112 | + | |
| 113 | + public String getNumber() { | |
| 114 | + return number; | |
| 115 | + } | |
| 116 | + | |
| 117 | + public void setNumber(String number) { | |
| 118 | + this.number = number; | |
| 119 | + } | |
| 120 | + | |
| 121 | + public String getName() { | |
| 122 | + return name; | |
| 123 | + } | |
| 124 | + | |
| 125 | + public void setName(String name) { | |
| 126 | + this.name = name; | |
| 127 | + } | |
| 128 | + | |
| 129 | + public String getPhone() { | |
| 130 | + return phone; | |
| 131 | + } | |
| 132 | + | |
| 133 | + public void setPhone(String phone) { | |
| 134 | + this.phone = phone; | |
| 135 | + } | |
| 136 | + | |
| 137 | + public String getYunSize() { | |
| 138 | + return yunSize; | |
| 139 | + } | |
| 140 | + | |
| 141 | + public void setYunSize(String yunSize) { | |
| 142 | + this.yunSize = yunSize; | |
| 143 | + } | |
| 144 | + | |
| 145 | + public String getChanSize() { | |
| 146 | + return chanSize; | |
| 147 | + } | |
| 148 | + | |
| 149 | + public void setChanSize(String chanSize) { | |
| 150 | + this.chanSize = chanSize; | |
| 151 | + } | |
| 152 | + | |
| 153 | + public Date getLastMenstruation() { | |
| 154 | + return lastMenstruation; | |
| 155 | + } | |
| 156 | + | |
| 157 | + public void setLastMenstruation(Date lastMenstruation) { | |
| 158 | + this.lastMenstruation = lastMenstruation; | |
| 159 | + } | |
| 160 | + | |
| 161 | + public String getFmType() { | |
| 162 | + return fmType; | |
| 163 | + } | |
| 164 | + | |
| 165 | + public void setFmType(String fmType) { | |
| 166 | + this.fmType = fmType; | |
| 167 | + } | |
| 168 | + | |
| 169 | + public String getCreateUser() { | |
| 170 | + return createUser; | |
| 171 | + } | |
| 172 | + | |
| 173 | + public void setCreateUser(String createUser) { | |
| 174 | + this.createUser = createUser; | |
| 175 | + } | |
| 176 | + | |
| 177 | + public String getHospitalId() { | |
| 178 | + return hospitalId; | |
| 179 | + } | |
| 180 | + | |
| 181 | + public void setHospitalId(String hospitalId) { | |
| 182 | + this.hospitalId = hospitalId; | |
| 183 | + } | |
| 184 | + | |
| 185 | + public Date getCreated() { | |
| 186 | + return created; | |
| 187 | + } | |
| 188 | + | |
| 189 | + public void setCreated(Date created) { | |
| 190 | + this.created = created; | |
| 191 | + } | |
| 192 | + | |
| 193 | + public String getResideProvince() { | |
| 194 | + return resideProvince; | |
| 195 | + } | |
| 196 | + | |
| 197 | + public void setResideProvince(String resideProvince) { | |
| 198 | + this.resideProvince = resideProvince; | |
| 199 | + } | |
| 200 | + | |
| 201 | + public String getResideCity() { | |
| 202 | + return resideCity; | |
| 203 | + } | |
| 204 | + | |
| 205 | + public void setResideCity(String resideCity) { | |
| 206 | + this.resideCity = resideCity; | |
| 207 | + } | |
| 208 | + | |
| 209 | + public String getResideArea() { | |
| 210 | + return resideArea; | |
| 211 | + } | |
| 212 | + | |
| 213 | + public void setResideArea(String resideArea) { | |
| 214 | + this.resideArea = resideArea; | |
| 215 | + } | |
| 216 | + | |
| 217 | + public String getResideStreet() { | |
| 218 | + return resideStreet; | |
| 219 | + } | |
| 220 | + | |
| 221 | + public void setResideStreet(String resideStreet) { | |
| 222 | + this.resideStreet = resideStreet; | |
| 223 | + } | |
| 224 | + | |
| 225 | + public String getResideAddress() { | |
| 226 | + return resideAddress; | |
| 227 | + } | |
| 228 | + | |
| 229 | + public void setResideAddress(String resideAddress) { | |
| 230 | + this.resideAddress = resideAddress; | |
| 231 | + } | |
| 232 | + | |
| 233 | + public String getTemporaryProvince() { | |
| 234 | + return temporaryProvince; | |
| 235 | + } | |
| 236 | + | |
| 237 | + public void setTemporaryProvince(String temporaryProvince) { | |
| 238 | + this.temporaryProvince = temporaryProvince; | |
| 239 | + } | |
| 240 | + | |
| 241 | + public String getTemporaryCity() { | |
| 242 | + return temporaryCity; | |
| 243 | + } | |
| 244 | + | |
| 245 | + public void setTemporaryCity(String temporaryCity) { | |
| 246 | + this.temporaryCity = temporaryCity; | |
| 247 | + } | |
| 248 | + | |
| 249 | + public String getTemporaryArea() { | |
| 250 | + return temporaryArea; | |
| 251 | + } | |
| 252 | + | |
| 253 | + public void setTemporaryArea(String temporaryArea) { | |
| 254 | + this.temporaryArea = temporaryArea; | |
| 255 | + } | |
| 256 | + | |
| 257 | + public String getTemporaryStreet() { | |
| 258 | + return temporaryStreet; | |
| 259 | + } | |
| 260 | + | |
| 261 | + public void setTemporaryStreet(String temporaryStreet) { | |
| 262 | + this.temporaryStreet = temporaryStreet; | |
| 263 | + } | |
| 264 | + | |
| 265 | + public String getTemporaryAddress() { | |
| 266 | + return temporaryAddress; | |
| 267 | + } | |
| 268 | + | |
| 269 | + public void setTemporaryAddress(String temporaryAddress) { | |
| 270 | + this.temporaryAddress = temporaryAddress; | |
| 271 | + } | |
| 272 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CervicalCancerController.java
View file @
446581b
| ... | ... | @@ -7,7 +7,6 @@ |
| 7 | 7 | import org.springframework.web.bind.annotation.RequestBody; |
| 8 | 8 | import org.springframework.web.bind.annotation.RequestMapping; |
| 9 | 9 | import org.springframework.web.bind.annotation.RequestMethod; |
| 10 | -import org.springframework.web.bind.annotation.RequestParam; | |
| 11 | 10 | import org.springframework.web.bind.annotation.ResponseBody; |
| 12 | 11 | |
| 13 | 12 | import com.fasterxml.jackson.annotation.JsonAlias; |
| ... | ... | @@ -17,6 +16,7 @@ |
| 17 | 16 | import com.lyms.platform.common.result.BaseResponse; |
| 18 | 17 | import com.lyms.platform.operate.web.request.CervicalCancerListRequest; |
| 19 | 18 | import com.lyms.platform.operate.web.request.CervicalCancerRequest; |
| 19 | +import com.lyms.platform.operate.web.request.CommonParamRequest; | |
| 20 | 20 | import com.lyms.platform.operate.web.service.CervicalCancerService; |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | |
| ... | ... | @@ -35,14 +35,14 @@ |
| 35 | 35 | * |
| 36 | 36 | * 根据身份证号获取对应的建档信息 |
| 37 | 37 | * |
| 38 | - * @param idCard | |
| 38 | + * @param param | |
| 39 | 39 | * @return |
| 40 | 40 | */ |
| 41 | 41 | @RequestMapping(method = RequestMethod.GET, value = "/getPatientInfoByIdCard") |
| 42 | 42 | @ResponseBody |
| 43 | 43 | @TokenRequired |
| 44 | - public BaseResponse getPatientInfoByIdCard(@RequestParam String idCard) { | |
| 45 | - return cervicalCancerService.getPatientInfoByIdCard(idCard); | |
| 44 | + public BaseResponse getPatientInfoByIdCard(@JsonAlias CommonParamRequest param) { | |
| 45 | + return cervicalCancerService.getPatientInfoByIdCard(param); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PreEugenicsBaseController.java
View file @
446581b
| ... | ... | @@ -15,6 +15,7 @@ |
| 15 | 15 | import com.lyms.platform.common.base.BaseController; |
| 16 | 16 | import com.lyms.platform.common.result.BaseListResponse; |
| 17 | 17 | import com.lyms.platform.common.result.BaseResponse; |
| 18 | +import com.lyms.platform.operate.web.request.CommonParamRequest; | |
| 18 | 19 | import com.lyms.platform.operate.web.request.PreEugenicsBaseListRequest; |
| 19 | 20 | import com.lyms.platform.operate.web.request.PreEugenicsBaseRequest; |
| 20 | 21 | import com.lyms.platform.operate.web.service.IPreEugenicsService; |
| 21 | 22 | |
| ... | ... | @@ -35,14 +36,14 @@ |
| 35 | 36 | * |
| 36 | 37 | * 根据身份证号获取对应的孕前优生信息 |
| 37 | 38 | * |
| 38 | - * @param idCard | |
| 39 | + * @param param | |
| 39 | 40 | * @return |
| 40 | 41 | */ |
| 41 | 42 | @RequestMapping(method = RequestMethod.GET, value = "/getInfoByIdCard") |
| 42 | 43 | @ResponseBody |
| 43 | 44 | @TokenRequired |
| 44 | - public BaseResponse getPatientInfoByIdCard(@RequestParam String idCard) { | |
| 45 | - return iPreEugenicsService.getPatientInfoByIdCard(idCard); | |
| 45 | + public BaseResponse getPatientInfoByIdCard(@JsonAlias CommonParamRequest param) { | |
| 46 | + return iPreEugenicsService.getPatientInfoByIdCard(param); | |
| 46 | 47 | } |
| 47 | 48 | |
| 48 | 49 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantDeathController.java
View file @
446581b
| 1 | +package com.lyms.platform.operate.web.controller; | |
| 2 | + | |
| 3 | +import javax.servlet.http.HttpServletRequest; | |
| 4 | + | |
| 5 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 6 | +import org.springframework.stereotype.Controller; | |
| 7 | +import org.springframework.web.bind.annotation.RequestBody; | |
| 8 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 9 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 10 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 11 | +import org.springframework.web.bind.annotation.ResponseBody; | |
| 12 | + | |
| 13 | +import com.fasterxml.jackson.annotation.JsonAlias; | |
| 14 | +import com.lyms.platform.common.annotation.TokenRequired; | |
| 15 | +import com.lyms.platform.common.base.BaseController; | |
| 16 | +import com.lyms.platform.common.result.BaseListResponse; | |
| 17 | +import com.lyms.platform.common.result.BaseResponse; | |
| 18 | +import com.lyms.platform.operate.web.request.CommonParamRequest; | |
| 19 | +import com.lyms.platform.operate.web.request.PregnantDeathListRequest; | |
| 20 | +import com.lyms.platform.operate.web.request.PregnantDeathRequest; | |
| 21 | +import com.lyms.platform.operate.web.service.IPregnantDeathServer; | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * @author dongqin | |
| 25 | + * @description 孕产妇死亡报告卡 | |
| 26 | + * @date 16:05 2019/11/29 | |
| 27 | + **/ | |
| 28 | +@Controller | |
| 29 | +@RequestMapping("/pregnantDeath") | |
| 30 | +public class PregnantDeathController extends BaseController { | |
| 31 | + | |
| 32 | + @Autowired | |
| 33 | + private IPregnantDeathServer pregnantDeathServer; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * | |
| 37 | + * 根据身份证号获取对应的建档信息 | |
| 38 | + * | |
| 39 | + * @param param | |
| 40 | + * @return | |
| 41 | + */ | |
| 42 | + @RequestMapping(method = RequestMethod.GET, value = "/getPatientInfoByIdCard") | |
| 43 | + @ResponseBody | |
| 44 | + @TokenRequired | |
| 45 | + public BaseResponse getPatientInfoByIdCard(@JsonAlias CommonParamRequest param) { | |
| 46 | + return pregnantDeathServer.getPatientInfoByIdCard(param); | |
| 47 | + } | |
| 48 | + | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * 保存单个 | |
| 52 | + * | |
| 53 | + * @param param | |
| 54 | + * @return | |
| 55 | + */ | |
| 56 | + @RequestMapping(method = RequestMethod.POST, value = "/add") | |
| 57 | + @ResponseBody | |
| 58 | + @TokenRequired | |
| 59 | + public BaseResponse add(@RequestBody PregnantDeathRequest param, HttpServletRequest request) { | |
| 60 | + param.setCreateUser(getUserId(request).toString()); | |
| 61 | + return pregnantDeathServer.add(param); | |
| 62 | + } | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * 编辑单个 | |
| 66 | + * | |
| 67 | + * @param param | |
| 68 | + * @return | |
| 69 | + */ | |
| 70 | + @RequestMapping(method = RequestMethod.POST, value = "/edit") | |
| 71 | + @ResponseBody | |
| 72 | + @TokenRequired | |
| 73 | + public BaseResponse edit( @RequestBody PregnantDeathRequest param) { | |
| 74 | + return pregnantDeathServer.edit(param); | |
| 75 | + } | |
| 76 | + | |
| 77 | + /** | |
| 78 | + * 列表 | |
| 79 | + * | |
| 80 | + * @param param | |
| 81 | + * @return | |
| 82 | + */ | |
| 83 | + @RequestMapping(method = RequestMethod.GET, value = "/listPage") | |
| 84 | + @ResponseBody | |
| 85 | + @TokenRequired | |
| 86 | + public BaseListResponse listPage(@JsonAlias PregnantDeathListRequest param) { | |
| 87 | + return pregnantDeathServer.listPage(param); | |
| 88 | + } | |
| 89 | + | |
| 90 | + /** | |
| 91 | + * 单个查询 | |
| 92 | + * | |
| 93 | + * @param param | |
| 94 | + * @return | |
| 95 | + */ | |
| 96 | + @RequestMapping(method = RequestMethod.GET, value = "/detail") | |
| 97 | + @ResponseBody | |
| 98 | + @TokenRequired | |
| 99 | + public BaseResponse detail( @JsonAlias PregnantDeathRequest param) { | |
| 100 | + return pregnantDeathServer.detail(param); | |
| 101 | + } | |
| 102 | + | |
| 103 | + | |
| 104 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/CommonParamRequest.java
View file @
446581b
| 1 | +package com.lyms.platform.operate.web.request; | |
| 2 | + | |
| 3 | +import java.io.Serializable; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * @author dongqin | |
| 7 | + * @description | |
| 8 | + * @date 10:08 2019/12/2 | |
| 9 | + **/ | |
| 10 | +public class CommonParamRequest implements Serializable { | |
| 11 | + | |
| 12 | + private static final long serialVersionUID = -6426491224399839985L; | |
| 13 | + | |
| 14 | + /** | |
| 15 | + * 卡号:身份证号/证件号... | |
| 16 | + */ | |
| 17 | + private String cardNo; | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * 编号/就诊卡号.. | |
| 21 | + */ | |
| 22 | + private String otherNo; | |
| 23 | + | |
| 24 | + public String getCardNo() { | |
| 25 | + return cardNo; | |
| 26 | + } | |
| 27 | + | |
| 28 | + public void setCardNo(String cardNo) { | |
| 29 | + this.cardNo = cardNo; | |
| 30 | + } | |
| 31 | + | |
| 32 | + public String getOtherNo() { | |
| 33 | + return otherNo; | |
| 34 | + } | |
| 35 | + | |
| 36 | + public void setOtherNo(String otherNo) { | |
| 37 | + this.otherNo = otherNo; | |
| 38 | + } | |
| 39 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PregnantDeathListRequest.java
View file @
446581b
| 1 | +package com.lyms.platform.operate.web.request; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.dao.BaseQuery; | |
| 4 | + | |
| 5 | +public class PregnantDeathListRequest extends BaseQuery { | |
| 6 | + | |
| 7 | + /** | |
| 8 | + * 死亡报告卡的编号 | |
| 9 | + */ | |
| 10 | + private String number; | |
| 11 | + | |
| 12 | + /** | |
| 13 | + * 孕妇姓名 | |
| 14 | + */ | |
| 15 | + private String name; | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 手机号 | |
| 19 | + */ | |
| 20 | + private String phone; | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * 孕次 | |
| 24 | + */ | |
| 25 | + private String yunSize; | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 产次 | |
| 29 | + */ | |
| 30 | + private String chanSize; | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 填写人 | |
| 34 | + */ | |
| 35 | + private String createUser; | |
| 36 | + | |
| 37 | + /** | |
| 38 | + * 医院id | |
| 39 | + */ | |
| 40 | + private String hospitalId; | |
| 41 | + | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * 创建时间 | |
| 45 | + */ | |
| 46 | + private String startCreated; | |
| 47 | + private String endCreated; | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 居住地址 省市区街道详细地址 | |
| 51 | + */ | |
| 52 | + private String resideProvince; | |
| 53 | + private String resideCity; | |
| 54 | + private String resideArea; | |
| 55 | + private String resideStreet; | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * 暂住地址 省市区街道详细地址 | |
| 59 | + */ | |
| 60 | + private String temporaryProvince; | |
| 61 | + private String temporaryCity; | |
| 62 | + private String temporaryArea; | |
| 63 | + private String temporaryStreet; | |
| 64 | + | |
| 65 | + | |
| 66 | + public String getNumber() { | |
| 67 | + return number; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public void setNumber(String number) { | |
| 71 | + this.number = number; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public String getName() { | |
| 75 | + return name; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public void setName(String name) { | |
| 79 | + this.name = name; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public String getPhone() { | |
| 83 | + return phone; | |
| 84 | + } | |
| 85 | + | |
| 86 | + public void setPhone(String phone) { | |
| 87 | + this.phone = phone; | |
| 88 | + } | |
| 89 | + | |
| 90 | + public String getYunSize() { | |
| 91 | + return yunSize; | |
| 92 | + } | |
| 93 | + | |
| 94 | + public void setYunSize(String yunSize) { | |
| 95 | + this.yunSize = yunSize; | |
| 96 | + } | |
| 97 | + | |
| 98 | + public String getChanSize() { | |
| 99 | + return chanSize; | |
| 100 | + } | |
| 101 | + | |
| 102 | + public void setChanSize(String chanSize) { | |
| 103 | + this.chanSize = chanSize; | |
| 104 | + } | |
| 105 | + | |
| 106 | + public String getCreateUser() { | |
| 107 | + return createUser; | |
| 108 | + } | |
| 109 | + | |
| 110 | + public void setCreateUser(String createUser) { | |
| 111 | + this.createUser = createUser; | |
| 112 | + } | |
| 113 | + | |
| 114 | + public String getHospitalId() { | |
| 115 | + return hospitalId; | |
| 116 | + } | |
| 117 | + | |
| 118 | + public void setHospitalId(String hospitalId) { | |
| 119 | + this.hospitalId = hospitalId; | |
| 120 | + } | |
| 121 | + | |
| 122 | + public String getStartCreated() { | |
| 123 | + return startCreated; | |
| 124 | + } | |
| 125 | + | |
| 126 | + public void setStartCreated(String startCreated) { | |
| 127 | + this.startCreated = startCreated; | |
| 128 | + } | |
| 129 | + | |
| 130 | + public String getEndCreated() { | |
| 131 | + return endCreated; | |
| 132 | + } | |
| 133 | + | |
| 134 | + public void setEndCreated(String endCreated) { | |
| 135 | + this.endCreated = endCreated; | |
| 136 | + } | |
| 137 | + | |
| 138 | + public String getResideProvince() { | |
| 139 | + return resideProvince; | |
| 140 | + } | |
| 141 | + | |
| 142 | + public void setResideProvince(String resideProvince) { | |
| 143 | + this.resideProvince = resideProvince; | |
| 144 | + } | |
| 145 | + | |
| 146 | + public String getResideCity() { | |
| 147 | + return resideCity; | |
| 148 | + } | |
| 149 | + | |
| 150 | + public void setResideCity(String resideCity) { | |
| 151 | + this.resideCity = resideCity; | |
| 152 | + } | |
| 153 | + | |
| 154 | + public String getResideArea() { | |
| 155 | + return resideArea; | |
| 156 | + } | |
| 157 | + | |
| 158 | + public void setResideArea(String resideArea) { | |
| 159 | + this.resideArea = resideArea; | |
| 160 | + } | |
| 161 | + | |
| 162 | + public String getResideStreet() { | |
| 163 | + return resideStreet; | |
| 164 | + } | |
| 165 | + | |
| 166 | + public void setResideStreet(String resideStreet) { | |
| 167 | + this.resideStreet = resideStreet; | |
| 168 | + } | |
| 169 | + | |
| 170 | + | |
| 171 | + public String getTemporaryProvince() { | |
| 172 | + return temporaryProvince; | |
| 173 | + } | |
| 174 | + | |
| 175 | + public void setTemporaryProvince(String temporaryProvince) { | |
| 176 | + this.temporaryProvince = temporaryProvince; | |
| 177 | + } | |
| 178 | + | |
| 179 | + public String getTemporaryCity() { | |
| 180 | + return temporaryCity; | |
| 181 | + } | |
| 182 | + | |
| 183 | + public void setTemporaryCity(String temporaryCity) { | |
| 184 | + this.temporaryCity = temporaryCity; | |
| 185 | + } | |
| 186 | + | |
| 187 | + public String getTemporaryArea() { | |
| 188 | + return temporaryArea; | |
| 189 | + } | |
| 190 | + | |
| 191 | + public void setTemporaryArea(String temporaryArea) { | |
| 192 | + this.temporaryArea = temporaryArea; | |
| 193 | + } | |
| 194 | + | |
| 195 | + public String getTemporaryStreet() { | |
| 196 | + return temporaryStreet; | |
| 197 | + } | |
| 198 | + | |
| 199 | + public void setTemporaryStreet(String temporaryStreet) { | |
| 200 | + this.temporaryStreet = temporaryStreet; | |
| 201 | + } | |
| 202 | + | |
| 203 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PregnantDeathRequest.java
View file @
446581b
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PregnantDeathModelResult.java
View file @
446581b
| 1 | +package com.lyms.platform.operate.web.result; | |
| 2 | + | |
| 3 | +import com.lyms.platform.pojo.PregnantDeathModel; | |
| 4 | + | |
| 5 | +public class PregnantDeathModelResult extends PregnantDeathModel { | |
| 6 | + /** | |
| 7 | + * 居住地址 省市区街道详细地址 | |
| 8 | + */ | |
| 9 | + private String resideAddressStr; | |
| 10 | + | |
| 11 | + /** | |
| 12 | + * 暂住地址 省市区街道详细地址 | |
| 13 | + */ | |
| 14 | + private String temporaryAddressStr; | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * 填写单位 | |
| 18 | + */ | |
| 19 | + private String hospitalStr; | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * 填写人 | |
| 23 | + */ | |
| 24 | + private String createUserStr; | |
| 25 | + | |
| 26 | + public String getResideAddressStr() { | |
| 27 | + return resideAddressStr; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public void setResideAddressStr(String resideAddressStr) { | |
| 31 | + this.resideAddressStr = resideAddressStr; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public String getTemporaryAddressStr() { | |
| 35 | + return temporaryAddressStr; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public void setTemporaryAddressStr(String temporaryAddressStr) { | |
| 39 | + this.temporaryAddressStr = temporaryAddressStr; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public String getHospitalStr() { | |
| 43 | + return hospitalStr; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public void setHospitalStr(String hospitalStr) { | |
| 47 | + this.hospitalStr = hospitalStr; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public String getCreateUserStr() { | |
| 51 | + return createUserStr; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public void setCreateUserStr(String createUserStr) { | |
| 55 | + this.createUserStr = createUserStr; | |
| 56 | + } | |
| 57 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IFormReportService.java
View file @
446581b
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | import com.lyms.platform.common.result.BaseListResponse; |
| 5 | 5 | import com.lyms.platform.common.result.BaseModel; |
| 6 | 6 | import com.lyms.platform.common.result.BaseResponse; |
| 7 | +import com.lyms.platform.operate.web.request.CommonParamRequest; | |
| 7 | 8 | |
| 8 | 9 | public interface IFormReportService<Q extends BaseModel, S extends BaseQuery> { |
| 9 | 10 | |
| 10 | 11 | |
| ... | ... | @@ -42,9 +43,9 @@ |
| 42 | 43 | /** |
| 43 | 44 | * 根据身份证号获取对应的信息 |
| 44 | 45 | * |
| 45 | - * @param idCard | |
| 46 | + * @param param 检索的条件 | |
| 46 | 47 | * @return |
| 47 | 48 | */ |
| 48 | - BaseResponse getPatientInfoByIdCard(String idCard); | |
| 49 | + BaseResponse getPatientInfoByIdCard(CommonParamRequest param); | |
| 49 | 50 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IPregnantDeathServer.java
View file @
446581b
| 1 | +package com.lyms.platform.operate.web.service; | |
| 2 | + | |
| 3 | +import com.lyms.platform.operate.web.request.PregnantDeathListRequest; | |
| 4 | +import com.lyms.platform.operate.web.request.PregnantDeathRequest; | |
| 5 | + | |
| 6 | +public interface IPregnantDeathServer extends IFormReportService<PregnantDeathRequest, PregnantDeathListRequest> { | |
| 7 | + | |
| 8 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/CervicalCancerServiceImpl.java
View file @
446581b
| ... | ... | @@ -2,7 +2,6 @@ |
| 2 | 2 | |
| 3 | 3 | import java.util.Date; |
| 4 | 4 | import java.util.List; |
| 5 | -import java.util.Map; | |
| 6 | 5 | |
| 7 | 6 | import org.springframework.beans.BeanUtils; |
| 8 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | 8 | |
| ... | ... | @@ -17,12 +16,12 @@ |
| 17 | 16 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 18 | 17 | import com.lyms.platform.common.result.BaseListResponse; |
| 19 | 18 | import com.lyms.platform.common.result.BaseResponse; |
| 20 | -import com.lyms.platform.common.utils.MapUtil; | |
| 21 | 19 | import com.lyms.platform.common.utils.MongoConvertHelper; |
| 22 | 20 | import com.lyms.platform.common.utils.ReflectionUtils; |
| 23 | 21 | import com.lyms.platform.common.utils.StringUtils; |
| 24 | 22 | import com.lyms.platform.operate.web.request.CervicalCancerListRequest; |
| 25 | 23 | import com.lyms.platform.operate.web.request.CervicalCancerRequest; |
| 24 | +import com.lyms.platform.operate.web.request.CommonParamRequest; | |
| 26 | 25 | import com.lyms.platform.operate.web.result.CervicalCancerModelResult; |
| 27 | 26 | import com.lyms.platform.operate.web.service.CervicalCancerService; |
| 28 | 27 | import com.lyms.platform.operate.web.utils.CollectionUtils; |
| 29 | 28 | |
| 30 | 29 | |
| ... | ... | @@ -140,15 +139,19 @@ |
| 140 | 139 | /** |
| 141 | 140 | * 根据身份证号获取对应的建档信息 |
| 142 | 141 | * |
| 143 | - * @param idCard | |
| 142 | + * @param param | |
| 144 | 143 | * @return |
| 145 | 144 | */ |
| 146 | 145 | @Override |
| 147 | - public BaseResponse getPatientInfoByIdCard(String idCard) { | |
| 148 | - CervicalCancerModel modelByIdCardNo = mongoTemplate.findOne(Query.query(Criteria.where("idCardNo").is(idCard)), CervicalCancerModel.class); | |
| 146 | + public BaseResponse getPatientInfoByIdCard(CommonParamRequest param) { | |
| 147 | + String cardNo = param.getCardNo(); | |
| 148 | + if (StringUtils.isEmpty(cardNo)) { | |
| 149 | + return new BaseResponse("参数缺失",ErrorCodeConstants.PARAMETER_ERROR); | |
| 150 | + } | |
| 151 | + CervicalCancerModel modelByIdCardNo = mongoTemplate.findOne(Query.query(Criteria.where("idCardNo").is(cardNo)), CervicalCancerModel.class); | |
| 149 | 152 | CervicalCancerModelResult result = new CervicalCancerModelResult(); |
| 150 | 153 | if (modelByIdCardNo == null) { |
| 151 | - List<ResidentsArchiveModel> models = mongoTemplate.find(Query.query(Criteria.where("certificateNum").is(idCard)).with(new Sort(Sort.Direction.DESC, "created")), ResidentsArchiveModel.class); | |
| 154 | + List<ResidentsArchiveModel> models = mongoTemplate.find(Query.query(Criteria.where("certificateNum").is(cardNo)).with(new Sort(Sort.Direction.DESC, "created")), ResidentsArchiveModel.class); | |
| 152 | 155 | if (CollectionUtils.isEmpty(models)) { |
| 153 | 156 | return new BaseResponse("查无数据,请先到妇女建档进行建档操作", ErrorCodeConstants.NO_DATA); |
| 154 | 157 | } |
| ... | ... | @@ -177,9 +180,9 @@ |
| 177 | 180 | return baseResponse; |
| 178 | 181 | } |
| 179 | 182 | |
| 180 | - CervicalCancerRequest param = new CervicalCancerRequest(); | |
| 181 | - param.setId(modelByIdCardNo.getId()); | |
| 182 | - return detail(param); | |
| 183 | + CervicalCancerRequest request = new CervicalCancerRequest(); | |
| 184 | + request.setId(modelByIdCardNo.getId()); | |
| 185 | + return detail(request); | |
| 183 | 186 | } |
| 184 | 187 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PreEugebicsServiceImpl.java
View file @
446581b
| ... | ... | @@ -21,6 +21,7 @@ |
| 21 | 21 | import com.lyms.platform.common.utils.MongoConvertHelper; |
| 22 | 22 | import com.lyms.platform.common.utils.ReflectionUtils; |
| 23 | 23 | import com.lyms.platform.common.utils.StringUtils; |
| 24 | +import com.lyms.platform.operate.web.request.CommonParamRequest; | |
| 24 | 25 | import com.lyms.platform.operate.web.request.PreEugenicsBaseListRequest; |
| 25 | 26 | import com.lyms.platform.operate.web.request.PreEugenicsBaseRequest; |
| 26 | 27 | import com.lyms.platform.operate.web.result.PreEugenicsBaseListResult; |
| 27 | 28 | |
| 28 | 29 | |
| 29 | 30 | |
| 30 | 31 | |
| 31 | 32 | |
| ... | ... | @@ -48,44 +49,54 @@ |
| 48 | 49 | /** |
| 49 | 50 | * 根据身份证号获取对应的孕前优生信息 |
| 50 | 51 | * |
| 51 | - * @param idCard | |
| 52 | + * @param param | |
| 52 | 53 | * @return |
| 53 | 54 | */ |
| 54 | 55 | @Override |
| 55 | - public BaseResponse getPatientInfoByIdCard(String idCard) { | |
| 56 | - PreEugenicsBaseModel one = mongoTemplate.findOne(Query.query(Criteria.where("husbandCardNo").is(idCard) | |
| 57 | - .orOperator(Criteria.where("wifeCardNo").is(idCard))), PreEugenicsBaseModel.class); | |
| 56 | + public BaseResponse getPatientInfoByIdCard(CommonParamRequest param) { | |
| 57 | + String cardNo = param.getCardNo(); | |
| 58 | + Query query = new Query(); | |
| 59 | + if (StringUtils.isNotEmpty(cardNo)) { | |
| 60 | + query.addCriteria(Criteria.where("husbandCardNo").is(cardNo).orOperator(Criteria.where("wifeCardNo").is(cardNo))); | |
| 61 | + } | |
| 62 | + String otherNo = param.getOtherNo(); | |
| 63 | + if (StringUtils.isNotEmpty(otherNo)) { | |
| 64 | + query.addCriteria(Criteria.where("husbandNo").is(otherNo).orOperator(Criteria.where("wifeNo").is(otherNo))); | |
| 65 | + } | |
| 66 | + PreEugenicsBaseModel one = mongoTemplate.findOne(query, PreEugenicsBaseModel.class); | |
| 58 | 67 | if (one == null) { |
| 59 | - ResidentsArchiveModel model = mongoTemplate.findOne(Query.query(Criteria.where("certificateNum").is(idCard)), ResidentsArchiveModel.class); | |
| 60 | - if (model == null) { | |
| 61 | - return new BaseResponse(); | |
| 62 | - } | |
| 63 | - one = new PreEugenicsBaseModel(); | |
| 64 | - one.setWifeName(model.getUsername()); | |
| 65 | - one.setWifeNation(model.getNationId()); | |
| 66 | - one.setWifeBirthday(model.getBirthday()); | |
| 67 | - one.setWifeAge(DateUtil.getAge(model.getBirthday()).toString()); | |
| 68 | - one.setWifeEducational(model.getLevelTypeId()); | |
| 69 | - one.setWifeCardType(model.getCertificateTypeId()); | |
| 70 | - one.setWifeCardNo(model.getCertificateNum()); | |
| 71 | - one.setWifeCareer(model.getProfessionTypeId()); | |
| 68 | + if (StringUtils.isNotEmpty(cardNo)) { | |
| 69 | + ResidentsArchiveModel model = mongoTemplate.findOne(Query.query(Criteria.where("certificateNum").is(cardNo)), ResidentsArchiveModel.class); | |
| 70 | + if (model == null) { | |
| 71 | + return new BaseResponse(); | |
| 72 | + } | |
| 73 | + one = new PreEugenicsBaseModel(); | |
| 74 | + one.setWifeName(model.getUsername()); | |
| 75 | + one.setWifeNation(model.getNationId()); | |
| 76 | + one.setWifeBirthday(model.getBirthday()); | |
| 77 | + one.setWifeAge(DateUtil.getAge(model.getBirthday()).toString()); | |
| 78 | + one.setWifeEducational(model.getLevelTypeId()); | |
| 79 | + one.setWifeCardType(model.getCertificateTypeId()); | |
| 80 | + one.setWifeCardNo(model.getCertificateNum()); | |
| 81 | + one.setWifeCareer(model.getProfessionTypeId()); | |
| 72 | 82 | |
| 73 | - // 妇女户口地址 | |
| 74 | - one.setWifeAccountProvince(model.getProvinceRegisterId()); | |
| 75 | - one.setWifeAccountCity(model.getCityRegisterId()); | |
| 76 | - one.setWifeAccountArea(model.getAreaRegisterId()); | |
| 77 | - one.setWifeAccountStreet(model.getStreetRegisterId()); | |
| 78 | - one.setWifeAccountAddress(model.getStreetRegisterId()); | |
| 83 | + // 妇女户口地址 | |
| 84 | + one.setWifeAccountProvince(model.getProvinceRegisterId()); | |
| 85 | + one.setWifeAccountCity(model.getCityRegisterId()); | |
| 86 | + one.setWifeAccountArea(model.getAreaRegisterId()); | |
| 87 | + one.setWifeAccountStreet(model.getStreetRegisterId()); | |
| 88 | + one.setWifeAccountAddress(model.getStreetRegisterId()); | |
| 79 | 89 | |
| 80 | - // 丈夫信息 | |
| 81 | - one.setHusbandName(model.getSpouseName()); | |
| 82 | - one.setHusbandPhone(model.getSpousePhone()); | |
| 83 | - one.setHusbandCardType(model.getSpouseCertTypeId()); | |
| 84 | - one.setHusbandCardNo(model.getSpouseCardNo()); | |
| 90 | + // 丈夫信息 | |
| 91 | + one.setHusbandName(model.getSpouseName()); | |
| 92 | + one.setHusbandPhone(model.getSpousePhone()); | |
| 93 | + one.setHusbandCardType(model.getSpouseCertTypeId()); | |
| 94 | + one.setHusbandCardNo(model.getSpouseCardNo()); | |
| 85 | 95 | |
| 86 | - BaseResponse baseResponse = new BaseResponse(); | |
| 87 | - baseResponse.setObject(one); | |
| 88 | - return baseResponse; | |
| 96 | + BaseResponse baseResponse = new BaseResponse(); | |
| 97 | + baseResponse.setObject(one); | |
| 98 | + return baseResponse; | |
| 99 | + } | |
| 89 | 100 | } |
| 90 | 101 | |
| 91 | 102 | BaseResponse baseResponse = new BaseResponse(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PregnantDeathServerImpl.java
View file @
446581b
| 1 | +package com.lyms.platform.operate.web.service.impl; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | +import java.util.LinkedList; | |
| 5 | +import java.util.List; | |
| 6 | + | |
| 7 | +import org.springframework.beans.BeanUtils; | |
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 9 | +import org.springframework.data.domain.Sort; | |
| 10 | +import org.springframework.data.mongodb.core.MongoTemplate; | |
| 11 | +import org.springframework.data.mongodb.core.query.Criteria; | |
| 12 | +import org.springframework.data.mongodb.core.query.Query; | |
| 13 | +import org.springframework.data.mongodb.core.query.Update; | |
| 14 | +import org.springframework.stereotype.Service; | |
| 15 | + | |
| 16 | +import com.lyms.platform.biz.service.BasicConfigService; | |
| 17 | +import com.lyms.platform.common.result.BaseListResponse; | |
| 18 | +import com.lyms.platform.common.result.BaseResponse; | |
| 19 | +import com.lyms.platform.common.utils.DateUtil; | |
| 20 | +import com.lyms.platform.common.utils.MongoConvertHelper; | |
| 21 | +import com.lyms.platform.common.utils.ReflectionUtils; | |
| 22 | +import com.lyms.platform.common.utils.StringUtils; | |
| 23 | +import com.lyms.platform.operate.web.request.CommonParamRequest; | |
| 24 | +import com.lyms.platform.operate.web.request.PregnantDeathListRequest; | |
| 25 | +import com.lyms.platform.operate.web.request.PregnantDeathRequest; | |
| 26 | +import com.lyms.platform.operate.web.result.PregnantDeathModelResult; | |
| 27 | +import com.lyms.platform.operate.web.service.IPregnantDeathServer; | |
| 28 | +import com.lyms.platform.operate.web.utils.CollectionUtils; | |
| 29 | +import com.lyms.platform.operate.web.utils.CommonsHelper; | |
| 30 | +import com.lyms.platform.permission.model.Organization; | |
| 31 | +import com.lyms.platform.permission.model.Users; | |
| 32 | +import com.lyms.platform.permission.service.OrganizationService; | |
| 33 | +import com.lyms.platform.permission.service.UsersService; | |
| 34 | +import com.lyms.platform.pojo.AntExChuModel; | |
| 35 | +import com.lyms.platform.pojo.Patients; | |
| 36 | +import com.lyms.platform.pojo.PersonModel; | |
| 37 | +import com.lyms.platform.pojo.PregnantDeathModel; | |
| 38 | + | |
| 39 | +@Service | |
| 40 | +public class PregnantDeathServerImpl implements IPregnantDeathServer { | |
| 41 | + | |
| 42 | + @Autowired | |
| 43 | + private MongoTemplate mongoTemplate; | |
| 44 | + | |
| 45 | + @Autowired | |
| 46 | + private BasicConfigService basicConfigService; | |
| 47 | + | |
| 48 | + @Autowired | |
| 49 | + private OrganizationService organizationService; | |
| 50 | + | |
| 51 | + @Autowired | |
| 52 | + private UsersService usersService; | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 保存单个 | |
| 56 | + * | |
| 57 | + * @param param | |
| 58 | + * @return | |
| 59 | + */ | |
| 60 | + @Override | |
| 61 | + public BaseResponse add(PregnantDeathRequest param) { | |
| 62 | + param.setCreated(new Date()); | |
| 63 | + mongoTemplate.insert(param); | |
| 64 | + return new BaseResponse(); | |
| 65 | + } | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * 编辑单个 | |
| 69 | + * | |
| 70 | + * @param param | |
| 71 | + * @return | |
| 72 | + */ | |
| 73 | + @Override | |
| 74 | + public BaseResponse edit(PregnantDeathRequest param) { | |
| 75 | + Query query = Query.query(Criteria.where("id").is(param.getId())); | |
| 76 | + Update update = MongoConvertHelper | |
| 77 | + .convertToNativeUpdate(ReflectionUtils.getUpdateField(param)); | |
| 78 | + mongoTemplate.updateFirst(query, update, PregnantDeathModel.class); | |
| 79 | + return new BaseResponse(); | |
| 80 | + } | |
| 81 | + | |
| 82 | + /** | |
| 83 | + * 列表 | |
| 84 | + * | |
| 85 | + * @param param | |
| 86 | + * @return | |
| 87 | + */ | |
| 88 | + @Override | |
| 89 | + public BaseListResponse listPage(PregnantDeathListRequest param) { | |
| 90 | + Query query = new Query(); | |
| 91 | + // 编号 | |
| 92 | + String number = param.getNumber(); | |
| 93 | + if (StringUtils.isNotEmpty(number)) { | |
| 94 | + query.addCriteria(Criteria.where("number").is(number)); | |
| 95 | + } | |
| 96 | + // 姓名 | |
| 97 | + String name = param.getName(); | |
| 98 | + if (StringUtils.isNotEmpty(name)) { | |
| 99 | + query.addCriteria(Criteria.where("name").is(name)); | |
| 100 | + } | |
| 101 | + // 手机号 | |
| 102 | + String phone = param.getPhone(); | |
| 103 | + if (StringUtils.isNotEmpty(phone)) { | |
| 104 | + query.addCriteria(Criteria.where("phone").is(phone)); | |
| 105 | + } | |
| 106 | + // 孕次 | |
| 107 | + String yunSize = param.getYunSize(); | |
| 108 | + if (StringUtils.isNotEmpty(yunSize)) { | |
| 109 | + query.addCriteria(Criteria.where("yunSize").is(yunSize)); | |
| 110 | + } | |
| 111 | + // 产次 | |
| 112 | + String chanSize = param.getChanSize(); | |
| 113 | + if (StringUtils.isNotEmpty(chanSize)) { | |
| 114 | + query.addCriteria(Criteria.where("chanSize").is(chanSize)); | |
| 115 | + } | |
| 116 | + // 填写人 | |
| 117 | + String createUser = param.getCreateUser(); | |
| 118 | + if (StringUtils.isNotEmpty(createUser)) { | |
| 119 | + query.addCriteria(Criteria.where("createUser").is(createUser)); | |
| 120 | + } | |
| 121 | + // 填写单位 | |
| 122 | + String hospitalId = param.getHospitalId(); | |
| 123 | + if (StringUtils.isNotEmpty(hospitalId)) { | |
| 124 | + query.addCriteria(Criteria.where("hospitalId").is(hospitalId)); | |
| 125 | + } | |
| 126 | + // 填写时间 | |
| 127 | + String startCreated = param.getStartCreated(); | |
| 128 | + String endCreated = param.getEndCreated(); | |
| 129 | + if (StringUtils.isNotEmpty(startCreated) && StringUtils.isNotEmpty(endCreated)) { | |
| 130 | + Date startDate = DateUtil.parseYMD(startCreated); | |
| 131 | + Date dayFirstSecond = DateUtil.getDayFirstSecond(startDate); | |
| 132 | + Date endDate = DateUtil.parseYMD(endCreated); | |
| 133 | + Date dayLastSecond = DateUtil.getDayLastSecond(endDate); | |
| 134 | + query.addCriteria(Criteria.where("created").gte(dayFirstSecond).lte(dayLastSecond)); | |
| 135 | + } | |
| 136 | + | |
| 137 | + // 居住地址 | |
| 138 | + String resideProvince = param.getResideProvince(); | |
| 139 | + if (StringUtils.isNotEmpty(resideProvince)) { | |
| 140 | + query.addCriteria(Criteria.where("resideProvince").is(resideProvince)); | |
| 141 | + String resideCity = param.getResideCity(); | |
| 142 | + if (StringUtils.isNotEmpty(resideCity)) { | |
| 143 | + query.addCriteria(Criteria.where("resideCity").is(resideCity)); | |
| 144 | + String resideArea = param.getResideArea(); | |
| 145 | + if (StringUtils.isNotEmpty(resideArea)) { | |
| 146 | + query.addCriteria(Criteria.where("resideArea").is(resideArea)); | |
| 147 | + } | |
| 148 | + } | |
| 149 | + } | |
| 150 | + | |
| 151 | + // 暂住地址 | |
| 152 | + String temporaryProvince = param.getTemporaryProvince(); | |
| 153 | + if (StringUtils.isNotEmpty(temporaryProvince)) { | |
| 154 | + query.addCriteria(Criteria.where("temporaryProvince").is(temporaryProvince)); | |
| 155 | + String temporaryCity = param.getTemporaryCity(); | |
| 156 | + if (StringUtils.isNotEmpty(temporaryCity)) { | |
| 157 | + query.addCriteria(Criteria.where("temporaryCity").is(temporaryCity)); | |
| 158 | + String temporaryArea = param.getTemporaryArea(); | |
| 159 | + if (StringUtils.isNotEmpty(temporaryArea)) { | |
| 160 | + query.addCriteria(Criteria.where("temporaryArea").is(temporaryArea)); | |
| 161 | + String temporaryStreet = param.getTemporaryStreet(); | |
| 162 | + if (StringUtils.isNotEmpty(temporaryStreet)) { | |
| 163 | + query.addCriteria(Criteria.where("temporaryStreet").is(temporaryStreet)); | |
| 164 | + } | |
| 165 | + } | |
| 166 | + } | |
| 167 | + } | |
| 168 | + | |
| 169 | + query.with(new Sort(Sort.Direction.DESC, "created")); | |
| 170 | + long count = mongoTemplate.count(query, PregnantDeathModel.class); | |
| 171 | + param.mysqlBuild((int) count); | |
| 172 | + query.skip(param.getOffset()).limit(param.getLimit()); | |
| 173 | + List<PregnantDeathModelResult> results = new LinkedList<>(); | |
| 174 | + List<PregnantDeathModel> models = mongoTemplate.find(query, PregnantDeathModel.class); | |
| 175 | + for (PregnantDeathModel model : models) { | |
| 176 | + PregnantDeathModelResult result = new PregnantDeathModelResult(); | |
| 177 | + getOtherStr(result, model); | |
| 178 | + results.add(result); | |
| 179 | + } | |
| 180 | + | |
| 181 | + BaseListResponse baseListResponse = new BaseListResponse(); | |
| 182 | + baseListResponse.setData(results); | |
| 183 | + baseListResponse.setPageInfo(param.getPageInfo()); | |
| 184 | + return baseListResponse; | |
| 185 | + } | |
| 186 | + | |
| 187 | + /** | |
| 188 | + * 单个查询 | |
| 189 | + * | |
| 190 | + * @param param | |
| 191 | + * @return | |
| 192 | + */ | |
| 193 | + @Override | |
| 194 | + public BaseResponse detail(PregnantDeathRequest param) { | |
| 195 | + String id = param.getId(); | |
| 196 | + if (StringUtils.isEmpty(id)) { | |
| 197 | + return new BaseResponse(); | |
| 198 | + } | |
| 199 | + PregnantDeathModelResult result = new PregnantDeathModelResult(); | |
| 200 | + PregnantDeathModel model = mongoTemplate.findOne(Query.query(Criteria.where("id").is(id)), PregnantDeathModel.class); | |
| 201 | + if (model != null) { | |
| 202 | + getOtherStr(result, model); | |
| 203 | + } | |
| 204 | + BaseResponse baseResponse = new BaseResponse(); | |
| 205 | + baseResponse.setObject(result); | |
| 206 | + return baseResponse; | |
| 207 | + } | |
| 208 | + | |
| 209 | + private void getOtherStr(PregnantDeathModelResult result, PregnantDeathModel model) { | |
| 210 | + BeanUtils.copyProperties(model, result); | |
| 211 | + result.setResideAddressStr(CommonsHelper.getResidence( | |
| 212 | + result.getResideProvince(), | |
| 213 | + result.getResideCity(), | |
| 214 | + result.getResideArea(), | |
| 215 | + result.getResideStreet(), | |
| 216 | + result.getResideAddress(), | |
| 217 | + basicConfigService)); | |
| 218 | + result.setTemporaryAddressStr(CommonsHelper.getResidence( | |
| 219 | + result.getTemporaryProvince(), | |
| 220 | + result.getTemporaryCity(), | |
| 221 | + result.getTemporaryArea(), | |
| 222 | + result.getTemporaryStreet(), | |
| 223 | + result.getTemporaryAddress(), | |
| 224 | + basicConfigService | |
| 225 | + )); | |
| 226 | + String createUser = result.getCreateUser(); | |
| 227 | + if (StringUtils.isNotEmpty(createUser)) { | |
| 228 | + Users users = usersService.getUsers(Integer.parseInt(createUser)); | |
| 229 | + if (users != null) { | |
| 230 | + result.setCreateUserStr(users.getName()); | |
| 231 | + } | |
| 232 | + } | |
| 233 | + String hospitalId = result.getHospitalId(); | |
| 234 | + if (StringUtils.isNotEmpty(hospitalId)) { | |
| 235 | + Organization organization = organizationService.getOrganization(Integer.parseInt(hospitalId)); | |
| 236 | + if (organization != null) { | |
| 237 | + result.setHospitalStr(organization.getName()); | |
| 238 | + } | |
| 239 | + } | |
| 240 | + } | |
| 241 | + | |
| 242 | + /** | |
| 243 | + * 根据身份证号获取对应的信息 | |
| 244 | + * | |
| 245 | + * @param param | |
| 246 | + * @return | |
| 247 | + */ | |
| 248 | + @Override | |
| 249 | + public BaseResponse getPatientInfoByIdCard(CommonParamRequest param) { | |
| 250 | + String cardNo = param.getCardNo(); | |
| 251 | + Query query = new Query(); | |
| 252 | + if (StringUtils.isNotEmpty(cardNo)) { | |
| 253 | + query.addCriteria(Criteria.where("certificateNum").is(cardNo)); | |
| 254 | + } | |
| 255 | + String otherNo = param.getOtherNo(); | |
| 256 | + if (StringUtils.isNotEmpty(otherNo)) { | |
| 257 | + query.addCriteria(Criteria.where("number").is(otherNo)); | |
| 258 | + } | |
| 259 | + PregnantDeathModel model = mongoTemplate.findOne(query.with(new Sort(Sort.Direction.DESC, "created")), PregnantDeathModel.class); | |
| 260 | + PregnantDeathModelResult result = new PregnantDeathModelResult(); | |
| 261 | + if (model != null) { | |
| 262 | + getOtherStr(result, model); | |
| 263 | + BaseResponse baseResponse = new BaseResponse(); | |
| 264 | + baseResponse.setObject(result); | |
| 265 | + return baseResponse; | |
| 266 | + } | |
| 267 | + | |
| 268 | + if (StringUtils.isNotEmpty(cardNo)) { | |
| 269 | + PersonModel personModel = mongoTemplate.findOne(Query.query(Criteria.where("cardNo").is(cardNo)), PersonModel.class); | |
| 270 | + if (personModel != null) { | |
| 271 | + List<Patients> patients = mongoTemplate.find(Query.query(Criteria.where("pid").is(personModel.getId())).with(new Sort(Sort.Direction.DESC, "created")), Patients.class); | |
| 272 | + if (CollectionUtils.isNotEmpty(patients)) { | |
| 273 | + Patients patient = patients.get(0); | |
| 274 | + result.setName(personModel.getName()); | |
| 275 | + result.setPhone(personModel.getPhone()); | |
| 276 | + result.setLastMenstruation(patient.getLastMenses()); | |
| 277 | + result.setResideProvince(patient.getProvincePostRestId()); | |
| 278 | + result.setResideCity(patient.getCityPostRestId()); | |
| 279 | + result.setResideArea(patient.getAreaRegisterId()); | |
| 280 | + result.setResideStreet(patient.getStreetRegisterId()); | |
| 281 | + result.setResideAddress(patient.getAddressRegister()); | |
| 282 | + result.setResideAddressStr( CommonsHelper.getResidence( | |
| 283 | + patient.getProvinceRegisterId(), | |
| 284 | + patient.getCityRegisterId(), | |
| 285 | + patient.getAreaRegisterId(), | |
| 286 | + patient.getStreetRegisterId(), | |
| 287 | + patient.getAddressRegister(), | |
| 288 | + basicConfigService)); | |
| 289 | + AntExChuModel antExChuModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(patient.getId())), AntExChuModel.class); | |
| 290 | + if (antExChuModel != null) { | |
| 291 | + // 产次 | |
| 292 | + Integer prodTime = antExChuModel.getProdTime(); | |
| 293 | + if (prodTime != null) { | |
| 294 | + result.setChanSize(prodTime.toString()); | |
| 295 | + } | |
| 296 | + // 孕次 | |
| 297 | + Integer pregnancyTimes = antExChuModel.getPregnancyTimes(); | |
| 298 | + if (pregnancyTimes != null) { | |
| 299 | + result.setYunSize(pregnancyTimes.toString()); | |
| 300 | + } | |
| 301 | + } | |
| 302 | + BaseResponse baseResponse = new BaseResponse(); | |
| 303 | + baseResponse.setObject(result); | |
| 304 | + return baseResponse; | |
| 305 | + } | |
| 306 | + } | |
| 307 | + } | |
| 308 | + | |
| 309 | + BaseResponse baseResponse = new BaseResponse(); | |
| 310 | + baseResponse.setObject(result); | |
| 311 | + return baseResponse; | |
| 312 | + } | |
| 313 | +} |