Commit cde775b8feccb86776c8023d18145bf32889468d
1 parent
8fc6156de8
Exists in
master
and in
6 other branches
update
Showing 5 changed files with 102 additions and 49 deletions
- platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
cde775b
| ... | ... | @@ -53,12 +53,12 @@ |
| 53 | 53 | return newEquipmentNo; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - public static void main(String[] args) { | |
| 56 | + /* public static void main(String[] args) { | |
| 57 | 57 | |
| 58 | 58 | String dateNumber = getDateNumber("002"); |
| 59 | 59 | String substring = dateNumber.substring(8, dateNumber.length()); |
| 60 | 60 | System.out.println(substring); |
| 61 | - } | |
| 61 | + }*/ | |
| 62 | 62 | public static String getymd() { |
| 63 | 63 | return y_m_d.format(new Date()); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | |
| ... | ... | @@ -1663,14 +1663,14 @@ |
| 1663 | 1663 | return getYmdDate(calendar.getTime()); |
| 1664 | 1664 | } |
| 1665 | 1665 | |
| 1666 | - /* public static void main(String[] args) { | |
| 1666 | + public static void main(String[] args) { | |
| 1667 | 1667 | |
| 1668 | - Date bir = parseYMD("1990-03-07"); | |
| 1668 | + Date bir = parseYMD("2017-03-08"); | |
| 1669 | 1669 | Date bir1 = parseYMD("2019-03-08"); |
| 1670 | - int i = DateUtil.getAge(bir, bir1); | |
| 1670 | + int i = DateUtil.getAge2(bir, bir1); | |
| 1671 | 1671 | System.out.println(i); |
| 1672 | 1672 | |
| 1673 | - }*/ | |
| 1673 | + } | |
| 1674 | 1674 | |
| 1675 | 1675 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java
View file @
cde775b
| ... | ... | @@ -5,9 +5,13 @@ |
| 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.common.utils.StringUtils; | |
| 8 | 9 | import com.lyms.platform.operate.web.facade.AutoMatchFacade; |
| 9 | 10 | import com.lyms.platform.operate.web.service.IReportService; |
| 10 | 11 | import com.lyms.platform.operate.web.utils.CollectionUtils; |
| 12 | +import com.lyms.platform.permission.model.Organization; | |
| 13 | +import com.lyms.platform.permission.service.OrganizationService; | |
| 14 | +import com.lyms.platform.permission.service.UsersService; | |
| 11 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 16 | import org.springframework.stereotype.Controller; |
| 13 | 17 | import org.springframework.web.bind.annotation.*; |
| ... | ... | @@ -30,6 +34,10 @@ |
| 30 | 34 | private IReportService reportService; |
| 31 | 35 | @Autowired |
| 32 | 36 | private AutoMatchFacade autoMatchFacade; |
| 37 | + @Autowired | |
| 38 | + private UsersService usersService; | |
| 39 | + @Autowired | |
| 40 | + private OrganizationService organizationService; | |
| 33 | 41 | |
| 34 | 42 | /** |
| 35 | 43 | * 聊城曲线图 |
| ... | ... | @@ -55,7 +63,6 @@ |
| 55 | 63 | Integer ageType, Integer patientType, Date startDate, Date endDate, HttpServletRequest request) { |
| 56 | 64 | return reportService.patients(provinceId, cityId, areaId, streetId, 1, statistVal, ageType, patientType, startDate, endDate, getUserId(request)); |
| 57 | 65 | } |
| 58 | - | |
| 59 | 66 | /** |
| 60 | 67 | * 建档明细导出 |
| 61 | 68 | * @param statistType 统计环比 1=周 2=月 3=季度 4=半年 5=年 |
| 62 | 69 | |
| 63 | 70 | |
| ... | ... | @@ -68,15 +75,17 @@ |
| 68 | 75 | @RequestMapping(value = "/patients/export", method = RequestMethod.GET) |
| 69 | 76 | public void patientsExport(String provinceId, String cityId, String areaId, String streetId, Integer statistType, |
| 70 | 77 | Integer ageType, Integer patientType, Date startDate, Date endDate, HttpServletRequest request, HttpServletResponse response) { |
| 71 | - | |
| 72 | 78 | 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); | |
| 79 | + if(StringUtils.isNotEmpty(hospitalId)){ | |
| 80 | + Organization organization = organizationService.getOrganization(Integer.valueOf(hospitalId)); | |
| 81 | + //衡水导出格式 | |
| 82 | + if(organization!=null && "12".equals(organization.getCityId())){ | |
| 83 | + reportService.patientsHsExport(provinceId, cityId, areaId, streetId, statistType, ageType, patientType, startDate, endDate, getUserId(request), response); | |
| 76 | 84 | |
| 77 | - }else { | |
| 78 | - reportService.patientsExport(provinceId, cityId, areaId, streetId, statistType, ageType, patientType, startDate, endDate, getUserId(request), response); | |
| 79 | -// reportService.patientsExport(provinceId, cityId, aredId, streetId, statistType, ageType, patientType, startDate, endDate, 1000000185, response); | |
| 85 | + }else { | |
| 86 | + reportService.patientsExport(provinceId, cityId, areaId, streetId, statistType, ageType, patientType, startDate, endDate, getUserId(request), response); | |
| 87 | + // reportService.patientsExport(provinceId, cityId, aredId, streetId, statistType, ageType, patientType, startDate, endDate, 1000000185, response); | |
| 88 | + } | |
| 80 | 89 | } |
| 81 | 90 | |
| 82 | 91 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
cde775b
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
cde775b
| ... | ... | @@ -404,6 +404,40 @@ |
| 404 | 404 | return s1.substring(0,s1.indexOf(".")); |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | + }else if(StringUtils.isNotEmpty(month) && StringUtils.isNotEmpty(type) && "6".equals(type)){ | |
| 408 | + int i = 0; | |
| 409 | + Double count = 0.00; | |
| 410 | + if(StringUtils.isNotEmpty(ddz)){ | |
| 411 | + Double ddzd = Double.valueOf(ddz); | |
| 412 | + count += ddzd; | |
| 413 | + i++; | |
| 414 | + } | |
| 415 | + if(StringUtils.isNotEmpty(sxdz)){ | |
| 416 | + Double ddzd = Double.valueOf(ddz); | |
| 417 | + count += ddzd; | |
| 418 | + i++; | |
| 419 | + } | |
| 420 | + if(StringUtils.isNotEmpty(rs)){ | |
| 421 | + Double rsd = Double.valueOf(rs); | |
| 422 | + count += rsd; | |
| 423 | + i++; | |
| 424 | + } | |
| 425 | + if(StringUtils.isNotEmpty(yy)){ | |
| 426 | + Double yyd = Double.valueOf(yy); | |
| 427 | + count += yyd; | |
| 428 | + i++; | |
| 429 | + } | |
| 430 | + if(StringUtils.isNotEmpty(sqxw)){ | |
| 431 | + Double sqxwd = Double.valueOf(sqxw); | |
| 432 | + count += sqxwd; | |
| 433 | + i++; | |
| 434 | + } | |
| 435 | + Double pj = count / i; | |
| 436 | + if(pj !=null && pj.toString().contains(".")){ | |
| 437 | + String s1 = pj.toString(); | |
| 438 | + return s1.substring(0,s1.indexOf(".")); | |
| 439 | + } | |
| 440 | + | |
| 407 | 441 | } |
| 408 | 442 | } catch (NumberFormatException e) { |
| 409 | 443 | e.printStackTrace(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
cde775b
| ... | ... | @@ -862,6 +862,7 @@ |
| 862 | 862 | |
| 863 | 863 | ResponseUtil.responseExcel(cnames, results, response); |
| 864 | 864 | } |
| 865 | + | |
| 865 | 866 | @Override |
| 866 | 867 | 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 | 868 | List<Patients> patients = getPatients(provinceId, cityId, aredId, streetId, ageType, patientType, startDate, endDate, userId); |
| 868 | 869 | |
| 869 | 870 | |
| 870 | 871 | |
| 871 | 872 | |
| 872 | 873 | |
| ... | ... | @@ -895,50 +896,58 @@ |
| 895 | 896 | }); |
| 896 | 897 | |
| 897 | 898 | Map<String, String> cnames = new LinkedHashMap<>(); |
| 898 | - cnames.put("vcCardNo", "条码号"); | |
| 899 | - cnames.put("username", "姓名"); | |
| 899 | + cnames.put("条码号", "条码号"); | |
| 900 | + cnames.put("姓名", "姓名"); | |
| 900 | 901 | cnames.put("建档年龄", "建档年龄"); |
| 901 | - cnames.put("phone", "手机号"); | |
| 902 | - cnames.put("cardNo", "证件号"); | |
| 903 | - cnames.put("bookbuildingDate", "建档日期"); | |
| 904 | - cnames.put("week", "建档孕周"); | |
| 902 | + cnames.put("手机号", "手机号"); | |
| 903 | + cnames.put("证件号", "证件号"); | |
| 904 | + cnames.put("建档日期", "建档日期"); | |
| 905 | + cnames.put("建档孕周", "建档孕周"); | |
| 905 | 906 | cnames.put("建档机构", "建档机构"); |
| 906 | - cnames.put("huji", "户口所在地"); | |
| 907 | + cnames.put("户口所在地", "户口所在地"); | |
| 908 | + cnames.put("现住址", "现住址"); | |
| 907 | 909 | |
| 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", "建档医生"); | |
| 910 | + cnames.put("产后休养地", "产后休养地"); | |
| 911 | + cnames.put("丈夫姓名", "丈夫姓名"); | |
| 912 | + cnames.put("丈夫证件号码", "丈夫证件号码"); | |
| 913 | + cnames.put("丈夫联系电话", "丈夫联系电话"); | |
| 914 | + cnames.put("丈夫户口所在地", "丈夫户口所在地"); | |
| 915 | + cnames.put("结案状态", "结案状态"); | |
| 918 | 916 | |
| 919 | 917 | List<Map<String, Object>> results = new ArrayList<>(); |
| 920 | 918 | if (org.apache.commons.collections.CollectionUtils.isNotEmpty(patients)) { |
| 921 | 919 | int i = 0; |
| 922 | 920 | for (Patients p : patients) { |
| 923 | 921 | 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", "")); | |
| 922 | + result.put("条码号", p.getVcCardNo()); | |
| 923 | + result.put("姓名", p.getUsername()); | |
| 924 | + result.put("建档年龄", DateUtil.getAge2(p.getBirth(), p.getBookbuildingDate())); | |
| 925 | + result.put("手机号", p.getPhone()); | |
| 926 | + result.put("证件号", p.getCardNo()); | |
| 927 | + result.put("建档日期", DateUtil.getyyyy_MM_dd(p.getBookbuildingDate())); | |
| 928 | + result.put("建档孕周", DateUtil.getWeekDesc(p.getLastMenses(), p.getBookbuildingDate())); | |
| 929 | + result.put("建档机构", hNameCache.get(p.getHospitalId())); | |
| 934 | 930 | 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())); | |
| 931 | + result.put("户口所在地", householdAddress.replace("null", "")); | |
| 932 | + String residenceAddress = findName(p.getProvinceRegisterId()) + findName(p.getCityRegisterId()) + findName(p.getAreaRegisterId()) + findName(p.getStreetRegisterId()) + p.getAddressRegister(); | |
| 933 | + result.put("现住址", residenceAddress.replace("null", "")); | |
| 934 | + String provinceAddress = findName(p.getProvincePostRestId()) + findName(p.getCityPostRestId()) | |
| 935 | + + findName(p.getAreaPostRestId()) + findName(p.getStreetPostRestId()) + p.getAddressPostRest(); | |
| 936 | + result.put("产后休养地", provinceAddress.replace("null", "")); | |
| 937 | + result.put("丈夫姓名", p.getHusbandName()); | |
| 938 | + result.put("丈夫证件号码", p.getHcertificateNum()); | |
| 939 | + result.put("丈夫联系电话", p.getHusbandPhone()); | |
| 940 | + String hAddress = findName(p.getHprovinceRegisterId()) + findName(p.getHcityRegisterId()) | |
| 941 | + + findName(p.getHareaRegisterId()) + findName(p.getHstreetRegisterId()) + p.getHaddressRegister(); | |
| 942 | + result.put("丈夫户口所在地", hAddress.replace("null", "")); | |
| 943 | + //孕妇状态显示当前孕周 | |
| 944 | + if ("1".equals(p.getType())) { | |
| 945 | + result.put("结案状态", DateUtil.getWeekDesc(p.getLastMenses(),new Date())); | |
| 946 | + }else if ("3".equals(p.getType())){ | |
| 947 | + result.put("结案状态", "分娩"); | |
| 948 | + }else { | |
| 949 | + result.put("结案状态", ""); | |
| 950 | + } | |
| 942 | 951 | results.add(result); |
| 943 | 952 | } |
| 944 | 953 | } |