Commit 782bf6abca75a4e42a77225537cc4fae5835b62c
1 parent
7b1e9f5a44
Exists in
master
and in
6 other branches
新筛实验室接口
Showing 7 changed files with 167 additions and 16 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/NewSieveLabDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabySieveService.java
- platform-dal/src/main/java/com/lyms/platform/query/NewSieveLabModelQuery.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabySieveController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabySieveFacede.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/NewSieveLabDaoImpl.java
View file @
782bf6a
| ... | ... | @@ -5,12 +5,14 @@ |
| 5 | 5 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 6 | 6 | import com.lyms.platform.pojo.BabySieveModel; |
| 7 | 7 | import com.lyms.platform.pojo.NewSieveLabModel; |
| 8 | +import org.springframework.stereotype.Repository; | |
| 8 | 9 | |
| 9 | 10 | import java.util.List; |
| 10 | 11 | |
| 11 | 12 | /** |
| 12 | 13 | * Created by Administrator on 2018/12/3. |
| 13 | 14 | */ |
| 15 | +@Repository("newSieveLabDao") | |
| 14 | 16 | public class NewSieveLabDaoImpl extends BaseMongoDAOImpl<NewSieveLabModel> implements INewSieveLabDao { |
| 15 | 17 | public List<NewSieveLabModel> queryNewSieveLab(MongoQuery query){ |
| 16 | 18 | return find(query.convertToMongoQuery()); |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabySieveService.java
View file @
782bf6a
| 1 | 1 | package com.lyms.platform.biz.service; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.biz.dal.INewSieveLabDao; | |
| 3 | 4 | import com.lyms.platform.biz.dal.IbabySieveDao; |
| 4 | 5 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 5 | 6 | import com.lyms.platform.pojo.BabySieveModel; |
| 7 | +import com.lyms.platform.pojo.NewSieveLabModel; | |
| 6 | 8 | import com.lyms.platform.query.BabySieveQuery; |
| 9 | +import com.lyms.platform.query.NewSieveLabModelQuery; | |
| 7 | 10 | import org.apache.commons.lang.StringUtils; |
| 8 | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | 12 | import org.springframework.data.domain.Sort; |
| ... | ... | @@ -20,6 +23,8 @@ |
| 20 | 23 | |
| 21 | 24 | @Autowired |
| 22 | 25 | private IbabySieveDao babySieveDao; |
| 26 | + @Autowired | |
| 27 | + private INewSieveLabDao newSieveLabDao; | |
| 23 | 28 | |
| 24 | 29 | public List<BabySieveModel> getBabySieveQuery(BabySieveQuery babySieveQuery){ |
| 25 | 30 | MongoQuery query = babySieveQuery.convertToQuery(); |
| ... | ... | @@ -49,6 +54,15 @@ |
| 49 | 54 | |
| 50 | 55 | public BabySieveModel findOneBabySieveById(String id){ |
| 51 | 56 | return babySieveDao.findOneBabySieveById(id); |
| 57 | + } | |
| 58 | + | |
| 59 | + public List<NewSieveLabModel> queryNewSieveLab(NewSieveLabModelQuery newSieveLabModelQuery){ | |
| 60 | + MongoQuery query = newSieveLabModelQuery.convertToQuery(); | |
| 61 | + return newSieveLabDao.queryNewSieveLab(query); | |
| 62 | + } | |
| 63 | + | |
| 64 | + public NewSieveLabModel addNewSieveLab(NewSieveLabModel newSieveLabModel){ | |
| 65 | + return newSieveLabDao.addNewSieveLab(newSieveLabModel); | |
| 52 | 66 | } |
| 53 | 67 | |
| 54 | 68 |
platform-dal/src/main/java/com/lyms/platform/query/NewSieveLabModelQuery.java
View file @
782bf6a
| ... | ... | @@ -14,6 +14,22 @@ |
| 14 | 14 | private String id; |
| 15 | 15 | private String testNumber;//初筛试验号 |
| 16 | 16 | |
| 17 | + public String getId() { | |
| 18 | + return id; | |
| 19 | + } | |
| 20 | + | |
| 21 | + public void setId(String id) { | |
| 22 | + this.id = id; | |
| 23 | + } | |
| 24 | + | |
| 25 | + public String getTestNumber() { | |
| 26 | + return testNumber; | |
| 27 | + } | |
| 28 | + | |
| 29 | + public void setTestNumber(String testNumber) { | |
| 30 | + this.testNumber = testNumber; | |
| 31 | + } | |
| 32 | + | |
| 17 | 33 | public MongoQuery convertToQuery() { |
| 18 | 34 | MongoCondition condition = MongoCondition.newInstance(); |
| 19 | 35 | if(null != id){ |
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdJbgwInterface.java
View file @
782bf6a
| ... | ... | @@ -277,8 +277,8 @@ |
| 277 | 277 | map.put("MENSESLASTDATE",DateUtil.getyyyy_MM_dd(patients.getLastMenses())); |
| 278 | 278 | map.put("EXPECTEDCHILDBIRTHDAY",DateUtil.getyyyy_MM_dd(patients.getDueDate())); |
| 279 | 279 | String hospital = ""; |
| 280 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getHospitalId())) { | |
| 281 | - Organization organization = organizationService.getOrganization(Integer.parseInt(patients.getHospitalId())); | |
| 280 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(antExChuModel.getHospitalId())) { | |
| 281 | + Organization organization = organizationService.getOrganization(Integer.parseInt(antExChuModel.getHospitalId())); | |
| 282 | 282 | if (organization != null && organization.getYn() == YnEnums.YES.getId()) { |
| 283 | 283 | hospital = organization.getName(); |
| 284 | 284 | } |
| ... | ... | @@ -465,7 +465,7 @@ |
| 465 | 465 | ydfmw = ResolveUtils.replaceYDFMW(ydfmwMap, 1); |
| 466 | 466 | } |
| 467 | 467 | map.put("WVDEXAM",ydfmw); |
| 468 | - map.put("ORGCODE",patients.getHospitalId()); | |
| 468 | + map.put("ORGCODE",antExChuModel.getHospitalId()); | |
| 469 | 469 | /*String hospital = ""; |
| 470 | 470 | if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getHospitalId())) { |
| 471 | 471 | Organization organization = organizationService.getOrganization(Integer.parseInt(patients.getHospitalId())); |
| 472 | 472 | |
| ... | ... | @@ -600,10 +600,10 @@ |
| 600 | 600 | } |
| 601 | 601 | } |
| 602 | 602 | map.put("FOLLOWUPDOCTORNAME",checkDoctor); |
| 603 | - map.put("ORGCODE",patients.getHospitalId()); | |
| 603 | + map.put("ORGCODE",data.getHospitalId()); | |
| 604 | 604 | String hospital = ""; |
| 605 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(patients.getHospitalId())) { | |
| 606 | - Organization organization = organizationService.getOrganization(Integer.parseInt(patients.getHospitalId())); | |
| 605 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getHospitalId())) { | |
| 606 | + Organization organization = organizationService.getOrganization(Integer.parseInt(data.getHospitalId())); | |
| 607 | 607 | if (organization != null && organization.getYn() == YnEnums.YES.getId()) { |
| 608 | 608 | hospital = organization.getName(); |
| 609 | 609 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabySieveController.java
View file @
782bf6a
| ... | ... | @@ -146,5 +146,16 @@ |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
| 149 | + /** | |
| 150 | + * 新生儿实验室结果查看接口 | |
| 151 | + * @param testNum | |
| 152 | + * @return | |
| 153 | + */ | |
| 154 | + @ResponseBody | |
| 155 | + @RequestMapping(value = "/newSieveLab",method = RequestMethod.GET) | |
| 156 | + public BaseResponse newSieveLabResult(String testNum) { | |
| 157 | + return babySieveFacede.newSieveLabResult(testNum); | |
| 158 | + } | |
| 159 | + | |
| 149 | 160 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
782bf6a
| ... | ... | @@ -127,6 +127,8 @@ |
| 127 | 127 | |
| 128 | 128 | @Autowired |
| 129 | 129 | private PersonService personService; |
| 130 | + @Autowired | |
| 131 | + private BabySieveFacede babySieveFacede; | |
| 130 | 132 | |
| 131 | 133 | @Autowired |
| 132 | 134 | @Qualifier("commonThreadPool") |
| 133 | 135 | |
| ... | ... | @@ -2679,11 +2681,21 @@ |
| 2679 | 2681 | @ResponseBody |
| 2680 | 2682 | public String getZdy(@RequestParam("start") String start, @RequestParam("end") String end) { |
| 2681 | 2683 | |
| 2682 | - cdGwInterface.test(start,end); | |
| 2684 | + cdGwInterface.test(start, end); | |
| 2683 | 2685 | return "1"; |
| 2684 | 2686 | } |
| 2685 | 2687 | |
| 2686 | - | |
| 2688 | + /** | |
| 2689 | + * 承德新筛接口 | |
| 2690 | + * @param date | |
| 2691 | + * @return | |
| 2692 | + */ | |
| 2693 | + @RequestMapping(value = "/dr") | |
| 2694 | + @ResponseBody | |
| 2695 | + public String drCeshi(String date){ | |
| 2696 | + babySieveFacede.newSieveLab(date); | |
| 2697 | + return null; | |
| 2698 | + } | |
| 2687 | 2699 | |
| 2688 | 2700 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabySieveFacede.java
View file @
782bf6a
| ... | ... | @@ -23,16 +23,11 @@ |
| 23 | 23 | import com.lyms.platform.permission.model.LisReportModel; |
| 24 | 24 | import com.lyms.platform.permission.model.Organization; |
| 25 | 25 | import com.lyms.platform.permission.service.OrganizationService; |
| 26 | -import com.lyms.platform.pojo.BabyModel; | |
| 27 | -import com.lyms.platform.pojo.BabySieveModel; | |
| 28 | -import com.lyms.platform.pojo.MaternalDeliverModel; | |
| 29 | -import com.lyms.platform.pojo.Patients; | |
| 30 | -import com.lyms.platform.query.BabyModelQuery; | |
| 31 | -import com.lyms.platform.query.BabySieveQuery; | |
| 32 | -import com.lyms.platform.query.MatDeliverQuery; | |
| 33 | -import com.lyms.platform.query.PatientsQuery; | |
| 26 | +import com.lyms.platform.pojo.*; | |
| 27 | +import com.lyms.platform.query.*; | |
| 34 | 28 | import com.mchange.v1.util.ListUtils; |
| 35 | 29 | import org.apache.commons.collections.CollectionUtils; |
| 30 | +import org.apache.commons.io.FileUtils; | |
| 36 | 31 | import org.apache.commons.lang.StringUtils; |
| 37 | 32 | import org.springframework.beans.factory.annotation.Autowired; |
| 38 | 33 | import org.springframework.beans.factory.annotation.Qualifier; |
| ... | ... | @@ -40,6 +35,7 @@ |
| 40 | 35 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| 41 | 36 | import org.springframework.stereotype.Component; |
| 42 | 37 | |
| 38 | +import java.io.File; | |
| 43 | 39 | import java.text.ParseException; |
| 44 | 40 | import java.text.SimpleDateFormat; |
| 45 | 41 | import java.util.ArrayList; |
| ... | ... | @@ -889,6 +885,106 @@ |
| 889 | 885 | return babySieveManagerResult; |
| 890 | 886 | } |
| 891 | 887 | return babySieveManagerResult; |
| 888 | + } | |
| 889 | + | |
| 890 | + /** | |
| 891 | + * 新筛实验室接口 | |
| 892 | + * @param date | |
| 893 | + */ | |
| 894 | + public void newSieveLab(String date){ | |
| 895 | + try{ | |
| 896 | + String nowDate=null; | |
| 897 | + String path = "E:\\temp"; | |
| 898 | + File file = new File(path); | |
| 899 | + File[] files = file.listFiles(); | |
| 900 | + System.out.println("该目录下文件个数:" + files.length); | |
| 901 | + if(StringUtils.isNotEmpty(date)){ | |
| 902 | + nowDate = date; | |
| 903 | + }else{ | |
| 904 | + nowDate = DateUtil.getymd(); | |
| 905 | + } | |
| 906 | + for(int i = 0;i<files.length;i++){ | |
| 907 | + if(files[i].isFile()){ | |
| 908 | + String fileDate = DateUtil.getyyyy_MM_dd(new Date(files[i].lastModified())); | |
| 909 | + //读取当天新产生的文件 | |
| 910 | + if(nowDate.equals(fileDate)){ | |
| 911 | + String fileName = files[i].toString(); | |
| 912 | + int dex = fileName.indexOf("."); | |
| 913 | + if(-1 == dex){ | |
| 914 | + continue; | |
| 915 | + } | |
| 916 | + String name = fileName.substring(dex-5,dex); | |
| 917 | + //读文件 | |
| 918 | + List<String> list = FileUtils.readLines(new File(fileName)); | |
| 919 | + //文件的名称有两种一种是NTSHS.*,另一种是PKUH.*,判断名称分类字段数据保存 | |
| 920 | + if("NTSHS".equals(name)){ | |
| 921 | + if(list != null && list.size()>0){ | |
| 922 | + for(int j = 2;j<list.size();j++){ | |
| 923 | + String[] array = list.get(j).split(" "); | |
| 924 | + NewSieveLabModel newSieveLabModel = new NewSieveLabModel(); | |
| 925 | + if(j>=11){ | |
| 926 | + newSieveLabModel.setTestNumber(array[6]); | |
| 927 | + newSieveLabModel.setNtshsyingguang(array[11]); | |
| 928 | + newSieveLabModel.setNtshsnongdu(array[16]); | |
| 929 | + babySieveService.addNewSieveLab(newSieveLabModel); | |
| 930 | + }else if(j>=101){ | |
| 931 | + newSieveLabModel.setTestNumber(array[5]); | |
| 932 | + newSieveLabModel.setNtshsyingguang(array[10]); | |
| 933 | + newSieveLabModel.setNtshsnongdu(array[15]); | |
| 934 | + babySieveService.addNewSieveLab(newSieveLabModel); | |
| 935 | + }else{ | |
| 936 | + newSieveLabModel.setTestNumber(array[7]); | |
| 937 | + newSieveLabModel.setNtshsyingguang(array[12]); | |
| 938 | + newSieveLabModel.setNtshsnongdu(array[17]); | |
| 939 | + babySieveService.addNewSieveLab(newSieveLabModel); | |
| 940 | + } | |
| 941 | + | |
| 942 | + } | |
| 943 | + | |
| 944 | + } | |
| 945 | + }else{ | |
| 946 | + if(list != null && list.size()>0){ | |
| 947 | + for(int j = 2;j<list.size();j++){ | |
| 948 | + String[] array = list.get(j).split(" "); | |
| 949 | + NewSieveLabModel newSieveLabModel = new NewSieveLabModel(); | |
| 950 | + newSieveLabModel.setTestNumber(array[7]); | |
| 951 | + newSieveLabModel.setNtshsyingguang(array[13]); | |
| 952 | + newSieveLabModel.setNtshsnongdu(array[17]); | |
| 953 | + babySieveService.addNewSieveLab(newSieveLabModel); | |
| 954 | + } | |
| 955 | + } | |
| 956 | + } | |
| 957 | + } | |
| 958 | + continue; | |
| 959 | + } | |
| 960 | + continue; | |
| 961 | + } | |
| 962 | + | |
| 963 | + }catch (Exception e){ | |
| 964 | + e.printStackTrace(); | |
| 965 | + } | |
| 966 | + } | |
| 967 | + | |
| 968 | + | |
| 969 | + /** | |
| 970 | + * 新筛结果查看 | |
| 971 | + * @param testNum(初筛试验号) | |
| 972 | + * @return | |
| 973 | + */ | |
| 974 | + public BaseResponse newSieveLabResult(String testNum) { | |
| 975 | + BaseObjectResponse br = new BaseObjectResponse(); | |
| 976 | + if(StringUtils.isNotEmpty(testNum)){ | |
| 977 | + NewSieveLabModelQuery query = new NewSieveLabModelQuery(); | |
| 978 | + query.setTestNumber(testNum); | |
| 979 | + List<NewSieveLabModel> list = babySieveService.queryNewSieveLab(query); | |
| 980 | + if(list != null && list.size() > 0){ | |
| 981 | + br.setData(list); | |
| 982 | + br.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); | |
| 983 | + return br; | |
| 984 | + } | |
| 985 | + return br; | |
| 986 | + } | |
| 987 | + return br; | |
| 892 | 988 | } |
| 893 | 989 | |
| 894 | 990 | } |