|
@@ -3,7 +3,12 @@ package com.huyi.service.common.flowable.controller;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.huyi.service.base.entity.PubApprovalProcess;
|
|
|
+import com.huyi.service.base.entity.ZcFinanceInf;
|
|
|
+import com.huyi.service.base.entity.ZcFinanceRecord;
|
|
|
import com.huyi.service.base.service.IPubApprovalProcessService;
|
|
|
+import com.huyi.service.base.service.IZcFinanceInfService;
|
|
|
+import com.huyi.service.base.service.IZcFinanceRecordService;
|
|
|
+import com.huyi.service.common.flowable.service.ApprovalService;
|
|
|
import com.keao.tianhu.starter.mybatis.plus.entity.QueryRequest;
|
|
|
import com.tianhu.common.core.utils.CommonUtil;
|
|
|
import com.tianhu.common.core.utils.DateUtils;
|
|
@@ -14,14 +19,17 @@ import com.tianhu.common.log.annotation.Log;
|
|
|
import com.tianhu.common.log.enums.BusinessType;
|
|
|
import com.tianhu.common.security.annotation.PreAuthorize;
|
|
|
import com.tianhu.common.security.service.TokenService;
|
|
|
+import com.tianhu.system.api.RemoteCommonService;
|
|
|
import com.tianhu.system.api.model.LoginUser;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.cglib.beans.BeanMap;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
import java.text.ParseException;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -44,9 +52,18 @@ public class FlowableController extends BaseController
|
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RemoteCommonService remoteCommonService;
|
|
|
+ @Autowired
|
|
|
+ private ApprovalService approvalService;
|
|
|
+ @Autowired
|
|
|
+ private IZcFinanceRecordService zcFinanceRecordService;
|
|
|
+ // 开始流程
|
|
|
+ public final static String STRART_FLOW = "flow/strartFlow";
|
|
|
+
|
|
|
//自动生成的合同服务类
|
|
|
-// @Autowired
|
|
|
-// private IWcContractInfService wcContractInfService;
|
|
|
+ @Autowired
|
|
|
+ private IZcFinanceInfService zcFinanceInfService;
|
|
|
|
|
|
|
|
|
|
|
@@ -84,17 +101,159 @@ public class FlowableController extends BaseController
|
|
|
@RequestParam("id") String id,
|
|
|
@RequestParam("menuId") String menuId,
|
|
|
@RequestParam("companyId") String companyId) throws Exception {
|
|
|
- //合同审批通过
|
|
|
- /*if("1000000000".equals(menuId)){
|
|
|
- LambdaQueryWrapper<WcContractInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ //核心企业融信开立审批
|
|
|
+ if("1000000000".equals(menuId)){
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //主键
|
|
|
+ zcFinanceInf.setZfiId(id);
|
|
|
+ //审批通过
|
|
|
+ zcFinanceInf.setZfiCoreStatus("01");
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("00");
|
|
|
+ //待签收
|
|
|
+ zcFinanceInf.setZfiStatus("01");
|
|
|
+ zcFinanceInfService.updateById(zcFinanceInf);
|
|
|
+ //核心企业确权审批
|
|
|
+ }else if("1000000007".equals(menuId)){
|
|
|
+ ZcFinanceInf zcFinanceInf = zcFinanceInfService.getById(id);
|
|
|
+ String type = zcFinanceInf.getZfiCreateType();
|
|
|
+ if("0".equals(type)){
|
|
|
+ approvalService.addSignApproval(CommonUtil.entityToMap(zcFinanceInf));
|
|
|
+ }else if("2".equals(type)){
|
|
|
+ approvalService.addFinancingApproval(CommonUtil.entityToMap(zcFinanceInf));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //融资企业融信申请审批通过
|
|
|
+ else if("1000000002".equals(menuId)){
|
|
|
+ LambdaQueryWrapper<ZcFinanceInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ String [] arr = id.split("\\|");
|
|
|
+ String zfiId = arr[0];
|
|
|
+ lambdaQueryWrapper.eq(ZcFinanceInf::getZfiId,zfiId);
|
|
|
+ //lambdaQueryWrapper.eq(WcContractInf::getCifCompanyId,arr[1]);
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //审批通过
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("01");
|
|
|
+ zcFinanceInfService.update(zcFinanceInf,lambdaQueryWrapper);
|
|
|
+ //调用平台审批接口
|
|
|
+ ZcFinanceInf inf = zcFinanceInfService.getById(zfiId);
|
|
|
+ Map map = new HashMap();
|
|
|
+ //实体类转map
|
|
|
+ BeanMap beanMap = BeanMap.create(inf);
|
|
|
+ for (Object key : beanMap.keySet()) {
|
|
|
+ map.put(key + "", beanMap.get(key));
|
|
|
+ }
|
|
|
+ map.put("zfiId",zfiId);
|
|
|
+ approvalService.addPlatformApproval(map);
|
|
|
+ }//融资企业融信开立审批通过
|
|
|
+ else if("1000000001".equals(menuId)){
|
|
|
+ LambdaQueryWrapper<ZcFinanceInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ String [] arr = id.split("\\|");
|
|
|
+ String zfiId = arr[0];
|
|
|
+ lambdaQueryWrapper.eq(ZcFinanceInf::getZfiId,zfiId);
|
|
|
+ //lambdaQueryWrapper.eq(WcContractInf::getCifCompanyId,arr[1]);
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //审批通过
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("01");
|
|
|
+ zcFinanceInfService.update(zcFinanceInf,lambdaQueryWrapper);
|
|
|
+ //调用平台审批接口
|
|
|
+ ZcFinanceInf inf = zcFinanceInfService.getById(zfiId);
|
|
|
+ Map map = new HashMap();
|
|
|
+ //实体类转map
|
|
|
+ BeanMap beanMap = BeanMap.create(inf);
|
|
|
+ for (Object key : beanMap.keySet()) {
|
|
|
+ map.put(key + "", beanMap.get(key));
|
|
|
+ }
|
|
|
+ map.put("zfiId",zfiId);
|
|
|
+ approvalService.addPlatformApproval(map);
|
|
|
+ }//融资企业补充资料审批通过
|
|
|
+ else if("1000000003".equals(menuId)){
|
|
|
+ LambdaQueryWrapper<ZcFinanceInf> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ String [] arr = id.split("\\|");
|
|
|
+ //融信id
|
|
|
+ String zfiId = arr[0];
|
|
|
+ wrapper.eq(ZcFinanceInf::getZfiId,zfiId);
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("01");
|
|
|
+ zcFinanceInfService.update(zcFinanceInf,wrapper);
|
|
|
+ //融信id查询融资产品
|
|
|
+ ZcFinanceInf inf = zcFinanceInfService.getById(zfiId);
|
|
|
+ //融资产品
|
|
|
+ String zfiProductId = inf.getZfiProductId();
|
|
|
+ //调用平台审批
|
|
|
+ //查询当前操作员
|
|
|
+ LoginUser user = tokenService.getLoginUser();
|
|
|
+ String userName = user.getUsername();
|
|
|
+ Map map = new HashMap();
|
|
|
+ if (inf != null) {
|
|
|
+ BeanMap beanMap = BeanMap.create(inf);
|
|
|
+ for (Object key : beanMap.keySet()) {
|
|
|
+ map.put(key + "", beanMap.get(key));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //调用平台审批
|
|
|
+ approvalService.addPlatformApproval(map);
|
|
|
+ } //平台审批通过
|
|
|
+ else if("1000000004".equals(menuId)){
|
|
|
+ LambdaQueryWrapper<ZcFinanceInf> wrapper = new LambdaQueryWrapper<>();
|
|
|
String [] arr = id.split("\\|");
|
|
|
- lambdaQueryWrapper.eq(WcContractInf::getCifId,arr[0]);
|
|
|
- lambdaQueryWrapper.eq(WcContractInf::getCifCompanyId,arr[1]);
|
|
|
- WcContractInf wcContractInf = new WcContractInf();
|
|
|
+ //融信id
|
|
|
+ String zfiId = arr[0];
|
|
|
+ //融信id查询融信创建(0:供应商申请, 1:核心企业开立, 2:供应商开立)
|
|
|
+ ZcFinanceInf inf = zcFinanceInfService.getById(zfiId);
|
|
|
+ //融信创建(0:供应商申请, 1:核心企业开立, 2:供应商开立)
|
|
|
+ String zfiCreateType = inf.getZfiCreateType();
|
|
|
+ wrapper.eq(ZcFinanceInf::getZfiId,zfiId);
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //平台审批状态(00:审批中, 01:审批通过, 02:审批拒绝, 03:暂存)
|
|
|
+ zcFinanceInf.setZfiPlatformStatus("01");
|
|
|
+ //融资方审批状态(00:审批中, 01:审批通过, 02:审批拒绝, 03:暂存)
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("01");
|
|
|
+ Map map = new HashMap();
|
|
|
+ if (inf != null) {
|
|
|
+ BeanMap beanMap = BeanMap.create(inf);
|
|
|
+ for (Object key : beanMap.keySet()) {
|
|
|
+ map.put(key + "", beanMap.get(key));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ("1".equals(zfiCreateType)) {
|
|
|
+ //融信状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
|
|
|
+ zcFinanceInf.setZfiStatus("02");
|
|
|
+ zcFinanceInfService.update(zcFinanceInf,wrapper);
|
|
|
+ //调用融资审批
|
|
|
+
|
|
|
+ }else if ("0".equals(zfiCreateType) || "2".equals(zfiCreateType)){
|
|
|
+ //融信状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
|
|
|
+ zcFinanceInf.setZfiStatus("00");
|
|
|
+ zcFinanceInfService.update(zcFinanceInf,wrapper);
|
|
|
+ //调用核心企业确权审批
|
|
|
+ //approvalService.coreConfirmationApproval(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //融资审批通过
|
|
|
+ else if("1000000005".equals(menuId)){
|
|
|
+ LambdaQueryWrapper<ZcFinanceInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(ZcFinanceInf::getZfiId,id);
|
|
|
+ ZcFinanceInf zcfInf = new ZcFinanceInf();
|
|
|
//审批通过
|
|
|
- wcContractInf.setCifState("02");
|
|
|
- wcContractInfService.update(wcContractInf,lambdaQueryWrapper);
|
|
|
- }*/
|
|
|
+ zcfInf.setZfiStatus("02");
|
|
|
+ zcFinanceInfService.update(zcfInf,lambdaQueryWrapper);
|
|
|
+ }
|
|
|
+ //融资审批通过
|
|
|
+ else if("1000000006".equals(menuId)){
|
|
|
+ LambdaQueryWrapper<ZcFinanceInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(ZcFinanceInf::getZfiId,id);
|
|
|
+ ZcFinanceInf zcfInf = new ZcFinanceInf();
|
|
|
+ //审批通过
|
|
|
+ zcfInf.setZfiStatus("04");
|
|
|
+ zcFinanceInfService.update(zcfInf,lambdaQueryWrapper);
|
|
|
+ LambdaQueryWrapper<ZcFinanceRecord> zcFinanceRecordLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ zcFinanceRecordLambdaQueryWrapper.eq(ZcFinanceRecord::getZfrFinanceId,id);
|
|
|
+ ZcFinanceRecord zcFinanceRecord = new ZcFinanceRecord();
|
|
|
+ //审批通过
|
|
|
+ zcFinanceRecord.setZfrStatus("00");
|
|
|
+ zcFinanceRecord.setZfrApproveStt("01");
|
|
|
+ zcFinanceRecordService.update(zcFinanceRecord,zcFinanceRecordLambdaQueryWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
@@ -110,23 +269,115 @@ public class FlowableController extends BaseController
|
|
|
@RequestParam("menuId") String menuId,
|
|
|
@RequestParam("companyId") String companyId,
|
|
|
@RequestParam("state") String state) throws Exception {
|
|
|
- //合同
|
|
|
- /*if("1000000000".equals(menuId)){
|
|
|
- LambdaQueryWrapper<WcContractInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ //核心企业融信开立审批
|
|
|
+ if("1000000000".equals(menuId)){
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //审批拒绝
|
|
|
+ if("delete".equals(state)){
|
|
|
+ zcFinanceInf.setZfiId(id);
|
|
|
+ zcFinanceInf.setZfiCoreStatus("02");
|
|
|
+ }else if("recall".equals(state)){
|
|
|
+ zcFinanceInf.setZfiId(id);
|
|
|
+ zcFinanceInf.setZfiCoreStatus("03");
|
|
|
+ }
|
|
|
+ zcFinanceInfService.updateById(zcFinanceInf);
|
|
|
+ //核心企业确权审批
|
|
|
+ }else if("1000000007".equals(menuId)){
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //审批拒绝
|
|
|
+ if("delete".equals(state)){
|
|
|
+ zcFinanceInf.setZfiId(id);
|
|
|
+ zcFinanceInf.setZfiStatus("02");
|
|
|
+ }else if("recall".equals(state)){
|
|
|
+ zcFinanceInf.setZfiId(id);
|
|
|
+ zcFinanceInf.setZfiStatus("02");
|
|
|
+ }
|
|
|
+ zcFinanceInfService.updateById(zcFinanceInf);
|
|
|
+ }
|
|
|
+ //融资企业融信申请拒绝
|
|
|
+ else if("1000000002".equals(menuId)){
|
|
|
+ LambdaQueryWrapper<ZcFinanceInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ String [] arr = id.split("\\|");
|
|
|
+ lambdaQueryWrapper.eq(ZcFinanceInf::getZfiId,arr[0]);
|
|
|
+ //lambdaQueryWrapper.eq(WcContractInf::getCifCompanyId,arr[1]);
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //审批拒绝
|
|
|
+ if("delete".equals(state)){
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("02");
|
|
|
+ }else if("recall".equals(state)){
|
|
|
+ //撤回
|
|
|
+ //更改为保存状态
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("03");
|
|
|
+ }
|
|
|
+ zcFinanceInfService.update(zcFinanceInf,lambdaQueryWrapper);
|
|
|
+ }//融资企业融信开立拒绝
|
|
|
+ else if("1000000001".equals(menuId)){
|
|
|
+ LambdaQueryWrapper<ZcFinanceInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
String [] arr = id.split("\\|");
|
|
|
- lambdaQueryWrapper.eq(WcContractInf::getCifId,arr[0]);
|
|
|
- lambdaQueryWrapper.eq(WcContractInf::getCifCompanyId,arr[1]);
|
|
|
- WcContractInf wcContractInf = new WcContractInf();
|
|
|
+ lambdaQueryWrapper.eq(ZcFinanceInf::getZfiId,arr[0]);
|
|
|
+ //lambdaQueryWrapper.eq(WcContractInf::getCifCompanyId,arr[1]);
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
//审批拒绝
|
|
|
if("delete".equals(state)){
|
|
|
- wcContractInf.setCifState("01");
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("02");
|
|
|
}else if("recall".equals(state)){
|
|
|
//撤回
|
|
|
//更改为保存状态
|
|
|
- wcContractInf.setCifState("03");
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("03");
|
|
|
+ }
|
|
|
+ zcFinanceInfService.update(zcFinanceInf,lambdaQueryWrapper);
|
|
|
+ }//融资企业补充资料审批拒绝
|
|
|
+ else if("1000000003".equals(menuId)){
|
|
|
+ LambdaQueryWrapper<ZcFinanceInf> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ String [] arr = id.split("\\|");
|
|
|
+ wrapper.eq(ZcFinanceInf::getZfiId,arr[0]);
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //审批拒绝
|
|
|
+ if("delete".equals(state)){
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("02");
|
|
|
+ }
|
|
|
+ zcFinanceInfService.update(zcFinanceInf,wrapper);
|
|
|
+ }
|
|
|
+ //平台审批拒绝
|
|
|
+ else if("1000000004".equals(menuId)){
|
|
|
+ LambdaQueryWrapper<ZcFinanceInf> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ String [] arr = id.split("\\|");
|
|
|
+ wrapper.eq(ZcFinanceInf::getZfiId,arr[0]);
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //审批拒绝
|
|
|
+ if("delete".equals(state)){
|
|
|
+ //平台审批状态(00:审批中, 01:审批通过, 02:审批拒绝, 03:暂存)
|
|
|
+ zcFinanceInf.setZfiPlatformStatus("02");
|
|
|
+ //融资方审批状态(00:审批中, 01:审批通过, 02:审批拒绝, 03:暂存)
|
|
|
+ zcFinanceInf.setZfiSupplierStatus("02");
|
|
|
+ //融信状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
|
|
|
+ zcFinanceInf.setZfiStatus("06");
|
|
|
+ }
|
|
|
+ zcFinanceInfService.update(zcFinanceInf,wrapper);
|
|
|
+ }//融资企业签收审批
|
|
|
+ else if("1000000005".equals(menuId)){
|
|
|
+ LambdaQueryWrapper<ZcFinanceInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(ZcFinanceInf::getZfiId,id);
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //审批拒绝
|
|
|
+ zcFinanceInf.setZfiStatus("03");
|
|
|
+ zcFinanceInfService.update(zcFinanceInf,lambdaQueryWrapper);
|
|
|
+ }//融资审批
|
|
|
+ else if("1000000006".equals(menuId)){
|
|
|
+ LambdaQueryWrapper<ZcFinanceInf> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(ZcFinanceInf::getZfiId,id);
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //审批拒绝
|
|
|
+ zcFinanceInf.setZfiStatus("03");
|
|
|
+ zcFinanceInfService.update(zcFinanceInf,lambdaQueryWrapper);
|
|
|
+ LambdaQueryWrapper<ZcFinanceRecord> zcFinanceRecordLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ zcFinanceRecordLambdaQueryWrapper.eq(ZcFinanceRecord::getZfrFinanceId,id);
|
|
|
+ ZcFinanceRecord zcFinanceRecord = new ZcFinanceRecord();
|
|
|
+ //审批拒绝
|
|
|
+ zcFinanceRecord.setZfrStatus("02");
|
|
|
+ zcFinanceRecord.setZfrApproveStt("02");
|
|
|
+ zcFinanceRecordService.update(zcFinanceRecord,zcFinanceRecordLambdaQueryWrapper);
|
|
|
}
|
|
|
- wcContractInfService.update(wcContractInf,lambdaQueryWrapper);
|
|
|
- }*/
|
|
|
|
|
|
return AjaxResult.success();
|
|
|
}
|