Commit 1207f40783db0efc01aaf1778863be3c6ecb8f2d
1 parent
a1ce2468f5
Exists in
master
and in
6 other branches
两癌个案审核
Showing 3 changed files with 328 additions and 2 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
View file @
1207f40
... | ... | @@ -7522,9 +7522,95 @@ |
7522 | 7522 | e.printStackTrace(); |
7523 | 7523 | } |
7524 | 7524 | } |
7525 | + public static void saveBaby(String fileName) { | |
7526 | + ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml"); | |
7527 | + MongoTemplate mongoTemplate | |
7528 | + = (MongoTemplate) applicationContext.getBean("mongoTemplate"); | |
7529 | + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray()); | |
7530 | + File file = new File(fileName); | |
7531 | + Workbook wb = null; | |
7532 | + try { | |
7533 | + wb = Workbook.getWorkbook(file); | |
7525 | 7534 | |
7535 | + Sheet s = wb.getSheet(0); | |
7536 | + int rows = s.getRows(); | |
7537 | + if (rows > 0) { | |
7538 | + //遍历每行 | |
7539 | + for (int i = 2; i < rows; i++) { | |
7540 | + // System.out.println("rows=" + i); | |
7541 | + AreaAddressModel model = new AreaAddressModel(); | |
7542 | + Cell[] cells = s.getRow(i); | |
7543 | + if (cells.length > 0) { | |
7544 | + for (int j = 0; j < cells.length; j++) { | |
7545 | + String str = cells[j].getContents().trim(); | |
7546 | + switch (j) { | |
7547 | + case 7: | |
7548 | + System.out.print(str+" "); | |
7549 | + continue; | |
7550 | + case 8: | |
7551 | + System.out.print(str+" "); | |
7552 | + continue; | |
7553 | + case 9: | |
7554 | + System.out.print(str+" "); | |
7555 | + continue; | |
7556 | + case 11: | |
7557 | + System.out.print(str+" "); | |
7558 | + continue; | |
7559 | + case 12: | |
7560 | + System.out.print(str+" "); | |
7561 | + continue; | |
7562 | + case 13: | |
7563 | + System.out.print(str+" "); | |
7564 | + continue; | |
7565 | + case 14: | |
7566 | + System.out.print(str+" "); | |
7567 | + continue; | |
7568 | + case 15: | |
7569 | + System.out.print(str+" "); | |
7570 | + continue; | |
7571 | + case 17: | |
7572 | + System.out.print(str+" "); | |
7573 | + continue; | |
7574 | + case 20: | |
7575 | + System.out.print(str+" "); | |
7576 | + continue; | |
7577 | + case 21: | |
7578 | + System.out.print(str+" "); | |
7579 | + continue; | |
7580 | + case 22: | |
7581 | + System.out.print(str+" "); | |
7582 | + continue; | |
7583 | + case 23: | |
7584 | + System.out.print(str+" "); | |
7585 | + continue; | |
7586 | + case 26: | |
7587 | + System.out.print(str+" "); | |
7588 | + continue; | |
7589 | + case 29: | |
7590 | + System.out.print(str+" "); | |
7591 | + continue; | |
7592 | + case 30: | |
7593 | + System.out.print(str+" "); | |
7594 | + continue; | |
7595 | + case 32: | |
7596 | + System.out.print(str+" "); | |
7597 | + continue; | |
7598 | + case 42: | |
7599 | + System.out.print(str+" "); | |
7600 | + continue; | |
7601 | + } | |
7602 | + } | |
7603 | + } | |
7604 | + System.out.println(); | |
7605 | + } | |
7606 | + } | |
7607 | + } catch (Exception e) { | |
7608 | + e.printStackTrace(); | |
7609 | + } | |
7610 | + } | |
7526 | 7611 | public static void main(String[] args) { |
7527 | - saveAreaOrg("C:\\Users\\liquanyu\\Desktop\\doc\\temp\\org.xls"); | |
7612 | + saveBaby("D:\\temp\\丰宁各地个人档案表\\丰宁各地个人档案表\\草原卫生院0-6岁儿童个人健康档案.xls"); | |
7613 | + //saveAreaOrg("C:\\Users\\liquanyu\\Desktop\\doc\\temp\\org.xls"); | |
7528 | 7614 | //saveInout("C:\\Users\\liquanyu\\Desktop\\doc\\temp\\预约.xls"); |
7529 | 7615 | // compareYqys("C:\\Users\\liquanyu\\Desktop\\doc\\temp\\联网.xls","C:\\Users\\liquanyu\\Desktop\\doc\\temp\\单机.xls"); |
7530 | 7616 | //saveGw("C:\\Users\\liquanyu\\Desktop\\doc\\承德工位\\承德工位机构表.xls","C:\\Users\\liquanyu\\Desktop\\doc\\承德工位\\龙源承德机构表.xls"); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
1207f40
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 | import com.lyms.platform.common.result.BaseListResponse; |
16 | 16 | import com.lyms.platform.common.utils.*; |
17 | 17 | import com.lyms.platform.common.utils.HttpClientUtil; |
18 | +import com.lyms.platform.operate.web.request.BabyBookbuildingAddRequest; | |
18 | 19 | import com.lyms.platform.operate.web.request.MessagesResult; |
19 | 20 | import com.lyms.platform.operate.web.result.*; |
20 | 21 | import com.lyms.platform.operate.web.service.TeamService; |
... | ... | @@ -24,6 +25,9 @@ |
24 | 25 | import com.lyms.platform.permission.service.CheckItemService; |
25 | 26 | import com.lyms.platform.pojo.*; |
26 | 27 | import com.lyms.platform.query.*; |
28 | +import jxl.Cell; | |
29 | +import jxl.Sheet; | |
30 | +import jxl.Workbook; | |
27 | 31 | import net.sf.json.JSONArray; |
28 | 32 | import org.apache.commons.collections.CollectionUtils; |
29 | 33 | import org.apache.commons.collections.MapUtils; |
30 | 34 | |
... | ... | @@ -100,8 +104,9 @@ |
100 | 104 | private BasicConfigFacade basicConfigFacade; |
101 | 105 | @Autowired |
102 | 106 | private SieveFacade sieveFacade; |
103 | - | |
104 | 107 | @Autowired |
108 | + private BabyBookbuildingFacade babyBookbuildingFacade; | |
109 | + @Autowired | |
105 | 110 | private AntExRecordService recordService; |
106 | 111 | |
107 | 112 | @Autowired |
... | ... | @@ -7958,6 +7963,25 @@ |
7958 | 7963 | filepath.getParentFile().mkdirs(); |
7959 | 7964 | } |
7960 | 7965 | file.transferTo(filepath); |
7966 | + | |
7967 | + List<BabyBookbuildingAddRequest> list = pareExclBaby(filepath); | |
7968 | + if (CollectionUtils.isNotEmpty(list)) | |
7969 | + { | |
7970 | + for (BabyBookbuildingAddRequest request : list) | |
7971 | + { | |
7972 | + if (StringUtils.isEmpty(request.getHospitalId()) || StringUtils.isEmpty(request.getBuildDoctor())) | |
7973 | + { | |
7974 | + System.out.println("baby name "+request.getBabyName()); | |
7975 | + continue; | |
7976 | + } | |
7977 | + List<BabyModel> babyModels = mongoTemplate.find(Query.query(Criteria.where("mcertNo"). | |
7978 | + is(request.getMommyCertificateNum()).and("yn").is(1).and("name").is(request.getBabyName())), BabyModel.class); | |
7979 | + if (CollectionUtils.isEmpty(babyModels)) | |
7980 | + { | |
7981 | + babyBookbuildingFacade.addBabyBookbuilding(request, Integer.parseInt(request.getBuildDoctor())); | |
7982 | + } | |
7983 | + } | |
7984 | + } | |
7961 | 7985 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
7962 | 7986 | objectResponse.setErrormsg("成功"); |
7963 | 7987 | return objectResponse; |
... | ... | @@ -7967,6 +7991,174 @@ |
7967 | 7991 | objectResponse.setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION); |
7968 | 7992 | return objectResponse; |
7969 | 7993 | } |
7994 | + } | |
7995 | + | |
7996 | + private List<BabyBookbuildingAddRequest> pareExclBaby(File file) | |
7997 | + { | |
7998 | + Workbook wb = null; | |
7999 | + List<BabyBookbuildingAddRequest> list = new ArrayList<>(); | |
8000 | + try { | |
8001 | + wb = Workbook.getWorkbook(file); | |
8002 | + | |
8003 | + Sheet s = wb.getSheet(0); | |
8004 | + int rows = s.getRows(); | |
8005 | + if (rows > 0) { | |
8006 | + //遍历每行 | |
8007 | + for (int i = 2; i < rows; i++) { | |
8008 | + BabyBookbuildingAddRequest model = new BabyBookbuildingAddRequest(); | |
8009 | + Cell[] cells = s.getRow(i); | |
8010 | + if (cells.length > 0) { | |
8011 | + for (int j = 0; j < cells.length; j++) { | |
8012 | + if (StringUtils.isEmpty(cells[j].getContents())) | |
8013 | + { | |
8014 | + continue; | |
8015 | + } | |
8016 | + String str = cells[j].getContents().trim(); | |
8017 | + switch (j) { | |
8018 | + case 7: | |
8019 | + model.setBabyName(str); | |
8020 | + continue; | |
8021 | + case 8: | |
8022 | + model.setSex(str.equals("男") ? 1 : 0); | |
8023 | + continue; | |
8024 | + case 9: | |
8025 | + model.setBnationId(CommonsHelper.getIdByName(str,basicConfigService,SystemConfig.NATION_TYPE_ID)); | |
8026 | + continue; | |
8027 | + case 11: | |
8028 | + if ("A型".equals(str)) | |
8029 | + { | |
8030 | + model.setBloodType("1"); | |
8031 | + } else if ("B型".equals(str)) | |
8032 | + { | |
8033 | + model.setBloodType("2"); | |
8034 | + } else if ("O型".equals(str)) | |
8035 | + { | |
8036 | + model.setBloodType("3"); | |
8037 | + } else if ("AB型".equals(str)) | |
8038 | + { | |
8039 | + model.setBloodType("4"); | |
8040 | + } else if ("不详".equals(str)) | |
8041 | + { | |
8042 | + model.setBloodType("5"); | |
8043 | + } | |
8044 | + continue; | |
8045 | + case 12: | |
8046 | + model.setBabyCardNo(str); | |
8047 | + continue; | |
8048 | + case 13: | |
8049 | + if (StringUtils.isNotEmpty(str) && str.contains("贫困")) | |
8050 | + { | |
8051 | + model.setPoor("1"); | |
8052 | + } | |
8053 | + else | |
8054 | + { | |
8055 | + model.setPoor("0"); | |
8056 | + } | |
8057 | + continue; | |
8058 | + case 14: | |
8059 | + model.setFileCode(str); | |
8060 | + continue; | |
8061 | + case 15: | |
8062 | + if (StringUtils.isNotEmpty(str)) | |
8063 | + { | |
8064 | + Map<String,Object> zffs = new HashMap<>(); | |
8065 | + if (str.contains("城镇居民基本医疗保险")) | |
8066 | + { | |
8067 | + zffs.put("czjmjbylbx",true); | |
8068 | + } | |
8069 | + if (str.contains("商业医疗保险")) | |
8070 | + { | |
8071 | + zffs.put("syylbx",true); | |
8072 | + } | |
8073 | + if (str.contains("新型农村合作医疗")) | |
8074 | + { | |
8075 | + zffs.put("xxnchzyl",true); | |
8076 | + } | |
8077 | + if (str.contains("城镇职工基本医疗保险")) | |
8078 | + { | |
8079 | + zffs.put("czzgjbylbx",true); | |
8080 | + } | |
8081 | + if (str.contains("贫困救助")) | |
8082 | + { | |
8083 | + zffs.put("pkjz",true); | |
8084 | + } | |
8085 | + if (str.contains("全自费")) | |
8086 | + { | |
8087 | + zffs.put("qzf",true); | |
8088 | + } | |
8089 | + if (str.contains("全公费")) | |
8090 | + { | |
8091 | + zffs.put("qgf",true); | |
8092 | + } | |
8093 | + model.setPayType(zffs); | |
8094 | + } | |
8095 | + continue; | |
8096 | + case 17: | |
8097 | + model.setMfileCode(str); | |
8098 | + continue; | |
8099 | + case 20: | |
8100 | + model.setBabyBirthday("20"+str); | |
8101 | + continue; | |
8102 | + case 21: | |
8103 | + model.setSelfPhone(str); | |
8104 | + continue; | |
8105 | + case 22: | |
8106 | + model.setMommyName(str); | |
8107 | + continue; | |
8108 | + case 23: | |
8109 | + model.setMommyCertificateNum(str); | |
8110 | + model.setMommyPhone(str); | |
8111 | + model.setMommyCertificateTypeId("57e1dcd3f0f02e7ca519d6c6"); | |
8112 | + continue; | |
8113 | + case 26: | |
8114 | + str = str.replace("丰宁满族自治县",""); | |
8115 | + str = str.replace("河北省承德市",""); | |
8116 | + model.setHomeProvinceId("1"); | |
8117 | + model.setHomeCityId("9"); | |
8118 | + model.setHomeAreaId("131"); | |
8119 | + model.setHomeAddress(str); | |
8120 | + continue; | |
8121 | + case 29: | |
8122 | + String hospitalId = CommonsHelper.getHospitalIdByName(str,organizationService); | |
8123 | + if (StringUtils.isNotEmpty(hospitalId)) | |
8124 | + { | |
8125 | + model.setHospitalId(hospitalId); | |
8126 | + } | |
8127 | + else | |
8128 | + { | |
8129 | + ExceptionUtils.catchException(str+" 没有找到机构"); | |
8130 | + break; | |
8131 | + } | |
8132 | + continue; | |
8133 | + case 30: | |
8134 | + String doctid = CommonsHelper.getUserIdByName(str,model.getHospitalId(),usersService); | |
8135 | + if (StringUtils.isNotEmpty(doctid)) | |
8136 | + { | |
8137 | + model.setBuildDoctor(doctid); | |
8138 | + } | |
8139 | + else | |
8140 | + { | |
8141 | + ExceptionUtils.catchException(str+" 没有找到账号"); | |
8142 | + break; | |
8143 | + } | |
8144 | + continue; | |
8145 | + case 32: | |
8146 | + model.setBuildDate("20"+str); | |
8147 | + continue; | |
8148 | + case 42: | |
8149 | + model.setVillage(str); | |
8150 | + continue; | |
8151 | + } | |
8152 | + } | |
8153 | + } | |
8154 | + list.add(model); | |
8155 | + } | |
8156 | + } | |
8157 | + } catch (Exception e) { | |
8158 | + ExceptionUtils.catchException(e,"解析儿童异常"); | |
8159 | + return null; | |
8160 | + } | |
8161 | + return list; | |
7970 | 8162 | } |
7971 | 8163 | |
7972 | 8164 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CommonsHelper.java
View file @
1207f40
... | ... | @@ -5,12 +5,15 @@ |
5 | 5 | import com.lyms.platform.operate.web.result.Address; |
6 | 6 | import com.lyms.platform.operate.web.result.AddressInner; |
7 | 7 | import com.lyms.platform.permission.model.Organization; |
8 | +import com.lyms.platform.permission.model.OrganizationQuery; | |
8 | 9 | import com.lyms.platform.permission.model.Users; |
10 | +import com.lyms.platform.permission.model.UsersQuery; | |
9 | 11 | import com.lyms.platform.permission.service.OrganizationService; |
10 | 12 | import com.lyms.platform.permission.service.UsersService; |
11 | 13 | import com.lyms.platform.pojo.BabyModel; |
12 | 14 | import com.lyms.platform.pojo.BasicConfig; |
13 | 15 | import com.lyms.platform.pojo.Patients; |
16 | +import com.lyms.platform.query.BasicConfigQuery; | |
14 | 17 | import org.apache.commons.lang.StringUtils; |
15 | 18 | |
16 | 19 | import java.util.HashMap; |
... | ... | @@ -120,6 +123,21 @@ |
120 | 123 | return ""; |
121 | 124 | } |
122 | 125 | |
126 | + public static String getIdByName(String name, BasicConfigService basicConfigService,String parentId) { | |
127 | + if (StringUtils.isEmpty(name)) | |
128 | + { | |
129 | + return ""; | |
130 | + } | |
131 | + BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); | |
132 | + basicConfigQuery.setName(name); | |
133 | + basicConfigQuery.setParentId(parentId); | |
134 | + List<BasicConfig> basicConfigs = basicConfigService.queryBasicConfig(basicConfigQuery); | |
135 | + if (CollectionUtils.isNotEmpty(basicConfigs)) { | |
136 | + return basicConfigs.get(0).getId(); | |
137 | + } | |
138 | + return ""; | |
139 | + } | |
140 | + | |
123 | 141 | /** |
124 | 142 | * 填充地址信息 |
125 | 143 | * |
... | ... | @@ -167,6 +185,21 @@ |
167 | 185 | return hospital; |
168 | 186 | } |
169 | 187 | |
188 | + public static String getHospitalIdByName(String hospitalName,OrganizationService organizationService) | |
189 | + { | |
190 | + String hospitalId = ""; | |
191 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(hospitalName)) { | |
192 | + OrganizationQuery query = new OrganizationQuery(); | |
193 | + query.setName(hospitalName); | |
194 | + List<Organization> organizations = organizationService.queryOrganization(query); | |
195 | + if (CollectionUtils.isNotEmpty(organizations)) { | |
196 | + hospitalId = organizations.get(0).getId()+""; | |
197 | + } | |
198 | + } | |
199 | + return hospitalId; | |
200 | + } | |
201 | + | |
202 | + | |
170 | 203 | public static String getUserName(String userId,UsersService usersService) |
171 | 204 | { |
172 | 205 | String checkDoctor = ""; |
... | ... | @@ -174,6 +207,21 @@ |
174 | 207 | Users users = usersService.getUsers(Integer.parseInt(userId)); |
175 | 208 | if (users != null && users.getYn() == YnEnums.YES.getId()) { |
176 | 209 | checkDoctor = users.getName(); |
210 | + } | |
211 | + } | |
212 | + return checkDoctor; | |
213 | + } | |
214 | + | |
215 | + public static String getUserIdByName(String name,String hId,UsersService usersService) | |
216 | + { | |
217 | + String checkDoctor = ""; | |
218 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(name) && StringUtils.isNotEmpty(hId)) { | |
219 | + UsersQuery query = new UsersQuery(); | |
220 | + query.setOrgId(Integer.parseInt(hId)); | |
221 | + query.setName(name); | |
222 | + List<Users> users = usersService.queryUsers(query); | |
223 | + if (CollectionUtils.isNotEmpty(users)) { | |
224 | + return users.get(0).getId()+""; | |
177 | 225 | } |
178 | 226 | } |
179 | 227 | return checkDoctor; |