| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.ltkj.common.annotation.RepeatSubmit; |
| | | import com.ltkj.common.core.controller.BaseController; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.common.enums.DataSourceType; |
| | | import com.ltkj.framework.config.UserHoder; |
| | | import com.ltkj.framework.datasource.DynamicDataSourceContextHolder; |
| | | import com.ltkj.hosp.domain.TjCustomer; |
| | | import com.ltkj.hosp.domain.TjOrder; |
| | |
| | | private ITjOrderService orderService; |
| | | @Resource |
| | | private ISysDeptService deptService; |
| | | @Resource |
| | | private LtkjHisUserService hisUserService; |
| | | |
| | | @GetMapping("/getTjHyBgList") |
| | | @ApiOperation(value = "查询lis数据库项目信息接口") |
| | | public AjaxResult getTjHyBgList(@RequestParam(required = false)String pacCode, |
| | | @RequestParam(required = false)String pacName, |
| | | @RequestParam(required = false)String pacRemark) { |
| | | List<Map<String, Object>> maps = testMapper.getTjHyBgList(pacCode,pacName,pacRemark); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | return AjaxResult.success(maps); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/newGetTjPat") |
| | | @ApiOperation(value = "新的查询体检信息接口") |
| | | public AjaxResult newGetTjPat() { |
| | | List<Map<String, Object>> maps = testMapper.newGetTjPat(); |
| | | public AjaxResult newGetTjPat(@RequestParam(required = false)String pacCode, |
| | | @RequestParam(required = false)String pacName, |
| | | @RequestParam(required = false)String pacRemark) { |
| | | // List<Map<String, Object>> maps = testMapper.newGetTjPat111111(pacName); |
| | | List<Map<String, Object>> maps = testMapper.newGetTjPat(pacCode,pacName,pacRemark); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | return AjaxResult.success(maps); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getLtkjHisUser") |
| | | @ApiOperation(value = "同步his用户") |
| | | public AjaxResult getLtkjHisUser() { |
| | | List<LtkjHisUser> list = testMapper.getLtkjHisUser(); |
| | | if(null !=list && list.size()>0){ |
| | | DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | for (LtkjHisUser user : list) { |
| | | LtkjHisUser hisUser= hisUserService.getHisUserByHisGh(user.getHisgh()); |
| | | if(null == hisUser){ |
| | | hisUserService.save(user); |
| | | } |
| | | } |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/dataSynchronization") |
| | | @ApiOperation(value = "同步sql server数据到本地数据库数据接口") |
| | | @RepeatSubmit |
| | | public AjaxResult dataSynchronization(@RequestParam String tjNumber) { |
| | | //根据配置调取存储过程 将临时表数据存入预约表2023.12.12 |
| | | // final String getInfoFromSqlData = configService.selectConfigByKey("getInfoFromSqlData"); |
| | | // if ("Y".equals(getInfoFromSqlData)) { |
| | | TjOrder order = orderService.getOrderByTjNum(tjNumber); |
| | | if (null != order) { |
| | | List<LtkjHysqd> one = testMapper.getHysqdByTmh(order.getCardId()); |
| | | if (one != null && one.size() > 0) { |
| | | for (LtkjHysqd ltkjHysqd : one) { |
| | | // DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | LtkjHysqd hysqd = ltkjHysqdService.getLtkjHysqdByTjhAndTmh(ltkjHysqd.getTjh(), ltkjHysqd.getTmh()); |
| | | if(hysqd==null){ |
| | | ltkjHysqdService.save(ltkjHysqd); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | List<LtkjHybgd> one1 = testMapper.getHybgdByTmh(ltkjHysqd.getTmh()); |
| | | if (one1 != null && one1.size() > 0) { |
| | | DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | ltkjHybgdService.saveBatch(one1); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // List<LtkjExamJcsqd> one2 = testMapper.getExamJcsqdTmh(tjNumber); |
| | | // if (one2 != null && one2.size() > 0) { |
| | | // DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | // ltkjExamJcsqdService.saveBatch(one2); |
| | | // DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | // for (LtkjExamJcsqd ltkjExamJcsqd : one2) { |
| | | // List<LtkjExamJcbgd> one3 = testMapper.getExamJcbgdByTjh(ltkjExamJcsqd.getTmh()); |
| | | // if (one3 != null && one3.size() > 0) { |
| | | // DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | // ltkjExamJcbgdService.saveBatch(one3); |
| | | // DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | // } |
| | | // } |
| | | // } |
| | | //同步化验项目 |
| | | testMapper.updateDetailByCall(order.getCardId(), String.valueOf(order.getOrderId()),order.getTjNumber(), "1"); |
| | | //同步检查项目 |
| | | testMapper.updateDetailByTjJcCall(order.getCardId(), String.valueOf(order.getOrderId()),order.getTjNumber(),"1"); |
| | | } |
| | | // } |
| | | return AjaxResult.success("同步成功"); |
| | | } |
| | | } |