Commit 40338377b99a341f790ba6af1b32c42717aff15c
1 parent
9e12a3a08e
Exists in
master
and in
6 other branches
update code
Showing 4 changed files with 106 additions and 13 deletions
- platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SmsConfigController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SmsConfigFacade.java
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java
View file @
4033837
| ... | ... | @@ -24,6 +24,7 @@ |
| 24 | 24 | |
| 25 | 25 | import java.sql.Connection; |
| 26 | 26 | import java.sql.SQLException; |
| 27 | +import java.text.DecimalFormat; | |
| 27 | 28 | import java.text.ParseException; |
| 28 | 29 | import java.text.SimpleDateFormat; |
| 29 | 30 | import java.util.*; |
| 30 | 31 | |
| ... | ... | @@ -161,8 +162,9 @@ |
| 161 | 162 | deliverAddRequest.setDueDate(DateUtil.getyyyy_MM_dd(dueDate)); |
| 162 | 163 | deliverAddRequest.setParentId(patient.getId()); |
| 163 | 164 | deliverAddRequest.setPid(patient.getPid()); |
| 165 | + String week = ""; | |
| 164 | 166 | if (StringUtils.isNotEmpty(item.getRc())) { |
| 165 | - String week = ""; | |
| 167 | + | |
| 166 | 168 | if (item.getRc().split("\\u002B").length > 1) { |
| 167 | 169 | week = item.getRc().split("\\u002B")[0] + "周"; |
| 168 | 170 | week += item.getRc().split("\\u002B")[1] + "天"; |
| ... | ... | @@ -232,7 +234,7 @@ |
| 232 | 234 | } |
| 233 | 235 | else |
| 234 | 236 | { //秦皇岛服务器有分娩记录,但是在这边系统没有对于孕妇 取分娩信息建档儿童数据 |
| 235 | - buildBaby( item, patInfo, dueDateStr, dueDate); | |
| 237 | + buildBaby( item, patInfo, dueDate); | |
| 236 | 238 | } |
| 237 | 239 | } |
| 238 | 240 | else |
| ... | ... | @@ -439,7 +441,7 @@ |
| 439 | 441 | continue; |
| 440 | 442 | } |
| 441 | 443 | Date dueDate1 = fmt.parse(dueDateStr1); |
| 442 | - buildBaby( i,patInfo, dueDateStr1, dueDate1); | |
| 444 | + buildBaby( i,patInfo, dueDate1); | |
| 443 | 445 | } |
| 444 | 446 | |
| 445 | 447 | } |
| ... | ... | @@ -477,7 +479,7 @@ |
| 477 | 479 | } |
| 478 | 480 | |
| 479 | 481 | |
| 480 | - public void buildBaby(FmItem item,FmPatInfo patInfo, String dueDateStr,Date dueDate) | |
| 482 | + public void buildBaby(FmItem item,FmPatInfo patInfo, Date dueDate) | |
| 481 | 483 | { |
| 482 | 484 | try{ |
| 483 | 485 | UsersQuery usersQuery = new UsersQuery(); |
| 484 | 486 | |
| 485 | 487 | |
| 486 | 488 | |
| ... | ... | @@ -517,18 +519,18 @@ |
| 517 | 519 | } |
| 518 | 520 | |
| 519 | 521 | request.setMommyPhone(patInfo.getPhone()); |
| 520 | - String babyName = item.getYexb()+("男".equals(item.getYexb()) ? "之子" : "之女"); | |
| 522 | + String babyName = patInfo.getName()+("男".equals(item.getYexb()) ? "之子" : "之女"); | |
| 521 | 523 | request.setBabyName(babyName); |
| 522 | 524 | request.setSex("男".equals(item.getYexb()) ? 1 : 0); |
| 523 | 525 | |
| 524 | - request.setBabyBirthday(dueDateStr); //生日 | |
| 526 | + request.setBabyBirthday(DateUtil.getyyyy_MM_dd(dueDate)); //生日 | |
| 525 | 527 | |
| 526 | 528 | if (StringUtils.isNotEmpty(item.getRc())) { |
| 527 | 529 | String week = ""; |
| 528 | 530 | if (item.getRc().split("\\u002B").length > 1) { |
| 529 | - week = item.getRc().split("\\u002B")[0] + "周"; | |
| 531 | + week = item.getRc().split("\\u002B")[0]; | |
| 530 | 532 | } else { |
| 531 | - week = item.getRc() + "周"; | |
| 533 | + week = item.getRc(); | |
| 532 | 534 | } |
| 533 | 535 | try { |
| 534 | 536 | request.setDueWeek(Integer.parseInt(week)); //分娩孕周 |
| 535 | 537 | |
| ... | ... | @@ -548,13 +550,16 @@ |
| 548 | 550 | request.setDueType(tpmcType);//分娩方式 |
| 549 | 551 | request.setFetusCount(item.getDjt()); //第几胎 |
| 550 | 552 | request.setDueCount(item.getCjc());//第几产 |
| 551 | - request.setBabyWeight(item.getTz()); //体重 | |
| 553 | + DecimalFormat df = new DecimalFormat("#.00"); | |
| 554 | + double w = Double.parseDouble(item.getTz()); | |
| 555 | + request.setBabyWeight(df.format(w/1000)); //体重 | |
| 552 | 556 | request.setBabyHeight(item.getSc()); //身长 |
| 553 | 557 | Map<String,String> map = new HashMap<>(); |
| 554 | 558 | map.put("pf1",item.getYfz()); |
| 555 | 559 | map.put("pf5", item.getWfz()); |
| 556 | 560 | map.put("pf10", item.getSfz()); |
| 557 | 561 | request.setApgarScore(map); |
| 562 | + request.setDeliverOrg("216"); | |
| 558 | 563 | |
| 559 | 564 | request.setBuildDoctor(users.get(0).getId() + ""); |
| 560 | 565 | request.setBuildDate(DateUtil.getyyyy_MM_dd(dueDate)); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SmsConfigController.java
View file @
4033837
| ... | ... | @@ -29,6 +29,7 @@ |
| 29 | 29 | import org.springframework.stereotype.Controller; |
| 30 | 30 | import org.springframework.web.bind.annotation.*; |
| 31 | 31 | |
| 32 | +import javax.servlet.http.HttpServletResponse; | |
| 32 | 33 | import javax.validation.Valid; |
| 33 | 34 | import java.util.*; |
| 34 | 35 | |
| ... | ... | @@ -210,6 +211,32 @@ |
| 210 | 211 | @RequestParam(required = false) Integer limit) { |
| 211 | 212 | return smsConfigFacade.querySmsList(hospitalName, phone, smsType, smsStatus, content, planTime, actualTime, objType, page, limit); |
| 212 | 213 | } |
| 214 | + | |
| 215 | + | |
| 216 | + /** | |
| 217 | + * 导出短信 | |
| 218 | + * @param hospitalName | |
| 219 | + * @param phone | |
| 220 | + * @param smsType | |
| 221 | + * @param smsStatus | |
| 222 | + * @param objType | |
| 223 | + * @param content | |
| 224 | + * @param planTime | |
| 225 | + * @param actualTime | |
| 226 | + | |
| 227 | + */ | |
| 228 | + @RequestMapping(value = "/exportSmsList", method = RequestMethod.GET) | |
| 229 | + public void exportSmsList(HttpServletResponse httpServletResponse,@RequestParam(required = false) String hospitalName, | |
| 230 | + @RequestParam(required = false) String phone, | |
| 231 | + @RequestParam(required = false) Integer smsType, | |
| 232 | + @RequestParam(required = false) Integer smsStatus, | |
| 233 | + @RequestParam(required = false) Integer objType, | |
| 234 | + @RequestParam(required = false) String content, | |
| 235 | + @RequestParam(required = false) String planTime, | |
| 236 | + @RequestParam(required = false) String actualTime) { | |
| 237 | + smsConfigFacade.exportSmsList(hospitalName, phone, smsType, smsStatus, content, planTime, actualTime, objType, httpServletResponse); | |
| 238 | + } | |
| 239 | + | |
| 213 | 240 | |
| 214 | 241 | |
| 215 | 242 | @RequestMapping(value = "/sendBabyBuildSms", method = RequestMethod.GET) |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
4033837
| ... | ... | @@ -2157,6 +2157,7 @@ |
| 2157 | 2157 | data.put("serviceStatus", StringUtils.emptyDeal(model.getServiceStatus() == null ? "" : ServiceStatusEnums.getNameById(model.getServiceStatus()))); |
| 2158 | 2158 | data.put("nextDate", StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(model.getNextDate()))); |
| 2159 | 2159 | data.put("monthAge", StringUtils.emptyDeal(DateUtil.getBabyMonthAge(model.getBirth(), new Date()))); |
| 2160 | + data.put("created", StringUtils.emptyDeal(DateUtil.getyyyy_MM_dd(model.getCreated()))); | |
| 2160 | 2161 | |
| 2161 | 2162 | String diagnose = ""; |
| 2162 | 2163 | if (StringUtils.isNotEmpty(model.getPid())) { |
| ... | ... | @@ -2236,6 +2237,7 @@ |
| 2236 | 2237 | cnames.put("monthAge", "月龄"); |
| 2237 | 2238 | cnames.put("diagnose", "高危诊断"); |
| 2238 | 2239 | cnames.put("highRisk", "是否健康"); |
| 2240 | + cnames.put("created", "建档时间"); | |
| 2239 | 2241 | httpServletResponse.setContentType("application/octet-stream"); |
| 2240 | 2242 | httpServletResponse.setCharacterEncoding("UTF-8"); |
| 2241 | 2243 | httpServletResponse.setHeader("Content-Disposition", "attachment;fileName=" + "childDatas.xls"); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SmsConfigFacade.java
View file @
4033837
| ... | ... | @@ -7,10 +7,7 @@ |
| 7 | 7 | import com.lyms.platform.common.result.BaseListResponse; |
| 8 | 8 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 9 | 9 | import com.lyms.platform.common.result.BaseResponse; |
| 10 | -import com.lyms.platform.common.utils.DateUtil; | |
| 11 | -import com.lyms.platform.common.utils.JsonUtil; | |
| 12 | -import com.lyms.platform.common.utils.StringUtils; | |
| 13 | -import com.lyms.platform.common.utils.SystemConfig; | |
| 10 | +import com.lyms.platform.common.utils.*; | |
| 14 | 11 | import com.lyms.platform.operate.web.request.SmsConfigRequest; |
| 15 | 12 | import com.lyms.platform.operate.web.result.*; |
| 16 | 13 | import com.lyms.platform.operate.web.utils.ConfigTask; |
| ... | ... | @@ -26,6 +23,9 @@ |
| 26 | 23 | import org.springframework.beans.factory.annotation.Autowired; |
| 27 | 24 | import org.springframework.stereotype.Component; |
| 28 | 25 | |
| 26 | +import javax.servlet.http.HttpServletResponse; | |
| 27 | +import java.io.IOException; | |
| 28 | +import java.io.OutputStream; | |
| 29 | 29 | import java.util.*; |
| 30 | 30 | |
| 31 | 31 | /** |
| ... | ... | @@ -863,6 +863,65 @@ |
| 863 | 863 | } |
| 864 | 864 | } |
| 865 | 865 | return ""; |
| 866 | + } | |
| 867 | + | |
| 868 | + /** | |
| 869 | + * 导出短信列表 | |
| 870 | + * | |
| 871 | + * @param hospitalName 医院名称 | |
| 872 | + * @param phone 手机号码 | |
| 873 | + * @param smsType 短信类型 | |
| 874 | + * @param smsStatus 短信状态 | |
| 875 | + * @param content 短信内容 | |
| 876 | + * @param planTime 计划发送时间 | |
| 877 | + * @param actualTime 实际发送时间 | |
| 878 | + * @param objType 发送短信 | |
| 879 | + * @param httpServletResponse | |
| 880 | + */ | |
| 881 | + public void exportSmsList(String hospitalName, String phone, Integer smsType, Integer smsStatus, String content, String planTime, String actualTime, Integer objType,HttpServletResponse httpServletResponse) { | |
| 882 | + | |
| 883 | + try | |
| 884 | + { | |
| 885 | + BaseListResponse list = querySmsList( hospitalName, phone, smsType, smsStatus, content, planTime, actualTime, objType, 1, 999999999); | |
| 886 | + List<Map<String, Object>> datas = new ArrayList<>(); | |
| 887 | + List<Map<String,String>> results = list.getData(); | |
| 888 | + | |
| 889 | + if (CollectionUtils.isNotEmpty(results)) | |
| 890 | + { | |
| 891 | + for(Map<String,String> map : results) | |
| 892 | + { | |
| 893 | + Map<String, Object> data = new HashMap<>(); | |
| 894 | + data.put("hospitalName",map.get("hospitalName")); | |
| 895 | + data.put("objType",map.get("objType")); | |
| 896 | + data.put("smsType",map.get("smsType")); | |
| 897 | + data.put("phone",map.get("phone")); | |
| 898 | + data.put("content",map.get("content")); | |
| 899 | + data.put("planTime",map.get("planTime")); | |
| 900 | + data.put("actualTime",map.get("actualTime")); | |
| 901 | + data.put("smsStatus",map.get("smsStatus")); | |
| 902 | + data.put("timeType",map.get("timeType")); | |
| 903 | + datas.add(data); | |
| 904 | + } | |
| 905 | + } | |
| 906 | + | |
| 907 | + OutputStream out = httpServletResponse.getOutputStream(); | |
| 908 | + Map<String, String> cnames = new LinkedHashMap<>(); | |
| 909 | + cnames.put("hospitalName", "医院"); | |
| 910 | + cnames.put("objType", "发送对象"); | |
| 911 | + cnames.put("smsType", "短信类型"); | |
| 912 | + cnames.put("phone", "电话号码"); | |
| 913 | + cnames.put("content", "短信内容"); | |
| 914 | + cnames.put("planTime", "计划发送时间"); | |
| 915 | + cnames.put("actualTime", "实际发送时间"); | |
| 916 | + cnames.put("smsStatus", "状态"); | |
| 917 | + cnames.put("timeType", "是否及时"); | |
| 918 | + httpServletResponse.setContentType("application/octet-stream"); | |
| 919 | + httpServletResponse.setCharacterEncoding("UTF-8"); | |
| 920 | + httpServletResponse.setHeader("Content-Disposition", "attachment;fileName=sms.xls"); | |
| 921 | + ExcelUtil.toExcel(out, datas, cnames); | |
| 922 | + } catch (IOException e) { | |
| 923 | + e.printStackTrace(); | |
| 924 | + } | |
| 866 | 925 | } |
| 867 | 926 | } |