From d423307d3df56feb412d43f939a49195f3fff92e Mon Sep 17 00:00:00 2001 From: zjh <zjh@888> Date: 星期四, 21 十二月 2023 19:51:20 +0800 Subject: [PATCH] zjh 本地 2023/12/21 -2 --- ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java | 38 ++++++++++++++++++++++++++++++++++---- 1 files changed, 34 insertions(+), 4 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java index fbb2ab9..40e10f2 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java @@ -4,11 +4,14 @@ import javax.servlet.http.HttpServletResponse; import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ltkj.common.enums.DataSourceType; import com.ltkj.common.utils.bean.BeanUtils; import com.ltkj.framework.config.MatchUtils; +import com.ltkj.framework.datasource.DynamicDataSourceContextHolder; import com.ltkj.hosp.domain.TjReservation; import com.ltkj.hosp.mapper.TestMapper; import com.ltkj.hosp.service.ITjReservationService; +import com.ltkj.hosp.service.TjvLtkjvtjpatService; import com.ltkj.hosp.sqlDomain.LtkjTjPat; import com.ltkj.system.service.ISysConfigService; import io.swagger.annotations.Api; @@ -52,6 +55,8 @@ @Resource private TestMapper testMapper; + @Resource + private TjvLtkjvtjpatService tjvLtkjvtjpatService; @@ -60,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) { //鍒ゆ柇韬唤璇佸彿鏍煎紡鏄惁姝g‘ @@ -78,8 +83,34 @@ //鏍规嵁閰嶇疆璋冨彇瀛樺偍杩囩▼ 灏嗕复鏃惰〃鏁版嵁瀛樺叆棰勭害琛�2023.12.12 final String getInfoFromSqlData = sysConfigService.selectConfigByKey("getInfoFromSqlData"); if ("Y".equals(getInfoFromSqlData)){ -// LtkjTjPat tjPatByIdCard = testMapper.getTjPatByIdCard(cusIdcard); - testMapper.getTjPatByCusId(cusIdcard); + //鏍规嵁韬唤璇佸ソ鏌ヤ俊鎭� + 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(); + //鍐嶆牴鎹韩浠借瘉鍙峰啓customer琛� + TjCustomer tjCustomer = tjCustomerService.getTjCustomerByCusIdCard(cusIdcard); + if(null == tjCustomer){ + testMapper.getTjPatByCusId(cusIdcard); + LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>(); + qw.eq(TjCustomer::getCusIdcard, cusIdcard); + TjCustomer customer = tjCustomerService.getOne(qw); + customer.setReservationId(customer.getCardId()); + return success(customer); + }else { + tjCustomer.setReservationId(tjCustomer.getCardId()); + return success(tjCustomer); + } + } //end====2023.12.12 LambdaQueryWrapper<TjReservation> wq = new LambdaQueryWrapper<>(); @@ -120,7 +151,6 @@ tjCustomer1.setReservationId(tjReservation.getId()); tjCustomer1.setDiscount(tjReservation.getDiscount()); tjCustomer1.setGroupingId(tjReservation.getGroupingId()); - return success(tjCustomer1); } -- Gitblit v1.8.0