Commit 2be0ef9ae47413e01a6542d3bc14f154f5a6eb96

Authored by liquanyu
1 parent bef581c348

民生工程修改

Showing 3 changed files with 728 additions and 282 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/LivelihoodProjectsController.java View file @ 2be0ef9
... ... @@ -58,9 +58,11 @@
58 58 */
59 59 @RequestMapping(value = "/getMsgcC101", method = RequestMethod.GET)
60 60 @ResponseBody
61   - public BaseObjectResponse getMsgcC101(@RequestParam(required = false) String startDate,
  61 + public BaseObjectResponse getMsgcC101(
  62 + @RequestParam(required = false) String cardNo,
  63 + @RequestParam(required = false) String startDate,
62 64 @RequestParam(required = false) String endDate) {
63   - return livelihoodProjectsFacade.getMsgcC101(startDate,endDate);
  65 + return livelihoodProjectsFacade.getMsgcC101(startDate,endDate,cardNo);
64 66 }
65 67  
66 68 /**
... ... @@ -86,7 +88,8 @@
86 88 @ResponseBody
87 89 public BaseObjectResponse getMsgcC201(@RequestParam(required = false) String startDate,
88 90 @RequestParam(required = false) String endDate,
89   - @RequestParam(required = false) String cardNo) {
  91 + @RequestParam(required = false) String cardNo
  92 + ) {
90 93 return livelihoodProjectsFacade.getMsgcC201(startDate,endDate,cardNo);
91 94 }
92 95 /**
... ... @@ -100,6 +103,13 @@
100 103 public BaseObjectResponse getMsgcC301(@RequestParam(required = false) String startDate,
101 104 @RequestParam(required = false) String endDate) {
102 105 return livelihoodProjectsFacade.getMsgcC301(startDate,endDate);
  106 + }
  107 +
  108 + @RequestMapping(value = "/getMsgcFm", method = RequestMethod.GET)
  109 + @ResponseBody
  110 + public BaseObjectResponse getMsgcFm(@RequestParam(required = false) String startDate,
  111 + @RequestParam(required = false) String endDate) {
  112 + return livelihoodProjectsFacade.getMsgcFm(startDate,endDate);
103 113 }
104 114 /**
105 115 * 新生儿信息(从)C401
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LivelihoodProjectsFacade.java View file @ 2be0ef9
Diff suppressed. Click to show
... ... @@ -15,6 +15,7 @@
15 15 import com.lyms.platform.common.utils.PropertiesUtils;
16 16 import com.lyms.platform.common.utils.SystemConfig;
17 17 import com.lyms.platform.operate.web.result.BasicConfigResult;
  18 +import com.lyms.platform.operate.web.result.MsgcResult;
18 19 import com.lyms.platform.operate.web.utils.CollectionUtils;
19 20 import com.lyms.platform.operate.web.utils.CommonsHelper;
20 21 import com.lyms.platform.permission.dao.master.CouponMapper;
21 22  
22 23  
... ... @@ -66,257 +67,20 @@
66 67 private CouponMapper couponMapper;
67 68  
68 69  
69   - public BaseObjectResponse getMsgcC101(String startDate, String endDate) {
  70 + public BaseObjectResponse getMsgcC101(String startDate, String endDate,String cardNo) {
70 71 List<Map> data = new ArrayList<>();
71   -// //查询条件
72   -// ResidentsArchiveQuery query = new ResidentsArchiveQuery();
73   -// query.setYn(YnEnums.YES.getId());
74   -// if (StringUtils.isNotEmpty(startDate) && StringUtils.isNotEmpty(endDate)) {
75   -// query.setBuildDateStart(DateUtil.getDayFirstSecond(DateUtil.parseYMD(startDate)));
76   -// query.setBuildDateEnd(DateUtil.getDayLastSecond(DateUtil.parseYMD(endDate)));
77   -// }else {
78   -// //默认获取当天数据
79   -// query.setBuildDateStart(DateUtil.getDayFirstSecond(new Date()));
80   -// query.setBuildDateEnd(DateUtil.getDayLastSecond(new Date()));
81   -// }
82   -// //只查询女性
83   -// query.setSex(SystemConfig.WOMAN_ID);
84   -//
85   -// List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(query);
86   -// List<Map> data = new ArrayList<>();
87   -// for (ResidentsArchiveModel model : modelList) {
88   -// try {
89   -// Map<String, Object> map = new HashMap<>();
90   -// //id
91   -// map.put("id",StringUtils.isNotEmpty(model.getId())?model.getId():"/");
92   -// //档案编号
93   -// map.put("file_number",null);
94   -// //纸质档案编号
95   -// map.put("file_number_paper",null);
96   -// //证件类型(lyms_basicconfig表中查"parentId": "c914bb2e-1825-4036-8a41-fe617c90d405")
97   -// String credentials_type_code="99";
98   -// if(StringUtils.isNotEmpty(model.getCertificateTypeId())){
99   -// switch (model.getCertificateTypeId()){
100   -// case "70ae1d93-2964-46bc-83fa-bec9ff605b1c":
101   -// //身份证
102   -// credentials_type_code="1";
103   -// break;
104   -// case "5797135b0cf2dd415ca09fe1":
105   -// //护照
106   -// credentials_type_code="3";
107   -// break;
108   -// case "efa9ede5-bd40-42bb-8966-a0bf4c20d8fb":
109   -// //军官证
110   -// credentials_type_code="1";
111   -// break;
112   -// }
113   -// }
114   -// map.put("credentials_type_code",credentials_type_code);
115   -// //其他身份证件名称
116   -// map.put("other_credentials_type",null);
117   -// //证件号码
118   -// map.put("credentials_number",StringUtils.isNotEmpty(model.getCertificateNum())?model.getCertificateNum():"/");
119   -// //出生日期
120   -// String birthday=DateUtil.getyyyy_MM_dd_hms(model.getBirthday());
121   -// if(StringUtils.isEmpty(birthday)){
122   -// if(StringUtils.isNotEmpty(model.getCertificateNum())){
123   -// //用身份证获取
124   -// birthday=DateUtil.getBirthFromIdCard(model.getCertificateNum());
125   -// if(StringUtils.isEmpty(birthday)){
126   -// birthday=DateUtil.getyyyy_MM_dd_hms(new Date());
127   -// }
128   -// }else {
129   -// birthday=DateUtil.getyyyy_MM_dd_hms(new Date());
130   -// }
131   -// }
132   -// map.put("birthday",birthday);
133   -// //姓名
134   -// map.put("name",StringUtils.isNotEmpty(model.getUsername())?model.getUsername():"/");
135   -// //姓名简拼
136   -// map.put("en_name",null);
137   -// //所属民族
138   -// String nation_code= CdGwNationEnums.getId(getBasicConfig(model.getNationId()));
139   -// map.put("nation_code",StringUtils.isNotEmpty(nation_code)?nation_code:"99");
140   -// //性别
141   -// map.put("gender_code","2");
142   -// //工作单位
143   -// map.put("work_unit",StringUtils.isNotEmpty(model.getWorkUnit())?model.getWorkUnit():null);
144   -// //固定电话
145   -// map.put("tel",null);
146   -// //手机号
147   -// map.put("phone",StringUtils.isNotEmpty(model.getPhone())?model.getPhone():"/");
148   -// //联系人姓名
149   -// map.put("contact_name",null);
150   -// //联系人电话
151   -// map.put("contact_phone",null);
152   -// //是否常驻
153   -// map.put("is_permanent_code",null);
154   -// //流动情况
155   -// map.put("permanent_type_code",null);
156   -//
157   -// //户籍类型(lyms_basicconfig表中查"parentId": "57624ba30cf23d4631523e9d")
158   -// String address_type_code="2";
159   -// if(StringUtils.isNotEmpty(model.getCensusTypeId())){
160   -// switch (model.getCensusTypeId()){
161   -// case "57624bf90cf23d4631523e9e":
162   -// //非农业户口
163   -// address_type_code="2";
164   -// break;
165   -// case "57624c090cf23d4631523e9f":
166   -// //农业户口
167   -// address_type_code="1";
168   -// break;
169   -// }
170   -// }
171   -// map.put("census_register_type_code",address_type_code);
172   -// //居住类型
173   -// map.put("address_type_code",null);
174   -// //户籍区划编码
175   -// map.put("residence_district_id",null);
176   -// //户籍地址区划详情
177   -// map.put("residence_district_detail",null);
178   -// //户籍地址
179   -// map.put("residence_address",null);
180   -// //身份证住址
181   -// map.put("id_card_address",null);
182   -// //年龄
183   -// Integer age=model.getAge();
184   -// if(null==model.getAge()){
185   -// if(StringUtils.isNotEmpty(model.getCertificateNum())){
186   -// //用身份证获取
187   -// age=DateUtil.getAgeForIdcard(model.getCertificateNum());
188   -// }
189   -// }
190   -// map.put("age",age);
191   -// //身高(cm)系统中不能获取 没有就传最小取值
192   -// map.put("height",20);
193   -// //血型
194   -// map.put("blood_type_code",null);
195   -// //RH阴性
196   -// map.put("blood_type_rh_code",null);
197   -// //文化程度(lyms_basicconfig表中查"parentId": "8046934b-ebe8-4037-98b6-a9ec47996700")
198   -// String edu_attainment_code="10";
199   -// if(StringUtils.isNotEmpty(model.getLevelTypeId())){
200   -// switch (model.getLevelTypeId()){
201   -// case "b819b01b-fc48-4ce7-b623-c2a3b56ffc91":
202   -// //研究生(博士后)
203   -// edu_attainment_code="1";
204   -// break;
205   -// case "15555f3c-4f11-4473-b289-ba20b2e37161":
206   -// //研究生(博士)
207   -// edu_attainment_code="1";
208   -// break;
209   -// case "c88bb1f0-9a75-4ad4-9ac8-0b04fa2701c7":
210   -// //研究生(硕士)
211   -// edu_attainment_code="1";
212   -// break;
213   -// case "11b87441-c63c-419b-b2d0-d968a002f4ce":
214   -// //大学本科
215   -// edu_attainment_code="2";
216   -// break;
217   -// case "7e49120b-ec92-44c4-b77c-5fb151a7bdd4":
218   -// //大学专科和专科学校
219   -// edu_attainment_code="3";
220   -// break;
221   -// case "ec0fd0b3-f404-4c50-887f-28baa31b3870":
222   -// //中等专业学校
223   -// edu_attainment_code="4";
224   -// break;
225   -// case "6c95f456-3e9e-45f4-bdef-04fd0ce4daf7":
226   -// //技工学校
227   -// edu_attainment_code="5";
228   -// break;
229   -// case "baa86f20-535a-4874-b09d-9f5ae8d89a5d":
230   -// //高中
231   -// edu_attainment_code="6";
232   -// break;
233   -// case "7a8f2edf-ef69-494f-95a3-c98149c35978":
234   -// //初中
235   -// edu_attainment_code="7";
236   -// break;
237   -// case "4250cdba-2d25-41ef-acf8-ebbde48156b2":
238   -// //小学
239   -// edu_attainment_code="8";
240   -// break;
241   -// case "b4157251-2fbc-4d70-b32f-d78e1b4f9251":
242   -// //文盲或半文盲
243   -// edu_attainment_code="9";
244   -// break;
245   -// }
246   -// }
247   -// map.put("edu_attainment_code",edu_attainment_code);
248   -// //职业
249   -// map.put("profession_code",null);
250   -// //婚姻状况(lyms_basicconfig表中查"parentId": "0ab3e86b-dfdb-47eb-a58b-a2f2d978b69f")
251   -// String marital_status_code="5";
252   -// if(StringUtils.isNotEmpty(model.getMarriageId())){
253   -// switch (model.getMarriageId()){
254   -// case "d049eaaa-7265-4cdb-879f-992ab6320a3a":
255   -// //未婚
256   -// marital_status_code="1";
257   -// break;
258   -// case "d75d1902-61a5-4a17-a68a-5b8a9826537b":
259   -// //已婚
260   -// marital_status_code="2";
261   -// break;
262   -// }
263   -// }
264   -// map.put("marital_status_code",marital_status_code);
265   -// //责任医生
266   -// map.put("doctor_name",null);
267   -// //建档人
268   -// String create_doctor="/";
269   -// if(StringUtils.isNotEmpty(model.getBuildDoctor())) {
270   -// Users user = usersService.getUsers(Integer.parseInt(model.getBuildDoctor()));
271   -// if (null!=user && StringUtils.isNotEmpty(user.getName())) {
272   -// create_doctor=user.getName();
273   -// }
274   -// }
275   -// map.put("create_doctor",create_doctor);
276   -// //建档日期
277   -// map.put("this_date",null!=model.getBuildDay()?DateUtil.getyyyy_MM_dd_hms(model.getBuildDay()):DateUtil.getyyyy_MM_dd_hms(new Date()));
278   -// //出生人口编码
279   -// map.put("childbirth_code",null);
280   -// //是否孕妇
281   -// map.put("is_gravida",null);
282   -// //是否产妇
283   -// map.put("is_puerpera",null);
284   -// //系统录入时间
285   -// map.put("entering_time",null!=model.getCreated()?DateUtil.getyyyy_MM_dd_hms(model.getCreated()):DateUtil.getyyyy_MM_dd_hms(new Date()));
286   -// //所属机构编码
287   -// String hospital_name = couponMapper.findHospitalNameById(model.getHospitalId());
288   -// String organ_id=organizationService.getPlatHosNewCode(hospital_name);
289   -// map.put("organ_id", StringUtils.isNotEmpty(organ_id)?organ_id:"/");
290   -// //现住址国家区划编码(现住址国家区划编码(村/居委会)取 县/区 级的编码
291   -// String areaName="";
292   -// if(StringUtils.isNotEmpty(model.getAreaId())){
293   -// areaName=CommonsHelper.getName1(model.getAreaId(), basicConfigService);
294   -// }
295   -// if(StringUtils.isNotEmpty(model.getAreaRegisterId()) && StringUtils.isEmpty(areaName)){
296   -// areaName=CommonsHelper.getName1(model.getAreaRegisterId(), basicConfigService);
297   -// }
298   -// map.put("district_nation_code", organizationService.getAreaCode(areaName));
299   -// //母亲姓名简拼
300   -// map.put("mother_en_name",null);
301   -// //数据上传时间
302   -//// map.put("import_time",null);
303   -// //修改时间
304   -// map.put("last_modified_time",null);
305   -// //删除状态,0正常,1删除
306   -// map.put("is_deleted","0");
307   -// //删除时间
308   -// map.put("deleted_time",null);
309   -// data.add(map);
310   -// } catch (NumberFormatException e) {
311   -// e.printStackTrace();
312   -// }
313   -// }
314 72  
315 73 /***********************************************************************/
316 74 //patient表数据组装
317 75 PatientsQuery patientsQuery = new PatientsQuery();
318 76 patientsQuery.setYn(YnEnums.YES.getId());
319   - patientsQuery.setTypeList(Arrays.asList(1,3));//孕妇,产妇
  77 + if (StringUtils.isNotEmpty(cardNo)){
  78 +
  79 + patientsQuery.setCardNo(cardNo);
  80 + }
  81 + //patientsQuery.setTypeList(Arrays.asList(1,3));//孕妇,产妇
  82 + patientsQuery.setType(3);//产妇
  83 +
320 84 patientsQuery.setExtEnable(false);
321 85 patientsQuery.setBuildTypeNot(1);
322 86 if (StringUtils.isNotEmpty(startDate) && StringUtils.isNotEmpty(endDate)) {
... ... @@ -561,6 +325,232 @@
561 325 return objectResponse;
562 326 }
563 327  
  328 +
  329 + public Map<String, Object> getC101Person(String id) {
  330 +
  331 + Patients model = patientsService.findOnePatientById(id);
  332 + try {
  333 + Map<String, Object> map = new HashMap<>();
  334 + //id
  335 + map.put("id",StringUtils.isNotEmpty(model.getId())?model.getId():"/");
  336 + //档案编号
  337 + map.put("file_number",null);
  338 + //纸质档案编号
  339 + map.put("file_number_paper",null);
  340 + //证件类型(lyms_basicconfig表中查"parentId": "c914bb2e-1825-4036-8a41-fe617c90d405")
  341 + String credentials_type_code="99";
  342 + if(StringUtils.isNotEmpty(model.getPcerteTypeId())){
  343 + switch (model.getPcerteTypeId()){
  344 + case "70ae1d93-2964-46bc-83fa-bec9ff605b1c":
  345 + //身份证
  346 + credentials_type_code="1";
  347 + break;
  348 + case "5797135b0cf2dd415ca09fe1":
  349 + //护照
  350 + credentials_type_code="3";
  351 + break;
  352 + case "efa9ede5-bd40-42bb-8966-a0bf4c20d8fb":
  353 + //军官证
  354 + credentials_type_code="1";
  355 + break;
  356 + }
  357 + }
  358 + map.put("credentials_type_code",credentials_type_code);
  359 + //其他身份证件名称
  360 + map.put("other_credentials_type",null);
  361 + //证件号码
  362 + map.put("credentials_number",StringUtils.isNotEmpty(model.getCardNo())?model.getCardNo():"/");
  363 + //出生日期
  364 + String birthday=DateUtil.getyyyy_MM_dd_hms(model.getBirth());
  365 + if(StringUtils.isEmpty(birthday)){
  366 + if(StringUtils.isNotEmpty(model.getCardNo())){
  367 + //用身份证获取
  368 + birthday=DateUtil.getBirthFromIdCard(model.getCardNo());
  369 + if(StringUtils.isEmpty(birthday)){
  370 + birthday=DateUtil.getyyyy_MM_dd_hms(new Date());
  371 + }
  372 + }else {
  373 + birthday=DateUtil.getyyyy_MM_dd_hms(new Date());
  374 + }
  375 + }
  376 + map.put("birthday",birthday);
  377 + //姓名
  378 + map.put("name",StringUtils.isNotEmpty(model.getUsername())?model.getUsername():"/");
  379 + //姓名简拼
  380 + map.put("en_name",null);
  381 + //所属民族
  382 + String nation_code= CdGwNationEnums.getId(getBasicConfig(model.getPnationId()));
  383 + map.put("nation_code",StringUtils.isNotEmpty(nation_code)?nation_code:"99");
  384 + //性别
  385 + map.put("gender_code","2");
  386 + //工作单位
  387 + map.put("work_unit",StringUtils.isNotEmpty(model.getPworkUnit())?model.getPworkUnit():null);
  388 + //固定电话
  389 + map.put("tel",null);
  390 + //手机号
  391 + map.put("phone",StringUtils.isNotEmpty(model.getPhone())?model.getPhone():"/");
  392 + //联系人姓名
  393 + map.put("contact_name",null);
  394 + //联系人电话
  395 + map.put("contact_phone",null);
  396 + //是否常驻
  397 + map.put("is_permanent_code",null);
  398 + //流动情况
  399 + map.put("permanent_type_code",null);
  400 +
  401 + //户籍类型(lyms_basicconfig表中查"parentId": "57624ba30cf23d4631523e9d")
  402 + String address_type_code="2";
  403 + if(StringUtils.isNotEmpty(model.getPcensusTypeId())){
  404 + switch (model.getPcensusTypeId()){
  405 + case "57624bf90cf23d4631523e9e":
  406 + //非农业户口
  407 + address_type_code="2";
  408 + break;
  409 + case "57624c090cf23d4631523e9f":
  410 + //农业户口
  411 + address_type_code="1";
  412 + break;
  413 + }
  414 + }
  415 + map.put("census_register_type_code",address_type_code);
  416 + //居住类型
  417 + map.put("address_type_code",null);
  418 + //户籍区划编码
  419 + map.put("residence_district_id",null);
  420 + //户籍地址区划详情
  421 + map.put("residence_district_detail",null);
  422 + //户籍地址
  423 + map.put("residence_address",null);
  424 + //身份证住址
  425 + map.put("id_card_address",null);
  426 + //年龄
  427 + Integer age=model.getAge();
  428 + if(null==model.getAge()){
  429 + if(StringUtils.isNotEmpty(model.getCardNo())){
  430 + //用身份证获取
  431 + age=DateUtil.getAgeForIdcard(model.getCardNo());
  432 + }
  433 + }
  434 + map.put("age",age);
  435 + //身高(cm)系统中不能获取 没有就传最小取值
  436 + map.put("height",20);
  437 + //血型
  438 + map.put("blood_type_code",null);
  439 + //RH阴性
  440 + map.put("blood_type_rh_code",null);
  441 + //文化程度(lyms_basicconfig表中查"parentId": "8046934b-ebe8-4037-98b6-a9ec47996700")
  442 + String edu_attainment_code="10";
  443 + if(StringUtils.isNotEmpty(model.getLevelTypeId())){
  444 + switch (model.getLevelTypeId()){
  445 + case "b819b01b-fc48-4ce7-b623-c2a3b56ffc91":
  446 + //研究生(博士后)
  447 + edu_attainment_code="1";
  448 + break;
  449 + case "15555f3c-4f11-4473-b289-ba20b2e37161":
  450 + //研究生(博士)
  451 + edu_attainment_code="1";
  452 + break;
  453 + case "c88bb1f0-9a75-4ad4-9ac8-0b04fa2701c7":
  454 + //研究生(硕士)
  455 + edu_attainment_code="1";
  456 + break;
  457 + case "11b87441-c63c-419b-b2d0-d968a002f4ce":
  458 + //大学本科
  459 + edu_attainment_code="2";
  460 + break;
  461 + case "7e49120b-ec92-44c4-b77c-5fb151a7bdd4":
  462 + //大学专科和专科学校
  463 + edu_attainment_code="3";
  464 + break;
  465 + case "ec0fd0b3-f404-4c50-887f-28baa31b3870":
  466 + //中等专业学校
  467 + edu_attainment_code="4";
  468 + break;
  469 + case "6c95f456-3e9e-45f4-bdef-04fd0ce4daf7":
  470 + //技工学校
  471 + edu_attainment_code="5";
  472 + break;
  473 + case "baa86f20-535a-4874-b09d-9f5ae8d89a5d":
  474 + //高中
  475 + edu_attainment_code="6";
  476 + break;
  477 + case "7a8f2edf-ef69-494f-95a3-c98149c35978":
  478 + //初中
  479 + edu_attainment_code="7";
  480 + break;
  481 + case "4250cdba-2d25-41ef-acf8-ebbde48156b2":
  482 + //小学
  483 + edu_attainment_code="8";
  484 + break;
  485 + case "b4157251-2fbc-4d70-b32f-d78e1b4f9251":
  486 + //文盲或半文盲
  487 + edu_attainment_code="9";
  488 + break;
  489 + }
  490 + }
  491 + map.put("edu_attainment_code",edu_attainment_code);
  492 + //职业
  493 + map.put("profession_code",null);
  494 + //婚姻状况 没有准确字段,用marriageStatus代替
  495 + String marital_status_code="5";
  496 + if(null!=model.getMarriageStatus()){
  497 + if(model.getMarriageStatus()==1 || model.getMarriageStatus()==2){
  498 + //初婚,再婚算已婚
  499 + marital_status_code="2";
  500 + }
  501 + }
  502 + map.put("marital_status_code",marital_status_code);
  503 + //责任医生
  504 + map.put("doctor_name",null);
  505 + //建档人
  506 + String create_doctor="/";
  507 + if(StringUtils.isNotEmpty(model.getBookbuildingDoctor())) {
  508 + Users user = usersService.getUsers(Integer.parseInt(model.getBookbuildingDoctor()));
  509 + if (null!=user && StringUtils.isNotEmpty(user.getName())) {
  510 + create_doctor=user.getName();
  511 + }
  512 + }
  513 + map.put("create_doctor",create_doctor);
  514 + //建档日期
  515 + map.put("this_date",null!=model.getBookbuildingDate()?DateUtil.getyyyy_MM_dd_hms(model.getBookbuildingDate()):DateUtil.getyyyy_MM_dd_hms(new Date()));
  516 + //出生人口编码
  517 + map.put("childbirth_code",null);
  518 + //是否孕妇
  519 + map.put("is_gravida",null);
  520 + //是否产妇
  521 + map.put("is_puerpera",null);
  522 + //系统录入时间
  523 + map.put("entering_time",null!=model.getCreated()?DateUtil.getyyyy_MM_dd_hms(model.getCreated()):DateUtil.getyyyy_MM_dd_hms(new Date()));
  524 + //所属机构编码
  525 + String hospital_name = couponMapper.findHospitalNameById(model.getHospitalId());
  526 + String organ_id=organizationService.getPlatHosNewCode(hospital_name);
  527 + map.put("organ_id", StringUtils.isNotEmpty(organ_id)?organ_id:"/");
  528 + //现住址国家区划编码(现住址国家区划编码(村/居委会)取 县/区 级的编码 如果现住址没有 就拿户籍地
  529 + String areaName="";
  530 + if(StringUtils.isNotEmpty(model.getAreaRegisterId())){
  531 + areaName=CommonsHelper.getName1(model.getAreaRegisterId(), basicConfigService);
  532 + }
  533 + if(StringUtils.isNotEmpty(model.getAreaId()) && StringUtils.isEmpty(areaName)){
  534 + areaName=CommonsHelper.getName1(model.getAreaId(), basicConfigService);
  535 + }
  536 + map.put("district_nation_code", organizationService.getAreaCode(areaName));
  537 + //母亲姓名简拼
  538 + map.put("mother_en_name",null);
  539 + //数据上传时间
  540 +// map.put("import_time",null);
  541 + //修改时间
  542 + map.put("last_modified_time",null);
  543 + //删除状态,0正常,1删除
  544 + map.put("is_deleted","0");
  545 + //删除时间
  546 + map.put("deleted_time",null);
  547 + return map;
  548 + } catch (NumberFormatException e) {
  549 + e.printStackTrace();
  550 + }
  551 + return null;
  552 + }
  553 +
564 554 private String getBasicConfig(String id) {
565 555 if (com.lyms.platform.common.utils.StringUtils.isEmpty(id)) {
566 556 return "";
567 557  
568 558  
569 559  
... ... @@ -772,23 +762,20 @@
772 762 public BaseObjectResponse getMsgcC201(String startDate, String endDate,String cardNo) {
773 763 PatientsQuery patientsQuery = new PatientsQuery();
774 764 patientsQuery.setYn(YnEnums.YES.getId());
775   - patientsQuery.setTypeList(Arrays.asList(1,3));//孕妇,产妇
776 765 patientsQuery.setExtEnable(false);
777 766 patientsQuery.setBuildTypeNot(1);
778 767 if (StringUtils.isNotEmpty(cardNo))
779 768 {
780 769 patientsQuery.setCardNo(cardNo);
  770 +
781 771 }
  772 + patientsQuery.setType(3);//产妇
  773 + // patientsQuery.setTypeList(Arrays.asList(1,3));//孕妇,产妇
782 774  
783 775 if (StringUtils.isNotEmpty(startDate) && StringUtils.isNotEmpty(endDate)) {
784 776 patientsQuery.setBookbuildingDateStart(DateUtil.getDayFirstSecond(DateUtil.parseYMD(startDate)));
785 777 patientsQuery.setBookbuildingDateEnd(DateUtil.getDayLastSecond(DateUtil.parseYMD(endDate)));
786 778 }
787   -// else {
788   -// //默认获取当天数据
789   -// patientsQuery.setBookbuildingDateStart(DateUtil.getDayFirstSecond(new Date()));
790   -// patientsQuery.setBookbuildingDateEnd(DateUtil.getDayLastSecond(new Date()));
791   -// }
792 779 List <Patients> patientsList = patientsService.queryPatient(patientsQuery);
793 780 List<Map> data = new ArrayList<>();
794 781 for (Patients patients : patientsList) {
795 782  
... ... @@ -804,13 +791,14 @@
804 791 {
805 792 continue;
806 793 }
807   - }else if ("16".equals(HIS_VERSION))
808   - {
809   - if (patients.getBookbuildingDate() != null && patients.getFmDate() != null && DateUtil.daysBetween(patients.getBookbuildingDate(),patients.getFmDate()) <= 30)
810   - {
811   - continue;
812   - }
813 794 }
  795 +// else if ("16".equals(HIS_VERSION))
  796 +// {
  797 +// if (patients.getBookbuildingDate() != null && patients.getFmDate() != null && DateUtil.daysBetween(patients.getBookbuildingDate(),patients.getFmDate()) <= 30)
  798 +// {
  799 +// continue;
  800 +// }
  801 +// }
814 802  
815 803  
816 804 Map<String, Object> map = new HashMap<>();
817 805  
... ... @@ -1060,12 +1048,8 @@
1060 1048 Query query=new Query();
1061 1049 query.addCriteria(Criteria.where("yn").is(1));
1062 1050 if(StringUtils.isNotEmpty(startDate) && StringUtils.isNotEmpty(endDate)){
1063   - query.addCriteria(Criteria.where("dueDate1").gte(DateUtil.getDayFirstSecond(DateUtil.parseYMD(startDate)))
  1051 + query.addCriteria(Criteria.where("created").gte(DateUtil.getDayFirstSecond(DateUtil.parseYMD(startDate)))
1064 1052 .lte(DateUtil.getDayLastSecond(DateUtil.parseYMD(endDate))));
1065   - }else {
1066   - //当天的数据
1067   - query.addCriteria(Criteria.where("dueDate1").gte(DateUtil.getDayFirstSecond(new Date()))
1068   - .lte(DateUtil.getDayLastSecond(new Date())));
1069 1053 }
1070 1054 List<MaternalDeliverModel> fmList = mongoTemplate.find(query, MaternalDeliverModel.class);
1071 1055 List<Map> data = new ArrayList<>();
... ... @@ -1216,22 +1200,6 @@
1216 1200 String hospital_name = couponMapper.findHospitalNameById(model.getHospitalId());
1217 1201 String organ_id=organizationService.getPlatHosNewCode(hospital_name);
1218 1202 map.put("organ_id", StringUtils.isNotEmpty(organ_id)?organ_id:"/");
1219   - //关联妇女档id
1220   -// String person_id="/";
1221   -// if(StringUtils.isNotEmpty(model.getParentId())){
1222   -// Patients patients = patientsService.findOnePatientById(model.getParentId());
1223   -// if(null!=patients && StringUtils.isNotEmpty(patients.getCardNo())) {
1224   -// ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery();
1225   -// archiveQuery.setYn(YnEnums.YES.getId());
1226   -// archiveQuery.setCertificateNum(patients.getCardNo());
1227   -// List<ResidentsArchiveModel> modelList = residentsArchiveService.queryResident(archiveQuery);
1228   -// if (CollectionUtils.isNotEmpty(modelList)) {
1229   -// person_id = modelList.get(0).getId();
1230   -// }
1231   -// }
1232   -// }
1233   -// map.put("person_id", person_id);
1234   -// //关联专档id
1235 1203 if(StringUtils.isNotEmpty(model.getParentId())){
1236 1204 Patients patients = patientsService.findOnePatientById(model.getParentId());
1237 1205 if(null!=patients && StringUtils.isNotEmpty(patients.getCardNo())) {
1238 1206  
... ... @@ -1242,7 +1210,243 @@
1242 1210 {
1243 1211 map.put("file_id", "");
1244 1212 }
  1213 + map.put("parent_id", model.getParentId());
  1214 + //导入时间
  1215 + //修改时间
  1216 + map.put("last_modified_time", null);
  1217 + //删除状态
  1218 + map.put("is_deleted", "0");
  1219 + //删除时间
  1220 + map.put("deleted_time", null);
1245 1221  
  1222 + data.add(map);
  1223 + } catch (Exception e) {
  1224 + e.printStackTrace();
  1225 + }
  1226 + }
  1227 +
  1228 + BaseObjectResponse objectResponse = new BaseObjectResponse();
  1229 + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
  1230 + objectResponse.setErrormsg("成功");
  1231 + objectResponse.setData(data);
  1232 + return objectResponse;
  1233 + }
  1234 +
  1235 +
  1236 +
  1237 + public Map<String, Object> getC201Patient(String id) {
  1238 + Patients patients = patientsService.findOnePatientById(id);
  1239 + try{
  1240 + if ("4".equals(HIS_VERSION))
  1241 + {
  1242 + if (!("2".equals(patients.getCityId()) || (patients.isSendCoupon() != null && patients.isSendCoupon())))
  1243 + {
  1244 + return null;
  1245 + }
  1246 + }
  1247 + Map<String, Object> map = new HashMap<>();
  1248 + //id
  1249 + map.put("id",StringUtils.isNotEmpty(patients.getId())?patients.getId():"/");
  1250 + //档案状态
  1251 + map.put("file_status_code", null!=patients.getType()?(patients.getType()==1?"1":"2"):"/");
  1252 + //末次月经
  1253 + map.put("last_menstrual_period",null!=patients.getLastMenses()?DateUtil.getyyyy_MM_dd(patients.getLastMenses()):DateUtil.getyyyy_MM_dd(new Date()));
  1254 + //预产期
  1255 + map.put("expected_date", null!=patients.getDueDate()?DateUtil.getyyyy_MM_dd(patients.getDueDate()):DateUtil.getyyyy_MM_dd(new Date()));
  1256 + //建档医生
  1257 + String doctor_name="/";
  1258 + if(StringUtils.isNotEmpty(patients.getBookbuildingDoctor())) {
  1259 + Users user = usersService.getUsers(Integer.parseInt(patients.getBookbuildingDoctor()));
  1260 + if (null!=user && StringUtils.isNotEmpty(user.getName())) {
  1261 + doctor_name=user.getName();
  1262 + }
  1263 + }
  1264 + map.put("doctor_name", doctor_name);
  1265 + //是否分娩(直接判断分娩日期)
  1266 + map.put("is_childbirth", null!=patients.getFmDate()?"1":"0");
  1267 + //分娩时间
  1268 + map.put("born_date", null!=patients.getFmDate()?DateUtil.getyyyy_MM_dd_hms(patients.getFmDate()):null);
  1269 + //出院日期
  1270 + map.put("discharge_date", null);
  1271 + //结案时间
  1272 + map.put("close_date", null);
  1273 + //结案原因
  1274 + map.put("close_reason_code", null);
  1275 + //结案原因-其它
  1276 + map.put("close_reason_detailed", null);
  1277 + //母子保健卡号
  1278 + map.put("health_card_number", null);
  1279 + //姓名
  1280 + map.put("mother_name", StringUtils.isNotEmpty(patients.getUsername())?patients.getUsername():"/");
  1281 + //年龄
  1282 + Integer mother_age=patients.getAge();
  1283 + if(null==mother_age){
  1284 + if(StringUtils.isNotEmpty(patients.getCardNo())){
  1285 + //用身份证获取
  1286 + mother_age=DateUtil.getAgeForIdcard(patients.getCardNo());
  1287 + }else {
  1288 + mother_age=0;
  1289 + }
  1290 + }
  1291 + map.put("mother_age", mother_age);
  1292 + //国籍
  1293 + String gj= CdGwPcountryEnums.getId(getBasicConfig(patients.getPcountryId()));
  1294 + map.put("mother_nationality_code", StringUtils.isNotEmpty(gj)?gj:"156");
  1295 + //民族
  1296 + String mz=NationEnums.getId(getBasicConfig(patients.getPnationId()));
  1297 + map.put("mother_nation_code", StringUtils.isNotEmpty(mz)?mz:"99");
  1298 + //母亲现住址标识,母亲现住址区划编码(居委会/村)取 县/区 级的编码
  1299 + String areaRegisterName="";
  1300 + if(StringUtils.isNotEmpty(patients.getAreaRegisterId())){
  1301 + areaRegisterName=CommonsHelper.getName1(patients.getAreaRegisterId(), basicConfigService);
  1302 + }
  1303 + map.put("mother_now_address_id", organizationService.getAreaCode(areaRegisterName));
  1304 + //母亲现住址详情(非必填)
  1305 + String mother_now_address=null;
  1306 + if(StringUtils.isNotEmpty(patients.getProvinceRegisterId()) && StringUtils.isNotEmpty(patients.getCityRegisterId()) &&
  1307 + StringUtils.isNotEmpty(patients.getAreaRegisterId()) && StringUtils.isNotEmpty(patients.getStreetRegisterId()) &&
  1308 + StringUtils.isNotEmpty(patients.getVillageRegister()) && StringUtils.isNotEmpty(patients.getAddressRegister())){
  1309 + mother_now_address= CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getVillageRegister()+patients.getAddressRegister(), basicConfigService);
  1310 + }
  1311 + map.put("mother_now_address", mother_now_address);
  1312 + //母亲户籍地址标识,母亲户籍地址区划编码(居委会/村)取 县/区 级的编码
  1313 + String areaName="";
  1314 + if(StringUtils.isNotEmpty(patients.getAreaId())){
  1315 + areaName=CommonsHelper.getName1(patients.getAreaId(), basicConfigService);
  1316 + }
  1317 + map.put("mother_address_id", organizationService.getAreaCode(areaName));
  1318 + //母亲户籍地址--详情部分
  1319 + map.put("mother_address_detail", StringUtils.isNotEmpty(patients.getAddress())?patients.getAddress():"/");
  1320 + //母亲地址(出生证明母亲地址) 获取母亲 户籍地址,没有 就/
  1321 + String mother_address="/";
  1322 + if(StringUtils.isNotEmpty(patients.getProvinceId()) && StringUtils.isNotEmpty(patients.getCityId()) &&
  1323 + StringUtils.isNotEmpty(patients.getAreaId()) && StringUtils.isNotEmpty(patients.getStreetId()) &&
  1324 + StringUtils.isNotEmpty(patients.getAddress())){
  1325 + mother_address= CommonsHelper.getResidence(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getStreetId(), patients.getAddress(), basicConfigService);
  1326 + }
  1327 + map.put("mother_address", mother_address);
  1328 + //证件类型(lyms_basicconfig表中查"parentId": "c914bb2e-1825-4036-8a41-fe617c90d405")
  1329 + String mother_credentials_type_code="99";
  1330 + if(StringUtils.isNotEmpty(patients.getPcerteTypeId())){
  1331 + switch (patients.getPcerteTypeId()){
  1332 + case "70ae1d93-2964-46bc-83fa-bec9ff605b1c":
  1333 + //身份证
  1334 + mother_credentials_type_code="1";
  1335 + break;
  1336 + case "5797135b0cf2dd415ca09fe1":
  1337 + //护照
  1338 + mother_credentials_type_code="3";
  1339 + break;
  1340 + case "efa9ede5-bd40-42bb-8966-a0bf4c20d8fb":
  1341 + //军官证
  1342 + mother_credentials_type_code="1";
  1343 + break;
  1344 + }
  1345 + }
  1346 + map.put("mother_credentials_type_code", mother_credentials_type_code);
  1347 + //其他证件名称
  1348 + map.put("mother_other_credentials_type", null);
  1349 + //有效身份证件号码
  1350 + map.put("mother_credentials_number", StringUtils.isNotEmpty(patients.getCardNo())?patients.getCardNo():"/");
  1351 + //丈夫姓名
  1352 + map.put("father_name", StringUtils.isNotEmpty(patients.getHusbandName())?patients.getHusbandName():"/");
  1353 + //丈夫年龄
  1354 + Integer father_age=DateUtil.getAge(patients.getHusbandBirth());
  1355 + if(null==father_age){
  1356 + if(StringUtils.isNotEmpty(patients.getHcertificateNum())){
  1357 + //用身份证获取
  1358 + father_age=DateUtil.getAgeForIdcard(patients.getHcertificateNum());
  1359 + }else {
  1360 + father_age=0;
  1361 + }
  1362 + }
  1363 + map.put("father_age", father_age);
  1364 + //丈夫国籍
  1365 + String hgj= CdGwPcountryEnums.getId(getBasicConfig(patients.getHcountryId()));
  1366 + map.put("father_nationality_code", StringUtils.isNotEmpty(hgj)?hgj:"156");
  1367 + //丈夫民族
  1368 + String hmz=NationEnums.getId(getBasicConfig(patients.getHnationId()));
  1369 + map.put("father_nation_code", StringUtils.isNotEmpty(hmz)?hmz:"99");
  1370 + //丈夫现住址标识,丈夫现住址区划编码(居委会/村)取 县/区 级的编码
  1371 + String hareaName="";
  1372 + if(StringUtils.isNotEmpty(patients.getHareaId())){
  1373 + hareaName=CommonsHelper.getName1(patients.getHareaId(), basicConfigService);
  1374 + }
  1375 + else if (StringUtils.isNotEmpty(patients.getAreaRegisterId()))
  1376 + {
  1377 + hareaName=CommonsHelper.getName1(patients.getAreaRegisterId(), basicConfigService);
  1378 + }
  1379 + map.put("father_now_address_id", organizationService.getAreaCode(hareaName));
  1380 + //丈夫现住址详情
  1381 + String father_now_address=null;
  1382 + if(StringUtils.isNotEmpty(patients.getHprovinceId()) && StringUtils.isNotEmpty(patients.getHcityId()) &&
  1383 + StringUtils.isNotEmpty(patients.getHareaId()) && StringUtils.isNotEmpty(patients.getHstreetId()) &&
  1384 + StringUtils.isNotEmpty(patients.getHvillage()) && StringUtils.isNotEmpty(patients.getHaddress())){
  1385 + father_now_address= CommonsHelper.getResidence(patients.getHprovinceId(), patients.getHcityId(), patients.getHareaId(), patients.getHstreetId(), patients.getHvillage()+patients.getHaddress(), basicConfigService);
  1386 + }
  1387 + map.put("father_now_address", father_now_address);
  1388 + //丈夫户籍地址标识,丈夫户籍地址区划编码(区县)取 县/区 级的编码
  1389 + String hareaRegisterName="";
  1390 + if(StringUtils.isNotEmpty(patients.getHareaRegisterId())){
  1391 + hareaRegisterName=CommonsHelper.getName1(patients.getHareaRegisterId(), basicConfigService);
  1392 + }
  1393 + map.put("father_address_id", organizationService.getAreaCode(hareaRegisterName));
  1394 + //丈夫户籍地址--详情部分
  1395 + map.put("father_address_detail", StringUtils.isNotEmpty(patients.getHaddressRegister())?patients.getHaddressRegister():"/");
  1396 + //父亲地址(出生证明母亲地址) 获取父亲 户籍地址,没有 就/
  1397 + String father_address="/";
  1398 + if(StringUtils.isNotEmpty(patients.getHprovinceRegisterId()) && StringUtils.isNotEmpty(patients.getHcityRegisterId()) &&
  1399 + StringUtils.isNotEmpty(patients.getHareaRegisterId()) && StringUtils.isNotEmpty(patients.getHstreetRegisterId()) &&
  1400 + StringUtils.isNotEmpty(patients.getHaddressRegister())){
  1401 + father_address= CommonsHelper.getResidence(patients.getHprovinceRegisterId(), patients.getHcityRegisterId(), patients.getHareaRegisterId(), patients.getHstreetRegisterId(), patients.getHaddressRegister(), basicConfigService);
  1402 + }
  1403 + map.put("father_address", father_address);
  1404 + //丈夫证件类型(lyms_basicconfig表中查"parentId": "c914bb2e-1825-4036-8a41-fe617c90d405")
  1405 + String father_credentials_type_code="99";
  1406 + if(StringUtils.isNotEmpty(patients.getHcertificateTypeId())){
  1407 + switch (patients.getHcertificateTypeId()){
  1408 + case "70ae1d93-2964-46bc-83fa-bec9ff605b1c":
  1409 + //身份证
  1410 + father_credentials_type_code="1";
  1411 + break;
  1412 + case "5797135b0cf2dd415ca09fe1":
  1413 + //护照
  1414 + father_credentials_type_code="3";
  1415 + break;
  1416 + case "efa9ede5-bd40-42bb-8966-a0bf4c20d8fb":
  1417 + //军官证
  1418 + father_credentials_type_code="1";
  1419 + break;
  1420 + }
  1421 + }
  1422 + map.put("father_credentials_type_code", father_credentials_type_code);
  1423 + //丈夫其他证件名称
  1424 + map.put("father_other_credentials_type", null);
  1425 + //丈夫有效身份证件号码
  1426 + map.put("father_credentials_number", StringUtils.isNotEmpty(patients.getHcertificateNum())?patients.getHcertificateNum():"/");
  1427 + //手机号码
  1428 + map.put("phone", StringUtils.isNotEmpty(patients.getHusbandPhone())?patients.getHusbandPhone():"/");
  1429 + //是否高危
  1430 + map.put("is_high_risk", null);
  1431 + //是否早孕建档
  1432 + map.put("is_early_pregnancy", null);
  1433 + //是否已打印出生证明
  1434 + map.put("is_birth_certificate", null);
  1435 + //录入系统时间
  1436 + map.put("entering_time", null!=patients.getCreated()?DateUtil.getyyyy_MM_dd_hms(patients.getCreated()):DateUtil.getyyyy_MM_dd_hms(new Date()));
  1437 + //是否未提供男方信息(建档时是否未提供男方信息)
  1438 +
  1439 + map.put("not_provided_father_info", null!=patients.getReqHusband()?(patients.getReqHusband()?"F":"T"):"F");
  1440 + //丈夫电话
  1441 + map.put("father_phone", null);
  1442 + //建档日期
  1443 + map.put("this_date",null!=patients.getBookbuildingDate()?DateUtil.getyyyy_MM_dd_hms(patients.getBookbuildingDate()):DateUtil.getyyyy_MM_dd_hms(new Date()));
  1444 + //所属机构编码
  1445 + String hospital_name = couponMapper.findHospitalNameById(patients.getHospitalId());
  1446 + String organ_id=organizationService.getPlatHosNewCode(hospital_name);
  1447 + map.put("organ_id", StringUtils.isNotEmpty(organ_id)?organ_id:"/");
  1448 + //关联妇女档id
  1449 + map.put("person_id", patients.getId());
1246 1450 //导入时间
1247 1451 // map.put("import_time", null);
1248 1452 //修改时间
1249 1453  
1250 1454  
1251 1455  
... ... @@ -1252,12 +1456,210 @@
1252 1456 //删除时间
1253 1457 map.put("deleted_time", null);
1254 1458  
1255   - data.add(map);
  1459 + //建档地址的区划代码
  1460 + String jddqhdm="";
  1461 + String areaId = couponMapper.findAreaId(patients.getHospitalId());
  1462 + if(StringUtils.isNotEmpty(areaId)){
  1463 + jddqhdm=CommonsHelper.getName1(areaId, basicConfigService);
  1464 + }
  1465 + map.put("jddqhdm", organizationService.getAreaCode(jddqhdm));
  1466 + return map;
1256 1467 } catch (Exception e) {
1257 1468 e.printStackTrace();
1258 1469 }
  1470 + return null;
  1471 + }
  1472 +
  1473 + public BaseObjectResponse getMsgcFm(String startDate, String endDate) {
  1474 +
  1475 + Query query=new Query();
  1476 + query.addCriteria(Criteria.where("yn").is(1));
  1477 + if(StringUtils.isNotEmpty(startDate) && StringUtils.isNotEmpty(endDate)){
  1478 + query.addCriteria(Criteria.where("created").gte(DateUtil.getDayFirstSecond(DateUtil.parseYMD(startDate)))
  1479 + .lte(DateUtil.getDayLastSecond(DateUtil.parseYMD(endDate))));
1259 1480 }
  1481 + List<MaternalDeliverModel> fmList = mongoTemplate.find(query, MaternalDeliverModel.class);
  1482 + List<MsgcResult> data = new ArrayList<>();
  1483 + for (MaternalDeliverModel model : fmList) {
  1484 + try {
  1485 + MsgcResult result = new MsgcResult();
  1486 + Map map=new HashMap();
  1487 + //id
  1488 + map.put("id", StringUtils.isNotEmpty(model.getId())?model.getId():"/");
  1489 + //分娩日期
  1490 + map.put("this_date", null!=model.getDueDate1()?DateUtil.getyyyy_MM_dd_hms(model.getDueDate1()):DateUtil.getyyyy_MM_dd_hms(new Date()));
  1491 + //住院病历号
  1492 + map.put("medical_record_number", StringUtils.isNotEmpty(model.getInHospitalNo())?model.getInHospitalNo():"/");
  1493 + //分娩时孕周
  1494 + Integer week_num=0;
  1495 + if(StringUtils.isNotEmpty(model.getDueWeek())){
  1496 + String[] week = model.getDueWeek().split("周");
  1497 + if (NumberUtils.isNumber(week[0])) {
  1498 + week_num=Integer.parseInt(week[0]);
  1499 + }
  1500 + }
  1501 + map.put("week_num",week_num);
  1502 + //分娩时孕天
  1503 + Integer day_num=0;
  1504 + if(StringUtils.isNotEmpty(model.getDueWeek())){
  1505 + String[] week = model.getDueWeek().split("[+]");
  1506 + if (week.length==2 && NumberUtils.isNumber(week[1].substring(0,week[1].length()-1))) {
  1507 + day_num=Integer.parseInt(week[1].substring(0,week[1].length()-1));
  1508 + }
  1509 + }
  1510 + map.put("day_num", day_num);
  1511 + //分娩方式
  1512 + String birth_fashion_code = "6";
  1513 + if (StringUtils.isNotEmpty(model.getDeliveryMode())) {
  1514 + Map m = JsonUtil.str2Obj(model.getDeliveryMode(), Map.class);
  1515 + if (m != null) {
  1516 + Object b = m.get("fmfs");
  1517 + if (b != null) {
  1518 + switch (b.toString()) {
  1519 + case "1":
  1520 + birth_fashion_code = "1";
  1521 + break;
  1522 + case "2":
  1523 + birth_fashion_code = "5";
  1524 + break;
  1525 + }
  1526 + }
  1527 + }
  1528 + }
  1529 + map.put("birth_fashion_code", birth_fashion_code);
  1530 + //产程Ⅰ(小时)
  1531 + map.put("production_process_one_hour", null);
  1532 + //产程Ⅰ(分钟)
  1533 + map.put("production_process_one_minute", null);
  1534 + //产程Ⅱ(小时)
  1535 + map.put("production_process_tow_hour", null);
  1536 + //产程Ⅱ(分钟)
  1537 + map.put("production_process_tow_minute", null);
  1538 + //产程Ⅲ(小时)
  1539 + map.put("production_process_three_hour", null);
  1540 + //产程Ⅲ(分钟)
  1541 + map.put("production_process_threeminute", null);
  1542 + //总产程(小时)
  1543 + map.put("production_process_total_hour", null);
  1544 + //总产程(分钟)
  1545 + map.put("production_process_totalminute", null);
  1546 + //产后血压高压
  1547 + map.put("blood_pressure_high", null);
  1548 + //产后血压低压
  1549 + map.put("blood_pressure_low", null);
  1550 + //产后2小时血压高压
  1551 + map.put("blood_pressure_secondhour_high", null);
  1552 + //产后2小时血压低压
  1553 + map.put("blood_pressure_second_hour_low", null);
  1554 + //呼吸(次/分)
  1555 + map.put("breathing_rate", null);
  1556 + //脉搏(次/分)
  1557 + map.put("pulse_rate", null);
  1558 + //产时出血量(ml)
  1559 + map.put("bleeding_amount_first_hour", null);
  1560 + //产后2小时出血量(ml)
  1561 + map.put("bleeding_amount_second_hour", null);
  1562 + //总出血量
  1563 + map.put("bleeding_amount_total", null);
  1564 + //会阴情况
  1565 + map.put("perineal_condition_code",null);
  1566 + //撕裂Ⅰ°
  1567 + map.put("perineal_tearing_one",null);
  1568 + //撕裂Ⅱ°
  1569 + map.put("perineal_tearing_two", null);
  1570 + //撕裂Ⅲ°
  1571 + map.put("perineal_tearing_three", null);
  1572 + //撕裂缝线
  1573 + map.put("perineal_tearing_suture", null);
  1574 + //新生儿情况
  1575 + String neonatal_condition_code="/";
  1576 + if (null!=model.getTireNumber()) {
  1577 + switch (model.getTireNumber()){
  1578 + case 1:
  1579 + neonatal_condition_code="1";
  1580 + break;
  1581 + case 2:
  1582 + neonatal_condition_code="2";
  1583 + break;
  1584 + default:
  1585 + neonatal_condition_code="3";
  1586 + }
  1587 + }
  1588 + map.put("neonatal_condition_code", neonatal_condition_code);
  1589 + //畸形详细
  1590 + map.put("malformation_detailed", null);
  1591 + //新生儿情况其它
  1592 + map.put("neonatal_condition_other", null);
  1593 + //出院时间
  1594 + map.put("out_time", null);
  1595 + //分娩医院名称
  1596 + String birth_hospital_name = couponMapper.findHospitalNameById(model.getFmHospital());
  1597 + map.put("birth_hospital_name", StringUtils.isNotEmpty(birth_hospital_name)?birth_hospital_name:"/");
  1598 + //接生者(接生医生)
  1599 + String mid_wife="/";
  1600 + if(StringUtils.isNotEmpty(model.getDeliverDoctor())) {
  1601 + try{
  1602 + Users user = usersService.getUsers(Integer.parseInt(model.getDeliverDoctor()));
  1603 + if (null!=user && StringUtils.isNotEmpty(user.getName())) {
  1604 + mid_wife=user.getName();
  1605 + }
  1606 + }catch (Exception e)
  1607 + {
  1608 + mid_wife = model.getDeliverDoctor();
  1609 + }
1260 1610  
  1611 + }
  1612 + map.put("mid_wife", mid_wife);
  1613 + //产妇状态
  1614 + String maternal_state_code=model.getMaternalInfo();
  1615 + map.put("maternal_state_code", StringUtils.isNotEmpty(maternal_state_code)?maternal_state_code:"/");
  1616 + //产时并发症
  1617 + map.put("obstetric_morbidity_code", null);
  1618 + //产时并发症--详述
  1619 + map.put("obstetric_morbidity_contents", null);
  1620 + //开奶时间
  1621 + map.put("milk_open_time", null);
  1622 + //分娩机构(分娩医疗机构统一社会信用代码)
  1623 + String delivery_institution_id=organizationService.getPlatHosNewCode(birth_hospital_name);
  1624 + map.put("delivery_institution_id", StringUtils.isNotEmpty(delivery_institution_id)?delivery_institution_id:"/");
  1625 + //录入系统时间
  1626 + map.put("entering_time", null!=model.getCreated()?DateUtil.getyyyy_MM_dd_hms(model.getCreated()):DateUtil.getyyyy_MM_dd_hms(new Date()));
  1627 + //所属机构编码(所属医疗机构统一社会信用代码)
  1628 + String hospital_name = couponMapper.findHospitalNameById(model.getHospitalId());
  1629 + String organ_id=organizationService.getPlatHosNewCode(hospital_name);
  1630 + map.put("organ_id", StringUtils.isNotEmpty(organ_id)?organ_id:"/");
  1631 + if(StringUtils.isNotEmpty(model.getParentId())){
  1632 + Patients patients = patientsService.findOnePatientById(model.getParentId());
  1633 + if(patients != null){
  1634 + if(StringUtils.isNotEmpty(patients.getSource())) {
  1635 + result.setPatientInfo(getC201Patient(patients.getSource()));
  1636 + result.setPersonInfo(getC101Person(patients.getSource()));
  1637 + map.put("file_id", patients.getSource());
  1638 + }else {
  1639 + result.setPatientInfo(getC201Patient(patients.getId()));
  1640 + result.setPersonInfo(getC101Person(patients.getId()));
  1641 + map.put("file_id", patients.getId());
  1642 + }
  1643 + }
  1644 + }
  1645 +
  1646 + map.put("parent_id", model.getParentId());
  1647 + //导入时间
  1648 + //修改时间
  1649 + map.put("last_modified_time", null);
  1650 + //删除状态
  1651 + map.put("is_deleted", "0");
  1652 + //删除时间
  1653 + map.put("deleted_time", null);
  1654 +
  1655 +
  1656 + result.setFmInfo(map);
  1657 + data.add(result);
  1658 + } catch (Exception e) {
  1659 + e.printStackTrace();
  1660 + }
  1661 + }
  1662 +
1261 1663 BaseObjectResponse objectResponse = new BaseObjectResponse();
1262 1664 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
1263 1665 objectResponse.setErrormsg("成功");
... ... @@ -1496,5 +1898,6 @@
1496 1898 objectResponse.setData(data);
1497 1899 return objectResponse;
1498 1900 }
  1901 +
1499 1902 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/MsgcResult.java View file @ 2be0ef9
  1 +package com.lyms.platform.operate.web.result;
  2 +
  3 +import java.util.Map;
  4 +
  5 +public class MsgcResult {
  6 + private Map<String,Object> personInfo;
  7 + private Map<String,Object> patientInfo;
  8 + private Map<String,Object> fmInfo;
  9 +
  10 + public Map<String, Object> getPersonInfo() {
  11 + return personInfo;
  12 + }
  13 +
  14 + public void setPersonInfo(Map<String, Object> personInfo) {
  15 + this.personInfo = personInfo;
  16 + }
  17 +
  18 + public Map<String, Object> getPatientInfo() {
  19 + return patientInfo;
  20 + }
  21 +
  22 + public void setPatientInfo(Map<String, Object> patientInfo) {
  23 + this.patientInfo = patientInfo;
  24 + }
  25 +
  26 + public Map<String, Object> getFmInfo() {
  27 + return fmInfo;
  28 + }
  29 +
  30 + public void setFmInfo(Map<String, Object> fmInfo) {
  31 + this.fmInfo = fmInfo;
  32 + }
  33 +}