|
...
|
...
|
@@ -4,15 +4,19 @@ import java.util.HashMap; |
|
|
|
import java.util.List;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
import com.ruoyi.flowable.entity.Matter;
|
|
|
|
import com.baomidou.mybatisplus.annotation.TableName;
|
|
|
|
import com.ruoyi.compliancemanagement.domain.TblContract;
|
|
|
|
import com.ruoyi.compliancemanagement.domain.bo.TblBusinessWorkflowBo;
|
|
|
|
import com.ruoyi.compliancemanagement.model.TblContractModel;
|
|
|
|
import com.ruoyi.compliancemanagement.service.ITblBusinessWorkflowService;
|
|
|
|
import com.ruoyi.workflow.service.IWfProcessService;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import javax.validation.constraints.*;
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
|
import org.flowable.engine.runtime.ProcessInstance;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
|
...
|
...
|
@@ -22,7 +26,6 @@ import com.ruoyi.common.core.domain.PageQuery; |
|
|
|
import com.ruoyi.common.core.domain.R;
|
|
|
|
import com.ruoyi.common.core.validate.AddGroup;
|
|
|
|
import com.ruoyi.common.core.validate.EditGroup;
|
|
|
|
import com.ruoyi.common.core.validate.QueryGroup;
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
import com.ruoyi.compliancemanagement.domain.vo.TblContractVo;
|
|
...
|
...
|
@@ -44,13 +47,14 @@ public class TblContractController extends BaseController { |
|
|
|
|
|
|
|
private final ITblContractService iTblContractService;
|
|
|
|
private final IWfProcessService iWfProcessService;
|
|
|
|
private final ITblBusinessWorkflowService iTblBusinessWorkflowService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询【请填写功能名称】列表
|
|
|
|
*/
|
|
|
|
@SaCheckPermission("system:contract:list")
|
|
|
|
@GetMapping("/list")
|
|
|
|
public TableDataInfo<TblContractVo> list(TblContractBo bo, PageQuery pageQuery) {
|
|
|
|
public TableDataInfo<TblContractModel> list(TblContractBo bo, PageQuery pageQuery) {
|
|
|
|
return iTblContractService.queryPageList(bo, pageQuery);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -99,14 +103,15 @@ public class TblContractController extends BaseController { |
|
|
|
// return toAjax(iTblContractService.insertByBo(bo));
|
|
|
|
// }
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@SaCheckPermission("system:contract:addAndStart")
|
|
|
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
|
|
|
@RepeatSubmit()
|
|
|
|
@PostMapping()
|
|
|
|
public R<Void> addAndStart(
|
|
|
|
@Validated(AddGroup.class) @RequestBody TblContractBo bo) {
|
|
|
|
Matter matter = new Matter();
|
|
|
|
String matterKey = "Process_18tcmzu:1:216d90ff-3f8a-11ef-b7e7-70b5e84e8ddf";
|
|
|
|
// Matter matter = new Matter();
|
|
|
|
String procDefId = "Process_18tcmzu:1:040fd586-433c-11ef-b955-421c839c76ba";
|
|
|
|
iTblContractService.insertByBo(bo);
|
|
|
|
Long id = bo.getId();
|
|
|
|
//Long id = sLeaveService.create(studentLeave,matterKey);
|
|
...
|
...
|
@@ -141,11 +146,22 @@ public class TblContractController extends BaseController { |
|
|
|
// CollegeMatters mat = iCollegeMattersService.getMatter(matterKey);
|
|
|
|
// matter.setMatterDept(mat.getMatterDepartmentId());
|
|
|
|
// variables.put("department", mat.getMatterDepartmentId());
|
|
|
|
matter.setMatterKey(matterKey);
|
|
|
|
matter.setBusinessKey(matterKey + "." + id);
|
|
|
|
matter.setVariables(variables);
|
|
|
|
matter.setProcessId("Process_18tcmzu:1:216d90ff-3f8a-11ef-b7e7-70b5e84e8ddf");
|
|
|
|
iWfProcessService.startProcess(matter);
|
|
|
|
// matter.setMatterKey(procDefId);
|
|
|
|
// matter.setBusinessKey(procDefId + "." + id);
|
|
|
|
// matter.setVariables(variables);
|
|
|
|
// matter.setProcessId("Process_18tcmzu:1:216d90ff-3f8a-11ef-b7e7-70b5e84e8ddf");
|
|
|
|
// iWfProcessService.startProcess(matter);
|
|
|
|
ProcessInstance processInstance = iWfProcessService.startProcessByDefId(procDefId, variables);
|
|
|
|
|
|
|
|
if(null != processInstance){
|
|
|
|
TblBusinessWorkflowBo tblBusinessWorkflowBo = new TblBusinessWorkflowBo();
|
|
|
|
tblBusinessWorkflowBo.setBusinessId(id);
|
|
|
|
tblBusinessWorkflowBo.setProcInsId(processInstance.getProcessInstanceId());
|
|
|
|
TableName table = TblContract.class.getAnnotation(TableName.class);
|
|
|
|
tblBusinessWorkflowBo.setTableName(table.value());
|
|
|
|
iTblBusinessWorkflowService.insertByBo(tblBusinessWorkflowBo);
|
|
|
|
// iTblContractService.updateProcInsIdById(processInstance.getProcessInstanceId(),id);
|
|
|
|
}
|
|
|
|
return R.ok("成功");
|
|
|
|
}else{
|
|
|
|
return R.fail("系统故障!");
|
...
|
...
|
|