忘记密码

This commit is contained in:
sxu 2025-05-08 20:19:19 +08:00
parent 68b1ca0b37
commit 5cfadeca93
3 changed files with 22 additions and 21 deletions

View File

@ -25,31 +25,32 @@ import java.util.List;
public interface CustInfoMapper extends BaseMapper<CustInfo> {
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);
@Select({"select c.cust_id, c.cust_name, c.mobile from cust_info c inner join acc_card a on c.cust_id = a.cust_id where a.serial_num = #{serialNum}"})
CustInfo queryCustBySerialNum(String serialNum);
@Select({"select cust_id from cust_info where cust_num = #{custNum} and cust_state=1"})
Long selectCustIdByCustNum(String custNum);
@Select({"SELECT cust_id FROM cust_info where cust_third_id = #{custThirdId} and cust_state = 1"})
Long queryCustIdByCustThirdId(String custThirdId);
@Select({"select cust_num, cust_name, org_full_name, cust_photo_url, ai.acc_bal from cust_info ci left join acc_info ai on ci.cust_id = ai.cust_id where ci.cust_id = #{custId} "})
MacOrdCurrWriteOffVO getCustAccInfoByCustId(@Param("custId") Long custId);
// @Select({"select c.cust_id, c.cust_name, c.mobile from cust_info c inner join acc_card a on c.cust_id = a.cust_id where a.serial_num = #{serialNum}"})
// CustInfo queryCustBySerialNum(String serialNum);
//
//
// @Select({"select cust_id from cust_info where cust_num = #{custNum} and cust_state=1"})
// Long selectCustIdByCustNum(String custNum);
//
// @Select({"SELECT cust_id FROM cust_info where cust_third_id = #{custThirdId} and cust_state = 1"})
// Long queryCustIdByCustThirdId(String custThirdId);
//
// @Select({"select cust_num, cust_name, org_full_name, cust_photo_url, ai.acc_bal from cust_info ci left join acc_info ai on ci.cust_id = ai.cust_id where ci.cust_id = #{custId} "})
// MacOrdCurrWriteOffVO getCustAccInfoByCustId(@Param("custId") Long custId);
CustInfoForRechargeVO getCustInfoForRechargeByCustNum(@Param("custNum") String custNum, @Param("custState") Integer custState);
List<CustInfoForRechargeVO> listCustInfoForRechargeByCustNums(@Param("custNumList") List<String> custNumList, @Param("custState") Integer custState);
@Select({"SELECT DISTINCT t1.cust_num FROM cust_info t1 LEFT JOIN cust_photo t2 ON t1.cust_id = t2.cust_id WHERE t1.cust_state = 1 AND t2.features_build_status IS NULL OR t2.features_build_status = 1"})
List<String> listCustNumNonFeatures();
// @Select({"SELECT DISTINCT t1.cust_num FROM cust_info t1 LEFT JOIN cust_photo t2 ON t1.cust_id = t2.cust_id WHERE t1.cust_state = 1 AND t2.features_build_status IS NULL OR t2.features_build_status = 1"})
// List<String> listCustNumNonFeatures();
Long queryOrgManagerCustIdByCustId(@Param("custId") Long custId);

View File

@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bonus.canteen.core.customer.constants.*;
import com.bonus.canteen.core.customer.mapper.CustInfoMapper;
import com.bonus.canteen.core.customer.po.CustomerNumByOrgIdMapperPO;
import com.bonus.canteen.core.customer.vo.PageCustInfoPhotoVO;
import com.bonus.common.core.constant.CacheConstants;
@ -29,7 +30,6 @@ import com.bonus.canteen.core.common.utils.LogUtil;
import com.bonus.canteen.core.customer.api.CustCasualApi;
import com.bonus.canteen.core.customer.business.CustInfoBurialPointBusiness;
import com.bonus.canteen.core.customer.dto.*;
import com.bonus.canteen.core.customer.mapper.CustInfoMapper;
import com.bonus.canteen.core.customer.model.CustAccTemp;
import com.bonus.canteen.core.customer.model.CustErrorToLead;
import com.bonus.canteen.core.customer.model.CustInfo;
@ -497,8 +497,7 @@ public class CustInfoServiceImpl extends ServiceImpl<CustInfoMapper, CustInfo> 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");
}
@ -541,7 +540,8 @@ public class CustInfoServiceImpl extends ServiceImpl<CustInfoMapper, CustInfo> i
public boolean verifySmsCode(SmsCodeVerifyDTO smsCodeVerifyDTO, String cacheKey) {
String key = cacheKey + smsCodeVerifyDTO.getTelephoneNumber();
String code = redisService.getCacheObject(key); //RedisUtil.getString(key);
log.info("redis缓存验证码code : {}", code);
log.info("redis缓存验证码code: {}, 输入的验证码: {}, 检验结果1: {}, 检验结果2: {}", code, smsCodeVerifyDTO.getCode(),
ObjectUtil.isNotEmpty(code), ObjectUtil.equal(code, smsCodeVerifyDTO.getCode()));
return ObjectUtil.isNotEmpty(code) && ObjectUtil.equal(code, smsCodeVerifyDTO.getCode());
}

View File

@ -25,9 +25,9 @@
</where>
</select>
<update id="updateById">
<update id="updateCustPwdByCustId">
update cust_info
set cust_name = #{custName}, cust_num = #{custNum}, mobile = #{mobile}, id_card = #{idCard}, pwd = #{pwd}
set pwd = #{pwd}
where cust_id = #{custId}
</update>