|
@@ -13,11 +13,13 @@ import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.util.PasswordUtil;
|
|
import org.jeecg.common.util.PasswordUtil;
|
|
import org.jeecg.common.util.RedisUtil;
|
|
import org.jeecg.common.util.RedisUtil;
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
|
+import org.jeecg.modules.adminuser.entity.AdminCompSelect;
|
|
import org.jeecg.modules.adminuser.entity.AdminTransferAccounts;
|
|
import org.jeecg.modules.adminuser.entity.AdminTransferAccounts;
|
|
import org.jeecg.modules.adminuser.entity.AdminUser;
|
|
import org.jeecg.modules.adminuser.entity.AdminUser;
|
|
import org.jeecg.modules.adminuser.entity.AdminUserVO;
|
|
import org.jeecg.modules.adminuser.entity.AdminUserVO;
|
|
import org.jeecg.modules.adminuser.mapper.AdminTransferAccountsMapper;
|
|
import org.jeecg.modules.adminuser.mapper.AdminTransferAccountsMapper;
|
|
import org.jeecg.modules.adminuser.mapper.AdminUserMapper;
|
|
import org.jeecg.modules.adminuser.mapper.AdminUserMapper;
|
|
|
|
+import org.jeecg.modules.adminuser.service.IAdminCompSelectService;
|
|
import org.jeecg.modules.adminuser.service.IAdminUserService;
|
|
import org.jeecg.modules.adminuser.service.IAdminUserService;
|
|
import org.jeecg.modules.base.service.BaseCommonService;
|
|
import org.jeecg.modules.base.service.BaseCommonService;
|
|
import org.jeecg.modules.pay.example.config.Config;
|
|
import org.jeecg.modules.pay.example.config.Config;
|
|
@@ -48,10 +50,7 @@ import javax.annotation.Resource;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.nio.charset.Charset;
|
|
import java.nio.charset.Charset;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
-import java.util.Date;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Random;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
import static org.jeecg.modules.pay.sdk.utils.DESUtil.tripleDesEncrypt;
|
|
import static org.jeecg.modules.pay.sdk.utils.DESUtil.tripleDesEncrypt;
|
|
|
|
|
|
@@ -89,6 +88,8 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
private AdminTransferAccountsMapper adminTransferAccountsMapper;
|
|
private AdminTransferAccountsMapper adminTransferAccountsMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private IAdminUserService adminUserService;
|
|
private IAdminUserService adminUserService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IAdminCompSelectService adminCompSelectService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -98,18 +99,11 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Result saveUser(AdminUser adminUser) {
|
|
public Result saveUser(AdminUser adminUser) {
|
|
|
|
+
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
adminUser.setCompName(user.getRealname());
|
|
adminUser.setCompName(user.getRealname());
|
|
String phone = adminUser.getPhone();
|
|
String phone = adminUser.getPhone();
|
|
String compName = adminUser.getCompName();
|
|
String compName = adminUser.getCompName();
|
|
- QueryWrapper<AdminUser> adminUserQueryWrapper = new QueryWrapper<>();
|
|
|
|
- adminUserQueryWrapper.eq("phone", phone);
|
|
|
|
- adminUserQueryWrapper.eq("comp_name", compName);
|
|
|
|
- List<AdminUser> list = this.list(adminUserQueryWrapper);
|
|
|
|
- if (null != list && list.size() > 0) {
|
|
|
|
- return Result.error("手机号已经存在,请勿重复添加");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
adminUser.setDoctorAndSpecialist("1");
|
|
adminUser.setDoctorAndSpecialist("1");
|
|
String salt = oConvertUtils.randomGen(8);
|
|
String salt = oConvertUtils.randomGen(8);
|
|
adminUser.setSalt(salt);
|
|
adminUser.setSalt(salt);
|
|
@@ -122,25 +116,83 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
adminUser.setWisMhu("允许");
|
|
adminUser.setWisMhu("允许");
|
|
adminUser.setCompleteInformation(1);
|
|
adminUser.setCompleteInformation(1);
|
|
adminUser.setIsTrue("1");
|
|
adminUser.setIsTrue("1");
|
|
|
|
+ adminUser.setSysOrgCode(user.getOrgCode());
|
|
adminUser.setYzh(user.getYzh());
|
|
adminUser.setYzh(user.getYzh());
|
|
adminUser.setWisWjdc("允许");
|
|
adminUser.setWisWjdc("允许");
|
|
String passwordEncode = PasswordUtil.encrypt(adminUser.getPhone(), adminUser.getPassword(), salt);
|
|
String passwordEncode = PasswordUtil.encrypt(adminUser.getPhone(), adminUser.getPassword(), salt);
|
|
adminUser.setPassword(passwordEncode);
|
|
adminUser.setPassword(passwordEncode);
|
|
- this.save(adminUser);
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ QueryWrapper<AdminUser> adminUserQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ adminUserQueryWrapper.eq("phone", phone);
|
|
|
|
+ AdminUser adminUsers = adminUserService.getOne(adminUserQueryWrapper);
|
|
|
|
+
|
|
|
|
+ if (null != adminUsers) {
|
|
|
|
+
|
|
|
|
+ AdminCompSelect adminCompSelect = new AdminCompSelect();
|
|
|
|
+ adminCompSelect.setOrderId(adminUsers.getId());
|
|
|
|
+ adminCompSelect.setPhone(phone);
|
|
|
|
+ adminCompSelect.setCompName(compName);
|
|
|
|
+ adminCompSelect.setSysOrgCode(adminUser.getSysOrgCode());
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ QueryWrapper<AdminCompSelect> adminCompSelectQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ adminCompSelectQueryWrapper.eq("phone", phone);
|
|
|
|
+ adminCompSelectQueryWrapper.eq("comp_name", compName);
|
|
|
|
+ adminCompSelectQueryWrapper.eq("sys_org_code", adminUser.getSysOrgCode());
|
|
|
|
+ List<AdminCompSelect> list = adminCompSelectService.list(adminCompSelectQueryWrapper);
|
|
|
|
+
|
|
|
|
+ if (null != list && list.size() > 0) {
|
|
|
|
+ return Result.error("该手机号已存在该公司,请更换手机号进行注册");
|
|
|
|
+ } else {
|
|
|
|
+ adminCompSelectService.save(adminCompSelect);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ adminUser.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
+
|
|
|
|
+ AdminCompSelect adminCompSelect = new AdminCompSelect();
|
|
|
|
+ adminCompSelect.setOrderId(adminUser.getId());
|
|
|
|
+ adminCompSelect.setPhone(phone);
|
|
|
|
+ adminCompSelect.setCompName(compName);
|
|
|
|
+ adminCompSelect.setSysOrgCode(adminUser.getSysOrgCode());
|
|
|
|
+
|
|
|
|
+ QueryWrapper<AdminCompSelect> adminCompSelectQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ adminCompSelectQueryWrapper.eq("phone", phone);
|
|
|
|
+ adminCompSelectQueryWrapper.eq("comp_name", compName);
|
|
|
|
+ adminCompSelectQueryWrapper.eq("sys_org_code", adminUser.getSysOrgCode());
|
|
|
|
+ List<AdminCompSelect> list = adminCompSelectService.list(adminCompSelectQueryWrapper);
|
|
|
|
+
|
|
|
|
+ if (null != list && list.size() > 0) {
|
|
|
|
+ return Result.error("该手机号已存在该公司,请更换手机号进行注册");
|
|
|
|
+ } else {
|
|
|
|
+ adminCompSelectService.save(adminCompSelect);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.save(adminUser);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
return Result.OK("操作成功");
|
|
return Result.OK("操作成功");
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Result<?> giveMoney(AdminUser adminUser1) {
|
|
public Result<?> giveMoney(AdminUser adminUser1) {
|
|
String id = adminUser1.getId();
|
|
String id = adminUser1.getId();
|
|
AdminUser adminUser = this.getById(id);
|
|
AdminUser adminUser = this.getById(id);
|
|
|
|
+ String yzh = adminUser.getYzh();
|
|
|
|
+ if ("0".equals(yzh)) {
|
|
|
|
+ return Result.error("请确认云账户转账权限是否开启");
|
|
|
|
+ }
|
|
|
|
+
|
|
CreateBankpayOrderRequest request = new CreateBankpayOrderRequest();
|
|
CreateBankpayOrderRequest request = new CreateBankpayOrderRequest();
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
String format = sdf.format(date);
|
|
String format = sdf.format(date);
|
|
Random random = new Random();
|
|
Random random = new Random();
|
|
int randomNumber = random.nextInt(900000) + 100000;
|
|
int randomNumber = random.nextInt(900000) + 100000;
|
|
- request.setOrderId("BL"+format+randomNumber);
|
|
|
|
|
|
+ request.setOrderId("BL" + format + randomNumber);
|
|
request.setDealerId(dealer_id);
|
|
request.setDealerId(dealer_id);
|
|
request.setBrokerId(broker_id);
|
|
request.setBrokerId(broker_id);
|
|
request.setRealName(adminUser.getName());
|
|
request.setRealName(adminUser.getName());
|
|
@@ -161,16 +213,16 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
response = clientPay.createBankpayOrder(YzhRequest.build(requestId, request));
|
|
response = clientPay.createBankpayOrder(YzhRequest.build(requestId, request));
|
|
if (response.isSuccess()) {// 请求成功
|
|
if (response.isSuccess()) {// 请求成功
|
|
CreateBankpayOrderResponse data = response.getData();
|
|
CreateBankpayOrderResponse data = response.getData();
|
|
- baseCommonService.addLog("请求成功转账的唯一标识request-id: " + requestId+"", CommonConstant.LOG_TYPE_2, 2);
|
|
|
|
- return Result.ok("请求成功:转账金额"+request.getPay());
|
|
|
|
|
|
+ baseCommonService.addLog("请求成功转账的唯一标识request-id: " + requestId + "", CommonConstant.LOG_TYPE_2, 2);
|
|
|
|
+ return Result.ok("请求成功:转账金额" + request.getPay());
|
|
} else {
|
|
} else {
|
|
System.out.println("HTTP Status Code:" + response.getHttpCode());
|
|
System.out.println("HTTP Status Code:" + response.getHttpCode());
|
|
System.out.println("发生异常:" + response.getCode() + "-" + response.getMessage());
|
|
System.out.println("发生异常:" + response.getCode() + "-" + response.getMessage());
|
|
- baseCommonService.addLog("发生异常转账的唯一标识request-id: " + requestId+ response.getCode() + "-" + response.getMessage(), CommonConstant.LOG_TYPE_2, 2);
|
|
|
|
- return Result.error( response.getCode() + "-" + response.getMessage());
|
|
|
|
|
|
+ baseCommonService.addLog("发生异常转账的唯一标识request-id: " + requestId + response.getCode() + "-" + response.getMessage(), CommonConstant.LOG_TYPE_2, 2);
|
|
|
|
+ return Result.error(response.getCode() + "-" + response.getMessage());
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- return Result.error( "请求失败");
|
|
|
|
|
|
+ return Result.error("请求失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -253,7 +305,6 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
// //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
|
// //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
|
// QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
|
|
// QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
|
|
// queryWrapper.eq("phone", userPhone);
|
|
// queryWrapper.eq("phone", userPhone);
|
|
-// queryWrapper.eq("is_true", "1");
|
|
|
|
// AdminUser storeMember1 = this.getOne(queryWrapper);
|
|
// AdminUser storeMember1 = this.getOne(queryWrapper);
|
|
// if (storeMember1 == null) {
|
|
// if (storeMember1 == null) {
|
|
// baseCommonService.addLog("用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
|
|
// baseCommonService.addLog("用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
|
|
@@ -314,14 +365,20 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
//update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
|
//update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
|
QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.eq("phone", userPhone);
|
|
queryWrapper.eq("phone", userPhone);
|
|
- queryWrapper.eq("is_true", "1");
|
|
|
|
AdminUser storeMember1 = this.getOne(queryWrapper);
|
|
AdminUser storeMember1 = this.getOne(queryWrapper);
|
|
if (storeMember1 == null) {
|
|
if (storeMember1 == null) {
|
|
baseCommonService.addLog("用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
|
|
baseCommonService.addLog("用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
|
|
return Result.error("token校验该用户不存在");
|
|
return Result.error("token校验该用户不存在");
|
|
}
|
|
}
|
|
- //银行卡四要素认证(上传验证码)
|
|
|
|
- return this.bankCardFourAuthConfirm(adminUserVO,storeMember1);
|
|
|
|
|
|
+ String yzh = storeMember1.getYzh();
|
|
|
|
+ if ("1".equals(yzh)) {
|
|
|
|
+ //银行卡四要素认证(上传验证码)
|
|
|
|
+ return this.bankCardFourAuthConfirm(adminUserVO, storeMember1);
|
|
|
|
+ } else {
|
|
|
|
+ this.saveAdminUserVO(adminUserVO, storeMember1);
|
|
|
|
+ return Result.ok("操作成功");
|
|
|
|
+ }
|
|
|
|
+
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
return Result.error("请求失败");
|
|
return Result.error("请求失败");
|
|
}
|
|
}
|
|
@@ -343,7 +400,6 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
//update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
|
//update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
|
QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.eq("phone", userPhone);
|
|
queryWrapper.eq("phone", userPhone);
|
|
- queryWrapper.eq("is_true", "1");
|
|
|
|
AdminUser storeMember1 = this.getOne(queryWrapper);
|
|
AdminUser storeMember1 = this.getOne(queryWrapper);
|
|
if (storeMember1 == null) {
|
|
if (storeMember1 == null) {
|
|
baseCommonService.addLog("用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
|
|
baseCommonService.addLog("用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
|
|
@@ -378,7 +434,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private Result<?> bankCardFourAuthConfirm(AdminUserVO adminUserVO,AdminUser adminUser) {
|
|
|
|
|
|
+ private Result<?> bankCardFourAuthConfirm(AdminUserVO adminUserVO, AdminUser adminUser) {
|
|
BankCardFourAuthConfirmRequest request = new BankCardFourAuthConfirmRequest();
|
|
BankCardFourAuthConfirmRequest request = new BankCardFourAuthConfirmRequest();
|
|
request.setCardNo(adminUserVO.getBackCard());
|
|
request.setCardNo(adminUserVO.getBackCard());
|
|
request.setIdCard(adminUserVO.getCard());
|
|
request.setIdCard(adminUserVO.getCard());
|
|
@@ -399,7 +455,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
BankCardFourAuthConfirmResponse data = response.getData();
|
|
BankCardFourAuthConfirmResponse data = response.getData();
|
|
baseCommonService.addLog("银行卡四要素认证(上传验证码)请求的唯一标识request-id: " + requestId, CommonConstant.LOG_TYPE_2, 2);
|
|
baseCommonService.addLog("银行卡四要素认证(上传验证码)请求的唯一标识request-id: " + requestId, CommonConstant.LOG_TYPE_2, 2);
|
|
System.out.println("请求成功:" + data);
|
|
System.out.println("请求成功:" + data);
|
|
- this.saveAdminUserVO(adminUserVO,adminUser);
|
|
|
|
|
|
+ this.saveAdminUserVO(adminUserVO, adminUser);
|
|
return Result.ok("请求成功:" + data);
|
|
return Result.ok("请求成功:" + data);
|
|
|
|
|
|
} else {
|
|
} else {
|
|
@@ -413,15 +469,15 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public void saveAdminUserVO(AdminUserVO adminUserVO,AdminUser adminUser) {
|
|
|
|
|
|
+ public void saveAdminUserVO(AdminUserVO adminUserVO, AdminUser adminUser) {
|
|
|
|
|
|
String sysOrgCode = adminUser.getSysOrgCode();
|
|
String sysOrgCode = adminUser.getSysOrgCode();
|
|
|
|
|
|
QueryWrapper<AdminUser> adminUserQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<AdminUser> adminUserQueryWrapper = new QueryWrapper<>();
|
|
- adminUserQueryWrapper.eq("phone",adminUser.getPhone());
|
|
|
|
- adminUserQueryWrapper.eq("sys_org_code",sysOrgCode);
|
|
|
|
|
|
+ adminUserQueryWrapper.eq("phone", adminUser.getPhone());
|
|
|
|
+ adminUserQueryWrapper.eq("sys_org_code", sysOrgCode);
|
|
AdminUser one = adminUserService.getOne(adminUserQueryWrapper);
|
|
AdminUser one = adminUserService.getOne(adminUserQueryWrapper);
|
|
- if (null!=one){
|
|
|
|
|
|
+ if (null != one) {
|
|
one.setCard(adminUserVO.getCard());
|
|
one.setCard(adminUserVO.getCard());
|
|
one.setCardholderName(adminUserVO.getName());
|
|
one.setCardholderName(adminUserVO.getName());
|
|
one.setBackCard(adminUserVO.getBackCard());
|
|
one.setBackCard(adminUserVO.getBackCard());
|
|
@@ -437,6 +493,4 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|