zjh
2023-12-21 fd05507e8595739c80f485d67fdeeed91708f746
ltkj-admin/src/main/java/com/ltkj/web/controller/sqlserver/TjSqlController.java
@@ -8,6 +8,7 @@
import com.ltkj.common.core.redis.RedisCache;
import com.ltkj.common.enums.DataSourceType;
import com.ltkj.framework.datasource.DynamicDataSourceContextHolder;
import com.ltkj.hosp.domain.TjCustomer;
import com.ltkj.hosp.domain.TjOrder;
import com.ltkj.hosp.domain.TjOrderRemark;
import com.ltkj.hosp.service.*;
@@ -62,6 +63,8 @@
    private LtkjHysqdService ltkjHysqdService;
    @Autowired
    public RedisTemplate<Object,Object> redisTemplate;
    @Resource
    private ITjCustomerService tjCustomerService;
    @Resource
    private RedisCache redisCache;
    @Resource
@@ -157,6 +160,7 @@
    @GetMapping("/getTjPat")
    @ApiOperation(value = "测试getTjPat")
    public AjaxResult getTjPat() {
        List<LtkjTjPat> list = testMapper.getTjPat();
        DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
@@ -167,6 +171,31 @@
        return AjaxResult.success(list);
    }
    @GetMapping("/getTjPatByIdCard")
    @ApiOperation(value = "根据身份证号测试getTjPat")
    public AjaxResult getTjPatByIdCard(@RequestParam String idCard) {
        LtkjTjPat tjPatByIdCard = testMapper.getTjPatByIdCard(idCard.trim());
        if(null != tjPatByIdCard){
            String fcardNo = tjPatByIdCard.getFcardNo();
            if(null !=fcardNo){
                fcardNo=fcardNo.trim();
                tjPatByIdCard.setFcardNo(fcardNo);
            }
            LtkjTjPat ltkjTjPat = tjvLtkjvtjpatService.getLtkjTjPatByCusIdCard(idCard);
            if(null==ltkjTjPat){
                tjvLtkjvtjpatService.save(tjPatByIdCard);
            }
        }
        DynamicDataSourceContextHolder.clearDataSourceType();
        //再根据身份证号写customer表
        TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(idCard);
        if(null == tjCustomer){
            testMapper.getTjPatByCusId(idCard);
        }
        return AjaxResult.success(tjPatByIdCard);
    }
    @GetMapping("/getExamJcbgd")
    public AjaxResult getExamJcbgd() {
        List<LtkjExamJcbgd> list = testMapper.getExamJcbgd();