From 5c4b2e1271e32cda8f424a3589cf63981a95bfb2 Mon Sep 17 00:00:00 2001
From: wyw <13885678+wyw0828@user.noreply.gitee.com>
Date: Mon, 22 Jul 2024 17:09:10 +0800
Subject: [PATCH] =?UTF-8?q?[feat]=20=E6=96=B0=E5=A2=9E=E5=90=88=E5=90=8C?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../module/cms/enums/ErrorCodeConstants.java | 6 +
yudao-module-cms/yudao-module-cms-biz/pom.xml | 6 +
.../admin/contract/ContractController.java | 91 +++++++++++
.../admin/contract/vo/ContractPageReqVO.java | 102 ++++++++++++
.../admin/contract/vo/ContractRespVO.java | 151 ++++++++++++++++++
.../admin/contract/vo/ContractSaveReqVO.java | 95 +++++++++++
.../dal/dataobject/contract/ContractDO.java | 147 +++++++++++++++++
.../dal/mysql/contract/ContractMapper.java | 54 +++++++
.../cms/service/contract/ContractService.java | 53 ++++++
.../service/contract/ContractServiceImpl.java | 98 ++++++++++++
.../contract/ContractMapper.xml | 12 ++
.../yudao/module/pms/api/ProjectApi.java | 17 ++
.../api/dto/project/ProjectDetailRespDTO.java | 21 +++
.../pms/api/dto/project/ProjectRespDTO.java | 46 ++++++
.../module/pms/api/project/ProjectImpl.java | 30 ++++
.../pms/dal/dataobject/project/ProjectDO.java | 5 +-
.../dataobject/project/ProjectDetailDO.java | 3 -
.../pms/dal/mysql/project/ProjectMapper.java | 2 +-
18 files changed, 931 insertions(+), 8 deletions(-)
create mode 100644 yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/ContractController.java
create mode 100644 yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/vo/ContractPageReqVO.java
create mode 100644 yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/vo/ContractRespVO.java
create mode 100644 yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/vo/ContractSaveReqVO.java
create mode 100644 yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/dataobject/contract/ContractDO.java
create mode 100644 yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/mysql/contract/ContractMapper.java
create mode 100644 yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/contract/ContractService.java
create mode 100644 yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/contract/ContractServiceImpl.java
create mode 100644 yudao-module-cms/yudao-module-cms-biz/src/main/resources/mapper/customerCompany/contract/ContractMapper.xml
create mode 100644 yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/ProjectApi.java
create mode 100644 yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/dto/project/ProjectDetailRespDTO.java
create mode 100644 yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/dto/project/ProjectRespDTO.java
create mode 100644 yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/api/project/ProjectImpl.java
diff --git a/yudao-module-cms/yudao-module-cms-api/src/main/java/cn/iocoder/yudao/module/cms/enums/ErrorCodeConstants.java b/yudao-module-cms/yudao-module-cms-api/src/main/java/cn/iocoder/yudao/module/cms/enums/ErrorCodeConstants.java
index abee178a1..82e047b8e 100644
--- a/yudao-module-cms/yudao-module-cms-api/src/main/java/cn/iocoder/yudao/module/cms/enums/ErrorCodeConstants.java
+++ b/yudao-module-cms/yudao-module-cms-api/src/main/java/cn/iocoder/yudao/module/cms/enums/ErrorCodeConstants.java
@@ -9,4 +9,10 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
*/
public interface ErrorCodeConstants {
ErrorCode CUSTOMER_COMPANY_NOT_EXISTS = new ErrorCode(1_020_000_000, "客户公司管理不存在");
+
+ ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(2_020_000_000, "合同不存在");
+
+
+
+
}
diff --git a/yudao-module-cms/yudao-module-cms-biz/pom.xml b/yudao-module-cms/yudao-module-cms-biz/pom.xml
index b85804e64..ca875d5e7 100644
--- a/yudao-module-cms/yudao-module-cms-biz/pom.xml
+++ b/yudao-module-cms/yudao-module-cms-biz/pom.xml
@@ -29,6 +29,12 @@
${revision}
+
+ cn.iocoder.boot
+ yudao-module-pms-api
+ ${revision}
+
+
cn.iocoder.boot
diff --git a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/ContractController.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/ContractController.java
new file mode 100644
index 000000000..06e27fd75
--- /dev/null
+++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/ContractController.java
@@ -0,0 +1,91 @@
+package cn.iocoder.yudao.module.cms.controller.admin.contract;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractPageReqVO;
+import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractRespVO;
+import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractSaveReqVO;
+import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
+import cn.iocoder.yudao.module.cms.service.contract.ContractService;
+import org.springframework.web.bind.annotation.*;
+import jakarta.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+import jakarta.validation.*;
+import jakarta.servlet.http.*;
+import java.io.IOException;
+import java.util.List;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
+
+@Tag(name = "管理后台 - 合同管理")
+@RestController
+@RequestMapping("/cms/contract")
+@Validated
+public class ContractController {
+
+ @Resource
+ private ContractService contractService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建合同")
+ @PreAuthorize("@ss.hasPermission('cms:contract:create')")
+ public CommonResult createContract(@Valid @RequestBody ContractSaveReqVO createReqVO) {
+ return success(contractService.createContract(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新合同")
+ @PreAuthorize("@ss.hasPermission('cms:contract:update')")
+ public CommonResult updateContract(@Valid @RequestBody ContractSaveReqVO updateReqVO) {
+ contractService.updateContract(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除合同")
+ @Parameter(name = "projectId", description = "项目id", required = true)
+ @PreAuthorize("@ss.hasPermission('cms:contract:delete')")
+ public CommonResult deleteContract(@RequestParam("projectId") Long projectId) {
+ contractService.deleteContract(projectId);
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得合同")
+ @Parameter(name = "projectId", description = "项目id", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('cms:contract:query')")
+ public CommonResult getContract(@RequestParam("projectId") Long projectId) {
+ ContractRespVO contractRespVO = contractService.getContract(projectId);
+ return success(contractRespVO);
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得合同分页")
+ @PreAuthorize("@ss.hasPermission('cms:contract:query')")
+ public CommonResult> getContractPage(@Valid ContractPageReqVO pageReqVO) {
+ PageResult pageResult = contractService.getContractPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, ContractRespVO.class));
+ }
+
+ @GetMapping("/export-excel")
+ @Operation(summary = "导出合同 Excel")
+ @PreAuthorize("@ss.hasPermission('cms:contract:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportContractExcel(@Valid ContractPageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List list = contractService.getContractPage(pageReqVO).getList();
+ // 导出 Excel
+ ExcelUtils.write(response, "合同.xls", "数据", ContractRespVO.class,
+ BeanUtils.toBean(list, ContractRespVO.class));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/vo/ContractPageReqVO.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/vo/ContractPageReqVO.java
new file mode 100644
index 000000000..b66ae265e
--- /dev/null
+++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/vo/ContractPageReqVO.java
@@ -0,0 +1,102 @@
+package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 合同分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class ContractPageReqVO extends PageParam {
+
+ @Schema(description = "合同名称", example = "芋艿")
+ private String name;
+
+ @Schema(description = "合同类型", example = "2")
+ private String type;
+
+ @Schema(description = "合同进展")
+ private String progress;
+
+ @Schema(description = "合同拟定时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] expectedTime;
+
+ @Schema(description = "合同用印时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] printingTime;
+
+ @Schema(description = "签订时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] signingTime;
+
+ @Schema(description = "归档时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] archiveTime;
+
+ @Schema(description = "合同状态", example = "1")
+ private String status;
+
+ @Schema(description = "计费方式", example = "1")
+ 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 = "资金来源")
+ private String source;
+
+ @Schema(description = "优惠", example = "17910")
+ private String discount;
+
+ @Schema(description = "是否联合体")
+ private Boolean consortium;
+
+ @Schema(description = "联合体单位")
+ private String consortiumCompany;
+
+ @Schema(description = "占主合同比例")
+ private String extProportion;
+
+ @Schema(description = "审定金额")
+ private BigDecimal approvedAmount;
+
+ @Schema(description = "审核文件url", example = "https://www.iocoder.cn")
+ private String reviewFileUrl;
+
+ @Schema(description = "创建时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] createTime;
+
+ @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;
+
+}
\ No newline at end of file
diff --git a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/vo/ContractRespVO.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/vo/ContractRespVO.java
new file mode 100644
index 000000000..bc7d15f65
--- /dev/null
+++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/vo/ContractRespVO.java
@@ -0,0 +1,151 @@
+package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 合同 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class ContractRespVO {
+
+
+
+ @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 = "出图公司", 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 = "2024年6月28日")
+ @ExcelProperty("分包合同商议提示")
+ private Date subcontractNegotiationTips;
+
+ @Schema(description = "暂定结算数", requiredMode = Schema.RequiredMode.REQUIRED,example = "68.0000")
+ @ExcelProperty("暂定结算数")
+ private Double ProvisionalSettlement;
+
+ @Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
+ @ExcelProperty("合同名称")
+ private String name;
+
+ @Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+ @ExcelProperty("合同类型")
+ private String type;
+
+ @Schema(description = "合同进展", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("合同进展")
+ private String progress;
+
+ @Schema(description = "合同拟定时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("合同拟定时间")
+ private LocalDateTime expectedTime;
+
+ @Schema(description = "合同用印时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("合同用印时间")
+ private LocalDateTime printingTime;
+
+ @Schema(description = "签订时间")
+ @ExcelProperty("签订时间")
+ private LocalDateTime signingTime;
+
+ @Schema(description = "归档时间")
+ @ExcelProperty("归档时间")
+ private LocalDateTime archiveTime;
+
+ @Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+ @ExcelProperty("合同状态")
+ private String status;
+
+ @Schema(description = "计费方式", example = "1")
+ @ExcelProperty("计费方式")
+ private String countType;
+
+ @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("资金来源")
+ private String source;
+
+ @Schema(description = "优惠", example = "17910")
+ @ExcelProperty("优惠")
+ private String discount;
+
+ @Schema(description = "是否联合体")
+ @ExcelProperty("是否联合体")
+ private Boolean consortium;
+
+ @Schema(description = "联合体单位")
+ @ExcelProperty("联合体单位")
+ private String consortiumCompany;
+
+ @Schema(description = "占主合同比例")
+ @ExcelProperty("占主合同比例")
+ private String extProportion;
+
+ @Schema(description = "审定金额", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("审定金额")
+ private BigDecimal approvedAmount;
+
+ @Schema(description = "审核文件url", example = "https://www.iocoder.cn")
+ @ExcelProperty("审核文件url")
+ private String reviewFileUrl;
+
+ @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ @ExcelProperty("创建时间")
+ private LocalDateTime createTime;
+
+ @Schema(description = "签订合同总额")
+ @ExcelProperty("签订合同总额")
+ private BigDecimal amount;
+
+ @Schema(description = "前期费")
+ @ExcelProperty("前期费")
+ private BigDecimal preAmount;
+
+ @Schema(description = "设计费")
+ @ExcelProperty("设计费")
+ private BigDecimal designAmount;
+
+ @Schema(description = "勘测费")
+ @ExcelProperty("勘测费")
+ private BigDecimal surveyFees;
+
+ @Schema(description = "测量费")
+ @ExcelProperty("测量费")
+ private BigDecimal measurementFee;
+
+ @Schema(description = "其他费")
+ @ExcelProperty("其他费")
+ private BigDecimal otherFee;
+
+}
\ No newline at end of file
diff --git a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/vo/ContractSaveReqVO.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/vo/ContractSaveReqVO.java
new file mode 100644
index 000000000..4a485d2ef
--- /dev/null
+++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/contract/vo/ContractSaveReqVO.java
@@ -0,0 +1,95 @@
+package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import jakarta.validation.constraints.*;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 合同新增/修改 Request VO")
+@Data
+public class ContractSaveReqVO {
+
+ @Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
+ @NotEmpty(message = "合同名称不能为空")
+ private String name;
+
+ @Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
+ @NotEmpty(message = "合同类型不能为空")
+ 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 = "合同状态不能为空")
+ private String status;
+
+ @Schema(description = "计费方式", example = "1")
+ 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 = "资金来源")
+ private String source;
+
+ @Schema(description = "优惠", example = "17910")
+ 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;
+
+}
\ No newline at end of file
diff --git a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/dataobject/contract/ContractDO.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/dataobject/contract/ContractDO.java
new file mode 100644
index 000000000..dfb94f8b8
--- /dev/null
+++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/dataobject/contract/ContractDO.java
@@ -0,0 +1,147 @@
+package cn.iocoder.yudao.module.cms.dal.dataobject.contract;
+
+import lombok.*;
+import java.util.*;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.math.BigDecimal;
+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 com.baomidou.mybatisplus.annotation.*;
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 合同 DO
+ *
+ * @author 管理员
+ */
+@TableName("cms_contract")
+@KeySequence("cms_contract_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ContractDO extends BaseDO {
+
+ /**
+ * 主键
+ */
+ @TableId
+ private Long id;
+ /**
+ * 项目id
+ */
+ private Long projectId;
+ /**
+ * 合同名称
+ */
+ private String name;
+ /**
+ * 合同类型
+ */
+ private String type;
+ /**
+ * 合同进展
+ */
+ private String progress;
+ /**
+ * 合同拟定时间
+ */
+ private LocalDateTime expectedTime;
+ /**
+ * 合同用印时间
+ */
+ private LocalDateTime printingTime;
+ /**
+ * 签订时间
+ */
+ private LocalDateTime signingTime;
+ /**
+ * 归档时间
+ */
+ private LocalDateTime archiveTime;
+ /**
+ * 合同状态
+ */
+ private String status;
+ /**
+ * 计费方式
+ */
+ private String countType;
+ /**
+ * 备注
+ */
+ private String remark;
+ /**
+ * 合同url
+ */
+ private String contractFileUrl;
+ /**
+ * 建安费
+ */
+ private BigDecimal constructionCost;
+ /**
+ * 资金来源
+ */
+ private String source;
+ /**
+ * 优惠
+ */
+ private String discount;
+ /**
+ * 是否联合体
+ */
+ private Boolean consortium;
+ /**
+ * 联合体单位
+ */
+ private String consortiumCompany;
+ /**
+ * 占主合同比例
+ */
+ private String extProportion;
+ /**
+ * 审定金额
+ */
+ private BigDecimal approvedAmount;
+ /**
+ * 审核文件url
+ */
+ private String reviewFileUrl;
+ /**
+ * 签订合同总额
+ */
+ private BigDecimal amount;
+ /**
+ * 前期费
+ */
+ private BigDecimal preAmount;
+ /**
+ * 设计费
+ */
+ private BigDecimal designAmount;
+ /**
+ * 勘测费
+ */
+ private BigDecimal surveyFees;
+ /**
+ * 测量费
+ */
+ private BigDecimal measurementFee;
+ /**
+ * 其他费
+ */
+ private BigDecimal otherFee;
+
+}
\ No newline at end of file
diff --git a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/mysql/contract/ContractMapper.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/mysql/contract/ContractMapper.java
new file mode 100644
index 000000000..20c965806
--- /dev/null
+++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/mysql/contract/ContractMapper.java
@@ -0,0 +1,54 @@
+package cn.iocoder.yudao.module.cms.dal.mysql.contract;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.*;
+
+/**
+ * 合同 Mapper
+ *
+ * @author 管理员
+ */
+@Mapper
+public interface ContractMapper extends BaseMapperX {
+
+ default PageResult selectPage(ContractPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .likeIfPresent(ContractDO::getName, reqVO.getName())
+ .eqIfPresent(ContractDO::getType, reqVO.getType())
+ .eqIfPresent(ContractDO::getProgress, reqVO.getProgress())
+ .betweenIfPresent(ContractDO::getExpectedTime, reqVO.getExpectedTime())
+ .betweenIfPresent(ContractDO::getPrintingTime, reqVO.getPrintingTime())
+ .betweenIfPresent(ContractDO::getSigningTime, reqVO.getSigningTime())
+ .betweenIfPresent(ContractDO::getArchiveTime, reqVO.getArchiveTime())
+ .eqIfPresent(ContractDO::getStatus, reqVO.getStatus())
+ .eqIfPresent(ContractDO::getCountType, reqVO.getCountType())
+ .eqIfPresent(ContractDO::getRemark, reqVO.getRemark())
+ .eqIfPresent(ContractDO::getContractFileUrl, reqVO.getContractFileUrl())
+ .eqIfPresent(ContractDO::getConstructionCost, reqVO.getConstructionCost())
+ .eqIfPresent(ContractDO::getSource, reqVO.getSource())
+ .eqIfPresent(ContractDO::getDiscount, reqVO.getDiscount())
+ .eqIfPresent(ContractDO::getConsortium, reqVO.getConsortium())
+ .eqIfPresent(ContractDO::getConsortiumCompany, reqVO.getConsortiumCompany())
+ .eqIfPresent(ContractDO::getExtProportion, reqVO.getExtProportion())
+ .eqIfPresent(ContractDO::getApprovedAmount, reqVO.getApprovedAmount())
+ .eqIfPresent(ContractDO::getReviewFileUrl, reqVO.getReviewFileUrl())
+ .betweenIfPresent(ContractDO::getCreateTime, reqVO.getCreateTime())
+ .eqIfPresent(ContractDO::getAmount, reqVO.getAmount())
+ .eqIfPresent(ContractDO::getPreAmount, reqVO.getPreAmount())
+ .eqIfPresent(ContractDO::getDesignAmount, reqVO.getDesignAmount())
+ .eqIfPresent(ContractDO::getSurveyFees, reqVO.getSurveyFees())
+ .eqIfPresent(ContractDO::getMeasurementFee, reqVO.getMeasurementFee())
+ .eqIfPresent(ContractDO::getOtherFee, reqVO.getOtherFee())
+
+ .orderByDesc(ContractDO::getId)
+
+
+ );
+
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/contract/ContractService.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/contract/ContractService.java
new file mode 100644
index 000000000..3693b101a
--- /dev/null
+++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/contract/ContractService.java
@@ -0,0 +1,53 @@
+package cn.iocoder.yudao.module.cms.service.contract;
+
+import jakarta.validation.*;
+import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.*;
+import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+
+/**
+ * 合同 Service 接口
+ *
+ * @author 管理员
+ */
+public interface ContractService {
+
+ /**
+ * 创建合同
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ Long createContract(@Valid ContractSaveReqVO createReqVO);
+
+ /**
+ * 更新合同
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updateContract(@Valid ContractSaveReqVO updateReqVO);
+
+ /**
+ * 删除合同
+ *
+ * @param id 编号
+ */
+ void deleteContract(Long id);
+
+ /**
+ * 获得合同
+ *
+ * @param id 编号
+ * @return 合同
+ */
+ ContractRespVO getContract(Long id);
+
+ /**
+ * 获得合同分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 合同分页
+ */
+ PageResult getContractPage(ContractPageReqVO pageReqVO);
+
+}
\ No newline at end of file
diff --git a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/contract/ContractServiceImpl.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/contract/ContractServiceImpl.java
new file mode 100644
index 000000000..13044adc9
--- /dev/null
+++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/contract/ContractServiceImpl.java
@@ -0,0 +1,98 @@
+package cn.iocoder.yudao.module.cms.service.contract;
+
+import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
+import cn.iocoder.yudao.module.pms.api.ProjectApi;
+import cn.iocoder.yudao.module.pms.api.dto.project.ProjectDetailRespDTO;
+import cn.iocoder.yudao.module.pms.api.dto.project.ProjectRespDTO;
+import org.springframework.stereotype.Service;
+import jakarta.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+
+import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.*;
+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 static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
+
+/**
+ * 合同 Service 实现类
+ *
+ * @author 管理员
+ */
+@Service
+@Validated
+public class ContractServiceImpl implements ContractService {
+
+ @Resource
+ private ContractMapper contractMapper;
+
+ @Resource
+ private ProjectApi projectApi;
+
+
+ @Override
+ public Long createContract(ContractSaveReqVO createReqVO) {
+ // 插入
+ ContractDO contract = BeanUtils.toBean(createReqVO, ContractDO.class);
+ contractMapper.insert(contract);
+ // 返回
+ return contract.getId();
+ }
+
+ @Override
+ public void updateContract(ContractSaveReqVO updateReqVO) {
+ // 更新
+ ContractDO updateObj = BeanUtils.toBean(updateReqVO, ContractDO.class);
+ contractMapper.updateById(updateObj);
+ }
+
+ @Override
+ public void deleteContract(Long id) {
+ // 校验存在
+ validateContractExists(id);
+ // 删除
+ contractMapper.deleteById(id);
+ }
+
+ private void validateContractExists(Long projectId) {
+ if (contractMapper.selectById(projectId) == null) {
+ throw exception(CONTRACT_NOT_EXISTS);
+ }
+ }
+
+ @Override
+ public ContractRespVO getContract(Long projectId) {
+ ContractDO contractDO = contractMapper.selectById(projectId);
+ ContractRespVO contractRespVO = BeanUtils.toBean(contractDO, ContractRespVO.class);
+
+// 需要联表查询
+// 1.项目编号 pms_project 直接 √
+// 2.主控部门(跟踪部门) pms_project找到的是id 需要联表 √
+// 3.项目经理 pms_project找到的是id 需要联表 √
+// 4.出图公司 pms_project 直接 √
+// 5.预计合同金额 pms_project 直接 √
+// 6.分包合同商议提示 pms_project_schedule
+// 7.暂定结算数
+ ProjectRespDTO project = projectApi.getProject(projectId);
+ contractRespVO.setCode(project.getCode());
+ contractRespVO.setDrawingCompany(project.getDrawingCompany());
+ contractRespVO.setExpectedContractAmount(project.getContractAmount());
+
+ ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
+ contractRespVO.setTrackingDep(projectDetail.getTrackingDepName());
+ contractRespVO.setProjectManager(projectDetail.getProjectManagerName());
+
+
+
+
+ return contractRespVO;
+ }
+
+ @Override
+ public PageResult getContractPage(ContractPageReqVO pageReqVO) {
+ return contractMapper.selectPage(pageReqVO);
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-cms/yudao-module-cms-biz/src/main/resources/mapper/customerCompany/contract/ContractMapper.xml b/yudao-module-cms/yudao-module-cms-biz/src/main/resources/mapper/customerCompany/contract/ContractMapper.xml
new file mode 100644
index 000000000..96cc50552
--- /dev/null
+++ b/yudao-module-cms/yudao-module-cms-biz/src/main/resources/mapper/customerCompany/contract/ContractMapper.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/ProjectApi.java b/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/ProjectApi.java
new file mode 100644
index 000000000..8d8996f18
--- /dev/null
+++ b/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/ProjectApi.java
@@ -0,0 +1,17 @@
+package cn.iocoder.yudao.module.pms.api;
+
+import cn.iocoder.yudao.module.pms.api.dto.project.ProjectDetailRespDTO;
+import cn.iocoder.yudao.module.pms.api.dto.project.ProjectRespDTO;
+
+public interface ProjectApi {
+ /**
+ * 获得项目部分信息
+ */
+ ProjectRespDTO getProject(Long projectId);
+
+ /**
+ * 获得项目detail信息
+ */
+ ProjectDetailRespDTO getProjectDetailById(Long projectId);
+
+}
diff --git a/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/dto/project/ProjectDetailRespDTO.java b/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/dto/project/ProjectDetailRespDTO.java
new file mode 100644
index 000000000..aa2090cbd
--- /dev/null
+++ b/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/dto/project/ProjectDetailRespDTO.java
@@ -0,0 +1,21 @@
+package cn.iocoder.yudao.module.pms.api.dto.project;
+
+import lombok.Data;
+
+@Data
+public class ProjectDetailRespDTO {
+
+ /**
+ * 跟踪部门
+ */
+ private String trackingDepName;
+ /**
+ * 项目经理
+ */
+ private String projectManagerName;
+ /**
+ * 客户公司
+ */
+ private String customerCompanyName;
+
+}
diff --git a/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/dto/project/ProjectRespDTO.java b/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/dto/project/ProjectRespDTO.java
new file mode 100644
index 000000000..f692b0cde
--- /dev/null
+++ b/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/dto/project/ProjectRespDTO.java
@@ -0,0 +1,46 @@
+package cn.iocoder.yudao.module.pms.api.dto.project;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 项目基本信息 dto
+ */
+@Data
+public class ProjectRespDTO {
+
+
+ /**
+ * 项目编号
+ */
+ private String code;
+
+ /**
+ * 出图公司
+ */
+ private String drawingCompany;
+
+ /**
+ * 跟踪部门id
+ */
+ private Long trackingDepId;
+
+ /**
+ * 客户公司id
+ */
+ private Long customerCompanyId;
+
+ /**
+ * 项目经理id
+ */
+ private Long projectManagerId;
+
+ /**
+ * 预计合同金额
+ */
+ private BigDecimal contractAmount;
+
+
+
+}
diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/api/project/ProjectImpl.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/api/project/ProjectImpl.java
new file mode 100644
index 000000000..8cb41c0af
--- /dev/null
+++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/api/project/ProjectImpl.java
@@ -0,0 +1,30 @@
+package cn.iocoder.yudao.module.pms.api.project;
+
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.pms.api.ProjectApi;
+import cn.iocoder.yudao.module.pms.api.dto.project.ProjectDetailRespDTO;
+import cn.iocoder.yudao.module.pms.api.dto.project.ProjectRespDTO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.project.ProjectDO;
+import cn.iocoder.yudao.module.pms.dal.dataobject.project.ProjectDetailDO;
+import cn.iocoder.yudao.module.pms.dal.mysql.project.ProjectMapper;
+import jakarta.annotation.Resource;
+
+public class ProjectImpl implements ProjectApi {
+ @Resource
+ private ProjectMapper projectMapper;
+
+
+ @Override
+ public ProjectRespDTO getProject(Long projectId) {
+ ProjectDO projectDO = projectMapper.selectById(projectId);
+ ProjectRespDTO projectRespDTO = BeanUtils.toBean(projectDO, ProjectRespDTO.class);
+ return projectRespDTO;
+ }
+
+ @Override
+ public ProjectDetailRespDTO getProjectDetailById(Long projectId) {
+ ProjectDetailDO projectMapperDetail = projectMapper.getDetailById(projectId);
+ ProjectDetailRespDTO detailRespDTO = BeanUtils.toBean(projectMapperDetail, ProjectDetailRespDTO.class);
+ return detailRespDTO;
+ }
+}
diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/project/ProjectDO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/project/ProjectDO.java
index d316c2513..acf03969c 100644
--- a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/project/ProjectDO.java
+++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/project/ProjectDO.java
@@ -4,11 +4,8 @@ import cn.iocoder.yudao.module.pms.enums.DictTypeConstants;
import lombok.*;
import java.math.BigDecimal;
-import java.util.*;
-import java.time.LocalDateTime;
-import java.time.LocalDateTime;
-import java.time.LocalDateTime;
import java.time.LocalDateTime;
+
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/project/ProjectDetailDO.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/project/ProjectDetailDO.java
index 9e32a72ae..b847a4a7b 100644
--- a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/project/ProjectDetailDO.java
+++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/dataobject/project/ProjectDetailDO.java
@@ -1,10 +1,7 @@
package cn.iocoder.yudao.module.pms.dal.dataobject.project;
-import cn.iocoder.yudao.framework.common.pojo.FileDTO;
import lombok.Data;
-import java.util.List;
-
/**
* @author hhyykk
* @description
diff --git a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/project/ProjectMapper.java b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/project/ProjectMapper.java
index c833f4106..df7addea9 100644
--- a/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/project/ProjectMapper.java
+++ b/yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/project/ProjectMapper.java
@@ -42,7 +42,7 @@ public interface ProjectMapper extends BaseMapperX {
.leftJoin(DeptDO.class, DeptDO::getId, ProjectDO::getTrackingDepId)
.leftJoin(AdminUserDO.class, AdminUserDO::getId, ProjectDO::getProjectManagerId)
.leftJoin(CustomerCompanyDO.class, CustomerCompanyDO::getId, ProjectDO::getCustomerCompanyId)
- );
+ );
}
default ProjectDetailDO getDetailById(Long id) {