Commit f4f288580220f76c8dae7e92d6d7a18ce0d85322

Authored by liquanyu
1 parent 8229b12121

update

Showing 3 changed files with 22 additions and 7 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/hs/SyncHsPatientService.java View file @ f4f2885
... ... @@ -50,7 +50,7 @@
50 50 public void synchsPatientData() {
51 51  
52 52 int pageStart = 1;
53   - int pageEnd = 5000;
  53 + int pageEnd = 4000;
54 54  
55 55 //查询孕妇档案
56 56 String sql = " select * from (select ROWNUM AS rowno, temp.* from (select replace(mp.P_NO, '-', '') as PID, " +
... ... @@ -68,7 +68,7 @@
68 68 System.out.println("查询数据完成");
69 69 break;
70 70 }
71   - int batchSize = 500;
  71 + int batchSize = 200;
72 72 int end = 0;
73 73 for (int i = 0; i < list.size(); i += batchSize) {
74 74 end = (end + batchSize);
... ... @@ -79,10 +79,9 @@
79 79 List<Map<String, Object>> tempList = list.subList(i, end);
80 80 commonThreadPool.execute(new PatientWorker(tempList, mongoTemplate));
81 81 }
82   -
83   - pageStart += 5000;
84   - pageEnd += 5000;
85   - }while (false);
  82 + pageStart += 4000;
  83 + pageEnd += 4000;
  84 + }while (true);
86 85 }
87 86  
88 87 private class PatientWorker extends Thread {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ApplyOrderController.java View file @ f4f2885
... ... @@ -97,7 +97,7 @@
97 97  
98 98  
99 99 //衡水华大基因,检查结果回调
100   - @RequestMapping("/resultCallback")
  100 + @RequestMapping(value="/resultCallback",method = RequestMethod.GET)
101 101 @ResponseBody
102 102 public BaseResponse resultCallback(@RequestParam(value = "sampleNum") String sampleNum,
103 103 @RequestHeader(value = "Authorization") String token
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java View file @ f4f2885
... ... @@ -2058,6 +2058,16 @@
2058 2058 return baseResponse.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("Authorization错误");
2059 2059 }
2060 2060  
  2061 + /**
  2062 + * 验证标本号是否存在
  2063 + */
  2064 + SieveApplyOrderModel sieveApplyOrderModel = new SieveApplyOrderModel();
  2065 + sieveApplyOrderModel.setNumber(sampleNum);
  2066 + boolean existTwo = exists(sieveApplyOrderModel);
  2067 + if (!existTwo) {
  2068 + return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("标本号不存在");
  2069 + }
  2070 +
2061 2071 new Thread(new Runnable() {
2062 2072 @Override
2063 2073 public void run() {
... ... @@ -2094,6 +2104,12 @@
2094 2104 }catch (Exception e)
2095 2105 {
2096 2106 System.out.println(e.getMessage()+"调用失败"+i);
  2107 + try {
  2108 + Thread.sleep(1000);
  2109 + }catch (Exception e1)
  2110 + {
  2111 +
  2112 + }
2097 2113 continue;
2098 2114 }
2099 2115 }