|
|
@@ -17,6 +17,7 @@ import com.tianhu.system.api.model.LoginUser;
|
|
|
import com.tianhu.system.companyAuth.service.IOwnAuthService;
|
|
|
import com.tianhu.system.domain.*;
|
|
|
import com.tianhu.system.service.*;
|
|
|
+import com.tianhu.system.utils.FlowableService;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -116,6 +117,8 @@ public class OwnAuthController extends BaseController {
|
|
|
* CFCA证件类型(小额打款认证)
|
|
|
*/
|
|
|
private String TYPECODE = "0";
|
|
|
+ @Autowired
|
|
|
+ private FlowableService flowableService;
|
|
|
/**
|
|
|
* 新增企业认证
|
|
|
*
|
|
|
@@ -249,7 +252,10 @@ public class OwnAuthController extends BaseController {
|
|
|
SysCompany.setScyAppendixFile(qtfjList.get(0).get("uid"));
|
|
|
}
|
|
|
//运营商三要素
|
|
|
- JSONObject operatorAuth =null;
|
|
|
+ JSONObject operatorAuth = null;
|
|
|
+ /*JSONObject operatorAuth = new JSONObject();
|
|
|
+ operatorAuth.put("Message", "SUCCESS");
|
|
|
+ operatorAuth.put("Verification", "20");*/
|
|
|
if(CommonUtil.isNotEmpty(handler)){
|
|
|
operatorAuth= CfcaUtil.operatorAuth(ISPRO, INSTITUTIONID, review, IDENTIFICATIONTYPE, handlerCard, phoneNumber, zbiRemark);
|
|
|
}else{
|
|
|
@@ -265,6 +271,9 @@ public class OwnAuthController extends BaseController {
|
|
|
}
|
|
|
//工商四要素
|
|
|
JSONObject companyAuth = CfcaUtil.companyAuth(ISPRO, INSTITUTIONID, scyName, scySocialCode, scyLegal, IDENTIFICATIONTYPE, scyLegalId, zbiRemark);
|
|
|
+ /*JSONObject companyAuth = new JSONObject();
|
|
|
+ companyAuth.put("Message", "SUCCESS");
|
|
|
+ companyAuth.put("Verification", "20");*/
|
|
|
System.out.print("工商四要素结果==========>" + companyAuth);
|
|
|
//状态(00:正常, 01:停用, 02:待四要素认证(认证中), 03:待对公户认证(认证中), 04:待实名审核(认证中), 99:删除)
|
|
|
SysCompany.setScyStatus("03");
|
|
|
@@ -285,6 +294,7 @@ public class OwnAuthController extends BaseController {
|
|
|
SysCompany.setCreateTime(currentTime);
|
|
|
sysCompanyService.createSysCompany(SysCompany);
|
|
|
//创建部门
|
|
|
+ String alternateNumber = IdUtils.fastSimpleUUID();
|
|
|
SysDept dept = new SysDept();
|
|
|
dept.setCompanyId(scyId);
|
|
|
dept.setDeptName(scyName);
|
|
|
@@ -292,6 +302,7 @@ public class OwnAuthController extends BaseController {
|
|
|
dept.setAncestors(defaultAn);
|
|
|
dept.setOrderNum(defaultOrder);
|
|
|
dept.setCreateBy(use.getUserId()+"");
|
|
|
+ dept.setAlternateNumber(alternateNumber);
|
|
|
deptService.insertDept(dept);
|
|
|
List<SysDept> deptList= deptService.selectDeptList(dept);
|
|
|
//部门id
|
|
|
@@ -334,9 +345,10 @@ public class OwnAuthController extends BaseController {
|
|
|
userService.insertUserRole(listUser);
|
|
|
}
|
|
|
SysUser listUserTwo = userService.selectUserByUserName(phoneNumber);
|
|
|
+ SysUser listUsers = null;
|
|
|
//创建其他和管理员
|
|
|
if(CommonUtil.isNotEmpty(operator)&&CommonUtil.isNotEmpty(number)){
|
|
|
- SysUser listUsers = userService.selectUserByUserName(number);
|
|
|
+ listUsers = userService.selectUserByUserName(number);
|
|
|
if(listUsers == null) {
|
|
|
SysUser user = new SysUser();
|
|
|
user.setUserName(number);
|
|
|
@@ -393,6 +405,45 @@ public class OwnAuthController extends BaseController {
|
|
|
sysUserCompanyRelService.updateSysUserCompanyRel(sysUserCompanyRel);
|
|
|
//返回企业信息
|
|
|
SysCompany company = sysCompanyService.getById(scyId);
|
|
|
+
|
|
|
+ // 审批增加分组
|
|
|
+ Map<String, Object> flowableRes = flowableService.addFlowableGroup(scyId, company.getScyName());
|
|
|
+ if (!"200".equals(flowableRes.get("code"))) {
|
|
|
+ throw new Exception("审批数据新增失败!");
|
|
|
+ }
|
|
|
+ flowableRes = flowableService.addFlowableGroup(alternateNumber, dept.getDeptName());
|
|
|
+ if (!"200".equals(flowableRes.get("code"))) {
|
|
|
+ throw new Exception("审批数据新增失败!");
|
|
|
+ }
|
|
|
+ // 经办人与登录用户是同一手机号
|
|
|
+ if (use.getUserName().equals(phoneNumber)) {
|
|
|
+ flowableRes = flowableService.addFlowableUser(String.valueOf(use.getUserId()), use.getNickName(), scyId);
|
|
|
+ if (!"200".equals(flowableRes.get("code"))) {
|
|
|
+ throw new Exception("审批数据新增失败!");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ flowableRes = flowableService.addFlowableUser(String.valueOf(use.getUserId()), use.getNickName(), scyId);
|
|
|
+ if (!"200".equals(flowableRes.get("code"))) {
|
|
|
+ throw new Exception("审批数据新增失败!");
|
|
|
+ }
|
|
|
+ // 经办人不存在
|
|
|
+ if(listUser == null){
|
|
|
+ listUser = userService.selectUserByUserName(phoneNumber);
|
|
|
+ }
|
|
|
+ flowableRes = flowableService.addFlowableUser(String.valueOf(listUser.getUserId()), listUser.getNickName(), scyId);
|
|
|
+ if (!"200".equals(flowableRes.get("code"))) {
|
|
|
+ throw new Exception("审批数据新增失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 业务人员不存在
|
|
|
+ if (CommonUtil.isNotEmpty(operator) && CommonUtil.isNotEmpty(number) && listUsers == null) {
|
|
|
+ listUsers = userService.selectUserByUserName(number);
|
|
|
+ flowableRes = flowableService.addFlowableUser(String.valueOf(listUsers.getUserId()), listUsers.getNickName(), scyId);
|
|
|
+ if (!"200".equals(flowableRes.get("code"))) {
|
|
|
+ throw new Exception("审批数据新增失败!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return R.ok(company);
|
|
|
}
|
|
|
|
|
|
@@ -493,6 +544,10 @@ public class OwnAuthController extends BaseController {
|
|
|
}else{
|
|
|
//企业打款申请
|
|
|
JSONObject operatorAuth = CfcaUtil.paymentApply(ISPRO, INSTITUTIONID, pbaiAccountName, pbaiBankaccountId,list.get(0).getZcbiBankNo(),zbiRemark);
|
|
|
+ /*JSONObject operatorAuth = new JSONObject();
|
|
|
+ operatorAuth.put("Message", "SUCCESS");
|
|
|
+ operatorAuth.put("Status", "20");
|
|
|
+ operatorAuth.put("TxSN", "100000001");*/
|
|
|
System.out.print("绑定对公户返回结果==========>" + operatorAuth);
|
|
|
String TxSN = operatorAuth.getString("TxSN");
|
|
|
if("SUCCESS".equals(operatorAuth.getString("Message"))){
|
|
|
@@ -554,6 +609,9 @@ public class OwnAuthController extends BaseController {
|
|
|
String zbiRemark = CommonUtil.objToString(map.get("zbiRemark"));
|
|
|
//打款验证
|
|
|
JSONObject operatorAuth = CfcaUtil.paymentAuth(ISPRO, INSTITUTIONID, bankAcc.get(0).getPbaiCfcaNo(), amount, zbiRemark);
|
|
|
+ /*JSONObject operatorAuth = new JSONObject();
|
|
|
+ operatorAuth.put("Message", "SUCCESS");
|
|
|
+ operatorAuth.put("Verification", "20");*/
|
|
|
System.out.print("打款认证结果==========>" + operatorAuth);
|
|
|
if (!"交易异常[已验证通过,不能重复验证]".equals(operatorAuth.getString("Message"))) {
|
|
|
//校验已通过
|
|
|
@@ -590,6 +648,9 @@ public class OwnAuthController extends BaseController {
|
|
|
String phone = CommonUtil.objToString(map.get("phone"));
|
|
|
//发送短信验证码
|
|
|
JSONObject operatorAuth = CfcaUtil.sendSmsCode(ISPRO, INSTITUTIONID,null,phone,null);
|
|
|
+ /*JSONObject operatorAuth = new JSONObject();
|
|
|
+ operatorAuth.put("Message", "SUCCESS");
|
|
|
+ operatorAuth.put("Status", "20");*/
|
|
|
System.out.print("发送短信验证码结果==========>" + operatorAuth);
|
|
|
if("SUCCESS".equals(operatorAuth.getString("Message"))){
|
|
|
if(!"20".equals(operatorAuth.getString("Status"))){
|
|
|
@@ -634,6 +695,9 @@ public class OwnAuthController extends BaseController {
|
|
|
String code = CommonUtil.objToString(map.get("code"));
|
|
|
//企业打款申请
|
|
|
JSONObject operatorAuth = CfcaUtil.checkSmsCode(ISPRO, INSTITUTIONID,phone,code,null);
|
|
|
+ /*JSONObject operatorAuth = new JSONObject();
|
|
|
+ operatorAuth.put("Message", "SUCCESS");
|
|
|
+ operatorAuth.put("Verification", "20");*/
|
|
|
System.out.print("短信验证码验证结果==========>" + operatorAuth);
|
|
|
if("SUCCESS".equals(operatorAuth.getString("Message"))){
|
|
|
if(!"20".equals(operatorAuth.getString("Verification"))){
|