Commit 73d52b471bfd6eadaf0f224e60a1a053d5f4fb6d
1 parent
b29f5c9dd2
Exists in
master
and in
6 other branches
update
Showing 3 changed files with 83 additions and 40 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/lhxfy/LhxfyService.java
View file @
73d52b4
| ... | ... | @@ -4,8 +4,8 @@ |
| 4 | 4 | import com.lyms.platform.biz.service.ResidentsArchiveService; |
| 5 | 5 | import com.lyms.platform.common.enums.YnEnums; |
| 6 | 6 | import com.lyms.platform.common.utils.*; |
| 7 | -import com.lyms.platform.operate.web.utils.CommonsHelper; | |
| 8 | -import com.lyms.platform.operate.web.utils.FunvCommonUtil; | |
| 7 | +import com.lyms.platform.common.utils.HttpClientUtil; | |
| 8 | +import com.lyms.platform.operate.web.utils.*; | |
| 9 | 9 | import com.lyms.platform.permission.model.LisReportItemModel; |
| 10 | 10 | import com.lyms.platform.permission.model.LisReportModel; |
| 11 | 11 | import com.lyms.platform.pojo.PreEugenicsBaseModel; |
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | |
| ... | ... | @@ -31,52 +31,64 @@ |
| 31 | 31 | */ |
| 32 | 32 | @Service("lhxfyService") |
| 33 | 33 | public class LhxfyService { |
| 34 | - | |
| 34 | + public static final String LHFY_LIS_URL = PropertiesUtils.getPropertyValue("lhfy_lis_url"); | |
| 35 | 35 | @Autowired |
| 36 | 36 | private MongoTemplate mongoTemplate; |
| 37 | +// public List<LisReportModel> getLhxfyLis(String cardNo) | |
| 38 | +// { | |
| 39 | +// Connection conn = com.lyms.hospitalapi.lhxfy.ConnTools.makeLisConnection(); | |
| 40 | +// QueryRunner queryRunner = new QueryRunner(true); | |
| 41 | +// try { | |
| 42 | +// String sql = " SELECT LIS_ID as lisId, TITLE as title, TYPE as type, CARDNO as vcCardNo, NAME as name, BHNUM as bhnum, AGE as age, SEX as sex, APPLY_TIME as applyTime, CHECK_TIME as checkTime, PUBLISH_TIME as publishTime, APPLY_DOCTOR as applyDoctor, " + | |
| 43 | +// "APPLY_DEPT as applyDept, CHECKER as checker, MODIFIED as modified, CREATED as created FROM LIS_REPORT_INFO WHERE CARDNO = '"+cardNo+"' AND PUBLISH_TIME >= trunc(sysdate) - 3"; | |
| 44 | +// List<LisReportModel> lisReportList = queryRunner.query(conn, sql, new BeanListHandler<LisReportModel>(LisReportModel.class)); | |
| 45 | +// if (CollectionUtils.isNotEmpty(lisReportList)) | |
| 46 | +// { | |
| 47 | +// for(LisReportModel model : lisReportList) | |
| 48 | +// { | |
| 49 | +// model.setItems(getLhxfyLisItem(model.getLisId())); | |
| 50 | +// } | |
| 51 | +// } | |
| 52 | +// return lisReportList; | |
| 53 | +// } | |
| 54 | +// catch (Exception e) | |
| 55 | +// { | |
| 56 | +// ExceptionUtils.catchException(e,"getLhxfyLis error"); | |
| 57 | +// } | |
| 58 | +// return null; | |
| 59 | +// } | |
| 60 | +// | |
| 61 | +// public List<LisReportItemModel> getLhxfyLisItem(String lisId) | |
| 62 | +// { | |
| 63 | +// Connection conn = com.lyms.hospitalapi.lhxfy.ConnTools.makeLisConnection(); | |
| 64 | +// QueryRunner queryRunner = new QueryRunner(true); | |
| 65 | +// try { | |
| 66 | +// String sql = "SELECT LIS_ID as lisId, CODE as code, NAME as name, RESULT as result, RESULT_FLAG as resultFlag, REF as ref, RESULT_TYPE as resultType, UNIT as unit FROM LIS_REPORT_ITEM WHERE LIS_ID = '"+lisId+"'"; | |
| 67 | +// List<LisReportItemModel> items = queryRunner.query(conn, sql, new BeanListHandler<LisReportItemModel>(LisReportItemModel.class)); | |
| 68 | +// return items; | |
| 69 | +// } | |
| 70 | +// catch (Exception e) | |
| 71 | +// { | |
| 72 | +// ExceptionUtils.catchException(e,"getLhxfyLis error"); | |
| 73 | +// } | |
| 74 | +// finally { | |
| 75 | +// } | |
| 76 | +// return null; | |
| 77 | +// } | |
| 78 | + | |
| 79 | + | |
| 37 | 80 | public List<LisReportModel> getLhxfyLis(String cardNo) |
| 38 | 81 | { |
| 39 | - Connection conn = com.lyms.hospitalapi.lhxfy.ConnTools.makeLisConnection(); | |
| 40 | - QueryRunner queryRunner = new QueryRunner(true); | |
| 41 | - try { | |
| 42 | - String sql = " SELECT LIS_ID as lisId, TITLE as title, TYPE as type, CARDNO as vcCardNo, NAME as name, BHNUM as bhnum, AGE as age, SEX as sex, APPLY_TIME as applyTime, CHECK_TIME as checkTime, PUBLISH_TIME as publishTime, APPLY_DOCTOR as applyDoctor, " + | |
| 43 | - "APPLY_DEPT as applyDept, CHECKER as checker, MODIFIED as modified, CREATED as created FROM LIS_REPORT_INFO WHERE CARDNO = '"+cardNo+"' AND PUBLISH_TIME >= trunc(sysdate) - 3"; | |
| 44 | - List<LisReportModel> lisReportList = queryRunner.query(conn, sql, new BeanListHandler<LisReportModel>(LisReportModel.class)); | |
| 45 | - if (CollectionUtils.isNotEmpty(lisReportList)) | |
| 46 | - { | |
| 47 | - for(LisReportModel model : lisReportList) | |
| 48 | - { | |
| 49 | - model.setItems(getLhxfyLisItem(model.getLisId())); | |
| 50 | - } | |
| 51 | - } | |
| 52 | - return lisReportList; | |
| 53 | - } | |
| 54 | - catch (Exception e) | |
| 82 | + Map<String, String> itemParam = new HashMap<>(1); | |
| 83 | + itemParam.put("cardNo", cardNo); | |
| 84 | + String json = HttpClientUtil.doPost(LHFY_LIS_URL, itemParam,"utf-8"); | |
| 85 | + if (StringUtils.isNotEmpty(json)) | |
| 55 | 86 | { |
| 56 | - ExceptionUtils.catchException(e,"getLhxfyLis error"); | |
| 87 | + return JsonUtil.toList(json,LisReportModel.class); | |
| 57 | 88 | } |
| 58 | 89 | return null; |
| 59 | 90 | } |
| 60 | 91 | |
| 61 | - public List<LisReportItemModel> getLhxfyLisItem(String lisId) | |
| 62 | - { | |
| 63 | - Connection conn = com.lyms.hospitalapi.lhxfy.ConnTools.makeLisConnection(); | |
| 64 | - QueryRunner queryRunner = new QueryRunner(true); | |
| 65 | - try { | |
| 66 | - String sql = "SELECT LIS_ID as lisId, CODE as code, NAME as name, RESULT as result, RESULT_FLAG as resultFlag, REF as ref, RESULT_TYPE as resultType, UNIT as unit FROM LIS_REPORT_ITEM WHERE LIS_ID = '"+lisId+"'"; | |
| 67 | - List<LisReportItemModel> items = queryRunner.query(conn, sql, new BeanListHandler<LisReportItemModel>(LisReportItemModel.class)); | |
| 68 | - return items; | |
| 69 | - } | |
| 70 | - catch (Exception e) | |
| 71 | - { | |
| 72 | - ExceptionUtils.catchException(e,"getLhxfyLis error"); | |
| 73 | - } | |
| 74 | - finally { | |
| 75 | - } | |
| 76 | - return null; | |
| 77 | - } | |
| 78 | - | |
| 79 | - | |
| 80 | 92 | public void autoInLis() |
| 81 | 93 | { |
| 82 | 94 | Query query = new Query(); |
| 83 | 95 | |
| ... | ... | @@ -84,10 +96,12 @@ |
| 84 | 96 | query.addCriteria(Criteria.where("fillDate").gte(start)); |
| 85 | 97 | |
| 86 | 98 | List <PreEugenicsBaseModel> preEugenicsBaseModels = mongoTemplate.find(query, PreEugenicsBaseModel.class); |
| 99 | + System.out.println("autoInLis="+preEugenicsBaseModels.size()); | |
| 87 | 100 | if (CollectionUtils.isNotEmpty(preEugenicsBaseModels)) |
| 88 | 101 | { |
| 89 | 102 | for (PreEugenicsBaseModel preEugenicsBaseModel : preEugenicsBaseModels) |
| 90 | 103 | { |
| 104 | + System.out.println("autoInLis WifeCardNo="+preEugenicsBaseModel.getWifeCardNo()); | |
| 91 | 105 | //查询妻子的lis |
| 92 | 106 | //白带检查 |
| 93 | 107 | List<Integer> bdjc = new LinkedList<>(); |
| 94 | 108 | |
| ... | ... | @@ -131,8 +145,10 @@ |
| 131 | 145 | } |
| 132 | 146 | |
| 133 | 147 | List<LisReportModel> lisReportModels = getLhxfyLis(preEugenicsBaseModel.getWifeCardNo()); |
| 148 | + System.out.println("lisReportModels="+lisReportModels.size()); | |
| 134 | 149 | if (CollectionUtils.isNotEmpty(lisReportModels)) { |
| 135 | 150 | for (LisReportModel model : lisReportModels) { |
| 151 | + System.out.println("LisReportModel="+model.getLisId()); | |
| 136 | 152 | List<LisReportItemModel> itemModels = model.getItems(); |
| 137 | 153 | if (CollectionUtils.isNotEmpty(itemModels)) { |
| 138 | 154 | for (LisReportItemModel itemModel : itemModels) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
73d52b4
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | import com.lyms.hospitalapi.cdfy.CdGwInterface; |
| 4 | 4 | import com.lyms.hospitalapi.cdfy.CdfyHisService; |
| 5 | 5 | import com.lyms.hospitalapi.dzfy.DzfyFmService; |
| 6 | +import com.lyms.hospitalapi.lhxfy.LhxfyService; | |
| 6 | 7 | import com.lyms.hospitalapi.qhdfy.QhdfyFmService; |
| 7 | 8 | import com.lyms.hospitalapi.qhdfy.QhdfyHisService; |
| 8 | 9 | import com.lyms.hospitalapi.qhdfy.SyncQhdBaseInfoService; |
| ... | ... | @@ -4620,5 +4621,29 @@ |
| 4620 | 4621 | private PremaritalCheckupFacade premaritalCheckupFacade; |
| 4621 | 4622 | @Autowired |
| 4622 | 4623 | private ResidentsArchiveFacade residentsArchiveFacade; |
| 4624 | + @Autowired | |
| 4625 | + private LhxfyService lhxfyService; | |
| 4626 | + | |
| 4627 | + /** | |
| 4628 | + * 孕前优生结果出来后 同步lis到孕前优生 | |
| 4629 | + * @return | |
| 4630 | + */ | |
| 4631 | + @RequestMapping(value = "/autoInLis", method = RequestMethod.GET) | |
| 4632 | + @ResponseBody | |
| 4633 | + public String autoInLis() { | |
| 4634 | + lhxfyService.autoInLis(); | |
| 4635 | + return "success"; | |
| 4636 | + } | |
| 4637 | + | |
| 4638 | + /** | |
| 4639 | + * 同步孕前优生档案到隆化his | |
| 4640 | + * @return | |
| 4641 | + */ | |
| 4642 | + @RequestMapping(value = "/syncResidents", method = RequestMethod.GET) | |
| 4643 | + @ResponseBody | |
| 4644 | + public String syncResidents() { | |
| 4645 | + lhxfyService.syncResidents(); | |
| 4646 | + return "success"; | |
| 4647 | + } | |
| 4623 | 4648 | } |