Commit a650bb6e0c0c18874fb265d50883351e9daa59da

Authored by jiangjiazhi
1 parent 1bc144e2a3

增加是否通知

Showing 1 changed file with 50 additions and 47 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ a650bb6
... ... @@ -5,12 +5,10 @@
5 5 import com.lyms.platform.common.enums.*;
6 6 import com.lyms.platform.common.result.BaseObjectResponse;
7 7 import com.lyms.platform.common.result.BaseResponse;
8   -import com.lyms.platform.common.utils.Assert;
9 8 import com.lyms.platform.common.utils.DateUtil;
10 9 import com.lyms.platform.common.utils.JsonUtil;
11 10 import com.lyms.platform.operate.web.request.MatDeliverAddRequest;
12 11 import com.lyms.platform.operate.web.request.MatDeliverQueryRequest;
13   -import com.lyms.platform.operate.web.result.AntenatalExaminationResult;
14 12 import com.lyms.platform.operate.web.result.MatDeliverListResult;
15 13 import com.lyms.platform.operate.web.result.MaternalDeliverResult;
16 14 import com.lyms.platform.permission.model.Organization;
... ... @@ -60,7 +58,7 @@
60 58 * @param deliverAddRequest
61 59 * @return
62 60 */
63   - public BaseResponse addOrUpdateMatDeliver(MatDeliverAddRequest deliverAddRequest,Integer userId) {
  61 + public BaseResponse addOrUpdateMatDeliver(MatDeliverAddRequest deliverAddRequest, Integer userId) {
64 62 //增加
65 63 if (StringUtils.isEmpty(deliverAddRequest.getId()) && StringUtils.isNotEmpty(deliverAddRequest.getParentId())) {
66 64 MaternalDeliverModel maternalDeliverModel = deliverAddRequest.convertToDataModel();
67 65  
68 66  
69 67  
... ... @@ -82,25 +80,27 @@
82 80 patientsService.updatePatient(patients.get(0));
83 81 }
84 82 }
85   -
86 83 for (MatDeliverAddRequest.Baby baby : list) {
87   - BabyModel babyModel = baby.convertToDataModel();
88   - babyModel.setParentId(parentId);
89   - babyModel.setName(userName + (babyModel.getSex() == 1 ? "之子" : "之女"));
90   - babyModel.setYn(YnEnums.YES.getId());
  84 + //判断妊娠结局是活产才添加数据
  85 + if ((RenShenJieJuEnums.O.getId() + "").equals(baby.getPregnancyOut())) {
  86 + BabyModel babyModel = baby.convertToDataModel();
  87 + babyModel.setParentId(parentId);
  88 + babyModel.setName(userName + (babyModel.getSex() == 1 ? "之子" : "之女"));
  89 + babyModel.setYn(YnEnums.YES.getId());
91 90  
92   - PersonModel personModel=new PersonModel();
93   - personModel.setType(2);
94   - personModel.setYn(YnEnums.YES.getId());
95   - personModel.setBirth(DateUtil.parseYMD(deliverAddRequest.getDueDate()));
96   - personModel.setModified(new Date());
97   - babyModel.setPid(personService.addPerson(personModel).getId());
98   - babyIds.add(babyService.addOneBaby(babyModel).getId());
  91 + PersonModel personModel = new PersonModel();
  92 + personModel.setType(2);
  93 + personModel.setYn(YnEnums.YES.getId());
  94 + personModel.setBirth(DateUtil.parseYMD(deliverAddRequest.getDueDate()));
  95 + personModel.setModified(new Date());
  96 + babyModel.setPid(personService.addPerson(personModel).getId());
  97 + babyIds.add(babyService.addOneBaby(babyModel).getId());
  98 + }
99 99 }
100 100 }
101   - List list1 = autoMatchFacade.matchOrgId(userId);
102   - if(CollectionUtils.isNotEmpty(list1)){
103   - maternalDeliverModel.setHospitalId(list1.get(0)+"");
  101 + List list1 = autoMatchFacade.matchOrgId(userId);
  102 + if (CollectionUtils.isNotEmpty(list1)) {
  103 + maternalDeliverModel.setHospitalId(list1.get(0) + "");
104 104 }
105 105 maternalDeliverModel.setBaby(babyIds);
106 106 maternalDeliverModel.setYn(YnEnums.YES.getId());
... ... @@ -149,7 +149,7 @@
149 149 */
150 150 public BaseResponse queryMatDeliver(MatDeliverQueryRequest deliverQueryRequest) {
151 151 //获取
152   - Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(),null);
  152 + Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null);
153 153 if (null == patients) {
154 154 return new BaseResponse().setErrormsg("没有相关的产妇记录").setErrorcode(ErrorCodeConstants.BUSINESS_ERROR);
155 155 }
156 156  
157 157  
158 158  
159 159  
... ... @@ -159,37 +159,37 @@
159 159 List<MaternalDeliverModel> list = matDeliverService.query(matDeliverQuery);
160 160 MatDeliverListResult matDeliverListResult = new MatDeliverListResult();
161 161 matDeliverListResult.convertToResult(list, patients);
162   - AntExQuery antExQuery=new AntExQuery();
  162 + AntExQuery antExQuery = new AntExQuery();
163 163 antExQuery.setParentId(patients.getId());
164 164 antExQuery.setYn(YnEnums.YES.getId());
165 165 List<AntenatalExaminationModel> examinationModel = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery());
166 166 try {
167   - String tTireNumber="";
  167 + String tTireNumber = "";
168 168 List data = new ArrayList();
169   - if(CollectionUtils.isNotEmpty(examinationModel)){
170   - if(null!=examinationModel&&StringUtils.isNotEmpty(examinationModel.get(0).getRiskFactor())){
171   - tTireNumber=examinationModel.get(0).getTireNumber();
172   - List l = JsonUtil.toList(examinationModel.get(0).getRiskFactor(),List.class);
173   - for(int i=0;i<l.size();i++){
174   - String key = (String)l.get(i);
175   - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(key);
176   - if(null!=basicConfig){
  169 + if (CollectionUtils.isNotEmpty(examinationModel)) {
  170 + if (null != examinationModel && StringUtils.isNotEmpty(examinationModel.get(0).getRiskFactor())) {
  171 + tTireNumber = examinationModel.get(0).getTireNumber();
  172 + List l = JsonUtil.toList(examinationModel.get(0).getRiskFactor(), List.class);
  173 + for (int i = 0; i < l.size(); i++) {
  174 + String key = (String) l.get(i);
  175 + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(key);
  176 + if (null != basicConfig) {
177 177 data.add(basicConfig.getName());
178 178 }
179 179 }
180 180 }
181   - }else{
182   - AntExChuQuery antExChuQuery=new AntExChuQuery();
  181 + } else {
  182 + AntExChuQuery antExChuQuery = new AntExChuQuery();
183 183 antExChuQuery.setYn(YnEnums.YES.getId());
184 184 antExChuQuery.setParentId(patients.getId());
185   - List<AntExChuModel> antExChuModels= antenatalExaminationService.queryAntExChu(antExChuQuery);
186   - if(CollectionUtils.isNotEmpty(antExChuModels)){
187   - tTireNumber=antExChuModels.get(0).getTireNumber();
188   - List l = JsonUtil.toList(antExChuModels.get(0).getHighrisk(),List.class);
189   - for(int i=0;i<l.size();i++){
190   - String key = (String)l.get(i);
191   - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(key);
192   - if(null!=basicConfig){
  185 + List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery);
  186 + if (CollectionUtils.isNotEmpty(antExChuModels)) {
  187 + tTireNumber = antExChuModels.get(0).getTireNumber();
  188 + List l = JsonUtil.toList(antExChuModels.get(0).getHighrisk(), List.class);
  189 + for (int i = 0; i < l.size(); i++) {
  190 + String key = (String) l.get(i);
  191 + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(key);
  192 + if (null != basicConfig) {
193 193 data.add(basicConfig.getName());
194 194 }
195 195 }
... ... @@ -198,7 +198,8 @@
198 198  
199 199 matDeliverListResult.setRiskFactor(data);
200 200 matDeliverListResult.setTireNumber1(tTireNumber);
201   - }catch (Exception e){}
  201 + } catch (Exception e) {
  202 + }
202 203 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(matDeliverListResult);
203 204 }
204 205  
205 206  
206 207  
207 208  
... ... @@ -261,19 +262,19 @@
261 262 map.put("getTaiPan", getTaiPan());
262 263 map.put("getQidaiYc", getQidaiYc());
263 264 map.put("getRenShenJieJuEnums", getRenShenJieJuEnums());
264   - map.put("organizations",convert());
265   - map.put("cTime",DateUtil.getyyyy_MM_dd(new Date()));
  265 + map.put("organizations", convert());
  266 + map.put("cTime", DateUtil.getyyyy_MM_dd(new Date()));
266 267 return new BaseObjectResponse().setData(map).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
267 268 }
268 269  
269   - private List convert(){
  270 + private List convert() {
270 271 List<Organization> organization = organizationService.queryHospital();
271 272 List data = new ArrayList();
272   - if(CollectionUtils.isNotEmpty(organization)){
273   - for(Organization org:organization){
  273 + if (CollectionUtils.isNotEmpty(organization)) {
  274 + for (Organization org : organization) {
274 275 Map map = new HashMap();
275   - map.put("id",org.getId());
276   - map.put("name",org.getName());
  276 + map.put("id", org.getId());
  277 + map.put("name", org.getName());
277 278 data.add(map);
278 279 }
279 280 }
... ... @@ -411,6 +412,7 @@
411 412 }
412 413 return list;
413 414 }
  415 +
414 416 //脐带异常类型
415 417 public List getQidaiYc() {
416 418 List<Object> list = new ArrayList<>();
... ... @@ -422,6 +424,7 @@
422 424 }
423 425 return list;
424 426 }
  427 +
425 428 //妊娠结局
426 429 public List getRenShenJieJuEnums() {
427 430 List<Object> list = new ArrayList<>();