mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-02-01 19:24:57 +08:00
[feat] 新增外部合同的流程管理 新增外部合同历史管理
This commit is contained in:
parent
ca81820971
commit
4c2024a149
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.bpm.api.task.dto;
|
|||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -14,9 +15,72 @@ import java.util.Map;
|
|||||||
@Data
|
@Data
|
||||||
public class BpmProcessInstanceGetRespDTO {
|
public class BpmProcessInstanceGetRespDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起流程的用户
|
||||||
|
*/
|
||||||
|
private User startUser;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class User {
|
||||||
|
/**
|
||||||
|
* 用户编号
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 用户昵称
|
||||||
|
*/
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门编号
|
||||||
|
*/
|
||||||
|
private Long deptId;
|
||||||
|
/**
|
||||||
|
* 部门名称
|
||||||
|
*/
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程实例状态
|
* 流程实例状态
|
||||||
*/
|
*/
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前审批中的任务
|
||||||
|
*/
|
||||||
|
private List<Task> tasks; // 仅在流程实例分页才返回
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Task {
|
||||||
|
/**
|
||||||
|
* 流程任务编号
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 任务名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
/**
|
||||||
|
* 持续时间
|
||||||
|
*/
|
||||||
|
private Long durationInMillis;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.cms.controller.admin.extContract;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.util.file.FileUtils;
|
import cn.iocoder.yudao.framework.common.util.file.FileUtils;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractProcessInstanceRespVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractSaveReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDetailDO;
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDetailDO;
|
||||||
@ -111,4 +112,12 @@ public class ExtContractController {
|
|||||||
return success(processId);
|
return success(processId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/get_process")
|
||||||
|
@Operation(summary = "查询流程")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:create')")
|
||||||
|
public CommonResult<ExtContractProcessInstanceRespVO> getExtContractProcessInstance(@RequestParam("id") Long id) {
|
||||||
|
ExtContractProcessInstanceRespVO process = extContractService.getProcess(id);
|
||||||
|
return success(process);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,223 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.extContract.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.FileDTO;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||||
|
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外部合同 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ExtContractProcessInstanceRespVO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "964")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16261")
|
||||||
|
@ExcelProperty("项目id")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||||
|
@ExcelProperty("项目编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "客户名称")
|
||||||
|
@ExcelProperty("客户名称")
|
||||||
|
private String constructionSide;
|
||||||
|
|
||||||
|
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||||
|
@ExcelProperty("主控部门")
|
||||||
|
private String trackingDep;
|
||||||
|
|
||||||
|
@Schema(description = "项目负责人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("项目负责人")
|
||||||
|
private String projectManager;
|
||||||
|
|
||||||
|
@Schema(description = "外部合同商议提示时间")
|
||||||
|
@ExcelProperty("外部合同商议提示时间")
|
||||||
|
private LocalDateTime exReminderTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "赵六")
|
||||||
|
@ExcelProperty("合同名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "合同类型", example = "2")
|
||||||
|
@ExcelProperty(value = "合同类型", converter = DictConvert.class)
|
||||||
|
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "合同进展")
|
||||||
|
@ExcelProperty("合同进展")
|
||||||
|
private String progress;
|
||||||
|
|
||||||
|
@Schema(description = "预计签订时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("预计签订时间")
|
||||||
|
private LocalDateTime expectedTime;
|
||||||
|
|
||||||
|
@Schema(description = "签订时间")
|
||||||
|
@ExcelProperty("签订时间")
|
||||||
|
private LocalDateTime signingTime;
|
||||||
|
|
||||||
|
@Schema(description = "归档时间")
|
||||||
|
@ExcelProperty("归档时间")
|
||||||
|
private LocalDateTime archiveTime;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "2")
|
||||||
|
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||||
|
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "合同总金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("合同总金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(description = "前期费用")
|
||||||
|
@ExcelProperty("前期费用")
|
||||||
|
private BigDecimal preAmount;
|
||||||
|
|
||||||
|
@Schema(description = "设计费")
|
||||||
|
@ExcelProperty("设计费")
|
||||||
|
private BigDecimal designFee;
|
||||||
|
|
||||||
|
@Schema(description = "勘测费")
|
||||||
|
@ExcelProperty("勘测费")
|
||||||
|
private BigDecimal surveyFees;
|
||||||
|
|
||||||
|
@Schema(description = "检测费")
|
||||||
|
@ExcelProperty("检测费")
|
||||||
|
private BigDecimal testingFee;
|
||||||
|
|
||||||
|
@Schema(description = "其他费")
|
||||||
|
@ExcelProperty("其他费")
|
||||||
|
private BigDecimal otherFee;
|
||||||
|
|
||||||
|
@Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@ExcelProperty(value = "计费方式", converter = DictConvert.class)
|
||||||
|
@DictFormat(DictTypeConstants.COUNT_TYPE)
|
||||||
|
private String countType;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "随便")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "合同附件url")
|
||||||
|
@ExcelProperty("合同附件url")
|
||||||
|
private List<FileDTO> contractFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "建安费")
|
||||||
|
@ExcelProperty("建安费")
|
||||||
|
private BigDecimal constructionCost;
|
||||||
|
|
||||||
|
@Schema(description = "资金来源")
|
||||||
|
@ExcelProperty(value = "资金来源", converter = DictConvert.class)
|
||||||
|
@DictFormat(DictTypeConstants.SOURCE)
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@Schema(description = "收费标准", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty(value = "收费标准", converter = DictConvert.class)
|
||||||
|
@DictFormat(DictTypeConstants.CHARGING_STANDARD)
|
||||||
|
private String chargingStandard;
|
||||||
|
|
||||||
|
@Schema(description = "优惠", example = "123")
|
||||||
|
@ExcelProperty("优惠")
|
||||||
|
private BigDecimal discount;
|
||||||
|
|
||||||
|
@Schema(description = "是否联合体", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("是否联合体")
|
||||||
|
private Boolean consortium;
|
||||||
|
|
||||||
|
@Schema(description = "联合体单位")
|
||||||
|
@ExcelProperty("联合体单位")
|
||||||
|
private String consortiumCompany;
|
||||||
|
|
||||||
|
@Schema(description = "合同商议提示")
|
||||||
|
@ExcelProperty("合同商议提示")
|
||||||
|
private LocalDateTime reminderTime;
|
||||||
|
|
||||||
|
@Schema(description = "审定金额")
|
||||||
|
@ExcelProperty("审定金额")
|
||||||
|
private BigDecimal approvedAmount;
|
||||||
|
|
||||||
|
@Schema(description = "审核文件url")
|
||||||
|
@ExcelProperty("审核文件url")
|
||||||
|
private List<FileDTO> reviewFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "最后编辑人")
|
||||||
|
@ExcelProperty("最后编辑人")
|
||||||
|
private String finalEditor;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
|
||||||
|
private String processName;
|
||||||
|
|
||||||
|
@Schema(description = "流程实例的状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private Integer processStatus; // 参见 BpmProcessInstanceStatusEnum 枚举
|
||||||
|
|
||||||
|
@Schema(description = "发起时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
@Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
@Schema(description = "持续时间", example = "1000")
|
||||||
|
private Long durationInMillis;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起流程的用户
|
||||||
|
*/
|
||||||
|
private User startUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前审批中的任务
|
||||||
|
*/
|
||||||
|
private List<Task> tasks; // 仅在流程实例分页才返回
|
||||||
|
|
||||||
|
@Schema(description = "用户信息")
|
||||||
|
@Data
|
||||||
|
public static class User {
|
||||||
|
|
||||||
|
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private Long id;
|
||||||
|
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private Long deptId;
|
||||||
|
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研发部")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Schema(description = "流程任务")
|
||||||
|
@Data
|
||||||
|
public static class Task {
|
||||||
|
|
||||||
|
@Schema(description = "流程任务的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory;
|
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.util.file.FileUtils;
|
import cn.iocoder.yudao.framework.common.util.file.FileUtils;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDetailDO;
|
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory.ExtContractHistoryDetailDO;
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory.ExtContractHistoryDetailDO;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@ -83,4 +81,6 @@ public class ExtContractHistoryController {
|
|||||||
ExcelUtils.write(response, "外部合同历史历史.xls", "数据", ExtContractHistoryRespVO.class,
|
ExcelUtils.write(response, "外部合同历史历史.xls", "数据", ExtContractHistoryRespVO.class,
|
||||||
BeanUtils.toBean(list, ExtContractHistoryRespVO.class));
|
BeanUtils.toBean(list, ExtContractHistoryRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.cms.service.extContract;
|
|||||||
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractProcessInstanceRespVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractSaveReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDetailDO;
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDetailDO;
|
||||||
@ -67,4 +68,11 @@ public interface ExtContractService {
|
|||||||
* @param id 外部合同id
|
* @param id 外部合同id
|
||||||
*/
|
*/
|
||||||
void validateExtContractExists(Long id);
|
void validateExtContractExists(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询流程
|
||||||
|
* @param id 外部合同id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ExtContractProcessInstanceRespVO getProcess(Long id);
|
||||||
}
|
}
|
@ -4,7 +4,9 @@ import cn.hutool.core.bean.BeanUtil;
|
|||||||
import cn.iocoder.yudao.framework.common.util.file.FileUtils;
|
import cn.iocoder.yudao.framework.common.util.file.FileUtils;
|
||||||
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceGetRespDTO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractProcessInstanceRespVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractSaveReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDO;
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDO;
|
||||||
@ -191,6 +193,19 @@ public class ExtContractServiceImpl implements ExtContractService {
|
|||||||
return processInstanceId;
|
return processInstanceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ExtContractProcessInstanceRespVO getProcess(Long id) {
|
||||||
|
ExtContractHistoryDO extContractHistoryDO = extContractHistoryMapper.selectOne("ext_contract_id", id);
|
||||||
|
String processInstanceId = extContractHistoryDO.getProcessInstanceId();
|
||||||
|
BpmProcessInstanceGetRespDTO processInstance = processInstanceApi.getProcessInstance(processInstanceId);
|
||||||
|
ExtContractProcessInstanceRespVO extContractProcessInstanceRespVO = new ExtContractProcessInstanceRespVO();
|
||||||
|
BeanUtil.copyProperties(processInstance, extContractProcessInstanceRespVO);
|
||||||
|
extContractHistoryDO.setProcessStatus(processInstance.getStatus());
|
||||||
|
|
||||||
|
|
||||||
|
return extContractProcessInstanceRespVO;
|
||||||
|
}
|
||||||
|
|
||||||
public void validateExtContractExists(Long id) {
|
public void validateExtContractExists(Long id) {
|
||||||
if (extContractMapper.selectById(id) == null) {
|
if (extContractMapper.selectById(id) == null) {
|
||||||
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
||||||
|
Loading…
Reference in New Issue
Block a user