Commit 74197253f7737f542b0a20c0df65e4258d1cfd5a
1 parent
7c3843aa26
Exists in
master
and in
6 other branches
隆化滦平修改
Showing 7 changed files with 254 additions and 81 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
- platform-common/src/main/java/com/lyms/platform/common/Test.java
- platform-common/src/main/java/com/lyms/platform/common/utils/HttpClientUtil.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/lhxfy/LhxfyService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FmController.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/MeasureInfoFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
View file @
7419725
... | ... | @@ -7186,10 +7186,237 @@ |
7186 | 7186 | } |
7187 | 7187 | |
7188 | 7188 | |
7189 | + public static void saveGw(String gworg,String lymsOrg) { | |
7190 | + ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml"); | |
7191 | + MongoTemplate mongoTemplate | |
7192 | + = (MongoTemplate) applicationContext.getBean("mongoTemplate"); | |
7193 | + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray()); | |
7194 | + List<Org> gworgs = new ArrayList<>(); | |
7195 | + List<Org> lymsorgs = new ArrayList<>(); | |
7196 | + try { | |
7197 | + File file = new File(gworg); | |
7198 | + Workbook wb = Workbook.getWorkbook(file); | |
7189 | 7199 | |
7200 | + Sheet s = wb.getSheet(0); | |
7201 | + int rows = s.getRows(); | |
7202 | + if (rows > 0) { | |
7203 | + //遍历每行 | |
7204 | + for (int i = 1; i < rows; i++) { | |
7205 | + Org gw = new Org(); | |
7206 | + Cell[] cells = s.getRow(i); | |
7207 | + if (cells.length > 0) { | |
7208 | + for (int j = 0; j < cells.length; j++) { | |
7190 | 7209 | |
7210 | + String str = cells[j].getContents().trim(); | |
7211 | + switch (j) { | |
7212 | + case 0: | |
7213 | + gw.setId(str); | |
7214 | + continue; | |
7215 | + case 1: | |
7216 | + gw.setValue(str); | |
7217 | + continue; | |
7218 | + case 2: | |
7219 | + if (StringUtils.isNotEmpty(str)) | |
7220 | + { | |
7221 | + gw.setAlisa(str); | |
7222 | + } | |
7223 | + continue; | |
7224 | + } | |
7225 | + } | |
7226 | + } | |
7227 | + gworgs.add(gw); | |
7228 | + } | |
7229 | + } | |
7230 | + } catch (Exception e) { | |
7231 | + e.printStackTrace(); | |
7232 | + } | |
7233 | + | |
7234 | + try { | |
7235 | + File file = new File(lymsOrg); | |
7236 | + Workbook wb = Workbook.getWorkbook(file); | |
7237 | + | |
7238 | + Sheet s = wb.getSheet(0); | |
7239 | + int rows = s.getRows(); | |
7240 | + if (rows > 0) { | |
7241 | + //遍历每行 | |
7242 | + for (int i = 1; i < rows; i++) { | |
7243 | + Org gw = new Org(); | |
7244 | + Cell[] cells = s.getRow(i); | |
7245 | + if (cells.length > 0) { | |
7246 | + for (int j = 0; j < cells.length; j++) { | |
7247 | + | |
7248 | + String str = cells[j].getContents().trim(); | |
7249 | + switch (j) { | |
7250 | + case 0: | |
7251 | + gw.setId(str); | |
7252 | + continue; | |
7253 | + case 1: | |
7254 | + gw.setValue(str); | |
7255 | + continue; | |
7256 | + } | |
7257 | + } | |
7258 | + } | |
7259 | + lymsorgs.add(gw); | |
7260 | + } | |
7261 | + } | |
7262 | + } catch (Exception e) { | |
7263 | + e.printStackTrace(); | |
7264 | + } | |
7265 | + | |
7266 | + System.out.println(gworgs.size()); | |
7267 | + System.out.println(lymsorgs.size()); | |
7268 | + | |
7269 | + for (Org lmorg : lymsorgs) | |
7270 | + { | |
7271 | + boolean isExist = false; | |
7272 | + for (Org gw : gworgs) | |
7273 | + { | |
7274 | + if (StringUtils.isNotEmpty(gw.getAlisa())) | |
7275 | + { | |
7276 | + if (lmorg.getValue().equals(gw.getAlisa())) | |
7277 | + { | |
7278 | + isExist = true; | |
7279 | + } | |
7280 | + } | |
7281 | + else | |
7282 | + { | |
7283 | + if (lmorg.getValue().equals(gw.getValue())) | |
7284 | + { | |
7285 | + isExist = true; | |
7286 | + } | |
7287 | + } | |
7288 | + | |
7289 | + } | |
7290 | + if (!isExist) | |
7291 | + { | |
7292 | + System.out.println(lmorg.getValue()); | |
7293 | + } | |
7294 | + } | |
7295 | + } | |
7296 | + | |
7297 | + public static class Org{ | |
7298 | + private String id; | |
7299 | + private String value; | |
7300 | + private String alisa; | |
7301 | + | |
7302 | + public String getAlisa() { | |
7303 | + return alisa; | |
7304 | + } | |
7305 | + | |
7306 | + public void setAlisa(String alisa) { | |
7307 | + this.alisa = alisa; | |
7308 | + } | |
7309 | + | |
7310 | + public String getId() { | |
7311 | + return id; | |
7312 | + } | |
7313 | + | |
7314 | + public void setId(String id) { | |
7315 | + this.id = id; | |
7316 | + } | |
7317 | + | |
7318 | + public String getValue() { | |
7319 | + return value; | |
7320 | + } | |
7321 | + | |
7322 | + public void setValue(String value) { | |
7323 | + this.value = value; | |
7324 | + } | |
7325 | + } | |
7326 | + | |
7327 | + | |
7328 | + | |
7329 | + public static void compareYqys(String gworg,String lymsOrg) { | |
7330 | + ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml"); | |
7331 | + MongoTemplate mongoTemplate | |
7332 | + = (MongoTemplate) applicationContext.getBean("mongoTemplate"); | |
7333 | + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray()); | |
7334 | + List<Org> gworgs = new ArrayList<>(); | |
7335 | + List<Org> lymsorgs = new ArrayList<>(); | |
7336 | + try { | |
7337 | + File file = new File(gworg); | |
7338 | + Workbook wb = Workbook.getWorkbook(file); | |
7339 | + | |
7340 | + Sheet s = wb.getSheet(0); | |
7341 | + int rows = s.getRows(); | |
7342 | + if (rows > 0) { | |
7343 | + //遍历每行 | |
7344 | + for (int i = 1; i < rows; i++) { | |
7345 | + Org gw = new Org(); | |
7346 | + Cell[] cells = s.getRow(i); | |
7347 | + if (cells.length > 0) { | |
7348 | + for (int j = 0; j < cells.length; j++) { | |
7349 | + | |
7350 | + String str = cells[j].getContents().trim(); | |
7351 | + switch (j) { | |
7352 | + case 0: | |
7353 | + gw.setValue(str); | |
7354 | + continue; | |
7355 | + } | |
7356 | + } | |
7357 | + } | |
7358 | + gworgs.add(gw); | |
7359 | + } | |
7360 | + } | |
7361 | + } catch (Exception e) { | |
7362 | + e.printStackTrace(); | |
7363 | + } | |
7364 | + | |
7365 | + try { | |
7366 | + File file = new File(lymsOrg); | |
7367 | + Workbook wb = Workbook.getWorkbook(file); | |
7368 | + | |
7369 | + Sheet s = wb.getSheet(0); | |
7370 | + int rows = s.getRows(); | |
7371 | + if (rows > 0) { | |
7372 | + //遍历每行 | |
7373 | + for (int i = 1; i < rows; i++) { | |
7374 | + Org gw = new Org(); | |
7375 | + Cell[] cells = s.getRow(i); | |
7376 | + if (cells.length > 0) { | |
7377 | + for (int j = 0; j < cells.length; j++) { | |
7378 | + | |
7379 | + String str = cells[j].getContents().trim(); | |
7380 | + switch (j) { | |
7381 | + case 0: | |
7382 | + gw.setValue(str); | |
7383 | + continue; | |
7384 | + } | |
7385 | + } | |
7386 | + } | |
7387 | + lymsorgs.add(gw); | |
7388 | + } | |
7389 | + } | |
7390 | + } catch (Exception e) { | |
7391 | + e.printStackTrace(); | |
7392 | + } | |
7393 | + | |
7394 | + System.out.println(gworgs.size()); | |
7395 | + System.out.println(lymsorgs.size()); | |
7396 | + | |
7397 | + for (Org lmorg : lymsorgs) | |
7398 | + { | |
7399 | + boolean isExist = false; | |
7400 | + for (Org gw : gworgs) | |
7401 | + { | |
7402 | + if (lmorg.getValue().equals(gw.getValue())) | |
7403 | + { | |
7404 | + isExist = true; | |
7405 | + } | |
7406 | + | |
7407 | + } | |
7408 | + if (!isExist) | |
7409 | + { | |
7410 | + System.out.println(lmorg.getValue()); | |
7411 | + } | |
7412 | + } | |
7413 | + } | |
7414 | + | |
7415 | + | |
7191 | 7416 | public static void main(String[] args) { |
7192 | - savePreeugenicsAddr("C:\\Users\\liquanyu\\Desktop\\doc\\孕前优生上传省平台\\隆化妇幼保健院孕前上传正式\\承德区划对照表.xls"); | |
7417 | + compareYqys("C:\\Users\\liquanyu\\Desktop\\doc\\temp\\联网.xls","C:\\Users\\liquanyu\\Desktop\\doc\\temp\\单机.xls"); | |
7418 | + //saveGw("C:\\Users\\liquanyu\\Desktop\\doc\\承德工位\\承德工位机构表.xls","C:\\Users\\liquanyu\\Desktop\\doc\\承德工位\\龙源承德机构表.xls"); | |
7419 | + //savePreeugenicsAddr("C:\\Users\\liquanyu\\Desktop\\doc\\孕前优生上传省平台\\隆化妇幼保健院孕前上传正式\\承德区划对照表.xls"); | |
7193 | 7420 | // dic(); |
7194 | 7421 | // handle(); |
7195 | 7422 | // getData(); |
platform-common/src/main/java/com/lyms/platform/common/Test.java
View file @
7419725
... | ... | @@ -9,65 +9,10 @@ |
9 | 9 | import java.util.Date; |
10 | 10 | |
11 | 11 | public class Test { |
12 | - public String convertStringToHex(String str){ | |
13 | 12 | |
14 | - char[] chars = str.toCharArray(); | |
15 | - | |
16 | - StringBuffer hex = new StringBuffer(); | |
17 | - for(int i = 0; i < chars.length; i++){ | |
18 | - hex.append(Integer.toHexString((int)chars[i])); | |
19 | - } | |
20 | - | |
21 | - return hex.toString(); | |
22 | - } | |
23 | - | |
24 | - public String convertHexToString(String hex){ | |
25 | - | |
26 | - StringBuilder sb = new StringBuilder(); | |
27 | - StringBuilder temp = new StringBuilder(); | |
28 | - | |
29 | - //49204c6f7665204a617661 split into two characters 49, 20, 4c... | |
30 | - for( int i=0; i<hex.length()-1; i+=2 ){ | |
31 | - | |
32 | - //grab the hex in pairs | |
33 | - String output = hex.substring(i, (i + 2)); | |
34 | - //convert hex to decimal | |
35 | - int decimal = Integer.parseInt(output, 16); | |
36 | - //convert the decimal to character | |
37 | - sb.append((char)decimal); | |
38 | - | |
39 | - temp.append(decimal); | |
40 | - } | |
41 | - | |
42 | - return sb.toString(); | |
43 | - } | |
44 | - | |
45 | - //504F533838383834 POS88884 | |
46 | 13 | public static void main(String[] args) throws UnsupportedEncodingException { |
47 | - String[] xxbfx = new String[9]; | |
48 | - for(String key : xxbfx) | |
49 | - if (key == null) | |
50 | - { | |
51 | - } | |
52 | - | |
53 | - Integer[] yigan = new Integer[]{-1,-1,-1,-1,-1}; | |
54 | - for(Integer key : yigan) | |
55 | - if (key == -1) | |
56 | - { | |
57 | - System.out.println(key); | |
58 | - } | |
59 | 14 | } |
60 | 15 | |
61 | - public static void print() { | |
62 | - int start=0; | |
63 | - byte[] bytes=new byte[s.length()/2]; | |
64 | - int j=0; | |
65 | - for (int i =0;i<s.length();i+=2){ | |
66 | - bytes[j++]= (byte) Integer.parseInt(s.substring(start,start+2),16); | |
67 | - } | |
68 | - System.out.println(Arrays.toString(bytes)); | |
69 | - } | |
70 | - private static String s="B0F8FB80808080808080F880808080F880F88080F880F8808080F8F88080F880808080F8F880F8F88080F8B0F8FB80808080808080F880808080F880F88080F880F8808080F8F88080F880808080F8F880F8F88080F8"; | |
71 | 16 | |
72 | 17 | } |
platform-common/src/main/java/com/lyms/platform/common/utils/HttpClientUtil.java
View file @
7419725
... | ... | @@ -239,6 +239,10 @@ |
239 | 239 | httpStr = EntityUtils.toString(entity, "utf-8"); |
240 | 240 | } catch (Exception e) { |
241 | 241 | ExceptionUtils.catchException(e,e.getMessage()); |
242 | + if (httpPost != null) | |
243 | + { | |
244 | + httpPost.releaseConnection(); | |
245 | + } | |
242 | 246 | return null; |
243 | 247 | } finally { |
244 | 248 | if (response != null) { |
platform-operate-api/src/main/java/com/lyms/hospitalapi/lhxfy/LhxfyService.java
View file @
7419725
... | ... | @@ -129,9 +129,15 @@ |
129 | 129 | public void autoInLis() |
130 | 130 | { |
131 | 131 | Query query = new Query(); |
132 | - Date start = DateUtil.addDay(new Date(),-15); | |
132 | + Date start = DateUtil.addDay(new Date(),-38); | |
133 | 133 | query.addCriteria(Criteria.where("fillDate").gte(start).and("hospitalId").is("2100001605"));//隆化定制 |
134 | +// MongoCondition c = MongoCondition.newInstance(); | |
135 | +// MongoCondition con1 = MongoCondition.newInstance("isUploadingProvince", 0, MongoOper.IS); | |
136 | +// MongoCondition con2 = MongoCondition.newInstance("isUploadingProvince",false, MongoOper.EXISTS); | |
137 | +// query.addCriteria(c.orCondition(new MongoCondition[]{con1, con2}).getCriteria()); | |
134 | 138 | |
139 | + System.out.println(query.toString()); | |
140 | + | |
135 | 141 | List <PreEugenicsBaseModel> preEugenicsBaseModels = mongoTemplate.find(query, PreEugenicsBaseModel.class); |
136 | 142 | System.out.println("autoInLis="+preEugenicsBaseModels.size()); |
137 | 143 | if (CollectionUtils.isNotEmpty(preEugenicsBaseModels)) |
138 | 144 | |
139 | 145 | |
140 | 146 | |
... | ... | @@ -1453,31 +1459,19 @@ |
1453 | 1459 | |
1454 | 1460 | /** |
1455 | 1461 | * 孕前优生-上传省平台定时任务 |
1456 | - * @param hospitalId //必传机构id | |
1457 | - * @param start //不传默认当前时间30天前 | |
1458 | - * @param end //不传默认当前时间 | |
1459 | 1462 | */ |
1460 | - public void uploadingProvinceTask(String hospitalId,Date start,Date end){ | |
1461 | - if(StringUtils.isEmpty(hospitalId)){ | |
1462 | - LogUtil.error("需要指定机构id", null); | |
1463 | - return; | |
1464 | - } | |
1465 | - if(start==null){ | |
1466 | - start = DateUtil.addDay(new Date(),-30);//当前时间30天前 | |
1467 | - } | |
1468 | - if(end==null){ | |
1469 | - end = new Date(); | |
1470 | - } | |
1463 | + public void uploadingProvinceTask(){ | |
1464 | + Date start = DateUtil.addDay(new Date(),-30);//当前时间30天前 | |
1471 | 1465 | Query query = new Query(); |
1472 | 1466 | //机构 |
1473 | - query.addCriteria(Criteria.where("hospitalId").is(hospitalId)); | |
1467 | + query.addCriteria(Criteria.where("hospitalId").is("2100001605")); | |
1474 | 1468 | //查询上传失败或者没有上传过的 |
1475 | 1469 | MongoCondition c = MongoCondition.newInstance(); |
1476 | 1470 | MongoCondition con1 = MongoCondition.newInstance("isUploadingProvince", 0, MongoOper.IS); |
1477 | 1471 | MongoCondition con2 = MongoCondition.newInstance("isUploadingProvince",false, MongoOper.EXISTS); |
1478 | 1472 | query.addCriteria(c.orCondition(new MongoCondition[]{con1, con2}).getCriteria()); |
1479 | 1473 | //检查结果时间 |
1480 | - query.addCriteria(Criteria.where("resultAdvice.fillDate").gte(DateUtil.getyyyy_MM_dd(start)).lte(DateUtil.getyyyy_MM_dd(end))); | |
1474 | + query.addCriteria(Criteria.where("fillDate").gte(start).lte(new Date())); | |
1481 | 1475 | //只返回id字段 |
1482 | 1476 | query.fields().include("_id"); |
1483 | 1477 | //查询院内孕前优生档案id集合 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FmController.java
View file @
7419725
... | ... | @@ -4,6 +4,8 @@ |
4 | 4 | import com.lyms.hospitalapi.linchengfy.LcfyFmService; |
5 | 5 | import com.lyms.hospitalapi.lpfy.IlpFyFmService; |
6 | 6 | import com.lyms.hospitalapi.nanhe.InhFyFmService; |
7 | +import com.lyms.platform.common.utils.ExceptionUtils; | |
8 | +import com.lyms.platform.common.utils.JsonUtil; | |
7 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
8 | 10 | import org.springframework.stereotype.Controller; |
9 | 11 | import org.springframework.web.bind.annotation.RequestBody; |
... | ... | @@ -35,7 +37,7 @@ |
35 | 37 | @RequestMapping(method = RequestMethod.POST, value = "/saveFmData") |
36 | 38 | @ResponseBody |
37 | 39 | public String saveFmData(@Valid @RequestBody List<Fm> models, HttpServletRequest httpServletRequest){ |
38 | - | |
40 | + ExceptionUtils.catchException(JsonUtil.array2JsonString(models)); | |
39 | 41 | if("17".equals(models.get(0).getVision())){ |
40 | 42 | lpfyFmService.queryFmPatient(models); |
41 | 43 | }if("41".equals(models.get(0).getVision())){ |
... | ... | @@ -46,7 +48,8 @@ |
46 | 48 | |
47 | 49 | |
48 | 50 | |
49 | - return null; | |
51 | + | |
52 | + return JsonUtil.array2JsonString(models); | |
50 | 53 | } |
51 | 54 | |
52 | 55 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
7419725
... | ... | @@ -4937,10 +4937,10 @@ |
4937 | 4937 | return ""; |
4938 | 4938 | } |
4939 | 4939 | |
4940 | - @RequestMapping(value = "/test/a", method = RequestMethod.GET) | |
4941 | - @ResponseBody | |
4942 | - public void testa() { | |
4943 | - lhxfyService.uploadingProvinceTask("2100001605", DateUtil.parseYMD("2021-12-09"), DateUtil.parseYMD("2021-12-10")); | |
4944 | - } | |
4940 | +// @RequestMapping(value = "/test/a", method = RequestMethod.GET) | |
4941 | +// @ResponseBody | |
4942 | +// public void testa() { | |
4943 | +// //lhxfyService.uploadingProvinceTask("2100001605", DateUtil.parseYMD("2021-12-09"), DateUtil.parseYMD("2021-12-10")); | |
4944 | +// } | |
4945 | 4945 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
View file @
7419725
... | ... | @@ -1187,7 +1187,7 @@ |
1187 | 1187 | if (p != null) { |
1188 | 1188 | |
1189 | 1189 | List<PatientWeight> patientWeights = patientWeightService2.queryPatientWeight(Query.query( |
1190 | - Criteria.where("pid").is(p.getPid()).and("yn").is("1").and("created").gte(p .getLastMenses()))); | |
1190 | + Criteria.where("pid").is(p.getPid()).and("yn").is("1"))); | |
1191 | 1191 | if(CollectionUtils.isNotEmpty(patientWeights)) |
1192 | 1192 | { |
1193 | 1193 | PatientWeight weight = patientWeights.get(0); |