Commit b4d95216bb764fc8825184f71c65e63f36572b1b
1 parent
a0b64aee5e
Exists in
master
and in
1 other branch
permission2
Showing 2 changed files with 57 additions and 13 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
b4d9521
| ... | ... | @@ -9,6 +9,7 @@ |
| 9 | 9 | import com.lyms.platform.common.enums.YnEnums; |
| 10 | 10 | import com.lyms.platform.common.utils.DateUtil; |
| 11 | 11 | import com.lyms.platform.common.utils.JsonUtil; |
| 12 | +import com.lyms.platform.common.utils.StringUtils; | |
| 12 | 13 | import com.lyms.platform.operate.web.service.SyncDataTaskService; |
| 13 | 14 | import com.lyms.platform.permission.service.OrganizationService; |
| 14 | 15 | import com.lyms.platform.pojo.AntExChuModel; |
| ... | ... | @@ -203,18 +204,6 @@ |
| 203 | 204 | return "assayconfiginit"; |
| 204 | 205 | } |
| 205 | 206 | |
| 206 | - public static void main(String[] a) { | |
| 207 | - try { | |
| 208 | - String json = FileUtils.readFileToString(new File("d:/assayconfig.json")); | |
| 209 | - List<AssayConfig> list = JsonUtil.toList(json, AssayConfig.class); | |
| 210 | - for (AssayConfig config:list) { | |
| 211 | - System.out.println(JsonUtil.obj2JsonString(config)); | |
| 212 | - } | |
| 213 | - } catch (IOException e) { | |
| 214 | - e.printStackTrace(); | |
| 215 | - } | |
| 216 | - } | |
| 217 | - | |
| 218 | 207 | @RequestMapping(value = "/updateXY", method = RequestMethod.GET) |
| 219 | 208 | @ResponseBody |
| 220 | 209 | public String updateXY() { |
| ... | ... | @@ -341,6 +330,52 @@ |
| 341 | 330 | } |
| 342 | 331 | } |
| 343 | 332 | return "syncPatNextTime finish"; |
| 333 | + } | |
| 334 | + | |
| 335 | + @RequestMapping(value = "/initCardNo", method = RequestMethod.GET) | |
| 336 | + @ResponseBody | |
| 337 | + public String initCardNo() { | |
| 338 | + PatientsQuery query = new PatientsQuery(); | |
| 339 | + query.setYn(1); | |
| 340 | + query.setHospitalId("216"); | |
| 341 | + List<Patients> list = patientsService.queryPatient(query); | |
| 342 | + int a = 0; | |
| 343 | + for (Patients patients:list) { | |
| 344 | + if (org.apache.commons.lang.StringUtils.isBlank(patients.getCardNo())) { | |
| 345 | + Patients db = new Patients(); | |
| 346 | + db.setId(patients.getId()); | |
| 347 | + db.setCardNo(patients.getPhone()); | |
| 348 | + db.setHcertificateTypeId("hcertificateTypeId"); | |
| 349 | + patientsService.updatePatient(db); | |
| 350 | + a++; | |
| 351 | + } | |
| 352 | + } | |
| 353 | + return "initCardNo finish - " + a; | |
| 354 | + } | |
| 355 | + | |
| 356 | + public static void main(String[] a) { | |
| 357 | + try { | |
| 358 | + List<String> list = FileUtils.readLines(new File("D:\\temp\\qhdfy_lost1.csv")); | |
| 359 | + List<String> linenums = new ArrayList<>(); | |
| 360 | + for (String line:list) { | |
| 361 | + String ss[] = line.split(","); | |
| 362 | + if (ss.length > 0 && ss[0].trim().length() > 0) { | |
| 363 | + linenums.add(ss[0].trim()); | |
| 364 | + } | |
| 365 | + } | |
| 366 | + List<String> list1 = FileUtils.readLines(new File("D:\\temp\\qhd-jd.csv"), "utf-8"); | |
| 367 | + StringBuffer sb = new StringBuffer(); | |
| 368 | + for (String line:list1) { | |
| 369 | + String ss[] = line.split(","); | |
| 370 | + if (ss.length > 0 && ss[0].trim().length() > 0 && linenums.contains(ss[0].trim())) { | |
| 371 | + sb.append(line); | |
| 372 | + sb.append("\r\n"); | |
| 373 | + } | |
| 374 | + } | |
| 375 | + FileUtils.writeStringToFile(new File("d:\\temp\\qhdfy_lost_data.csv"), sb.toString()); | |
| 376 | + } catch (Exception e) { | |
| 377 | + e.printStackTrace(); | |
| 378 | + } | |
| 344 | 379 | } |
| 345 | 380 | |
| 346 | 381 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java
View file @
b4d9521
| ... | ... | @@ -480,7 +480,9 @@ |
| 480 | 480 | } |
| 481 | 481 | try { |
| 482 | 482 | int tempIndex = line.indexOf(",,,,,,,,,,,,,,,"); |
| 483 | - line = line.substring(0, tempIndex + 1); | |
| 483 | + if (tempIndex > 20) { | |
| 484 | + line = line.substring(0, tempIndex + 1); | |
| 485 | + } | |
| 484 | 486 | String ss[] = line.split(","); |
| 485 | 487 | if (!ss[1].startsWith("2016")) { |
| 486 | 488 | continue; |
| ... | ... | @@ -726,6 +728,13 @@ |
| 726 | 728 | antExChuModel.setPid(patientsList.get(0).getPid()); |
| 727 | 729 | antenatalExaminationService.addOneAntEx(antExChuModel); |
| 728 | 730 | } |
| 731 | + continue; | |
| 732 | + } | |
| 733 | + if (patientsList.size() == 1) { | |
| 734 | + patients.setId(patientsList.get(0).getId()); | |
| 735 | + personModel.setId(patients.getId()); | |
| 736 | + personService.updatePerson(personModel, personModel.getId()); | |
| 737 | + patientsService.updatePatient(patients); | |
| 729 | 738 | continue; |
| 730 | 739 | } |
| 731 | 740 | personService.addPerson(personModel); |