|
@@ -35,6 +35,7 @@ import org.jeecg.modules.pay.sdk.base.YzhResponse;
|
|
|
import org.jeecg.modules.pay.sdk.payment.PaymentClient;
|
|
|
import org.jeecg.modules.pay.sdk.payment.domain.CreateBankpayOrderRequest;
|
|
|
import org.jeecg.modules.pay.sdk.payment.domain.CreateBankpayOrderResponse;
|
|
|
+import org.jeecg.modules.system.util.SecurityUtil;
|
|
|
import org.jeecg.modules.utils.HttpClientUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -86,6 +87,8 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
|
private RedisUtil redisUtil;
|
|
|
@Autowired
|
|
|
private AdminTransferAccountsMapper adminTransferAccountsMapper;
|
|
|
+ @Autowired
|
|
|
+ private IAdminUserService adminUserService;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -117,6 +120,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
|
adminUser.setPassword("123456");
|
|
|
}
|
|
|
adminUser.setWisMhu("允许");
|
|
|
+ adminUser.setIsTrue("1");
|
|
|
adminUser.setYzh(user.getYzh());
|
|
|
adminUser.setWisWjdc("允许");
|
|
|
String passwordEncode = PasswordUtil.encrypt(adminUser.getPhone(), adminUser.getPassword(), salt);
|
|
@@ -234,25 +238,25 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
|
@Override
|
|
|
public Result<?> perfectInformation(AdminUserVO adminUserVO, String authorization) {
|
|
|
|
|
|
- if (authorization.equals("")) {
|
|
|
- return Result.error("token不能为空");
|
|
|
- }
|
|
|
- String userPhone = JwtUtil.getUsername(authorization);
|
|
|
- //校验token==================
|
|
|
- if (!redisUtil.hasKey(CommonConstant.PREFIX_NFT_USER_TOKEN + userPhone)) {
|
|
|
- return Result.error("TOKEN失效");
|
|
|
- }
|
|
|
+// if (authorization.equals("")) {
|
|
|
+// return Result.error("token不能为空");
|
|
|
+// }
|
|
|
+// String userPhone = JwtUtil.getUsername(authorization);
|
|
|
+// //校验token==================
|
|
|
+// if (!redisUtil.hasKey(CommonConstant.PREFIX_NFT_USER_TOKEN + userPhone)) {
|
|
|
+// return Result.error("TOKEN失效");
|
|
|
+// }
|
|
|
try {
|
|
|
//1. 校验用户是否有效
|
|
|
- //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
|
|
- QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("phone", userPhone);
|
|
|
- queryWrapper.eq("is_true", "1");
|
|
|
- AdminUser storeMember1 = this.getOne(queryWrapper);
|
|
|
- if (storeMember1 == null) {
|
|
|
- baseCommonService.addLog("用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
|
|
|
- return Result.error("token校验该用户不存在");
|
|
|
- }
|
|
|
+// //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
|
|
+// QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
|
|
|
+// queryWrapper.eq("phone", userPhone);
|
|
|
+// queryWrapper.eq("is_true", "1");
|
|
|
+// AdminUser storeMember1 = this.getOne(queryWrapper);
|
|
|
+// if (storeMember1 == null) {
|
|
|
+// baseCommonService.addLog("用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
|
|
|
+// return Result.error("token校验该用户不存在");
|
|
|
+// }
|
|
|
//银行卡四要素认证(下发验证码)
|
|
|
return this.bankCardFourAuthVerify(adminUserVO);
|
|
|
} catch (Exception e) {
|
|
@@ -315,7 +319,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
|
return Result.error("token校验该用户不存在");
|
|
|
}
|
|
|
//银行卡四要素认证(上传验证码)
|
|
|
- return this.bankCardFourAuthConfirm(adminUserVO);
|
|
|
+ return this.bankCardFourAuthConfirm(adminUserVO,storeMember1);
|
|
|
} catch (Exception e) {
|
|
|
return Result.error("请求失败");
|
|
|
}
|
|
@@ -372,7 +376,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private Result<?> bankCardFourAuthConfirm(AdminUserVO adminUserVO) {
|
|
|
+ private Result<?> bankCardFourAuthConfirm(AdminUserVO adminUserVO,AdminUser adminUser) {
|
|
|
BankCardFourAuthConfirmRequest request = new BankCardFourAuthConfirmRequest();
|
|
|
request.setCardNo(adminUserVO.getBackCard());
|
|
|
request.setIdCard(adminUserVO.getCard());
|
|
@@ -381,6 +385,8 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
|
request.setCaptcha(adminUserVO.getCode());
|
|
|
request.setRef(adminUserVO.getRef());
|
|
|
YzhResponse<BankCardFourAuthConfirmResponse> response = null;
|
|
|
+
|
|
|
+
|
|
|
try {
|
|
|
String requestId = BaseUtil.getRandomStr("requestId");
|
|
|
// request-id:每次请求的唯一标识
|
|
@@ -391,7 +397,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
|
BankCardFourAuthConfirmResponse data = response.getData();
|
|
|
baseCommonService.addLog("银行卡四要素认证(上传验证码)请求的唯一标识request-id: " + requestId, CommonConstant.LOG_TYPE_2, 2);
|
|
|
System.out.println("请求成功:" + data);
|
|
|
- this.saveAdminUserVO(adminUserVO);
|
|
|
+ this.saveAdminUserVO(adminUserVO,adminUser);
|
|
|
return Result.ok("请求成功:" + data);
|
|
|
|
|
|
} else {
|
|
@@ -405,17 +411,26 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void saveAdminUserVO(AdminUserVO adminUserVO) {
|
|
|
- AdminUser adminUser = new AdminUser();
|
|
|
- adminUser.setName(adminUserVO.getName());
|
|
|
- adminUser.setCard(adminUserVO.getCard());
|
|
|
- adminUser.setBackCard(adminUserVO.getBackCard());
|
|
|
- adminUser.setCardholderPhone(adminUserVO.getCardholderPhone());
|
|
|
- adminUser.setDwname(adminUserVO.getDwname());
|
|
|
- adminUser.setKsname(adminUserVO.getKsname());
|
|
|
- adminUser.setDoctorAndSpecialist(adminUserVO.getDoctorAndSpecialist());
|
|
|
- adminUser.setCardPic(adminUserVO.getCardPic());
|
|
|
- this.saveAdminUserVO(adminUserVO);
|
|
|
+ public void saveAdminUserVO(AdminUserVO adminUserVO,AdminUser adminUser) {
|
|
|
+
|
|
|
+ String sysOrgCode = adminUser.getSysOrgCode();
|
|
|
+
|
|
|
+ QueryWrapper<AdminUser> adminUserQueryWrapper = new QueryWrapper<>();
|
|
|
+ adminUserQueryWrapper.eq("phone",adminUser.getPhone());
|
|
|
+ adminUserQueryWrapper.eq("sys_org_code",sysOrgCode);
|
|
|
+ AdminUser one = adminUserService.getOne(adminUserQueryWrapper);
|
|
|
+ if (null!=one){
|
|
|
+ one.setCard(adminUserVO.getCard());
|
|
|
+ one.setCardholderName(adminUserVO.getName());
|
|
|
+ one.setBackCard(adminUserVO.getBackCard());
|
|
|
+ one.setCardholderPhone(adminUserVO.getCardholderPhone());
|
|
|
+ one.setDwname(adminUserVO.getDwname());
|
|
|
+ one.setKsname(adminUserVO.getKsname());
|
|
|
+ one.setDoctorAndSpecialist(adminUserVO.getDoctorAndSpecialist());
|
|
|
+ one.setCardPic(adminUserVO.getCardPic());
|
|
|
+ this.updateById(one);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|