|
@@ -1,10 +1,12 @@
|
|
|
package com.huyi.service.financeRecord.controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.huyi.service.base.entity.*;
|
|
|
import com.huyi.service.base.service.*;
|
|
|
import com.huyi.service.financeRecord.service.FinanceRecordService;
|
|
|
+import com.huyi.service.util.FlowableService;
|
|
|
import com.keao.tianhu.starter.mybatis.plus.entity.QueryRequest;
|
|
|
import com.tianhu.common.core.constant.SalaryConstants;
|
|
|
import com.tianhu.common.core.domain.R;
|
|
@@ -88,6 +90,10 @@ public class FinanceRecordController extends BaseController {
|
|
|
private IZcFinanceInfService iZcFinanceInfService;
|
|
|
@Autowired
|
|
|
private RemoteConfigService configService;
|
|
|
+ @Autowired
|
|
|
+ private FlowableService flowableService;
|
|
|
+ // 开始流程
|
|
|
+ public final static String STRART_FLOW = "flow/strartFlow";
|
|
|
/**
|
|
|
* 查询融资管理列表
|
|
|
*/
|
|
@@ -264,6 +270,8 @@ public class FinanceRecordController extends BaseController {
|
|
|
//TODO
|
|
|
//融资状态
|
|
|
zcFinanceRecord.setZfrStatus("00");
|
|
|
+ //审批状态(00:审核中 01:审批通过, 02:审批拒绝, 03:暂存)
|
|
|
+ zcFinanceRecord.setZfrApproveStt("03");
|
|
|
//创建者
|
|
|
zcFinanceRecord.setCreateBy(userId);
|
|
|
//创建时间
|
|
@@ -404,6 +412,74 @@ public class FinanceRecordController extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 提交审批
|
|
|
+ * @param map
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Log(title = "提交审批", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping("/examineApprove")
|
|
|
+ public AjaxResult examineApprove(@RequestBody Map<String,Object> map) throws Exception {
|
|
|
+ //融信id
|
|
|
+ String zfrId = CommonUtil.objToString(map.get("zfrId"));
|
|
|
+ //查询当前操作员
|
|
|
+ LoginUser userInfo = tokenService.getLoginUser();
|
|
|
+ SysUser user = userInfo.getSysUser();
|
|
|
+ String companyId =user.getCompanyId();
|
|
|
+ Long userId = user.getUserId();
|
|
|
+ String userName =user.getUserName();
|
|
|
+ //查询融信id
|
|
|
+ ZcFinanceRecord zcFinanceRecord = iZcFinanceRecordService.getById(zfrId);
|
|
|
+ String financeId = zcFinanceRecord.getZfrFinanceId();
|
|
|
+ Map<String, Object> flowParam = new HashMap<String, Object>();
|
|
|
+ //查询当前操作员
|
|
|
+ flowParam.put("menuId", "1000000006");
|
|
|
+ flowParam.put("companyId", companyId);
|
|
|
+ //双主键
|
|
|
+ flowParam.put("businessKey", zfrId);
|
|
|
+ //员工id
|
|
|
+ flowParam.put("sessionUserId", userId);
|
|
|
+ //融资编号
|
|
|
+ String zfrNumber =zcFinanceRecord.getZfrNumber();
|
|
|
+ if(CommonUtil.isNotEmpty(zfrNumber)) {
|
|
|
+ flowParam.put("name",userName + DateUtils.getTime() + "发起审批,融信编号为:" + zfrNumber+"的融资审批");
|
|
|
+ }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 ("200".equals(resMap.get("code"))){
|
|
|
+ ZcFinanceInf zfi = new ZcFinanceInf();
|
|
|
+ zfi.setZfiId(financeId);
|
|
|
+ //状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
|
|
|
+ zfi.setZfiStatus("04");
|
|
|
+ iZcFinanceInfService.updateById(zfi);
|
|
|
+ //融资状态(00:融资中 01:已放款 02:融资失败 03:已结算)
|
|
|
+ zcFinanceRecord.setZfrStatus("00");
|
|
|
+ //审批状态(00:审核中 01:审批通过, 2:审批拒绝)
|
|
|
+ zcFinanceRecord.setZfrApproveStt("00");
|
|
|
+ iZcFinanceRecordService.updateById(zcFinanceRecord);
|
|
|
+ }
|
|
|
+ //未开启流程实例
|
|
|
+ if("300".equals(resMap.get("code")) || "350".equals(resMap.get("code"))){
|
|
|
+ ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
|
|
|
+ //融信id
|
|
|
+ zcFinanceInf.setZfiId(financeId);
|
|
|
+ //融信状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资 06:平台退回)
|
|
|
+ zcFinanceInf.setZfiStatus("04");
|
|
|
+ iZcFinanceInfService.updateById(zcFinanceInf);
|
|
|
+ //融资状态(00:融资中 01:已放款 02:融资失败 03:已结算)
|
|
|
+ zcFinanceRecord.setZfrStatus("00");
|
|
|
+ //审批状态(00:审核中 01:审批通过, 2:审批拒绝)
|
|
|
+ zcFinanceRecord.setZfrApproveStt("01");
|
|
|
+ iZcFinanceRecordService.updateById(zcFinanceRecord);
|
|
|
+ }else if (!"200".equals(resMap.get("code"))) {
|
|
|
+ throw new Exception(resMap.get("message").toString());
|
|
|
+ }
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 导出附件
|
|
|
* @return
|
|
|
*/
|