Commit ead224a3af2ef76926ba8b61b8a7ff9ac39dc93b
1 parent
41ab6eef4d
Exists in
master
and in
6 other branches
孕前优生上传
Showing 2 changed files with 53 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/lhxfy/LhxfyService.java
View file @
ead224a
... | ... | @@ -6,6 +6,7 @@ |
6 | 6 | import com.lyms.platform.common.dao.operator.MongoCondition; |
7 | 7 | import com.lyms.platform.common.dao.operator.MongoOper; |
8 | 8 | import com.lyms.platform.common.enums.YnEnums; |
9 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
9 | 10 | import com.lyms.platform.common.result.BaseResponse; |
10 | 11 | import com.lyms.platform.common.utils.*; |
11 | 12 | import com.lyms.platform.common.utils.HttpClientUtil; |
... | ... | @@ -954,7 +955,7 @@ |
954 | 955 | * 孕前优生-上传省平台 |
955 | 956 | */ |
956 | 957 | // private static final String URL = "http://39.101.222.193:8088";//测试 |
957 | -// private static final String KEY = "27d7bc6992724608bbfa0775a31c4b38";//沧州测试key | |
958 | +// private static final String KEY = "71d794fdb6ca4ef58c416830d31aabd9";//沧州测试key | |
958 | 959 | private static final String URL = "http://27.128.184.172:8087";//正式 |
959 | 960 | private static final String KEY = "04a5ad7515de40d3b1f7a7f1624daf10";//正式key |
960 | 961 | public BaseResponse uploadingProvince(List<String> ids){ |
... | ... | @@ -1474,5 +1475,49 @@ |
1474 | 1475 | private BasicConfigService basicConfigService; |
1475 | 1476 | @Autowired |
1476 | 1477 | private ResidentsArchiveService residentsArchiveService; |
1478 | + | |
1479 | + public BaseResponse getHistoryPreEugenicsId(String startDate, String endDate) { | |
1480 | + Map<String,String> params = new HashMap<>(); | |
1481 | + params.put("key",KEY); | |
1482 | + Query tquery = new Query(); | |
1483 | + | |
1484 | + Date start = DateUtil.parseYMD(startDate); | |
1485 | + Date end = DateUtil.parseYMD(endDate); | |
1486 | + end = DateUtil.getDayLastSecond(end); | |
1487 | + | |
1488 | + tquery.addCriteria(Criteria.where("hospitalId").is("2100001605")); | |
1489 | + tquery.addCriteria(Criteria.where("fillDate").gte(start).lte(end)); | |
1490 | + List<PreEugenicsBaseModel> modelList = mongoTemplate.find(tquery, PreEugenicsBaseModel.class); | |
1491 | + if (CollectionUtils.isNotEmpty(modelList)) | |
1492 | + { | |
1493 | + System.out.println(modelList.size()); | |
1494 | + for (PreEugenicsBaseModel model : modelList) | |
1495 | + { | |
1496 | + try{ | |
1497 | + if (StringUtils.isEmpty(model.getDocumentId())) | |
1498 | + { | |
1499 | + System.out.println("hid+"+model.getHusbandCardNo()+";wid="+model.getWifeCardNo()); | |
1500 | + params.put("wife_idCard",model.getWifeCardNo()); | |
1501 | + params.put("husband_idCard",model.getHusbandCardNo()); | |
1502 | + String result = repeatPost(URL+"/m/antenatalUpload/getArchives",JsonUtil.obj2Str(params)); | |
1503 | + UploadResult uploadResult = JsonUtil.jkstr2Obj(result, UploadResult.class); | |
1504 | + if (uploadResult != null && "0000".equals(uploadResult.getCode())) | |
1505 | + { | |
1506 | + model.setDocumentId(uploadResult.getDocumentId()); | |
1507 | + Query query = Query.query(Criteria.where("id").is(model.getId())); | |
1508 | + Update update = MongoConvertHelper | |
1509 | + .convertToNativeUpdate(ReflectionUtils.getUpdateField(model)); | |
1510 | + mongoTemplate.updateFirst(query, update, PreEugenicsBaseModel.class); | |
1511 | + } | |
1512 | + } | |
1513 | + }catch (Exception e) | |
1514 | + { | |
1515 | + ExceptionUtils.catchException(e,e.getMessage()); | |
1516 | + continue; | |
1517 | + } | |
1518 | + } | |
1519 | + } | |
1520 | + return new BaseObjectResponse(); | |
1521 | + } | |
1477 | 1522 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PreEugenicsBaseController.java
View file @
ead224a
... | ... | @@ -308,5 +308,12 @@ |
308 | 308 | return baseResponse; |
309 | 309 | } |
310 | 310 | |
311 | + @ResponseBody | |
312 | + @RequestMapping(value = "/getHistoryPreEugenicsId", method = RequestMethod.GET) | |
313 | + public BaseResponse getHistoryPreEugenicsId(@RequestParam String startDate,@RequestParam String endDate) { | |
314 | + BaseResponse baseResponse=lhxfyService.getHistoryPreEugenicsId(startDate,endDate); | |
315 | + return baseResponse; | |
316 | + } | |
317 | + | |
311 | 318 | } |