From b13833bbeeeec36dc678c6052b6bcae3bd04d075 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Sun, 27 Apr 2025 16:34:53 +0800 Subject: [PATCH] queryCustInfoDetailForApp --- .../core/customer/controller/CustInfoController.java | 2 ++ .../bonus/canteen/core/customer/model/CustInfo.java | 9 +++++---- .../customer/service/impl/CustInfoServiceImpl.java | 6 +++++- .../main/resources/mapper/customer/CustInfoMapper.xml | 10 ++++++++-- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/controller/CustInfoController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/controller/CustInfoController.java index 183b89a3..d3a0795a 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/controller/CustInfoController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/controller/CustInfoController.java @@ -20,6 +20,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import static com.bonus.canteen.core.common.encrypt.SM4EncryptUtils.sm4Encrypt; import static com.bonus.common.core.utils.PageUtils.startPage; import static com.bonus.common.core.web.domain.AjaxResult.success; import static com.bonus.canteen.core.common.encrypt.SM4EncryptUtils.sm4Decrypt; @@ -87,6 +88,7 @@ public class CustInfoController extends BaseController { Integer sourceType = this.getSourceTypeByHeaders(headers); sourceType = Objects.isNull(sourceType) ? SourceTypeEnum.HT_H5_MOBILE.getKey() : sourceType; AjaxResult ar = new AjaxResult(); + custInfo.setMobile(sm4Encrypt(custInfo.getMobile())); CustInfoVo result = this.custInfoService.queryCustInfoDetail(custInfo, sourceType); //System.out.println(sm4Decrypt("29G1AUHDmLvPe1tt0t12Dw==##encrypted")); result.setMobile(sm4Decrypt(result.getMobile())); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/model/CustInfo.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/model/CustInfo.java index a12f37cf..84f220dd 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/model/CustInfo.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/model/CustInfo.java @@ -23,10 +23,11 @@ public class CustInfo { @ApiModelProperty("主键自增") private Long id; @ApiModelProperty("人员id") - private @NotNull( - message = "{customer.id.nonNull}", - groups = {ValidationGroups.Update.class, ValidationGroups.Delete.class} -) Long custId; +// private @NotNull( +// message = "{customer.id.nonNull}", +// groups = {ValidationGroups.Update.class, ValidationGroups.Delete.class} +//) + Long custId; @ApiModelProperty("人员编号") private @NotNull( message = "{customer.num.nonNull}", diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/service/impl/CustInfoServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/service/impl/CustInfoServiceImpl.java index 75d2732a..9052e8cc 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/service/impl/CustInfoServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/service/impl/CustInfoServiceImpl.java @@ -157,7 +157,11 @@ public class CustInfoServiceImpl extends ServiceImpl i protected CustInfoVo getNormalCustInfoDetail(CustInfo custInfo, Integer sourceType) { custInfo.setCustState(PersonalStatusEnum.NORMAL.getKey()); CustInfoVo custInfoVo = custInfoMapper.queryCustInfoDetail(custInfo); - return addOrUpdateCustCasual(custInfoVo, sourceType); + if (ObjectUtil.isNotNull(custInfoVo)) { + return addOrUpdateCustCasual(custInfoVo, sourceType); + } else { + return null; + } } public CustInfoVo addOrUpdateCustCasual(CustInfoVo custInfoVo, Integer sourceType) { diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/customer/CustInfoMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/customer/CustInfoMapper.xml index d1ade803..a44ef7b3 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/customer/CustInfoMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/customer/CustInfoMapper.xml @@ -103,8 +103,14 @@ LEFT JOIN cust_place place ON ci.place_id = place.place_id LEFT JOIN cust_cost_center A ON A.cost_center_id = ci.cost_center_id LEFT JOIN cust_casual cc on ci.cust_id = cc.cust_id - where ci.cust_id = #{info.custId} - and ci.cust_state = #{info.custState} + where + ci.cust_state = #{info.custState} + + and ci.cust_id = #{info.custId} + + + and ci.mobile = #{info.mobile} +