|
|
|
package com.ruoyi.compliancemanagement.controller;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.annotation.TableName;
|
|
|
|
import com.ruoyi.compliancemanagement.domain.TblContract;
|
|
|
|
import com.ruoyi.compliancemanagement.domain.bo.TblBusinessWorkflowBo;
|
|
|
|
import com.ruoyi.compliancemanagement.domain.bo.TblContractBo;
|
|
|
|
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.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;
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
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.TblComplianceReviewVo;
|
|
|
|
import com.ruoyi.compliancemanagement.domain.bo.TblComplianceReviewBo;
|
|
|
|
import com.ruoyi.compliancemanagement.service.ITblComplianceReviewService;
|
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 合规审查
|
|
|
|
*
|
|
|
|
* @author ruoyi
|
|
|
|
* @date 2024-07-22
|
|
|
|
*/
|
|
|
|
@Validated
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/compliancemanagement/complianceReview")
|
|
|
|
public class TblComplianceReviewController extends BaseController {
|
|
|
|
|
|
|
|
private final ITblComplianceReviewService iTblComplianceReviewService;
|
|
|
|
private final IWfProcessService iWfProcessService;
|
|
|
|
private final ITblBusinessWorkflowService iTblBusinessWorkflowService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询合规审查列表
|
|
|
|
*/
|
|
|
|
@SaCheckPermission("compliancemanagement:complianceReview:list")
|
|
|
|
@GetMapping("/list")
|
|
|
|
public TableDataInfo<TblComplianceReviewVo> list(TblComplianceReviewBo bo, PageQuery pageQuery) {
|
|
|
|
return iTblComplianceReviewService.queryPageList(bo, pageQuery);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 导出合规审查列表
|
|
|
|
*/
|
|
|
|
@SaCheckPermission("compliancemanagement:complianceReview:export")
|
|
|
|
@Log(title = "合规审查", businessType = BusinessType.EXPORT)
|
|
|
|
@PostMapping("/export")
|
|
|
|
public void export(TblComplianceReviewBo bo, HttpServletResponse response) {
|
|
|
|
List<TblComplianceReviewVo> list = iTblComplianceReviewService.queryList(bo);
|
|
|
|
ExcelUtil.exportExcel(list, "合规审查", TblComplianceReviewVo.class, response);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取合规审查详细信息
|
|
|
|
*
|
|
|
|
* @param id 主键
|
|
|
|
*/
|
|
|
|
@SaCheckPermission("compliancemanagement:complianceReview:query")
|
|
|
|
@GetMapping("/{id}")
|
|
|
|
public R<TblComplianceReviewVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
|
@PathVariable Long id) {
|
|
|
|
return R.ok(iTblComplianceReviewService.queryById(id));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 新增合规审查
|
|
|
|
*/
|
|
|
|
// @SaCheckPermission("compliancemanagement:complianceReview:add")
|
|
|
|
// @Log(title = "合规审查", businessType = BusinessType.INSERT)
|
|
|
|
// @RepeatSubmit()
|
|
|
|
// @PostMapping()
|
|
|
|
// public R<Void> add(@Validated(AddGroup.class) @RequestBody TblComplianceReviewBo bo) {
|
|
|
|
// return toAjax(iTblComplianceReviewService.insertByBo(bo));
|
|
|
|
// }
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@SaCheckPermission("compliancemanagement:complianceReview:addAndStart")
|
|
|
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
|
|
|
|
@RepeatSubmit()
|
|
|
|
@PostMapping()
|
|
|
|
public R<Void> addAndStart(
|
|
|
|
@Validated(AddGroup.class) @RequestBody TblComplianceReviewBo bo) {
|
|
|
|
String procDefId = "Process_1721285503125:1:c39932d2-4808-11ef-bb1d-421c839c76ba";
|
|
|
|
iTblComplianceReviewService.insertByBo(bo);
|
|
|
|
Long id = bo.getId();
|
|
|
|
if (id > 0 || id != null){
|
|
|
|
Map<String, Object> variables = new HashMap<>();
|
|
|
|
// fromSource用来标识此事项是提交来源是客户端还是移动端
|
|
|
|
//合同编号
|
|
|
|
variables.put("contractno", bo.getContractno());
|
|
|
|
// 合同名称
|
|
|
|
variables.put("contractName",bo.getContractName());
|
|
|
|
// 合同类型
|
|
|
|
variables.put("contractType",Long.valueOf(bo.getContractType()));
|
|
|
|
// 生效日期
|
|
|
|
variables.put("effectiveDate", bo.getEffectiveDate());
|
|
|
|
// 到期日期
|
|
|
|
variables.put("expirationDate", bo.getExpirationDate());
|
|
|
|
// 甲方
|
|
|
|
variables.put("partyA", bo.getPartyA());
|
|
|
|
// 甲方链接地址
|
|
|
|
variables.put("partyAAddress", bo.getPartyAAddress());
|
|
|
|
// 乙方
|
|
|
|
variables.put("partyB", bo.getPartyB());
|
|
|
|
// 乙方链接地址
|
|
|
|
variables.put("partyBAddress", bo.getPartyBAddress());
|
|
|
|
// 签订日期
|
|
|
|
variables.put("signingDate", bo.getSigningDate());
|
|
|
|
// 标的物信息
|
|
|
|
variables.put("subjectInformation", bo.getSubjectInformation());
|
|
|
|
// 附件
|
|
|
|
variables.put("attachments", bo.getAttachments());
|
|
|
|
// 启动流程
|
|
|
|
ProcessInstance processInstance = iWfProcessService.startProcessByDefId(procDefId, variables);
|
|
|
|
|
|
|
|
if(null != processInstance){
|
|
|
|
TblBusinessWorkflowBo tblBusinessWorkflowBo = new TblBusinessWorkflowBo();
|
|
|
|
tblBusinessWorkflowBo.setBusinessId(id);
|
|
|
|
tblBusinessWorkflowBo.setProcInsId(processInstance.getProcessInstanceId());
|
|
|
|
tblBusinessWorkflowBo.setProcDefId(procDefId);
|
|
|
|
tblBusinessWorkflowBo.setDeployId(processInstance.getDeploymentId());
|
|
|
|
TableName table = TblContract.class.getAnnotation(TableName.class);
|
|
|
|
tblBusinessWorkflowBo.setTableName(table.value());
|
|
|
|
iTblBusinessWorkflowService.insertByBo(tblBusinessWorkflowBo);
|
|
|
|
}
|
|
|
|
return R.ok("成功");
|
|
|
|
}else{
|
|
|
|
return R.fail("系统故障!");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 修改合规审查
|
|
|
|
*/
|
|
|
|
@SaCheckPermission("compliancemanagement:complianceReview:edit")
|
|
|
|
@Log(title = "合规审查", businessType = BusinessType.UPDATE)
|
|
|
|
@RepeatSubmit()
|
|
|
|
@PutMapping()
|
|
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody TblComplianceReviewBo bo) {
|
|
|
|
return toAjax(iTblComplianceReviewService.updateByBo(bo));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 删除合规审查
|
|
|
|
*
|
|
|
|
* @param ids 主键串
|
|
|
|
*/
|
|
|
|
@SaCheckPermission("compliancemanagement:complianceReview:remove")
|
|
|
|
@Log(title = "合规审查", businessType = BusinessType.DELETE)
|
|
|
|
@DeleteMapping("/{ids}")
|
|
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
|
@PathVariable Long[] ids) {
|
|
|
|
return toAjax(iTblComplianceReviewService.deleteWithValidByIds(Arrays.asList(ids), true));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|