|
@@ -11,6 +11,8 @@ import com.tianhu.common.core.domain.R;
|
|
|
import com.tianhu.common.core.exception.BaseException;
|
|
import com.tianhu.common.core.exception.BaseException;
|
|
|
import com.tianhu.common.core.utils.*;
|
|
import com.tianhu.common.core.utils.*;
|
|
|
import com.tianhu.common.core.web.controller.BaseController;
|
|
import com.tianhu.common.core.web.controller.BaseController;
|
|
|
|
|
+import com.tianhu.common.log.annotation.Log;
|
|
|
|
|
+import com.tianhu.common.log.enums.BusinessType;
|
|
|
import com.tianhu.common.redis.service.RedisService;
|
|
import com.tianhu.common.redis.service.RedisService;
|
|
|
import com.tianhu.common.security.service.TokenService;
|
|
import com.tianhu.common.security.service.TokenService;
|
|
|
import com.tianhu.system.api.RemoteFileService;
|
|
import com.tianhu.system.api.RemoteFileService;
|
|
@@ -24,6 +26,7 @@ import com.tianhu.system.domain.*;
|
|
|
import com.tianhu.system.mapper.SysRoleMapper;
|
|
import com.tianhu.system.mapper.SysRoleMapper;
|
|
|
import com.tianhu.system.service.*;
|
|
import com.tianhu.system.service.*;
|
|
|
import com.tianhu.system.utils.FlowableService;
|
|
import com.tianhu.system.utils.FlowableService;
|
|
|
|
|
+import com.tianhu.system.utils.RegularUtil;
|
|
|
import com.tianhu.system.utils.SysConstant;
|
|
import com.tianhu.system.utils.SysConstant;
|
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -170,6 +173,7 @@ public class OwnAuthController extends BaseController {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/add")
|
|
@PostMapping("/add")
|
|
|
|
|
+ @Log(title = "企业认证", businessType = BusinessType.INSERT)
|
|
|
@Transactional(rollbackFor=Exception.class)
|
|
@Transactional(rollbackFor=Exception.class)
|
|
|
public R add(@RequestBody Map<String,Object> map) throws Exception {
|
|
public R add(@RequestBody Map<String,Object> map) throws Exception {
|
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
@@ -221,6 +225,9 @@ public class OwnAuthController extends BaseController {
|
|
|
if(CommonUtil.isEmpty(scyPhone)){
|
|
if(CommonUtil.isEmpty(scyPhone)){
|
|
|
return R.fail("企业电话不能为空");
|
|
return R.fail("企业电话不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
+ if(!RegularUtil.phone(scyPhone)&&!RegularUtil.landline(scyPhone)){
|
|
|
|
|
+ throw new Exception("企业电话格式错误!");
|
|
|
|
|
+ }
|
|
|
//法人姓名
|
|
//法人姓名
|
|
|
String scyLegal = CommonUtil.objToString(map.get("scyLegal"));
|
|
String scyLegal = CommonUtil.objToString(map.get("scyLegal"));
|
|
|
if(CommonUtil.isEmpty(scyLegal)){
|
|
if(CommonUtil.isEmpty(scyLegal)){
|
|
@@ -231,12 +238,38 @@ public class OwnAuthController extends BaseController {
|
|
|
if(CommonUtil.isEmpty(scyLegalId)){
|
|
if(CommonUtil.isEmpty(scyLegalId)){
|
|
|
return R.fail("法人证件号码不能为空");
|
|
return R.fail("法人证件号码不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
+ if(!RegularUtil.isPositive(scyLegalId)){
|
|
|
|
|
+ throw new Exception("法人证件号码格式错误!");
|
|
|
|
|
+ }
|
|
|
//经办人姓名
|
|
//经办人姓名
|
|
|
- String handler = CommonUtil.objToString(map.get("handler"));
|
|
|
|
|
|
|
+ String handler = null;
|
|
|
|
|
+ //是否法人亲办
|
|
|
|
|
+ if("1".equals(CommonUtil.objToString(map.get("legalHandle")))){
|
|
|
|
|
+ handler = CommonUtil.objToString(map.get("handler"));
|
|
|
|
|
+ if(CommonUtil.isEmpty(scyLegalId)){
|
|
|
|
|
+ return R.fail("经办人名称不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
//经办人身份证号
|
|
//经办人身份证号
|
|
|
- String handlerCard =CommonUtil.objToString(map.get("handlerCard"));
|
|
|
|
|
|
|
+ String handlerCard = null;
|
|
|
|
|
+ //是否法人亲办
|
|
|
|
|
+ if("1".equals(CommonUtil.objToString(map.get("legalHandle")))){
|
|
|
|
|
+ handlerCard = CommonUtil.objToString(map.get("handlerCard"));
|
|
|
|
|
+ if(CommonUtil.isEmpty(handlerCard)){
|
|
|
|
|
+ return R.fail("经办人身份证不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!RegularUtil.isPositive(handlerCard)){
|
|
|
|
|
+ throw new Exception("法人证件号码格式错误!");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
//经办人手机号
|
|
//经办人手机号
|
|
|
String phoneNumber =CommonUtil.objToString(map.get("phone"));
|
|
String phoneNumber =CommonUtil.objToString(map.get("phone"));
|
|
|
|
|
+ if(CommonUtil.isEmpty(phoneNumber)){
|
|
|
|
|
+ return R.fail("经办人手机号不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!RegularUtil.phone(phoneNumber)){
|
|
|
|
|
+ throw new Exception("经办人电话格式错误!");
|
|
|
|
|
+ }
|
|
|
//其他操作员
|
|
//其他操作员
|
|
|
String operator =CommonUtil.objToString(map.get("operator"));
|
|
String operator =CommonUtil.objToString(map.get("operator"));
|
|
|
//其他操作员手机号
|
|
//其他操作员手机号
|
|
@@ -245,14 +278,32 @@ public class OwnAuthController extends BaseController {
|
|
|
String zbiRemark = CommonUtil.objToString(map.get("zbiRemark"));
|
|
String zbiRemark = CommonUtil.objToString(map.get("zbiRemark"));
|
|
|
//营业执照
|
|
//营业执照
|
|
|
String scyLicenseFile =CommonUtil.objToString(map.get("scyLicenseFile"));
|
|
String scyLicenseFile =CommonUtil.objToString(map.get("scyLicenseFile"));
|
|
|
- //法人身份证正面
|
|
|
|
|
|
|
+ //法人身份证人像面
|
|
|
String fsfzzList =CommonUtil.objToString(map.get("fsfzzList"));
|
|
String fsfzzList =CommonUtil.objToString(map.get("fsfzzList"));
|
|
|
- //法人身份证反面
|
|
|
|
|
|
|
+ if(CommonUtil.isEmpty(fsfzzList)){
|
|
|
|
|
+ return R.fail("法人身份证人像面不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ //法人身份证国徽
|
|
|
List<Map<String,String>> fsfzfList = (List<Map<String, String>>) map.get("fsfzfList");
|
|
List<Map<String,String>> fsfzfList = (List<Map<String, String>>) map.get("fsfzfList");
|
|
|
- //经办人身份证正面
|
|
|
|
|
- String jsfzzList =CommonUtil.objToString(map.get("jsfzzList"));
|
|
|
|
|
- //经办人身份证反面
|
|
|
|
|
- List<Map<String,String>> jsfzfList = (List<Map<String, String>>) map.get("jsfzfList");
|
|
|
|
|
|
|
+ if(fsfzfList.size()==0){
|
|
|
|
|
+ return R.fail("法人身份证国徽面不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ String jsfzzList =null;
|
|
|
|
|
+ List<Map<String, String>> jsfzfList =null;
|
|
|
|
|
+ //经办人身份证人像面
|
|
|
|
|
+ jsfzzList = CommonUtil.objToString(map.get("jsfzzList"));
|
|
|
|
|
+ if("1".equals(CommonUtil.objToString(map.get("legalHandle")))) {
|
|
|
|
|
+ if(CommonUtil.isEmpty(jsfzzList)){
|
|
|
|
|
+ return R.fail("经办人身份证人像面不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //经办人身份证国徽面
|
|
|
|
|
+ jsfzfList = (List<Map<String, String>>) map.get("jsfzfList");
|
|
|
|
|
+ if("1".equals(CommonUtil.objToString(map.get("legalHandle")))) {
|
|
|
|
|
+ if(jsfzfList.size()==0){
|
|
|
|
|
+ return R.fail("经办人身份证国徽面不能为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
//法人授权书
|
|
//法人授权书
|
|
|
List<Map<String,String>> frsqsList = (List<Map<String, String>>) map.get("frsqsList");
|
|
List<Map<String,String>> frsqsList = (List<Map<String, String>>) map.get("frsqsList");
|
|
|
//数字证书授权
|
|
//数字证书授权
|
|
@@ -295,7 +346,7 @@ public class OwnAuthController extends BaseController {
|
|
|
/*JSONObject operatorAuth = new JSONObject();
|
|
/*JSONObject operatorAuth = new JSONObject();
|
|
|
operatorAuth.put("Message", "SUCCESS");
|
|
operatorAuth.put("Message", "SUCCESS");
|
|
|
operatorAuth.put("Verification", "20");*/
|
|
operatorAuth.put("Verification", "20");*/
|
|
|
- if(CommonUtil.isNotEmpty(handler)){
|
|
|
|
|
|
|
+ if("1".equals(CommonUtil.objToString(map.get("legalHandle")))){
|
|
|
operatorAuth= CfcaUtil.operatorAuth(ISPRO, INSTITUTIONID, handler, IDENTIFICATIONTYPE, handlerCard, phoneNumber, zbiRemark);
|
|
operatorAuth= CfcaUtil.operatorAuth(ISPRO, INSTITUTIONID, handler, IDENTIFICATIONTYPE, handlerCard, phoneNumber, zbiRemark);
|
|
|
}else{
|
|
}else{
|
|
|
operatorAuth= CfcaUtil.operatorAuth(ISPRO, INSTITUTIONID, scyLegal, IDENTIFICATIONTYPE, scyLegalId, phoneNumber, zbiRemark);
|
|
operatorAuth= CfcaUtil.operatorAuth(ISPRO, INSTITUTIONID, scyLegal, IDENTIFICATIONTYPE, scyLegalId, phoneNumber, zbiRemark);
|
|
@@ -406,7 +457,7 @@ public class OwnAuthController extends BaseController {
|
|
|
// 修改用户数据
|
|
// 修改用户数据
|
|
|
OwnSysUser sysUser = new OwnSysUser();
|
|
OwnSysUser sysUser = new OwnSysUser();
|
|
|
sysUser.setUserId(String.valueOf(use.getUserId()));
|
|
sysUser.setUserId(String.valueOf(use.getUserId()));
|
|
|
- if(CommonUtil.isNotEmpty(handler)){
|
|
|
|
|
|
|
+ if("1".equals(CommonUtil.objToString(map.get("legalHandle")))){
|
|
|
sysUser.setNickName(handler);
|
|
sysUser.setNickName(handler);
|
|
|
}else{
|
|
}else{
|
|
|
sysUser.setNickName(scyLegal);
|
|
sysUser.setNickName(scyLegal);
|
|
@@ -419,7 +470,7 @@ public class OwnAuthController extends BaseController {
|
|
|
sysUserCompanyRel.setSucrUserId(use.getUserId());
|
|
sysUserCompanyRel.setSucrUserId(use.getUserId());
|
|
|
sysUserCompanyRel.setSucrDeptId(deptId);
|
|
sysUserCompanyRel.setSucrDeptId(deptId);
|
|
|
sysUserCompanyRel.setSucrHandler("1");
|
|
sysUserCompanyRel.setSucrHandler("1");
|
|
|
- if(CommonUtil.isNotEmpty(handlerCard)){
|
|
|
|
|
|
|
+ if("1".equals(CommonUtil.objToString(map.get("legalHandle")))){
|
|
|
sysUserCompanyRel.setSucrCard(handlerCard);
|
|
sysUserCompanyRel.setSucrCard(handlerCard);
|
|
|
}else{
|
|
}else{
|
|
|
sysUserCompanyRel.setSucrCard(scyLegalId);
|
|
sysUserCompanyRel.setSucrCard(scyLegalId);
|
|
@@ -437,7 +488,7 @@ public class OwnAuthController extends BaseController {
|
|
|
if(handlerUser == null){
|
|
if(handlerUser == null){
|
|
|
SysUser sysUser = new SysUser();
|
|
SysUser sysUser = new SysUser();
|
|
|
sysUser.setUserName(phoneNumber);
|
|
sysUser.setUserName(phoneNumber);
|
|
|
- if(CommonUtil.isNotEmpty(handler)){
|
|
|
|
|
|
|
+ if("1".equals(CommonUtil.objToString(map.get("legalHandle")))){
|
|
|
sysUser.setNickName(handler);
|
|
sysUser.setNickName(handler);
|
|
|
}else{
|
|
}else{
|
|
|
sysUser.setNickName(scyLegal);
|
|
sysUser.setNickName(scyLegal);
|
|
@@ -455,7 +506,7 @@ public class OwnAuthController extends BaseController {
|
|
|
sysUserCompanyRel.setSucrUserId(handlerUser.getUserId());
|
|
sysUserCompanyRel.setSucrUserId(handlerUser.getUserId());
|
|
|
sysUserCompanyRel.setSucrDeptId(deptId);
|
|
sysUserCompanyRel.setSucrDeptId(deptId);
|
|
|
sysUserCompanyRel.setSucrHandler("1");
|
|
sysUserCompanyRel.setSucrHandler("1");
|
|
|
- if(CommonUtil.isNotEmpty(handlerCard)){
|
|
|
|
|
|
|
+ if("1".equals(CommonUtil.objToString(map.get("legalHandle")))){
|
|
|
sysUserCompanyRel.setSucrCard(handlerCard);
|
|
sysUserCompanyRel.setSucrCard(handlerCard);
|
|
|
}else{
|
|
}else{
|
|
|
sysUserCompanyRel.setSucrCard(scyLegalId);
|
|
sysUserCompanyRel.setSucrCard(scyLegalId);
|
|
@@ -470,7 +521,7 @@ public class OwnAuthController extends BaseController {
|
|
|
// TODO多公司用户名字存在不一样问题
|
|
// TODO多公司用户名字存在不一样问题
|
|
|
OwnSysUser sysUser = new OwnSysUser();
|
|
OwnSysUser sysUser = new OwnSysUser();
|
|
|
sysUser.setUserId(String.valueOf(use.getUserId()));
|
|
sysUser.setUserId(String.valueOf(use.getUserId()));
|
|
|
- if(CommonUtil.isNotEmpty(handler)){
|
|
|
|
|
|
|
+ if("1".equals(CommonUtil.objToString(map.get("legalHandle")))){
|
|
|
sysUser.setNickName(handler);
|
|
sysUser.setNickName(handler);
|
|
|
}else{
|
|
}else{
|
|
|
sysUser.setNickName(scyLegal);
|
|
sysUser.setNickName(scyLegal);
|
|
@@ -487,7 +538,7 @@ public class OwnAuthController extends BaseController {
|
|
|
sysUserCompanyRel.setSucrUserId(handlerUser.getUserId());
|
|
sysUserCompanyRel.setSucrUserId(handlerUser.getUserId());
|
|
|
sysUserCompanyRel.setSucrDeptId(deptId);
|
|
sysUserCompanyRel.setSucrDeptId(deptId);
|
|
|
sysUserCompanyRel.setSucrHandler("1");
|
|
sysUserCompanyRel.setSucrHandler("1");
|
|
|
- if(CommonUtil.isNotEmpty(handlerCard)){
|
|
|
|
|
|
|
+ if("1".equals(CommonUtil.objToString(map.get("legalHandle")))){
|
|
|
sysUserCompanyRel.setSucrCard(handlerCard);
|
|
sysUserCompanyRel.setSucrCard(handlerCard);
|
|
|
}else{
|
|
}else{
|
|
|
sysUserCompanyRel.setSucrCard(scyLegalId);
|
|
sysUserCompanyRel.setSucrCard(scyLegalId);
|
|
@@ -622,6 +673,7 @@ public class OwnAuthController extends BaseController {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/account")
|
|
@PostMapping("/account")
|
|
|
|
|
+ @Log(title = "绑定对公户", businessType = BusinessType.INSERT)
|
|
|
public R account(@RequestBody Map<String,Object> map) throws Exception {
|
|
public R account(@RequestBody Map<String,Object> map) throws Exception {
|
|
|
//获取登录用户
|
|
//获取登录用户
|
|
|
LoginUser user = tokenService.getLoginUser();
|
|
LoginUser user = tokenService.getLoginUser();
|
|
@@ -631,8 +683,17 @@ public class OwnAuthController extends BaseController {
|
|
|
String pbaiAccountName = CommonUtil.objToString(map.get("scyName"));
|
|
String pbaiAccountName = CommonUtil.objToString(map.get("scyName"));
|
|
|
//银行卡号
|
|
//银行卡号
|
|
|
String pbaiBankaccountId = CommonUtil.objToString(map.get("pbaiBankaccountId"));
|
|
String pbaiBankaccountId = CommonUtil.objToString(map.get("pbaiBankaccountId"));
|
|
|
|
|
+ if(CommonUtil.isEmpty(pbaiBankaccountId)){
|
|
|
|
|
+ throw new Exception("银行卡号不能为空!");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!RegularUtil.isPositive(pbaiBankaccountId)){
|
|
|
|
|
+ throw new Exception("请输入正确的银行卡号!");
|
|
|
|
|
+ }
|
|
|
//所属银行
|
|
//所属银行
|
|
|
String pbaiBankName = CommonUtil.objToString(map.get("pbaiBankName"));
|
|
String pbaiBankName = CommonUtil.objToString(map.get("pbaiBankName"));
|
|
|
|
|
+ if(CommonUtil.isEmpty(pbaiBankName)){
|
|
|
|
|
+ throw new Exception("所属银行不能为空!");
|
|
|
|
|
+ }
|
|
|
//备注
|
|
//备注
|
|
|
String zbiRemark = CommonUtil.objToString(map.get("zbiRemark"));
|
|
String zbiRemark = CommonUtil.objToString(map.get("zbiRemark"));
|
|
|
//查询银行行号
|
|
//查询银行行号
|
|
@@ -700,6 +761,7 @@ public class OwnAuthController extends BaseController {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/payment")
|
|
@PostMapping("/payment")
|
|
|
|
|
+ @Log(title = "打款验证", businessType = BusinessType.UPDATE)
|
|
|
public R payment(@RequestBody Map<String,Object> map) throws Exception {
|
|
public R payment(@RequestBody Map<String,Object> map) throws Exception {
|
|
|
//获取登录用户
|
|
//获取登录用户
|
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
LoginUser userInfo = tokenService.getLoginUser();
|
|
@@ -722,12 +784,20 @@ public class OwnAuthController extends BaseController {
|
|
|
if(bankAcc.size()==0){
|
|
if(bankAcc.size()==0){
|
|
|
return R.fail("所属账号不存在");
|
|
return R.fail("所属账号不存在");
|
|
|
}
|
|
}
|
|
|
- //金额(分)
|
|
|
|
|
|
|
+ //金额(元)
|
|
|
String amount = CommonUtil.objToString(map.get("amount"));
|
|
String amount = CommonUtil.objToString(map.get("amount"));
|
|
|
|
|
+ if(!RegularUtil.isPositive(amount)){
|
|
|
|
|
+ throw new Exception("请输入正确的金额!");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(1.00<Double.valueOf(amount)){
|
|
|
|
|
+ throw new Exception("校验金额不能大于一元!");
|
|
|
|
|
+ }
|
|
|
|
|
+ String strs = amount.substring(2, 4);
|
|
|
|
|
+
|
|
|
//备注
|
|
//备注
|
|
|
String zbiRemark = CommonUtil.objToString(map.get("zbiRemark"));
|
|
String zbiRemark = CommonUtil.objToString(map.get("zbiRemark"));
|
|
|
//打款验证
|
|
//打款验证
|
|
|
- JSONObject operatorAuth = CfcaUtil.paymentAuth(ISPRO, INSTITUTIONID, bankAcc.get(0).getPbaiCfcaNo(), amount, zbiRemark);
|
|
|
|
|
|
|
+ JSONObject operatorAuth = CfcaUtil.paymentAuth(ISPRO, INSTITUTIONID, bankAcc.get(0).getPbaiCfcaNo(), strs, zbiRemark);
|
|
|
/*JSONObject operatorAuth = new JSONObject();
|
|
/*JSONObject operatorAuth = new JSONObject();
|
|
|
operatorAuth.put("Message", "SUCCESS");
|
|
operatorAuth.put("Message", "SUCCESS");
|
|
|
operatorAuth.put("Verification", "20");*/
|
|
operatorAuth.put("Verification", "20");*/
|
|
@@ -787,6 +857,7 @@ public class OwnAuthController extends BaseController {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/verification")
|
|
@PostMapping("/verification")
|
|
|
|
|
+ @Log(title = "企业认证修改", businessType = BusinessType.UPDATE)
|
|
|
public R verification(@RequestBody Map<String,Object> map, HttpServletRequest request) throws Exception {
|
|
public R verification(@RequestBody Map<String,Object> map, HttpServletRequest request) throws Exception {
|
|
|
//获取登录用户
|
|
//获取登录用户
|
|
|
LoginUser loginUser = tokenService.getLoginUser();
|
|
LoginUser loginUser = tokenService.getLoginUser();
|
|
@@ -927,7 +998,7 @@ public class OwnAuthController extends BaseController {
|
|
|
LambdaQueryWrapper<ZcCfcaBankInf> bank = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ZcCfcaBankInf> bank = new LambdaQueryWrapper<>();
|
|
|
//所属银行
|
|
//所属银行
|
|
|
if(CommonUtil.isNotEmpty(pbaiBankName)){
|
|
if(CommonUtil.isNotEmpty(pbaiBankName)){
|
|
|
- bank.eq(ZcCfcaBankInf::getZcbiBankName,pbaiBankName);
|
|
|
|
|
|
|
+ bank.like(ZcCfcaBankInf::getZcbiBankName,pbaiBankName);
|
|
|
}
|
|
}
|
|
|
List<ZcCfcaBankInf> bankAcc = zcCfcaBankInfService.findZcCfcaBankInfs(bank);
|
|
List<ZcCfcaBankInf> bankAcc = zcCfcaBankInfService.findZcCfcaBankInfs(bank);
|
|
|
return R.ok(bankAcc);
|
|
return R.ok(bankAcc);
|