zjh
2023-12-21 fd05507e8595739c80f485d67fdeeed91708f746
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
@@ -65,7 +65,7 @@
     */
    @PostMapping(value = "/cusIdcard")
    @ApiOperation(value = "根据身份证号获取用户信息")
    @Log(title = "客户身份信息", businessType = BusinessType.EXPORT)
//    @Log(title = "客户身份信息", businessType = BusinessType.EXPORT)
    public AjaxResult getInfoByIdCard(@RequestParam @ApiParam(value = "客户身份证号") String cusIdcard) {
        if (!"".equals(cusIdcard) && cusIdcard != null) {
            //判断身份证号格式是否正确
@@ -83,15 +83,25 @@
            //根据配置调取存储过程 将临时表数据存入预约表2023.12.12
            final String getInfoFromSqlData = sysConfigService.selectConfigByKey("getInfoFromSqlData");
            if ("Y".equals(getInfoFromSqlData)){
//                 LtkjTjPat tjPatByIdCard = testMapper.getTjPatByIdCard(cusIdcard);
                List<LtkjTjPat> list = testMapper.getTjPat();
                DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name());
                for (LtkjTjPat ltkjTjPat : list) {
                    final boolean save = tjvLtkjvtjpatService.save(ltkjTjPat);
                //根据身份证好查信息
                 LtkjTjPat tjPatByIdCard = testMapper.getTjPatByIdCard(cusIdcard);
                if(null != tjPatByIdCard){
                    String fcardNo = tjPatByIdCard.getFcardNo();
                    if(null !=fcardNo){
                        fcardNo=fcardNo.trim();
                        tjPatByIdCard.setFcardNo(fcardNo);
                    }
                    LtkjTjPat ltkjTjPat = tjvLtkjvtjpatService.getLtkjTjPatByCusIdCard(cusIdcard);
                    if(null==ltkjTjPat){
                        tjvLtkjvtjpatService.save(tjPatByIdCard);
                    }
                }
                DynamicDataSourceContextHolder.clearDataSourceType();
                 testMapper.getTjPatByCusId(cusIdcard);
                //再根据身份证号写customer表
                TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusIdcard);
                if(null == tjCustomer){
                    testMapper.getTjPatByCusId(cusIdcard);
                }
            }
            //end====2023.12.12
            LambdaQueryWrapper<TjReservation> wq = new LambdaQueryWrapper<>();
@@ -132,7 +142,6 @@
                    tjCustomer1.setReservationId(tjReservation.getId());
                    tjCustomer1.setDiscount(tjReservation.getDiscount());
                    tjCustomer1.setGroupingId(tjReservation.getGroupingId());
                    return success(tjCustomer1);
                }