[feat] 新增外部合同的流程管理

This commit is contained in:
wyw 2024-08-19 14:59:21 +08:00
parent 5091059610
commit b80f413c06
22 changed files with 231 additions and 343 deletions

View File

@ -11,17 +11,15 @@ import lombok.Getter;
@Getter
@AllArgsConstructor
public enum ProcessStatusEnum {
//未执行
NO_EXECUTION("0","no_execution"),
//正在执行
EXECUTING("1","executing"),
//执行完成
COMPLETED("2","completed");
RUNNING(1, "审批中"),
APPROVE(2, "审批通过"),
REJECT(3, "审批不通过"),
CANCEL(4, "已取消");
/**
* 类型编号
*/
private final String code;
private final Integer code;
/**
* 类型编码
*/
@ -32,7 +30,7 @@ public enum ProcessStatusEnum {
* @param code 字典编号
* @return 类型编码
*/
public static String getNoByCode(String code) {
public static String getNoByCode(Integer code) {
for (ProcessStatusEnum value : values()) {
if (value.getCode().equals(code)) {
return value.getNo();

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
@ -27,4 +28,8 @@ public class ContractPageReqVO extends PageParam {
@Schema(description = "计费方式", example = "1")
@DictFormat(DictTypeConstants.COUNT_TYPE)
private String countType;
@Schema(description = "外部合同id", example = "13085")
@ExcelProperty("合同id")
private Long extContractId;
}

View File

@ -29,7 +29,9 @@ public class ContractRespVO {
@ExcelProperty("项目id")
private Long projectId;
@Schema(description = "外部合同id", example = "13085")
@ExcelProperty("合同id")
private Long extContractId;
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")

View File

@ -25,7 +25,9 @@ public class ContractSaveReqVO {
@ExcelProperty("项目id")
private Long projectId;
@Schema(description = "外部合同id", example = "13085")
@ExcelProperty("合同id")
private Long extContractId;
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
@ExcelProperty("项目编号")

View File

@ -14,129 +14,10 @@ import java.time.LocalDateTime;
@Data
public class ContractHistorySaveReqVO {
@Schema(description = "历史合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
private Long id;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
private Long projectId;
@Schema(description = "流程实体id", example = "12536")
private String processInstanceId;
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
@ExcelProperty("项目编号")
private String code;
@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 ReminderTime;
@Schema(description = "暂定结算数")
@ExcelProperty("暂定结算数")
private BigDecimal provisionalSettlement;
@Schema(description = "出图公司", requiredMode = Schema.RequiredMode.REQUIRED, example = "***设计院")
@ExcelProperty("出图公司")
private String drawingCompany;
@Schema(description = "预计合同金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "200.0000")
@ExcelProperty("预计合同金额")
private BigDecimal expectedContractAmount;
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@NotEmpty(message = "合同名称不能为空")
private String name;
@Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotEmpty(message = "合同类型不能为空")
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
private String type;
@Schema(description = "合同进展", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "合同进展不能为空")
private String progress;
@Schema(description = "合同拟定时间", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "合同拟定时间不能为空")
private LocalDateTime expectedTime;
@Schema(description = "合同用印时间", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "合同用印时间不能为空")
private LocalDateTime printingTime;
@Schema(description = "签订时间")
private LocalDateTime signingTime;
@Schema(description = "归档时间")
private LocalDateTime archiveTime;
@Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotEmpty(message = "合同状态不能为空")
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
private String status;
@Schema(description = "计费方式", example = "2")
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
private String countType;
@Schema(description = "备注", example = "你猜")
private String remark;
@Schema(description = "合同url", example = "https://www.iocoder.cn")
private String contractFileUrl;
@Schema(description = "建安费")
private BigDecimal constructionCost;
@Schema(description = "资金来源")
@DictFormat(DictTypeConstants.SOURCE)
private String source;
@Schema(description = "优惠", example = "18154")
private String discount;
@Schema(description = "是否联合体")
private Boolean consortium;
@Schema(description = "联合体单位")
private String consortiumCompany;
@Schema(description = "占主合同比例")
private String extProportion;
@Schema(description = "审定金额", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "审定金额不能为空")
private BigDecimal approvedAmount;
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
private String reviewFileUrl;
@Schema(description = "签订合同总额")
private BigDecimal amount;
@Schema(description = "前期费")
private BigDecimal preAmount;
@Schema(description = "设计费")
private BigDecimal designAmount;
@Schema(description = "勘测费")
private BigDecimal surveyFees;
@Schema(description = "测量费")
private BigDecimal measurementFee;
@Schema(description = "其他费")
private BigDecimal otherFee;
@Schema(description = "流程状态", example = "2")
@DictFormat(DictTypeConstants.PROCESS_STATUS)
private String processStatus;

View File

@ -28,7 +28,4 @@ public class ExtContractPageReqVO extends PageParam {
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
private String status;
@Schema(description = "合同id", example = "27460")
private Long contractId;
}

View File

@ -21,10 +21,6 @@ public class ExtContractRespVO {
@ExcelProperty("主键")
private Long id;
@Schema(description = "合同id", example = "13085")
@ExcelProperty("合同id")
private Long contractId;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16261")
@ExcelProperty("项目id")
private Long projectId;

View File

@ -20,10 +20,6 @@ public class ExtContractSaveReqVO {
@ExcelProperty("主键")
private Long id;
@Schema(description = "合同id", example = "13085")
@ExcelProperty("合同id")
private Long contractId;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16261")
@ExcelProperty("项目id")
private Long projectId;

View File

@ -34,8 +34,6 @@ import cn.iocoder.yudao.module.cms.service.extcontracthistory.ExtContractHistory
@Validated
public class ExtContractHistoryController {
@Resource
private ExtContractHistoryService extContractHistoryService;

View File

@ -24,20 +24,13 @@ public class ExtContractHistoryPageReqVO extends PageParam {
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
private String type;
@Schema(description = "客户公司id", example = "28989")
private Long customerCompanyId;
@Schema(description = "状态", example = "1")
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
private String status;
@Schema(description = "流程实体id", example = "8911")
private String processInstanceId;
@Schema(description = "流程状态", example = "2")
@DictFormat(DictTypeConstants.PROCESS_STATUS)
private String processStatus;
private Integer processStatus;
@Schema(description = "合同id", example = "26795")
private Long contractId;

View File

@ -1,11 +1,14 @@
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo;
import cn.iocoder.yudao.framework.common.pojo.FileDTO;
import cn.iocoder.yudao.module.cms.enums.DictTypeConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import com.alibaba.excel.annotation.*;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
@ -16,46 +19,45 @@ import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
public class ExtContractHistoryRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "324")
@ExcelProperty("主键")
private Long id;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "409")
@ExcelProperty("项目id")
private Long projectId;
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
@ExcelProperty("项目编号")
private String code;
@Schema(description = "客户名称")
@ExcelProperty("客户名称")
private String customerCompanyName;
private String constructionSide;
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
@ExcelProperty("主控部门")
private String trackingDep;
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("项目经理")
@Schema(description = "项目负责人", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("项目负责人")
private String projectManager;
@Schema(description = "合同提示时间")
@ExcelProperty("合同提示时间")
@Schema(description = "外部合同商议提示时间")
@ExcelProperty("外部合同商议提示时间")
private LocalDateTime exReminderTime;
@Schema(description = "客户公司id", example = "28989")
@ExcelProperty("客户公司id")
private Long customerCompanyId;
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("合同金额")
private BigDecimal amount;
@Schema(description = "合同名称", example = "张三")
@ExcelProperty("合同名称")
private String name;
@Schema(description = "合同类型", example = "1")
@Schema(description = "合同类型", example = "2")
@ExcelProperty("合同类型")
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
private String type;
@Schema(description = "合同进展")
@ExcelProperty("合同进展")
private String progress;
@ -72,12 +74,14 @@ public class ExtContractHistoryRespVO {
@ExcelProperty("归档时间")
private LocalDateTime archiveTime;
@Schema(description = "状态", example = "1")
@ExcelProperty("状态")
@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("前期费用")
@ -97,20 +101,19 @@ public class ExtContractHistoryRespVO {
@Schema(description = "其他费")
@ExcelProperty("其他费")
private String otherFee;
private BigDecimal otherFee;
@Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty(value = "计费方式", converter = DictConvert.class)
@DictFormat(DictTypeConstants.COUNT_TYPE)
@Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty("计费方式")
private String countType;
@Schema(description = "备注", example = "你猜")
@Schema(description = "备注", example = "随便")
@ExcelProperty("备注")
private String remark;
@Schema(description = "合同附件url", example = "https://www.iocoder.cn")
@ExcelProperty("合同附件url")
private String contractFileUrl;
private List<FileDTO> contractFileUrl;
@Schema(description = "建安费")
@ExcelProperty("建安费")
@ -118,17 +121,17 @@ public class ExtContractHistoryRespVO {
@Schema(description = "资金来源")
@ExcelProperty(value = "资金来源", converter = DictConvert.class)
@DictFormat(DictTypeConstants.COUNT_TYPE)
@DictFormat(DictTypeConstants.SOURCE)
private String source;
@Schema(description = "收费标准", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("收费标准")
@ExcelProperty(value = "收费标准", converter = DictConvert.class)
@DictFormat(DictTypeConstants.CHARGING_STANDARD)
private String chargingStandard;
@Schema(description = "优惠", example = "7511")
@Schema(description = "优惠", example = "28322")
@ExcelProperty("优惠")
private String discount;
private BigDecimal discount;
@Schema(description = "是否联合体", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("是否联合体")
@ -138,8 +141,8 @@ public class ExtContractHistoryRespVO {
@ExcelProperty("联合体单位")
private String consortiumCompany;
@Schema(description = "合同提示时间")
@ExcelProperty("合同提示时间")
@Schema(description = "合同商议提示")
@ExcelProperty("合同商议提示")
private LocalDateTime reminderTime;
@Schema(description = "审定金额")
@ -148,22 +151,22 @@ public class ExtContractHistoryRespVO {
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
@ExcelProperty("审核文件url")
private String reviewFileUrl;
private List<FileDTO> reviewFileUrl;
@Schema(description = "流程实体id", example = "8911")
@Schema(description = "最后编辑人")
@ExcelProperty("最后编辑人")
private String finalEditor;
@Schema(description = "流程实体id", example = "24870")
@ExcelProperty("流程实体id")
private String processInstanceId;
@Schema(description = "流程状态", example = "2")
@ExcelProperty(value = "流程状态", converter = DictConvert.class)
@DictFormat(DictTypeConstants.PROCESS_STATUS)
private String processStatus;
private Integer processStatus;
@Schema(description = "合同id", example = "26795")
@ExcelProperty("合同id")
private Long contractId;
@Schema(description = "外部合同id", example = "12093")
@Schema(description = "外部合同id", example = "1808")
@ExcelProperty("外部合同id")
private Long extContractId;

View File

@ -1,153 +1,149 @@
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo;
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.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 外部合同新增/修改 Request VO")
@Data
public class ExtContractHistorySaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "17790")
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "324")
@ExcelProperty("主键")
private Long id;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6935")
@NotNull(message = "项目id不能为空")
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "409")
@ExcelProperty("项目id")
private Long projectId;
@Schema(description = "流程实体id", example = "8911")
private String processInstanceId;
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
@ExcelProperty("项目编号")
private String code;
@Schema(description = "客户名称")
@ExcelProperty("客户名称")
private String customerCompanyName;
@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 = "客户公司id", example = "28989")
private Long customerCompanyId;
@Schema(description = "合同名称", example = "张三")
@ExcelProperty("合同名称")
private String name;
@Schema(description = "合同类型", example = "1")
@DictFormat(DictTypeConstants.CONTRACT_TYPE)
@Schema(description = "合同类型", example = "2")
@ExcelProperty("合同类型")
private String type;
@Schema(description = "合同进展")
@ExcelProperty("合同进展")
private String progress;
@Schema(description = "预计签订时间", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "预计签订时间不能为空")
@ExcelProperty("预计签订时间")
private LocalDateTime expectedTime;
@Schema(description = "签订时间")
@ExcelProperty("签订时间")
private LocalDateTime signingTime;
@Schema(description = "归档时间")
@ExcelProperty("归档时间")
private LocalDateTime archiveTime;
@Schema(description = "状态", example = "1")
@Schema(description = "状态", example = "2")
@ExcelProperty(value = "状态", converter = DictConvert.class)
@DictFormat(DictTypeConstants.CONTRACT_STATUS)
private String status;
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "合同金额不能为空")
@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 = "其他费")
private String otherFee;
@ExcelProperty("其他费")
private BigDecimal otherFee;
@Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotEmpty(message = "计费方式不能为空")
@DictFormat(DictTypeConstants.COUNT_TYPE)
@Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty("计费方式")
private String countType;
@Schema(description = "备注", example = "你猜")
@Schema(description = "备注", example = "随便")
@ExcelProperty("备注")
private String remark;
@Schema(description = "合同附件url", example = "https://www.iocoder.cn")
@ExcelProperty("合同附件url")
private String 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)
@NotEmpty(message = "收费标准不能为空")
@ExcelProperty(value = "收费标准", converter = DictConvert.class)
@DictFormat(DictTypeConstants.CHARGING_STANDARD)
private String chargingStandard;
@Schema(description = "优惠", example = "7511")
private String discount;
@Schema(description = "优惠", example = "28322")
@ExcelProperty("优惠")
private BigDecimal discount;
@Schema(description = "是否联合体", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "是否联合体不能为空")
@ExcelProperty("是否联合体")
private Boolean consortium;
@Schema(description = "联合体单位")
@ExcelProperty("联合体单位")
private String consortiumCompany;
@Schema(description = "合同提示时间")
@Schema(description = "合同商议提示")
@ExcelProperty("合同商议提示")
private LocalDateTime reminderTime;
@Schema(description = "审定金额")
@ExcelProperty("审定金额")
private BigDecimal approvedAmount;
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
@ExcelProperty("审核文件url")
private String reviewFileUrl;
@Schema(description = "最后编辑人")
@ExcelProperty("最后编辑人")
private String finalEditor;
@Schema(description = "流程实体id", example = "24870")
@ExcelProperty("流程实体id")
private String processInstanceId;
@Schema(description = "流程状态", example = "2")
@ExcelProperty(value = "流程状态", converter = DictConvert.class)
@DictFormat(DictTypeConstants.PROCESS_STATUS)
private String processStatus;
private Integer processStatus;
@Schema(description = "合同id", example = "26795")
private Long contractId;
@Schema(description = "外部合同id", example = "12093")
@Schema(description = "外部合同id", example = "1808")
@ExcelProperty("外部合同id")
private Long extContractId;
@Schema(description = "版本")
@ExcelProperty("版本")
private String version;
}

View File

@ -1,6 +1,8 @@
package cn.iocoder.yudao.module.cms.dal.dataobject.contract;
import cn.iocoder.yudao.framework.common.pojo.FileDTO;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
@ -34,7 +36,10 @@ public class ContractDO extends BaseDO {
* 项目id
*/
private Long projectId;
/**
* 外部合同id
*/
private Long extContractId;
/**
* 合同名称
*/

View File

@ -22,7 +22,6 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
@NoArgsConstructor
@AllArgsConstructor
public class ContractHistoryDO extends BaseDO {
/**
* 主键
*/
@ -32,10 +31,24 @@ public class ContractHistoryDO extends BaseDO {
* 项目id
*/
private Long projectId;
/**
* 流程状态
*/
private String processStatus;
/**
* 该合同的id
*/
private Long contractId;
/**
* 版本
*/
private String version;
/**
* 流程实体id
*/
private String processInstanceId;
/**
* 合同名称
*/
@ -66,12 +79,22 @@ public class ContractHistoryDO extends BaseDO {
private LocalDateTime archiveTime;
/**
* 合同状态
* 枚举 {@link cn.iocoder.yudao.module.cms.enums.DictTypeConstants}
*/
private String status;
/**
* 签订合同总额
*/
private BigDecimal amount;
/**
* 计费方式
* 枚举 {@link cn.iocoder.yudao.module.cms.enums.DictTypeConstants}
*/
private String countType;
/**
* 暂定结算数
*/
private BigDecimal provisionalSettlement;
/**
* 备注
*/
@ -91,7 +114,7 @@ public class ContractHistoryDO extends BaseDO {
/**
* 优惠
*/
private String discount;
private BigDecimal discount;
/**
* 是否联合体
*/
@ -103,7 +126,7 @@ public class ContractHistoryDO extends BaseDO {
/**
* 占主合同比例
*/
private String extProportion;
private BigDecimal extProportion;
/**
* 审定金额
*/
@ -113,39 +136,8 @@ public class ContractHistoryDO extends BaseDO {
*/
private String reviewFileUrl;
/**
* 签订合同总额
* 最后编辑人
*/
private BigDecimal amount;
/**
* 前期费
*/
private BigDecimal preAmount;
/**
* 设计费
*/
private BigDecimal designAmount;
/**
* 勘测费
*/
private BigDecimal surveyFees;
/**
* 测量费
*/
private BigDecimal measurementFee;
/**
* 其他费
*/
private BigDecimal otherFee;
/**
* 流程状态
*/
private String processStatus;
/**
* 合同
*/
private Long contractId;
/**
* 版本
*/
private String version;
private String finalEditor;
}

View File

@ -28,10 +28,6 @@ public class ExtContractDO extends BaseDO {
*/
@TableId
private Long id;
/**
* 合同id
*/
private Long contractId;
/**
* 项目id
*/

View File

@ -1,15 +1,28 @@
package cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory;
import cn.hutool.core.lang.Dict;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 外部合同 DO
* 外部合同历史 DO
*
* @author 管理员
*/
@ -40,10 +53,6 @@ public class ExtContractHistoryDO extends BaseDO {
* 合同类型
*/
private String type;
/**
* 客户公司id
*/
private Long customerCompanyId;
/**
* 合同进展
*/
@ -65,7 +74,7 @@ public class ExtContractHistoryDO extends BaseDO {
*/
private String status;
/**
* 合同金额
* 合同金额
*/
private BigDecimal amount;
/**
@ -87,11 +96,9 @@ public class ExtContractHistoryDO extends BaseDO {
/**
* 其他费
*/
private String otherFee;
private BigDecimal otherFee;
/**
* 计费方式
*
* 枚举 {@link //TODO contract_billing_type 对应的类}
*/
private String countType;
/**
@ -108,18 +115,17 @@ public class ExtContractHistoryDO extends BaseDO {
private BigDecimal constructionCost;
/**
* 资金来源
*
* 枚举 {@link //TODO funds_source 对应的类}
*/
private String source;
/**
* 收费标准
*
*/
private String chargingStandard;
/**
* 优惠
*/
private String discount;
private BigDecimal discount;
/**
* 是否联合体
*/
@ -129,7 +135,7 @@ public class ExtContractHistoryDO extends BaseDO {
*/
private String consortiumCompany;
/**
* 合同提示时间
* 合同商议提示
*/
private LocalDateTime reminderTime;
/**
@ -140,20 +146,18 @@ public class ExtContractHistoryDO extends BaseDO {
* 审核文件url
*/
private String reviewFileUrl;
/**
* 最后编辑人
*/
private String finalEditor;
/**
* 流程实体id
*/
private String processInstanceId;
/**
* 流程状态
*
* 枚举 {@link //TODO bpm_process_instance_status 对应的类}
*/
private String processStatus;
/**
* 合同id
*/
private Long contractId;
private Integer processStatus;
/**
* 外部合同id
*/

View File

@ -22,13 +22,7 @@ public interface ExtContractMapper extends BaseMapperX<ExtContractDO> {
.eqIfPresent(ExtContractDO::getProjectId, reqVO.getProjectId())
.eqIfPresent(ExtContractDO::getType, reqVO.getType())
.eqIfPresent(ExtContractDO::getStatus, reqVO.getStatus())
.eqIfPresent(ExtContractDO::getContractId, reqVO.getContractId()));
}
default List<ExtContractDO> selectLocalDateTime(Long contractId) {
return selectList(new LambdaQueryWrapperX<ExtContractDO>()
.eqIfPresent(ExtContractDO::getContractId,contractId)
.orderByDesc(ExtContractDO::getReminderTime));
);
}
}

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.cms.dal.mysql.extcontracthistory;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
@ -9,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo.*;
/**
* 外部合同 Mapper
* 外部合同历史 Mapper
*
* @author 管理员
*/
@ -21,12 +22,12 @@ public interface ExtContractHistoryMapper extends BaseMapperX<ExtContractHistory
.eqIfPresent(ExtContractHistoryDO::getProjectId, reqVO.getProjectId())
.likeIfPresent(ExtContractHistoryDO::getName, reqVO.getName())
.eqIfPresent(ExtContractHistoryDO::getType, reqVO.getType())
.eqIfPresent(ExtContractHistoryDO::getCustomerCompanyId, reqVO.getCustomerCompanyId())
.eqIfPresent(ExtContractHistoryDO::getStatus, reqVO.getStatus())
.eqIfPresent(ExtContractHistoryDO::getProcessInstanceId, reqVO.getProcessInstanceId())
.eqIfPresent(ExtContractHistoryDO::getProcessStatus, reqVO.getProcessStatus())
.eqIfPresent(ExtContractHistoryDO::getContractId, reqVO.getContractId())
.eqIfPresent(ExtContractHistoryDO::getExtContractId, reqVO.getExtContractId()));
.eqIfPresent(ExtContractHistoryDO::getExtContractId, reqVO.getExtContractId())
);
}
}

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.cms.service.contract;
import cn.hutool.core.bean.BeanUtil;
import cn.iocoder.yudao.framework.common.util.file.FileUtils;
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDetailDO;
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
import cn.iocoder.yudao.module.cms.service.extContract.ExtContractService;
@ -18,7 +19,6 @@ import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@ -60,6 +60,7 @@ public class ContractServiceImpl implements ContractService {
}
//校验,项目是否存在
Long projectId = createReqVO.getProjectId();
projectTrackingApi.validateProjectExists(projectId);
String name = createReqVO.getName();
String trimName = name.trim();
List<ContractDO> projectList = contractMapper.selectList("project_id", projectId);
@ -69,6 +70,8 @@ public class ContractServiceImpl implements ContractService {
}
}
ContractDO contract = BeanUtils.toBean(createReqVO, ContractDO.class);
contract.setReviewFileUrl(FileUtils.covertFileToJSONString(createReqVO.getReviewFileUrl()));
contract.setContractFileUrl(FileUtils.covertFileToJSONString(createReqVO.getContractFileUrl()));
contract.setCreator(userName);
contract.setUpdater(userName);
contractMapper.insert(contract);
@ -126,12 +129,12 @@ public class ContractServiceImpl implements ContractService {
if (contractDO == null) {
throw exception(CONTRACT_NOT_EXISTS);
}
Long extContractId = contractDO.getExtContractId();
Long projectId = contractDO.getProjectId();
projectTrackingApi.validateProjectExists(projectId);
ProjectScheduleDetailDTO projectScheduleDetail = projectScheduleApi.getProjectScheduleDetail(projectId);
ProjectTrackingDetailDTO projectTracking = projectTrackingApi.getProjectTracking(projectId);
LocalDateTime localDateTime = extContractService.getLocalDateTime(id);
contractDetailDO.setReminderTime(localDateTime);
contractDetailDO.setReminderTime(extContractService.getContractDetail(extContractId).getReminderTime());
BeanUtil.copyProperties(contractDO, contractDetailDO);
BeanUtil.copyProperties(projectTracking,contractDetailDO);
BeanUtil.copyProperties(projectScheduleDetail,contractDetailDO);

View File

@ -39,12 +39,9 @@ public class ContractHistoryServiceImpl implements ContractHistoryService {
@Override
public void updateContractHistory(Long loginUserId,ContractHistorySaveReqVO updateReqVO) {
//校验
Long id = updateReqVO.getId();
validateContractHistoryExists(id);
if (loginUserId == null){
throw exception(USER_NOT_EXISTS);
}
Long projectId = updateReqVO.getProjectId();
// 更新
ContractHistoryDO updateObj = BeanUtils.toBean(updateReqVO, ContractHistoryDO.class);
String userName = adminUserApi.getUser(loginUserId).getNickname();

View File

@ -56,11 +56,5 @@ public interface ExtContractService {
*/
PageResult<ExtContractRespVO> getExtContractPage(ExtContractPageReqVO pageReqVO);
/**
* 得到合同商议时间
* @param contractId 合同id
* @return
*/
LocalDateTime getLocalDateTime(Long contractId);
}

View File

@ -1,11 +1,16 @@
package cn.iocoder.yudao.module.cms.service.extContract;
import cn.hutool.core.bean.BeanUtil;
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.dto.BpmProcessInstanceCreateReqDTO;
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
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.dal.dataobject.extcontract.ExtContractDO;
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDetailDO;
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory.ExtContractHistoryDO;
import cn.iocoder.yudao.module.cms.dal.mysql.extContract.ExtContractMapper;
import cn.iocoder.yudao.module.cms.dal.mysql.extcontracthistory.ExtContractHistoryMapper;
import cn.iocoder.yudao.module.pms.api.projectschedule.ProjectScheduleApi;
import cn.iocoder.yudao.module.pms.api.projectschedule.dto.ProjectScheduleDetailDTO;
import cn.iocoder.yudao.module.pms.api.projecttracking.ProjectTrackingApi;
@ -17,7 +22,6 @@ import org.springframework.validation.annotation.Validated;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@ -33,6 +37,11 @@ import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
@Validated
public class ExtContractServiceImpl implements ExtContractService {
/**
* 外部合同审批流程定义
*/
public static final String PROCESS_KEY = "ext_contract_init";
@Resource
private ExtContractMapper extContractMapper;
@ -46,26 +55,59 @@ public class ExtContractServiceImpl implements ExtContractService {
private ProjectScheduleApi projectScheduleApi;
@Resource
private BpmProcessInstanceApi processInstanceApi;
@Resource
private ExtContractHistoryMapper extContractHistoryMapper;
@Override
public Long createExtContract(Long loginUserId, ExtContractSaveReqVO createReqVO) {
//插入外部合同表
String userName = adminUserApi.getUser(loginUserId).getNickname();
//校验,项目是否存在
Long contractId = createReqVO.getContractId();
String name = createReqVO.getName();
String trimName = name.trim();
List<ExtContractDO> extContractList = extContractMapper.selectList("contract_id", contractId);
Long projectId = createReqVO.getProjectId();
projectTrackingApi.validateProjectExists(projectId);
List<ExtContractDO> extContractList = extContractMapper.selectList("project_id", projectId);
for (ExtContractDO extContractDO : extContractList) {
if (extContractDO.getName().equals(trimName)){
throw exception(EXT_CONTRACT_EXISTS);
}
}
ExtContractDO extContract = BeanUtils.toBean(createReqVO, ExtContractDO.class);
extContract.setReviewFileUrl(FileUtils.covertFileToJSONString(createReqVO.getReviewFileUrl()));
extContract.setContractFileUrl(FileUtils.covertFileToJSONString(createReqVO.getContractFileUrl()));
extContract.setCreator(userName);
extContract.setUpdater(userName);
//也要插入历史
ExtContractHistoryDO extContractHistoryDO = BeanUtils.toBean(extContract, ExtContractHistoryDO.class);
extContractMapper.insert(extContract);
extContractHistoryDO.setExtContractId(extContract.getId());
//版本
if (extContractHistoryMapper.selectCount("project_id", createReqVO.getProjectId()) < 1) {
extContractHistoryDO.setVersion("1");
}else{
extContractHistoryDO.setVersion(String.valueOf(extContractHistoryMapper.selectCount("project_id", createReqVO.getProjectId()) + 1));
}
//状态
extContractHistoryDO.setProcessStatus(1);
extContractHistoryMapper.insert(extContractHistoryDO);
// 启动流程
if (createReqVO.getId() == null) {
String processInstanceId = processInstanceApi.createProcessInstance(loginUserId,
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
.setBusinessKey(String.valueOf(extContract.getId())));
// 写入工作流编号
extContractHistoryMapper.updateById(extContractHistoryDO.setProcessInstanceId(processInstanceId));
}
//返回
return extContract.getId();
}
@ -126,13 +168,6 @@ public class ExtContractServiceImpl implements ExtContractService {
return pageResult;
}
@Override
public LocalDateTime getLocalDateTime(Long contractId) {
List<ExtContractDO> extContractDOS = extContractMapper.selectLocalDateTime(contractId);
return extContractDOS.get(0).getReminderTime();
}
private void validateExtContractExists(Long id) {
if (extContractMapper.selectById(id) == null) {
throw exception(EXT_CONTRACT_NOT_EXISTS);