| | |
| | | import cn.iocoder.yudao.framework.common.util.number.NumberUtils; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| | | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractAuditReqVO; |
| | | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractPageReqVO; |
| | | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractRespVO; |
| | | import cn.iocoder.yudao.module.crm.controller.admin.contract.vo.contract.CrmContractSaveReqVO; |
| | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.stream.Stream; |
| | | |
| | | import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; |
| | |
| | | } |
| | | |
| | | @PutMapping("/submit") |
| | | @Operation(summary = "提交合同审批") |
| | | @Operation(summary = "提交合同审批(未提交/审核不通过→审批中),审批人由审批配置统一指定") |
| | | @Parameter(name = "id", description = "合同编号", required = true) |
| | | @PreAuthorize("@ss.hasPermission('crm:contract:update')") |
| | | public CommonResult<Boolean> submitContract(@RequestParam("id") Long id, |
| | | @RequestParam("processDefinitionKey") String processDefinitionKey) { |
| | | contractService.submitContract(id, processDefinitionKey, getLoginUserId()); |
| | | public CommonResult<Boolean> submitContract(@RequestParam("id") Long id) { |
| | | contractService.submitContract(id); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/approve-process-list") |
| | | @Operation(summary = "获取合同审批流程列表") |
| | | @PutMapping("/audit") |
| | | @Operation(summary = "审核合同(审批中→审核通过/审核不通过),仅审批人本人可操作") |
| | | @PreAuthorize("@ss.hasPermission('crm:contract:audit')") |
| | | public CommonResult<Boolean> auditContract(@Valid @RequestBody CrmContractAuditReqVO auditReqVO) { |
| | | contractService.auditContract(auditReqVO.getId(), auditReqVO.getPass(), auditReqVO.getReviewRemark()); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/approver-ids") |
| | | @Operation(summary = "获得合同的审批人编号集合,供前端判断是否展示审核按钮") |
| | | @PreAuthorize("@ss.hasPermission('crm:contract:query')") |
| | | public CommonResult<List<Map<String, Object>>> getContractApproveProcessList() { |
| | | return success(contractService.getContractApproveProcessDefinitionList()); |
| | | public CommonResult<Set<Long>> getApproverUserIds() { |
| | | return success(contractService.getContractApproverUserIds()); |
| | | } |
| | | |
| | | private List<CrmContractRespVO> buildContractDetailList(List<CrmContractDO> contractList) { |
| | |
| | | } |
| | | // 2.8 设置指令下发数量 |
| | | contractVO.setCommandCount(contractCommandService.countByContractId(contractVO.getId())); |
| | | contractVO.setAuditStatusName(CrmAuditStatusEnum.getNameByStatus(contractVO.getAuditStatus())); |
| | | }); |
| | | } |
| | | |