|
|
|
@ -10,11 +10,14 @@ import com.hai.common.security.UserCenter; |
|
|
|
|
import com.hai.common.utils.RedisUtil; |
|
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
|
import com.hai.config.HuiLianTongUnionCardConfig; |
|
|
|
|
import com.hai.entity.HighUser; |
|
|
|
|
import com.hai.entity.HighUserCard; |
|
|
|
|
import com.hai.enum_type.UserCardType; |
|
|
|
|
import com.hai.model.HighUserModel; |
|
|
|
|
import com.hai.model.ResponseData; |
|
|
|
|
import com.hai.service.HighUserCardService; |
|
|
|
|
import com.hai.service.HighUserPayPasswordService; |
|
|
|
|
import com.hai.service.HighUserService; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
@ -45,6 +48,11 @@ public class HighUserCardController { |
|
|
|
|
@Resource |
|
|
|
|
private RedisUtil redisUtil; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighUserService highUserService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighUserPayPasswordService highUserPayPasswordService; |
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getUserCardList", method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
@ -125,7 +133,11 @@ public class HighUserCardController { |
|
|
|
|
SessionObject sessionObject = userCenter.getSessionObject(request); |
|
|
|
|
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); |
|
|
|
|
|
|
|
|
|
if (highUserCardService.getDetailByUserCardNo(userInfoModel.getHighUser().getId(), body.getString("cardNo")) == null) { |
|
|
|
|
if (highUserCardService.isBindHtlCard(userInfoModel.getHighUser().getId()) == true) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "绑定失败!只能绑定一张工会卡"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (highUserCardService.getDetailByUserCardNo(userInfoModel.getHighUser().getId(), body.getString("cardNo")) != null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已绑定此卡,请勿重复绑定"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -142,7 +154,16 @@ public class HighUserCardController { |
|
|
|
|
highUserCardService.editCard(userCard); |
|
|
|
|
|
|
|
|
|
redisUtil.del(body.getString("phone")); |
|
|
|
|
return ResponseMsgUtil.success("操作成功"); |
|
|
|
|
|
|
|
|
|
// 定义个人所有数据
|
|
|
|
|
HighUser user = highUserService.findByUserId(userInfoModel.getHighUser().getId()); |
|
|
|
|
HighUserModel highUserModel = new HighUserModel(); |
|
|
|
|
user.setPassword(null); |
|
|
|
|
user.setIsSetPayPwd(highUserPayPasswordService.isSetPayPwd(user.getId())); |
|
|
|
|
user.setIsSetHltCard(highUserCardService.isBindHtlCard(user.getId())); |
|
|
|
|
highUserModel.setHighUser(user); |
|
|
|
|
SessionObject so = new SessionObject(user.getUnionId(), 1 , highUserModel); |
|
|
|
|
return ResponseMsgUtil.success(so); |
|
|
|
|
} |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "验证码错误"); |
|
|
|
|
|
|
|
|
|