diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/mapper/CustInfoMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/mapper/CustInfoMapper.java index 64021b3b..3798acd9 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/mapper/CustInfoMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/customer/mapper/CustInfoMapper.java @@ -27,6 +27,8 @@ public interface CustInfoMapper extends BaseMapper { CustInfo selectOne(CustInfo custInfo); int updateById(CustInfo custInfo); + int updateCustPwdByCustId(@Param("pwd") String pwd, @Param("custId") Long custId); + CustInfoVo queryCustInfoDetail(@Param("info") CustInfo info); CustInfoVo queryCustInfo(@Param("info") CustInfoDTO info); 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 9052e8cc..ae534298 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 @@ -497,8 +497,7 @@ public class CustInfoServiceImpl extends ServiceImpl i } BCryptPasswordEncoder bCrypt = new BCryptPasswordEncoder(); String password = bCrypt.encode(newPassword); - custInfo.setPwd(password); - custInfoMapper.updateById(custInfo); + custInfoMapper.updateCustPwdByCustId(password, custInfo.getCustId()); ajaxResult.put("msg", "修改成功"); ajaxResult.put("code", "200"); } 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 a44ef7b3..510f2bf2 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 @@ -31,6 +31,12 @@ where cust_id = #{custId} + + update cust_info + set pwd = #{pwd} + where cust_id = #{custId} + + ci.cust_id,