Commit 2cf78f99 authored by gaoyingwei's avatar gaoyingwei

修改 根据openId修改会员表

parent 81bfdfb9
......@@ -263,10 +263,10 @@ public class AppMemInfoController extends CyPaginationController<MemInfo> {
@CyOpeLogAnno(title = "system-会员表管理-修改会员表", businessType = CyLogTypeEnum.UPDATE)
@Operation(summary="修改会员表", description="修改会员表")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = false, schema = @Schema(type = "string"))})
@PutMapping("/memInfo/update/{userId:\\w+}")
@PutMapping("/memInfo/update/{openId:\\w+}")
@CyEncryptSm4Anno
public CyResult update(@PathVariable int userId, @RequestBody MemInfo memInfo, BindingResult bindingResult) {
memInfo.setUserId(userId);
public CyResult update(@PathVariable String openId, @RequestBody MemInfo memInfo, BindingResult bindingResult) {
memInfo.setWxOpenid(openId);
CyPersistModel data = memInfoServiceImpl.update(memInfo);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
......
......@@ -92,5 +92,12 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> {
* @return
*/
MemInfo getInfoByUserId(String userId);
/**
* 根据openid查询用户信息
* @param businessId
* @return
*/
MemInfo selectByOpenId(String openId);
}
......@@ -486,11 +486,13 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel update(MemInfo memInfo){
MemInfo info = baseMapper.selectByOpenId(memInfo.getWxOpenid());
//手机号、身份证存储加密
if (StringUtils.isNotBlank(memInfo.getMemPhone()))
memInfo.setMemPhone(CyAESUtils.encrypt(memInfo.getMemPhone()));
memInfo.setMemIdcard(null);
memInfo.setMemRealName(null);
memInfo.setMemIdcard(info.getMemIdcard());
memInfo.setMemRealName(info.getMemRealName());
memInfo.setBusinessId(info.getBusinessId());
//身份证、手机号验重
SysUserRbacDTO sysUserRbacDTO = baseMapper.checkPhoneRepeat(memInfo.getUserId(),memInfo.getMemPhone());
if (sysUserRbacDTO != null) {
......
......@@ -494,5 +494,10 @@
select * from mem_info where user_id = #{userId} and del_flag = 0
</select>
<select id="selectByOpenId" resultType="org.rcisoft.business.memInfo.entity.MemInfo"
parameterType="java.lang.String">
select * from mem_info where wx_openid = #{openId} and del_flag = 0
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment