Commit 8fc6156de8d7719adfb973592f6a4966973d50bb

Authored by wtt
1 parent be1932398a

update

Showing 6 changed files with 167 additions and 5 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java View file @ 8fc6156
... ... @@ -276,7 +276,7 @@
276 276 @RequestMapping(value = "/getNls", method = RequestMethod.GET)
277 277 @ResponseBody
278 278 public BaseObjectResponse getNls(@RequestParam(required = true) String month,
279   - @RequestParam(required = false) String value,
  279 + @RequestParam(required = false) String xlvalue,
280 280 @RequestParam(required = false) String ddz,
281 281 @RequestParam(required = false) String sxdz,
282 282 @RequestParam(required = false) String rs,
... ... @@ -285,7 +285,7 @@
285 285 @RequestParam(required = false) String type
286 286 ) {
287 287 BaseObjectResponse objectResponse = new BaseObjectResponse();
288   - objectResponse.setData(patientWeightService.getNls(month,value,ddz,sxdz, rs,yy,sqxw,type));
  288 + objectResponse.setData(patientWeightService.getNls(month,xlvalue,ddz,sxdz, rs,yy,sqxw,type));
289 289 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
290 290 objectResponse.setErrormsg("成功");
291 291 return objectResponse;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java View file @ 8fc6156
... ... @@ -5,6 +5,7 @@
5 5 import com.lyms.platform.common.base.LoginContext;
6 6 import com.lyms.platform.common.result.BaseObjectResponse;
7 7 import com.lyms.platform.common.utils.DateUtil;
  8 +import com.lyms.platform.operate.web.facade.AutoMatchFacade;
8 9 import com.lyms.platform.operate.web.service.IReportService;
9 10 import com.lyms.platform.operate.web.utils.CollectionUtils;
10 11 import org.springframework.beans.factory.annotation.Autowired;
11 12  
... ... @@ -27,8 +28,9 @@
27 28  
28 29 @Autowired
29 30 private IReportService reportService;
  31 + @Autowired
  32 + private AutoMatchFacade autoMatchFacade;
30 33  
31   -
32 34 /**
33 35 * 聊城曲线图
34 36 */
35 37  
... ... @@ -66,8 +68,17 @@
66 68 @RequestMapping(value = "/patients/export", method = RequestMethod.GET)
67 69 public void patientsExport(String provinceId, String cityId, String areaId, String streetId, Integer statistType,
68 70 Integer ageType, Integer patientType, Date startDate, Date endDate, HttpServletRequest request, HttpServletResponse response) {
69   - reportService.patientsExport(provinceId, cityId, areaId, streetId, statistType, ageType, patientType, startDate, endDate, getUserId(request), response);
  71 +
  72 + String hospitalId = autoMatchFacade.getHospitalId(getUserId(request));
  73 + //衡水导出格式
  74 + if("2100002261".equals(hospitalId)){
  75 + reportService.patientsHsExport(provinceId, cityId, areaId, streetId, statistType, ageType, patientType, startDate, endDate, getUserId(request), response);
  76 +
  77 + }else {
  78 + reportService.patientsExport(provinceId, cityId, areaId, streetId, statistType, ageType, patientType, startDate, endDate, getUserId(request), response);
70 79 // reportService.patientsExport(provinceId, cityId, aredId, streetId, statistType, ageType, patientType, startDate, endDate, 1000000185, response);
  80 + }
  81 +
71 82 }
72 83  
73 84 /**
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SieveController.java View file @ 8fc6156
... ... @@ -286,7 +286,21 @@
286 286 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
287 287 sieveFacade.exportRegionalCqsievesList(cqSieveQueryRequest, loginState.getId(), response);
288 288 }
289   -
  289 + /**
  290 + * 区域 无创-- 产筛申请统计导出
  291 + *
  292 + * @param cqSieveQueryRequest
  293 + * @param request
  294 + * @param response
  295 + * @Author: 武涛涛
  296 + * @Date: 2020/7/16 16:08
  297 + */
  298 + @RequestMapping(value = "/exportWcRegionalCqsievesList", method = RequestMethod.GET)
  299 + @TokenRequired
  300 + public void exportWcRegionalCqsievesList(@Valid CqSieveQueryRequest cqSieveQueryRequest, HttpServletRequest request, HttpServletResponse response) {
  301 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  302 + sieveFacade.exportWcRegionalCqsievesList(cqSieveQueryRequest, loginState.getId(), response);
  303 + }
290 304  
291 305 /**
292 306 * 实验室产筛管理
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveFacade.java View file @ 8fc6156
... ... @@ -3145,6 +3145,19 @@
3145 3145 cnames.put("18-三体", "18-三体");
3146 3146 cnames.put("神经管畸形", "神经管畸形");
3147 3147 }
  3148 + private void cnamesRegionalCqsievesWcMap(Map<String, String> cnames) {
  3149 + cnames.put("姓名", "姓名");
  3150 + cnames.put("年龄", "年龄");
  3151 + cnames.put("申请时间", "申请时间");
  3152 + cnames.put("申请孕周", "申请孕周");
  3153 + cnames.put("采血时间", "采血时间");
  3154 + cnames.put("申请医院", "申请医院");
  3155 + cnames.put("户籍地", "户籍地");
  3156 + cnames.put("产筛类型", "产筛类型");
  3157 + cnames.put("筛查状态", "筛查状态");
  3158 + cnames.put("收费类型", "收费类型");
  3159 + cnames.put("整体风险", "整体风险");
  3160 + }
3148 3161 public void exportRegionalCqsievesList(CqSieveQueryRequest cqSieveQueryRequest, Integer id, HttpServletResponse response) {
3149 3162 try {
3150 3163 BaseListResponse listResponse = (BaseListResponse) regionalCqsievesList(cqSieveQueryRequest, id, null, true);
... ... @@ -3180,6 +3193,46 @@
3180 3193 OutputStream out = response.getOutputStream();
3181 3194 Map<String, String> cnames = new LinkedHashMap<>();
3182 3195 cnamesRegionalCqsievesMap(cnames);
  3196 + response.setContentType("application/octet-stream");
  3197 + response.setCharacterEncoding("UTF-8");
  3198 + response.setHeader("Content-Disposition", "attachment;fileName=" + "csdata.xls");
  3199 + ExcelUtil.toExcel(out, datas, cnames);
  3200 + } catch (Exception e) {
  3201 + ExceptionUtils.catchException(e, "产筛统计导出异常");
  3202 + }
  3203 + }
  3204 + public void exportWcRegionalCqsievesList(CqSieveQueryRequest cqSieveQueryRequest, Integer id, HttpServletResponse response) {
  3205 + try {
  3206 + BaseListResponse listResponse = (BaseListResponse) regionalCqsievesList(cqSieveQueryRequest, id, null, true);
  3207 +
  3208 + List<SieveListResult> list = listResponse.getData();
  3209 + List<Map<String, Object>> datas = new ArrayList<>();
  3210 +
  3211 + if (CollectionUtils.isNotEmpty(list)) {
  3212 + for (SieveListResult sive : list) {
  3213 + try {
  3214 + Map<String, Object> data = new HashMap<>();
  3215 + data.put("姓名", sive.getName());
  3216 + data.put("年龄", sive.getAge());
  3217 + data.put("申请时间", sive.getApplyTime());
  3218 + data.put("申请孕周", sive.getDueWeek());
  3219 + data.put("采血时间", sive.getCollectionDate());
  3220 + data.put("申请医院", sive.getApplyHospital());
  3221 + data.put("户籍地", sive.getPlaceDomicile());
  3222 + data.put("产筛类型", sive.getSieveTypeStr());
  3223 + data.put("筛查状态", sive.getStatusText());
  3224 + data.put("收费类型", sive.getCostTypeStr());
  3225 + data.put("整体风险", sive.getZtfxText());
  3226 + datas.add(data);
  3227 + } catch (Exception e) {
  3228 + e.printStackTrace();
  3229 + continue;
  3230 + }
  3231 + }
  3232 + }
  3233 + OutputStream out = response.getOutputStream();
  3234 + Map<String, String> cnames = new LinkedHashMap<>();
  3235 + cnamesRegionalCqsievesWcMap(cnames);
3183 3236 response.setContentType("application/octet-stream");
3184 3237 response.setCharacterEncoding("UTF-8");
3185 3238 response.setHeader("Content-Disposition", "attachment;fileName=" + "csdata.xls");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IReportService.java View file @ 8fc6156
... ... @@ -101,6 +101,7 @@
101 101 BaseObjectResponse patients(String provinceId, String cityId, String aredId, String streetId, Integer statistType, Integer statistVal, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId);
102 102  
103 103 void patientsExport(String provinceId, String cityId, String aredId, String streetId, Integer statistType, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId, HttpServletResponse response);
  104 + void patientsHsExport(String provinceId, String cityId, String aredId, String streetId, Integer statistType, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId, HttpServletResponse response);
104 105  
105 106 void patientsExport2(String provinceId, String cityId, String areaId, String streetId, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId, HttpServletResponse response);
106 107  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ 8fc6156
... ... @@ -862,6 +862,89 @@
862 862  
863 863 ResponseUtil.responseExcel(cnames, results, response);
864 864 }
  865 + @Override
  866 + public void patientsHsExport(String provinceId, String cityId, String aredId, String streetId, Integer statistType, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId, HttpServletResponse response) {
  867 + List<Patients> patients = getPatients(provinceId, cityId, aredId, streetId, ageType, patientType, startDate, endDate, userId);
  868 +
  869 + Map<String, String> codeCache = new HashMap<>();
  870 + Map<String, String> hNameCache = new HashMap<>();
  871 + Map<String, String> userNameCache = new HashMap<>();
  872 + for (Patients patient : patients) {
  873 + if (!userNameCache.containsKey(patient.getBookbuildingDoctor())) {
  874 + userNameCache.put(patient.getBookbuildingDoctor(), couponMapper.findUserName(patient.getBookbuildingDoctor()));
  875 + }
  876 + if (codeCache.containsKey(patient.getHospitalId())) {
  877 + patient.setShortCode(codeCache.get(patient.getHospitalId()));
  878 + } else {
  879 + String name = couponMapper.findHospitalNameById(patient.getHospitalId());
  880 + String code = PingYinUtil.getFirstSpell(name);
  881 + patient.setShortCode(code);
  882 + codeCache.put(patient.getHospitalId(), code);
  883 + hNameCache.put(patient.getHospitalId(), name);
  884 + }
  885 + }
  886 +
  887 + Collections.sort(patients, new Comparator<Patients>() {
  888 + @Override
  889 + public int compare(Patients patients1, Patients patients2) {
  890 + if (StringUtils.isEmpty(patients1.getShortCode()) || StringUtils.isEmpty(patients2.getShortCode())) {
  891 + return 0;
  892 + }
  893 + return patients1.getShortCode().compareTo(patients2.getShortCode());
  894 + }
  895 + });
  896 +
  897 + Map<String, String> cnames = new LinkedHashMap<>();
  898 + cnames.put("vcCardNo", "条码号");
  899 + cnames.put("username", "姓名");
  900 + cnames.put("建档年龄", "建档年龄");
  901 + cnames.put("phone", "手机号");
  902 + cnames.put("cardNo", "证件号");
  903 + cnames.put("bookbuildingDate", "建档日期");
  904 + cnames.put("week", "建档孕周");
  905 + cnames.put("建档机构", "建档机构");
  906 + cnames.put("huji", "户口所在地");
  907 +
  908 + cnames.put("id", "#");
  909 + cnames.put("hospitalName", "医院名称");
  910 + cnames.put("birth", "出生日期");
  911 + cnames.put("age", "年龄");
  912 + cnames.put("huji", "户籍地");
  913 + cnames.put("juzhu", "居住地");
  914 + cnames.put("week", "建档孕周");
  915 + cnames.put("lastMens", "末次月经");
  916 + cnames.put("dueDate", "预产期");
  917 + cnames.put("doctorName", "建档医生");
  918 +
  919 + List<Map<String, Object>> results = new ArrayList<>();
  920 + if (org.apache.commons.collections.CollectionUtils.isNotEmpty(patients)) {
  921 + int i = 0;
  922 + for (Patients p : patients) {
  923 + Map<String, Object> result = new LinkedHashMap<>();
  924 + result.put("id", ++i);
  925 + result.put("hospitalName", hNameCache.get(p.getHospitalId()));
  926 + result.put("vcCardNo", p.getVcCardNo());
  927 + result.put("username", p.getUsername());
  928 + result.put("birth", DateUtil.getyyyy_MM_dd(p.getBirth()));
  929 + result.put("phone", com.lyms.platform.common.utils.StringUtils.encryPhone(p.getPhone()));
  930 + result.put("cardNo", com.lyms.platform.common.utils.StringUtils.encryCardNo(p.getCardNo()));
  931 + result.put("age", DateUtil.getAge(p.getBirth()));
  932 + String residenceAddress = findName(p.getProvinceRegisterId()) + findName(p.getCityRegisterId()) + findName(p.getAreaRegisterId()) + findName(p.getStreetRegisterId()) + p.getAddressRegister();
  933 + result.put("juzhu", residenceAddress.replace("null", ""));
  934 + String householdAddress = findName(p.getProvinceId()) + findName(p.getCityId()) + findName(p.getAreaId()) + findName(p.getStreetId()) + p.getAddress();
  935 + result.put("huji", householdAddress.replace("null", ""));
  936 +
  937 + result.put("week", DateUtil.getWeekDesc(p.getLastMenses(), p.getBookbuildingDate()));
  938 + result.put("lastMens", DateUtil.getyyyy_MM_dd(p.getLastMenses()));
  939 + result.put("dueDate", DateUtil.getyyyy_MM_dd(p.getDueDate()));
  940 + result.put("bookbuildingDate", DateUtil.getyyyy_MM_dd(p.getBookbuildingDate()));
  941 + result.put("doctorName", userNameCache.get(p.getBookbuildingDoctor()));
  942 + results.add(result);
  943 + }
  944 + }
  945 +
  946 + ResponseUtil.responseExcel(cnames, results, response);
  947 + }
865 948  
866 949 @Override
867 950 public void patientsExport2(String provinceId, String cityId, String areaId, String streetId, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId, HttpServletResponse response) {