|
@@ -8,10 +8,7 @@ import com.huyi.service.common.flowable.service.ApprovalService;
|
|
|
import com.huyi.service.util.FlowableService;
|
|
|
import com.tianhu.common.core.utils.CommonUtil;
|
|
|
import com.tianhu.common.core.utils.DateUtils;
|
|
|
-import com.tianhu.system.api.model.LoginUser;
|
|
|
-import org.checkerframework.checker.units.qual.A;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
@@ -158,10 +155,6 @@ public class ApprovalServiceImpl implements ApprovalService {
|
|
|
zcFinanceInf.setZfiStatus("00");
|
|
|
}
|
|
|
zcFinanceInfService.updateById(zcFinanceInf);
|
|
|
- if ("2".equals(zfiCreateType)){
|
|
|
- //调用核心企业确权审批
|
|
|
- coreConfirmationApproval(map);
|
|
|
- }
|
|
|
}else if (!"200".equals(resMap.get("code"))) {
|
|
|
throw new Exception(resMap.get("message").toString());
|
|
|
}
|
|
@@ -418,4 +411,127 @@ public class ApprovalServiceImpl implements ApprovalService {
|
|
|
throw new Exception(resMap.get("message").toString());
|
|
|
}
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 融资企业申请融信审批
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void financeApplyApproval(@RequestBody Map map) throws Exception{
|
|
|
+ Map<String, Object> flowParam = new HashMap<String, Object>();
|
|
|
+ //查询当前操作员
|
|
|
+ String companyId = CommonUtil.objToString(map.get("zfiSupplierId"));
|
|
|
+ LambdaQueryWrapper<SysUserCompanyRel> userQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ userQueryWrapper.eq(SysUserCompanyRel::getSucrCompanyId,companyId);
|
|
|
+ userQueryWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
|
|
|
+ List<SysUserCompanyRel> userList = iSysUserCompanyRelService.findSysUserCompanyRels(userQueryWrapper);
|
|
|
+ String userId= CommonUtil.objToString(userList.get(0).getSucrUserId());
|
|
|
+ //查询用户名称
|
|
|
+ SysUser sysUser = iSysUserService.getById(userId);
|
|
|
+ String userName = sysUser.getNickName();
|
|
|
+ flowParam.put("menuId", "1000000002");
|
|
|
+ flowParam.put("companyId", companyId);
|
|
|
+ //主键
|
|
|
+ flowParam.put("businessKey", CommonUtil.objToString(map.get("zfiId")));
|
|
|
+ //员工编号
|
|
|
+ flowParam.put("sessionUserId", userId);
|
|
|
+ String ZfiNumber = CommonUtil.objToString(map.get("ZfiNumber"));
|
|
|
+ if(CommonUtil.isNotEmpty(ZfiNumber)){
|
|
|
+ flowParam.put("name",userName + "在" + DateUtils.getTime() + "发起融资企业融信申请审批,融信编号为:" + ZfiNumber);
|
|
|
+ }else {
|
|
|
+ flowParam.put("name",userName + "在" + DateUtils.getTime() + "发起融资企业融信申请审批.");
|
|
|
+ }
|
|
|
+ JSONObject jsonObj=new JSONObject(map);
|
|
|
+ flowParam.put("paras", jsonObj.toString());
|
|
|
+ Map<String, Object> resMap = flowableService.apiPost(STRART_FLOW, flowParam);
|
|
|
+ //未开启流程实例
|
|
|
+ if("300".equals(resMap.get("code"))){
|
|
|
+ //修改状态为通过
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //融信编号
|
|
|
+ zcFinanceInf.setZfiId(CommonUtil.objToString(map.get("zfiId")));
|
|
|
+// //公司编号
|
|
|
+// contract.setCifCompanyId( CommonUtil.objToString(map.get("cifCompanyId")));
|
|
|
+ //审核通过
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("01");
|
|
|
+ zcFinanceInfService.updateById(zcFinanceInf);
|
|
|
+ //调用平台审批
|
|
|
+ approvalService.addPlatformApproval(map);
|
|
|
+ }else if("200".equals(resMap.get("code"))){
|
|
|
+ //修改状态为审批中
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //融信编号
|
|
|
+ zcFinanceInf.setZfiId(CommonUtil.objToString(map.get("zfiId")));
|
|
|
+// //公司编号
|
|
|
+// contract.setCifCompanyId( CommonUtil.objToString(map.get("cifCompanyId")));
|
|
|
+ //审核中
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("00");
|
|
|
+ zcFinanceInfService.updateById(zcFinanceInf);
|
|
|
+ }else if("450".equals(resMap.get("code"))){
|
|
|
+ throw new Exception("未配置审批流程!");
|
|
|
+ }else if (!"200".equals(resMap.get("code"))) {
|
|
|
+ throw new Exception(resMap.get("message").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 融资企业开立融信提交审批
|
|
|
+ * @param map
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void financeOpenApproval(@RequestBody Map map ) throws Exception {
|
|
|
+ Map<String, Object> flowParam = new HashMap<String, Object>();
|
|
|
+ //查询当前操作员
|
|
|
+ String companyId = CommonUtil.objToString(map.get("zfiSupplierId"));
|
|
|
+ LambdaQueryWrapper<SysUserCompanyRel> userQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ userQueryWrapper.eq(SysUserCompanyRel::getSucrCompanyId,companyId);
|
|
|
+ userQueryWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
|
|
|
+ List<SysUserCompanyRel> userList = iSysUserCompanyRelService.findSysUserCompanyRels(userQueryWrapper);
|
|
|
+ String userId= CommonUtil.objToString(userList.get(0).getSucrUserId());
|
|
|
+ //查询用户名称
|
|
|
+ SysUser sysUser = iSysUserService.getById(userId);
|
|
|
+ String userName = sysUser.getNickName();
|
|
|
+ flowParam.put("menuId", "1000000001");
|
|
|
+ flowParam.put("companyId", companyId);
|
|
|
+ //主键
|
|
|
+ flowParam.put("businessKey", CommonUtil.objToString(map.get("zfiId")));
|
|
|
+ //员工编号
|
|
|
+ flowParam.put("sessionUserId", userId);
|
|
|
+ String ZfiNumber = CommonUtil.objToString(map.get("ZfiNumber"));
|
|
|
+ if(CommonUtil.isNotEmpty(ZfiNumber)){
|
|
|
+ flowParam.put("name",userName + "在" + DateUtils.getTime() + "发起融资企业开立融信审批,融信编号为:" + ZfiNumber);
|
|
|
+ }else {
|
|
|
+ flowParam.put("name",userName + "在" + DateUtils.getTime() + "发起融资企业开立融信审批.");
|
|
|
+ }
|
|
|
+ JSONObject jsonObj=new JSONObject(map);
|
|
|
+ flowParam.put("paras", jsonObj.toString());
|
|
|
+ Map<String, Object> resMap = flowableService.apiPost(STRART_FLOW, flowParam);
|
|
|
+ //未开启流程实例
|
|
|
+ if("300".equals(resMap.get("code"))){
|
|
|
+ //修改状态为通过
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //融信编号
|
|
|
+ zcFinanceInf.setZfiId(CommonUtil.objToString(map.get("zfiId")));
|
|
|
+// //公司编号
|
|
|
+// contract.setCifCompanyId( CommonUtil.objToString(map.get("cifCompanyId")));
|
|
|
+ //审核通过
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("01");
|
|
|
+ zcFinanceInfService.updateById(zcFinanceInf);
|
|
|
+ //调用平台审批
|
|
|
+ approvalService.addPlatformApproval(map);
|
|
|
+ }else if("200".equals(resMap.get("code"))){
|
|
|
+ //修改状态为审批中
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //融信编号
|
|
|
+ zcFinanceInf.setZfiId(CommonUtil.objToString(map.get("zfiId")));
|
|
|
+// //公司编号
|
|
|
+// contract.setCifCompanyId( CommonUtil.objToString(map.get("cifCompanyId")));
|
|
|
+ //审核中
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("00");
|
|
|
+ zcFinanceInfService.updateById(zcFinanceInf);
|
|
|
+ }else if("450".equals(resMap.get("code"))){
|
|
|
+ throw new Exception("未配置审批流程!");
|
|
|
+ }else if (!"200".equals(resMap.get("code"))) {
|
|
|
+ throw new Exception(resMap.get("message").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|