|
@@ -27,6 +27,7 @@ import com.tianhu.system.mapper.SysProductMenuMapper;
|
|
|
import com.tianhu.system.mapper.SysRoleMapper;
|
|
|
import com.tianhu.system.mapper.SysRoleMenuMapper;
|
|
|
import com.tianhu.system.service.*;
|
|
|
+import com.tianhu.system.service.impl.SysUserServiceImpl;
|
|
|
import com.tianhu.system.utils.FlowableService;
|
|
|
import com.tianhu.system.utils.RegularUtil;
|
|
|
import com.tianhu.system.utils.SysConstant;
|
|
@@ -42,6 +43,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.io.IOException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
@@ -74,6 +76,8 @@ public class OwnAuthController extends BaseController {
|
|
|
@Autowired
|
|
|
private IOwnCompanyService companyService;
|
|
|
@Autowired
|
|
|
+ private IOwnSysUserService ownSysUserService;
|
|
|
+ @Autowired
|
|
|
private ISysDeptService deptService;
|
|
|
@Autowired
|
|
|
private ISysRoleService roleService;
|
|
@@ -84,6 +88,8 @@ public class OwnAuthController extends BaseController {
|
|
|
@Autowired
|
|
|
private ISysConfigService configService;
|
|
|
@Autowired
|
|
|
+ private SysRoleMenuMapper roleMenuMapper;
|
|
|
+ @Autowired
|
|
|
private SysProductMenuMapper productMenuMapper;
|
|
|
@Autowired
|
|
|
private RemoteFileService remoteFileService;
|
|
@@ -246,7 +252,7 @@ public class OwnAuthController extends BaseController {
|
|
|
String handler = null;
|
|
|
//是否法人亲办
|
|
|
if("1".equals(CommonUtil.objToString(map.get("legalHandle")))){
|
|
|
- handler = CommonUtil.objToString(map.get("handler"));
|
|
|
+ handler = CommonUtil.objToString(map.get("handler"));
|
|
|
if(CommonUtil.isEmpty(scyLegalId)){
|
|
|
return R.fail("经办人名称不能为空");
|
|
|
}
|
|
@@ -363,29 +369,29 @@ public class OwnAuthController extends BaseController {
|
|
|
//获取社会统一信用代码前两位
|
|
|
String scySocial = scySocialCode.substring(0, 2);
|
|
|
if("91".equals(scySocial)||"92".equals(scySocial)||"93".equals(scySocial)){
|
|
|
- //工商四要素
|
|
|
- JSONObject companyAuth = CfcaUtil.companyAuth(ISPRO, INSTITUTIONID, scyName, scySocialCode, scyLegal, IDENTIFICATIONTYPE, scyLegalId, zbiRemark);
|
|
|
+ //工商四要素
|
|
|
+ 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");
|
|
|
- //四要素认证状态(00:未认证, 01:认证通过, 02:认证未通过, 03:人工审批通过, 04:人工审批不通过)
|
|
|
- if("SUCCESS".equals(operatorAuth.getString("Message"))){
|
|
|
- if(!"20".equals(operatorAuth.getString("Verification"))){
|
|
|
- SysCompany.setScyAuthStatus("02");
|
|
|
+ System.out.print("工商四要素结果==========>" + companyAuth);
|
|
|
+ //状态(00:正常, 01:停用, 02:待四要素认证(认证中), 03:待对公户认证(认证中), 04:待实名审核(认证中), 99:删除)
|
|
|
+ SysCompany.setScyStatus("03");
|
|
|
+ //四要素认证状态(00:未认证, 01:认证通过, 02:认证未通过, 03:人工审批通过, 04:人工审批不通过)
|
|
|
+ if("SUCCESS".equals(operatorAuth.getString("Message"))){
|
|
|
+ if(!"20".equals(operatorAuth.getString("Verification"))){
|
|
|
+ SysCompany.setScyAuthStatus("02");
|
|
|
+ }else{
|
|
|
+ SysCompany.setScyAuthStatus("01");
|
|
|
+ };
|
|
|
}else{
|
|
|
- SysCompany.setScyAuthStatus("01");
|
|
|
- };
|
|
|
- }else{
|
|
|
- SysCompany.setScyAuthStatus("02");
|
|
|
- }
|
|
|
+ SysCompany.setScyAuthStatus("02");
|
|
|
+ }
|
|
|
}else{
|
|
|
//企查查
|
|
|
JSONObject BasicDetailsByName = QccCommonUtil.getBasicDetailsByName(KEY,SECRETKEY,scySocialCode);
|
|
|
//
|
|
|
- String status =BasicDetailsByName.getString("Status");
|
|
|
+ String status =BasicDetailsByName.getString("Status");
|
|
|
if("200".equals(status)){
|
|
|
String name =BasicDetailsByName.getJSONObject("Result").getString("Name");
|
|
|
if(!scyName.equals(name)){
|
|
@@ -404,7 +410,7 @@ public class OwnAuthController extends BaseController {
|
|
|
} else {
|
|
|
sysCompanyService.updateSysCompany(SysCompany);
|
|
|
}
|
|
|
- SysCompany companyServices = sysCompanyService.getById(scyId);
|
|
|
+ SysCompany companyServices = sysCompanyService.getById(scyId);
|
|
|
if("01".equals(companyServices.getScyType())&&(CommonUtil.isEmpty(operator)||CommonUtil.isEmpty(number))){
|
|
|
throw new Exception("核心企业请填写其他管理员!");
|
|
|
}
|
|
@@ -417,7 +423,7 @@ public class OwnAuthController extends BaseController {
|
|
|
dept.setDeptName(scyName);
|
|
|
dept.setDeptId(deptList.get(0).getDeptId());
|
|
|
deptService.updateDept(dept);
|
|
|
- // 创建部门
|
|
|
+ // 创建部门
|
|
|
} else {
|
|
|
String alternateNumber = IdUtils.fastSimpleUUID();
|
|
|
dept.setAlternateNumber(alternateNumber);
|
|
@@ -483,7 +489,7 @@ public class OwnAuthController extends BaseController {
|
|
|
sysUserCompanyRel.setSucrCardBackFile(jsfzfList.get(0).get("uid"));
|
|
|
}
|
|
|
sysUserCompanyRelService.saveOrUpdate(sysUserCompanyRel);
|
|
|
- // 经办人与登录用户不是同一手机号
|
|
|
+ // 经办人与登录用户不是同一手机号
|
|
|
} else {
|
|
|
// 经办人手机号是否存在
|
|
|
handlerUser = userService.selectUserByUserName(phoneNumber);
|
|
@@ -519,7 +525,7 @@ public class OwnAuthController extends BaseController {
|
|
|
sysUserCompanyRel.setSucrCardBackFile(jsfzfList.get(0).get("uid"));
|
|
|
}
|
|
|
sysUserCompanyRelService.saveOrUpdate(sysUserCompanyRel);
|
|
|
- // 经办人不存在
|
|
|
+ // 经办人不存在
|
|
|
} else {
|
|
|
// TODO多公司用户名字存在不一样问题
|
|
|
OwnSysUser sysUser = new OwnSysUser();
|
|
@@ -656,15 +662,15 @@ public class OwnAuthController extends BaseController {
|
|
|
public R getCardPositive(MultipartFile file,String fileType) {
|
|
|
//获取企业信息
|
|
|
Map map = ownAuthService.getCardPositive(file,fileType);
|
|
|
- //获取上传文件token
|
|
|
- String token = SecurityUtils.getToken(ServletUtils.getRequest());
|
|
|
- //文件传输
|
|
|
- R<PubFileInf> fileResult = remoteFileService.uploadFile(file,"01","04","00", "", token);
|
|
|
- if("00".equals(fileType)){
|
|
|
- map.put("fsfzzList",fileResult.getData().getPfiFileId());
|
|
|
- }else{
|
|
|
- map.put("jsfzzList",fileResult.getData().getPfiFileId());
|
|
|
- }
|
|
|
+ //获取上传文件token
|
|
|
+ String token = SecurityUtils.getToken(ServletUtils.getRequest());
|
|
|
+ //文件传输
|
|
|
+ R<PubFileInf> fileResult = remoteFileService.uploadFile(file,"01","04","00", "", token);
|
|
|
+ if("00".equals(fileType)){
|
|
|
+ map.put("fsfzzList",fileResult.getData().getPfiFileId());
|
|
|
+ }else{
|
|
|
+ map.put("jsfzzList",fileResult.getData().getPfiFileId());
|
|
|
+ }
|
|
|
//返回发票信息
|
|
|
return R.ok(map);
|
|
|
}
|
|
@@ -724,7 +730,7 @@ public class OwnAuthController extends BaseController {
|
|
|
if(formatter.format(calendar.getTime()).compareTo(formatter.format(bankAcc.get(0).getPbaiCfcaDate()))<0){
|
|
|
throw new BaseException("当前账户已存在");
|
|
|
}
|
|
|
- }else{
|
|
|
+ }else{
|
|
|
//企业打款申请
|
|
|
JSONObject operatorAuth = CfcaUtil.paymentApply(ISPRO, INSTITUTIONID, pbaiAccountName, pbaiBankaccountId,pbaiBankName,zbiRemark);
|
|
|
/*JSONObject operatorAuth = new JSONObject();
|
|
@@ -918,18 +924,18 @@ public class OwnAuthController extends BaseController {
|
|
|
if(CommonUtil.isNotEmpty(handler)) {
|
|
|
try {
|
|
|
companyAccount = AxqCommonUtil.companyAccount(scyName, IDENTTYPECODE, scySocialCode, phoneNumber, scyPhone, AUTHENTICATIONMODE, handler, TYPECODE, handlerCard,new HttpConnector(jksPath,keyStorePassword,channel,platId));
|
|
|
- }catch (Exception e) {
|
|
|
- System.out.println("开户失败==》"+e);
|
|
|
- throw new Exception("开户失败!");
|
|
|
- }
|
|
|
+ }catch (Exception e) {
|
|
|
+ System.out.println("开户失败===》"+e);
|
|
|
+ throw new Exception("开户失败!");
|
|
|
+ }
|
|
|
}else{
|
|
|
try {
|
|
|
companyAccount = AxqCommonUtil.companyAccount(scyName, IDENTTYPECODE, scySocialCode, phoneNumber, scyPhone, AUTHENTICATIONMODE, scyLegal, TYPECODE, scyLegalId,new HttpConnector(jksPath,keyStorePassword,channel,platId));
|
|
|
}catch (Exception e) {
|
|
|
- System.out.println("开户失败==》"+e);
|
|
|
+ System.out.println("开户失败===》"+e);
|
|
|
throw new Exception("开户失败!");
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
System.out.print("开户结果==========>" + companyAccount);
|
|
|
//返回cfca用户id
|
|
|
String userId = companyAccount.getJSONObject("enterprise").getString("userId");
|
|
@@ -946,7 +952,7 @@ public class OwnAuthController extends BaseController {
|
|
|
String managementProductId = null;
|
|
|
//判断是核心企业还是供应商
|
|
|
if("01".equals(pany.get(0).getScyType())){
|
|
|
- managementProductId = configService.selectConfigByKey("system.company.core");
|
|
|
+ managementProductId = configService.selectConfigByKey("system.company.core");
|
|
|
}else{
|
|
|
managementProductId = configService.selectConfigByKey("system.company.supplier");
|
|
|
}
|