diff --git a/sql/cms-ext/codegen-cms-ext-sql.sql b/sql/cms-ext/codegen-cms-ext-sql.sql new file mode 100644 index 000000000..982dd72aa --- /dev/null +++ b/sql/cms-ext/codegen-cms-ext-sql.sql @@ -0,0 +1,55 @@ +-- 菜单 SQL +INSERT INTO system_menu( + name, permission, type, sort, parent_id, + path, icon, component, status, component_name +) +VALUES ( + '外部合同管理', '', 2, 0, 2758, + 'ext-contract', '', 'cms-ext/extcontract/index', 0, 'ExtContract' + ); + +-- 按钮父菜单ID +-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码 +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +INSERT INTO system_menu( + name, permission, type, sort, parent_id, + path, icon, component, status +) +VALUES ( + '外部合同查询', 'cms-ext:ext-contract:query', 3, 1, @parentId, + '', '', '', 0 + ); +INSERT INTO system_menu( + name, permission, type, sort, parent_id, + path, icon, component, status +) +VALUES ( + '外部合同创建', 'cms-ext:ext-contract:create', 3, 2, @parentId, + '', '', '', 0 + ); +INSERT INTO system_menu( + name, permission, type, sort, parent_id, + path, icon, component, status +) +VALUES ( + '外部合同更新', 'cms-ext:ext-contract:update', 3, 3, @parentId, + '', '', '', 0 + ); +INSERT INTO system_menu( + name, permission, type, sort, parent_id, + path, icon, component, status +) +VALUES ( + '外部合同删除', 'cms-ext:ext-contract:delete', 3, 4, @parentId, + '', '', '', 0 + ); +INSERT INTO system_menu( + name, permission, type, sort, parent_id, + path, icon, component, status +) +VALUES ( + '外部合同导出', 'cms-ext:ext-contract:export', 3, 5, @parentId, + '', '', '', 0 + ); diff --git a/sql/cms/codegen-cms-sql.sql b/sql/cms/codegen-cms-sql.sql new file mode 100644 index 000000000..f56225345 --- /dev/null +++ b/sql/cms/codegen-cms-sql.sql @@ -0,0 +1,31 @@ +-- 菜单 SQL +INSERT INTO system_menu(name, permission, type, sort, parent_id, + path, icon, component, status, component_name) +VALUES ('合同管理', '', 2, 0, 2758, + 'contract', '', 'cms/contract/index', 0, 'Contract'); + +-- 按钮父菜单ID +-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码 +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +INSERT INTO system_menu(name, permission, type, sort, parent_id, + path, icon, component, status) +VALUES ('合同查询', 'cms:contract:query', 3, 1, @parentId, + '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, + path, icon, component, status) +VALUES ('合同创建', 'cms:contract:create', 3, 2, @parentId, + '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, + path, icon, component, status) +VALUES ('合同更新', 'cms:contract:update', 3, 3, @parentId, + '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, + path, icon, component, status) +VALUES ('合同删除', 'cms:contract:delete', 3, 4, @parentId, + '', '', '', 0); +INSERT INTO system_menu(name, permission, type, sort, parent_id, + path, icon, component, status) +VALUES ('合同导出', 'cms:contract:export', 3, 5, @parentId, + '', '', '', 0); 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 0473bcb3a..a1760b150 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 @@ -8,13 +8,12 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode; * @date 2024/7/3 */ public interface ErrorCodeConstants { - ErrorCode CUSTOMER_COMPANY_NOT_EXISTS = new ErrorCode(1_020_000_000, "客户公司管理不存在"); - // ========== 外包合同 2_021_000_000 ========== - ErrorCode OUTS_CONTRACT_NOT_EXISTS = new ErrorCode(2_021_000_000, "外包合同不存在"); + ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(2_020_000_000, "合同不存在"); + + ErrorCode EXT_CONTRACT_NOT_EXISTS = new ErrorCode(2_021_000_000, "外部合同不存在"); + + + - // ========== 外包合同历史 2_022_000_000 ========== - ErrorCode OUTS_CONTRACT_HISTORY_NOT_EXISTS = new ErrorCode(2_022_000_000, "外包合同历史不存在"); - // ========== 外包合同关联 2_023_000_000 ========== - ErrorCode CONTRACT_OUTS_NOT_EXISTS = new ErrorCode(2_023_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..4a97ea65f --- /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,90 @@ +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.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 = "id", description = "合同id", required = true) + @PreAuthorize("@ss.hasPermission('cms:contract:delete')") + public CommonResult deleteContract(@RequestParam("id") Long id) { + contractService.deleteContract(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得合同") + @Parameter(name = "id", description = "合同id", required = true) + @PreAuthorize("@ss.hasPermission('cms:contract:query')") + public CommonResult getContract(@RequestParam("id") Long id) { + ContractRespVO contractRespVO = contractService.getContract(id); + 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(pageResult); + } + + @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..133675503 --- /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,106 @@ +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 = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED) + private Long projectId; + + @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..57800a7a6 --- /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,150 @@ +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 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 = "分包合同提示时间") + @ExcelProperty("分包合同提示时间") + private LocalDateTime subReminderTime; + + @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 = "芋艿") + @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..3428a597b --- /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,124 @@ +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) + private Long id; + + @Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456") + private Long projectId; + + @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; + + @Schema(description = "创建者") + private String creator; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "创建时间不能为空") + private LocalDateTime createTime; + + @Schema(description = "更新者") + private String updater; + + @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "更新时间不能为空") + private LocalDateTime updateTime; + + @Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否删除不能为空") + private Boolean deleted; + + @Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12587") + @NotNull(message = "租户编号不能为空") + private Long tenantId; + + + +} \ 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/customerCompany/CustomerCompanyController.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/customerCompany/CustomerCompanyController.java deleted file mode 100644 index 8272f265c..000000000 --- a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/customerCompany/CustomerCompanyController.java +++ /dev/null @@ -1,103 +0,0 @@ -package cn.iocoder.yudao.module.cms.controller.admin.customerCompany; - -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.constraints.*; -import jakarta.validation.*; -import jakarta.servlet.http.*; -import java.util.*; -import java.io.IOException; - -import cn.iocoder.yudao.framework.common.pojo.PageParam; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -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.*; - -import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*; -import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO; -import cn.iocoder.yudao.module.cms.service.customerCompany.CustomerCompanyService; - -@Tag(name = "管理后台 - 客户公司") -@RestController -@RequestMapping("/cms/customer-company") -@Validated -public class CustomerCompanyController { - - @Resource - private CustomerCompanyService customerCompanyService; - - @PostMapping("/create") - @Operation(summary = "创建客户公司") - @PreAuthorize("@ss.hasPermission('cms:customer-company:create')") - public CommonResult createCustomerCompany(@Valid @RequestBody CustomerCompanySaveReqVO createReqVO) { - return success(customerCompanyService.createCustomerCompany(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新客户公司") - @PreAuthorize("@ss.hasPermission('cms:customer-company:update')") - public CommonResult updateCustomerCompany(@Valid @RequestBody CustomerCompanySaveReqVO updateReqVO) { - customerCompanyService.updateCustomerCompany(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除客户公司") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('cms:customer-company:delete')") - public CommonResult deleteCustomerCompany(@RequestParam("id") Long id) { - customerCompanyService.deleteCustomerCompany(id); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得客户公司") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('cms:customer-company:query')") - public CommonResult getCustomerCompany(@RequestParam("id") Long id) { - CustomerCompanyDO customerCompany = customerCompanyService.getCustomerCompany(id); - return success(BeanUtils.toBean(customerCompany, CustomerCompanyRespVO.class)); - } - - @GetMapping("/page") - @Operation(summary = "获得客户公司分页") - @PreAuthorize("@ss.hasPermission('cms:customer-company:query')") - public CommonResult> getCustomerCompanyPage(@Valid CustomerCompanyPageReqVO pageReqVO) { - PageResult pageResult = customerCompanyService.getCustomerCompanyPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, CustomerCompanyRespVO.class)); - } - - @GetMapping("/list") - @Operation(summary = "获得客户公司列表") - @PreAuthorize("@ss.hasPermission('cms:customer-company:query')") - public CommonResult> getCustomerCompanyList(CustomerCompanyPageReqVO reqVO) { - List list = customerCompanyService.getCustomerCompanyList(reqVO); - return success(BeanUtils.toBean(list, CustomerCompanyRespVO.class)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出客户公司 Excel") - @PreAuthorize("@ss.hasPermission('cms:customer-company:export')") - @ApiAccessLog(operateType = EXPORT) - public void exportCustomerCompanyExcel(@Valid CustomerCompanyPageReqVO pageReqVO, - HttpServletResponse response) throws IOException { - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = customerCompanyService.getCustomerCompanyPage(pageReqVO).getList(); - // 导出 Excel - ExcelUtils.write(response, "客户公司.xls", "数据", CustomerCompanyRespVO.class, - BeanUtils.toBean(list, CustomerCompanyRespVO.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/customerCompany/vo/CustomerCompanyPageReqVO.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/customerCompany/vo/CustomerCompanyPageReqVO.java deleted file mode 100644 index b7c21891c..000000000 --- a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/customerCompany/vo/CustomerCompanyPageReqVO.java +++ /dev/null @@ -1,33 +0,0 @@ -package cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo; - -import lombok.*; -import java.util.*; -import io.swagger.v3.oas.annotations.media.Schema; -import cn.iocoder.yudao.framework.common.pojo.PageParam; -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 CustomerCompanyPageReqVO extends PageParam { - - @Schema(description = "联系人", example = "张三") - private String contacts; - - @Schema(description = "创建时间") - private LocalDateTime createTime; - - @Schema(description = "公司名称", example = "电力公司") - private String name; - - @Schema(description = "地址") - private String address; - - @Schema(description = "电话") - private String phone; - -} \ 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/customerCompany/vo/CustomerCompanyRespVO.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/customerCompany/vo/CustomerCompanyRespVO.java deleted file mode 100644 index db3c73980..000000000 --- a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/customerCompany/vo/CustomerCompanyRespVO.java +++ /dev/null @@ -1,39 +0,0 @@ -package cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.LocalDateTime; -import com.alibaba.excel.annotation.*; - -@Schema(description = "管理后台 - 客户公司 Response VO") -@Data -@ExcelIgnoreUnannotated -public class CustomerCompanyRespVO { - - @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14907") - @ExcelProperty("主键") - private Long id; - - @Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") - @ExcelProperty("联系人") - private String contacts; - - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建时间") - private LocalDateTime createTime; - - @Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "电力公司") - @ExcelProperty("公司名称") - private String name; - - @Schema(description = "地址") - @ExcelProperty("地址") - private String address; - - @Schema(description = "电话") - @ExcelProperty("电话") - private String phone; - -} \ 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/customerCompany/vo/CustomerCompanySaveReqVO.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/customerCompany/vo/CustomerCompanySaveReqVO.java deleted file mode 100644 index c8900438d..000000000 --- a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/customerCompany/vo/CustomerCompanySaveReqVO.java +++ /dev/null @@ -1,29 +0,0 @@ -package cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import jakarta.validation.constraints.*; - -@Schema(description = "管理后台 - 客户公司新增/修改 Request VO") -@Data -public class CustomerCompanySaveReqVO { - - @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14907") - private Long id; - - @Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") - @NotEmpty(message = "联系人不能为空") - private String contacts; - - @Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "电力公司") - @NotEmpty(message = "公司名称不能为空") - private String name; - - @Schema(description = "地址") - private String address; - - @Schema(description = "电话") - private String phone; - -} \ 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/extcontract/ExtContractController.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/extcontract/ExtContractController.java new file mode 100644 index 000000000..eba5ecf70 --- /dev/null +++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/extcontract/ExtContractController.java @@ -0,0 +1,96 @@ +package cn.iocoder.yudao.module.cms.controller.admin.extcontract; + +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.service.extcontract.ExtContractService; +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.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +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-ext/ext-contract") +@Validated +public class ExtContractController { + + @Resource + private ExtContractService extContractService; + + @PostMapping("/create") + @Operation(summary = "创建外部合同") + @PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:create')") + public CommonResult createExtContract(@Valid @RequestBody ExtContractSaveReqVO createReqVO) { + return success(extContractService.createExtContract(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新外部合同") + @PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:update')") + public CommonResult updateExtContract(@Valid @RequestBody ExtContractSaveReqVO updateReqVO) { + extContractService.updateExtContract(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除外部合同") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:delete')") + public CommonResult deleteExtContract(@RequestParam("id") Long id) { + extContractService.deleteExtContract(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得外部合同") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:query')") + public CommonResult getExtContract(@RequestParam("id") Long id) { + ExtContractRespVO extContract = extContractService.getExtContract(id); + return success(extContract); + } + + @GetMapping("/page") + @Operation(summary = "获得外部合同分页") + @PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:query')") + public CommonResult> getExtContractPage(@Valid ExtContractPageReqVO pageReqVO) { + PageResult pageResult = extContractService.getExtContractPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, ExtContractRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出外部合同 Excel") + @PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportExtContractExcel(@Valid ExtContractPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = extContractService.getExtContractPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "外部合同.xls", "数据", ExtContractRespVO.class, + BeanUtils.toBean(list, ExtContractRespVO.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/extcontract/vo/ExtContractPageReqVO.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/extcontract/vo/ExtContractPageReqVO.java new file mode 100644 index 000000000..6b2ae7df8 --- /dev/null +++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/extcontract/vo/ExtContractPageReqVO.java @@ -0,0 +1,110 @@ +package cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo; + +import lombok.*; +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 ExtContractPageReqVO extends PageParam { + + @Schema(description = "项目id", example = "30598") + private Long projectId; + + @Schema(description = "合同名称", example = "芋艿") + private String name; + + @Schema(description = "合同类型", example = "1") + private String type; + + @Schema(description = "客户公司id", example = "25191") + private Long customerCompanyId; + + @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[] signingTime; + + @Schema(description = "归档时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] archiveTime; + + @Schema(description = "状态", example = "2") + private String status; + + @Schema(description = "合同金额") + private BigDecimal amount; + + @Schema(description = "前期费用") + private BigDecimal preAmount; + + @Schema(description = "设计费") + private BigDecimal designFee; + + @Schema(description = "勘测费") + private BigDecimal surveyFees; + + @Schema(description = "检测费") + private BigDecimal testingFee; + + @Schema(description = "其他费") + private String otherFee; + + @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 = "收费标准") + private String chargingStandard; + + @Schema(description = "优惠", example = "15529") + private String discount; + + @Schema(description = "是否联合体") + private Boolean consortium; + + @Schema(description = "联合体单位") + private String consortiumCompany; + + @Schema(description = "合同提示时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] reminderTime; + + @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 = "合同id", example = "27460") + private Long contractId; + +} \ 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/extcontract/vo/ExtContractRespVO.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/extcontract/vo/ExtContractRespVO.java new file mode 100644 index 000000000..d423255d9 --- /dev/null +++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/extcontract/vo/ExtContractRespVO.java @@ -0,0 +1,159 @@ +package cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; +import lombok.*; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 外部合同 Response VO") +@Data +@ExcelIgnoreUnannotated +public class ExtContractRespVO { + + + @Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001") + @ExcelProperty("项目编号") + private String code; + + + @Schema(description = "合同名称", example = "芋艿") + @ExcelProperty("合同名称") + private String name; + + @Schema(description = "合同类型", example = "1") + @ExcelProperty("合同类型") + private String type; + + + @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 reminderTime; + + @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("状态") + 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 String otherFee; + + @Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, 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 = "分包合同提示时间") + @ExcelProperty("分包合同提示时间") + private LocalDateTime subReminderTime; + + @Schema(description = "收费标准", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("收费标准") + private String chargingStandard; + + @Schema(description = "优惠", example = "15529") + @ExcelProperty("优惠") + private String discount; + + @Schema(description = "是否联合体", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("是否联合体") + private Boolean consortium; + + @Schema(description = "联合体单位") + @ExcelProperty("联合体单位") + private String consortiumCompany; + + + @Schema(description = "审定金额") + @ExcelProperty("审定金额") + private BigDecimal approvedAmount; + + @Schema(description = "审核文件url", example = "https://www.iocoder.cn") + @ExcelProperty("审核文件url") + private String reviewFileUrl; + + + @Schema(description = "合同id", example = "27460") + @ExcelProperty("合同id") + private Long contractId; + + + @Schema(description = "创建者") + private String creator; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "创建时间不能为空") + private LocalDateTime createTime; + + @Schema(description = "更新者") + private String updater; + + @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "更新时间不能为空") + private LocalDateTime updateTime; + +} \ 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/extcontract/vo/ExtContractSaveReqVO.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/extcontract/vo/ExtContractSaveReqVO.java new file mode 100644 index 000000000..23f507c43 --- /dev/null +++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/controller/admin/extcontract/vo/ExtContractSaveReqVO.java @@ -0,0 +1,129 @@ +package cn.iocoder.yudao.module.cms.controller.admin.extcontract.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 ExtContractSaveReqVO { + + @Schema(description = "外部合同编号", requiredMode = Schema.RequiredMode.REQUIRED) + private Long id; + + @Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "30598") + @NotNull(message = "项目id不能为空") + private Long projectId; + + @Schema(description = "合同名称", example = "芋艿") + private String name; + + @Schema(description = "合同类型", example = "1") + private String type; + + @Schema(description = "客户公司id", example = "25191") + private Long customerCompanyId; + + @Schema(description = "合同进展") + private String progress; + + @Schema(description = "预计签订时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "预计签订时间不能为空") + private LocalDateTime expectedTime; + + @Schema(description = "签订时间") + private LocalDateTime signingTime; + + @Schema(description = "归档时间") + private LocalDateTime archiveTime; + + @Schema(description = "状态", example = "2") + private String status; + + @Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "合同金额不能为空") + private BigDecimal amount; + + @Schema(description = "前期费用") + private BigDecimal preAmount; + + @Schema(description = "设计费") + private BigDecimal designFee; + + @Schema(description = "勘测费") + private BigDecimal surveyFees; + + @Schema(description = "检测费") + private BigDecimal testingFee; + + @Schema(description = "其他费") + private String otherFee; + + @Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "计费方式不能为空") + 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 = "收费标准", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "收费标准不能为空") + private String chargingStandard; + + @Schema(description = "优惠", example = "15529") + private String discount; + + @Schema(description = "是否联合体", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否联合体不能为空") + private Boolean consortium; + + @Schema(description = "联合体单位") + private String consortiumCompany; + + @Schema(description = "合同提示时间") + private LocalDateTime reminderTime; + + @Schema(description = "审定金额") + private BigDecimal approvedAmount; + + @Schema(description = "审核文件url", example = "https://www.iocoder.cn") + private String reviewFileUrl; + + @Schema(description = "合同id", example = "27460") + private Long contractId; + + @Schema(description = "创建者") + private String creator; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "创建时间不能为空") + private LocalDateTime createTime; + + @Schema(description = "更新者") + private String updater; + + @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "更新时间不能为空") + private LocalDateTime updateTime; + + @Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "是否删除不能为空") + private Boolean deleted; + + @Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12587") + @NotNull(message = "租户编号不能为空") + private Long tenantId; + +} \ 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..08af77378 --- /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,136 @@ +package cn.iocoder.yudao.module.cms.dal.dataobject.contract; + +import lombok.*; + +import java.time.LocalDateTime; +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/dataobject/customerCompany/CustomerCompanyDO.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/dataobject/customerCompany/CustomerCompanyDO.java deleted file mode 100644 index 6d9727772..000000000 --- a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/dataobject/customerCompany/CustomerCompanyDO.java +++ /dev/null @@ -1,47 +0,0 @@ -package cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany; - -import lombok.*; -import java.util.*; -import java.time.LocalDateTime; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.*; -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; - -/** - * 客户公司 DO - * - * @author hhyykk - */ -@TableName("cms_customer_company") -@KeySequence("cms_customer_company_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class CustomerCompanyDO extends BaseDO { - - /** - * 主键 - */ - @TableId - private Long id; - /** - * 联系人 - */ - private String contacts; - /** - * 公司名称 - */ - private String name; - /** - * 地址 - */ - private String address; - /** - * 电话 - */ - private String phone; - -} \ 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/extcontract/ExtContractDO.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/dataobject/extcontract/ExtContractDO.java new file mode 100644 index 000000000..b8ad0b689 --- /dev/null +++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/dataobject/extcontract/ExtContractDO.java @@ -0,0 +1,152 @@ +package cn.iocoder.yudao.module.cms.dal.dataobject.extcontract; + +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDateTime; +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 外部合同 DO + * + * @author 管理员 + */ +@TableName("cms_ext_contract") +@KeySequence("cms_ext_contract_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ExtContractDO extends BaseDO { + + /** + * 主键 + */ + @TableId + private Long id; + /** + * 项目id + */ + private Long projectId; + /** + * 合同名称 + */ + private String name; + /** + * 合同类型 + */ + private String type; + /** + * 客户公司id + */ + private Long customerCompanyId; + /** + * 合同进展 + */ + private String progress; + /** + * 预计签订时间 + */ + private LocalDateTime expectedTime; + /** + * 签订时间 + */ + private LocalDateTime signingTime; + /** + * 归档时间 + */ + private LocalDateTime archiveTime; + /** + * 状态 + */ + private String status; + /** + * 合同金额 + */ + private BigDecimal amount; + /** + * 前期费用 + */ + private BigDecimal preAmount; + /** + * 设计费 + */ + private BigDecimal designFee; + /** + * 勘测费 + */ + private BigDecimal surveyFees; + /** + * 检测费 + */ + private BigDecimal testingFee; + /** + * 其他费 + */ + private String otherFee; + /** + * 计费方式 + */ + private String countType; + /** + * 备注 + */ + private String remark; + /** + * 合同附件url + */ + private String contractFileUrl; + /** + * 建安费 + */ + private BigDecimal constructionCost; + /** + * 资金来源 + */ + private String source; + /** + * 收费标准 + */ + private String chargingStandard; + /** + * 优惠 + */ + private String discount; + /** + * 是否联合体 + */ + private Boolean consortium; + /** + * 联合体单位 + */ + private String consortiumCompany; + + /** + * 分包合同提示时间 + */ + private LocalDateTime subReminderTime; + /** + * 审定金额 + */ + private BigDecimal approvedAmount; + /** + * 审核文件url + */ + private String reviewFileUrl; + /** + * 合同id + */ + private Long contractId; + + /** + * 合同提示时间 + */ + private LocalDateTime reminderTime; + +} \ 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..ee6e9406d --- /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,51 @@ +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()) + ); + + } + +} + diff --git a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/mysql/customerCompany/CustomerCompanyMapper.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/mysql/customerCompany/CustomerCompanyMapper.java deleted file mode 100644 index 9f56ac6fd..000000000 --- a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/mysql/customerCompany/CustomerCompanyMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -package cn.iocoder.yudao.module.cms.dal.mysql.customerCompany; - -import java.util.*; - -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.customerCompany.CustomerCompanyDO; -import org.apache.ibatis.annotations.Mapper; -import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*; - -/** - * 客户公司 Mapper - * - * @author hhyykk - */ -@Mapper -public interface CustomerCompanyMapper extends BaseMapperX { - - default PageResult selectPage(CustomerCompanyPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .likeIfPresent(CustomerCompanyDO::getContacts, reqVO.getContacts()) - .eqIfPresent(CustomerCompanyDO::getCreateTime, reqVO.getCreateTime()) - .likeIfPresent(CustomerCompanyDO::getName, reqVO.getName()) - .eqIfPresent(CustomerCompanyDO::getAddress, reqVO.getAddress()) - .eqIfPresent(CustomerCompanyDO::getPhone, reqVO.getPhone()) - .orderByDesc(CustomerCompanyDO::getId)); - } - - default List selectList(CustomerCompanyPageReqVO reqVO) { - return selectList(new LambdaQueryWrapperX()); - } - -} \ 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/extcontract/ExtContractMapper.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/mysql/extcontract/ExtContractMapper.java new file mode 100644 index 000000000..2e7cc77b6 --- /dev/null +++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/dal/mysql/extcontract/ExtContractMapper.java @@ -0,0 +1,50 @@ +package cn.iocoder.yudao.module.cms.dal.mysql.extcontract; + +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.controller.admin.extcontract.vo.ExtContractPageReqVO; +import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 外部合同 Mapper + * + * @author 管理员 + */ +@Mapper +public interface ExtContractMapper extends BaseMapperX { + + default PageResult selectPage(ExtContractPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(ExtContractDO::getName, reqVO.getName()) + .eqIfPresent(ExtContractDO::getType, reqVO.getType()) + .eqIfPresent(ExtContractDO::getCustomerCompanyId, reqVO.getCustomerCompanyId()) + .eqIfPresent(ExtContractDO::getProgress, reqVO.getProgress()) + .betweenIfPresent(ExtContractDO::getExpectedTime, reqVO.getExpectedTime()) + .betweenIfPresent(ExtContractDO::getSigningTime, reqVO.getSigningTime()) + .betweenIfPresent(ExtContractDO::getArchiveTime, reqVO.getArchiveTime()) + .eqIfPresent(ExtContractDO::getStatus, reqVO.getStatus()) + .eqIfPresent(ExtContractDO::getAmount, reqVO.getAmount()) + .eqIfPresent(ExtContractDO::getPreAmount, reqVO.getPreAmount()) + .eqIfPresent(ExtContractDO::getDesignFee, reqVO.getDesignFee()) + .eqIfPresent(ExtContractDO::getSurveyFees, reqVO.getSurveyFees()) + .eqIfPresent(ExtContractDO::getTestingFee, reqVO.getTestingFee()) + .eqIfPresent(ExtContractDO::getOtherFee, reqVO.getOtherFee()) + .eqIfPresent(ExtContractDO::getCountType, reqVO.getCountType()) + .eqIfPresent(ExtContractDO::getRemark, reqVO.getRemark()) + .eqIfPresent(ExtContractDO::getContractFileUrl, reqVO.getContractFileUrl()) + .eqIfPresent(ExtContractDO::getConstructionCost, reqVO.getConstructionCost()) + .eqIfPresent(ExtContractDO::getSource, reqVO.getSource()) + .eqIfPresent(ExtContractDO::getChargingStandard, reqVO.getChargingStandard()) + .eqIfPresent(ExtContractDO::getDiscount, reqVO.getDiscount()) + .eqIfPresent(ExtContractDO::getConsortium, reqVO.getConsortium()) + .eqIfPresent(ExtContractDO::getConsortiumCompany, reqVO.getConsortiumCompany()) + .eqIfPresent(ExtContractDO::getApprovedAmount, reqVO.getApprovedAmount()) + .eqIfPresent(ExtContractDO::getReviewFileUrl, reqVO.getReviewFileUrl()) + .betweenIfPresent(ExtContractDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ExtContractDO::getContractId, reqVO.getContractId()) + .orderByDesc(ExtContractDO::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..a7236cfd2 --- /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,61 @@ +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; + +import java.math.BigDecimal; + +/** + * 合同 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); + + /** + * 获得暂定结算金额 + * @param id 合同编号 + * @return + */ + BigDecimal getProvisionalSettlement(Long id); +} \ 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..fd0315f4a --- /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,149 @@ +package cn.iocoder.yudao.module.cms.service.contract; + +import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDO; +import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper; +import cn.iocoder.yudao.module.cms.dal.mysql.extcontract.ExtContractMapper; +import cn.iocoder.yudao.module.pms.api.ProjectApi; +import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO; +import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +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 java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +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 { + + private static final Logger log = LoggerFactory.getLogger(ContractServiceImpl.class); + @Resource + private ContractMapper contractMapper; + + @Resource + private ProjectApi projectApi; + + @Resource + private ExtContractMapper extContractMapper; + + + @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 id) { + + ContractDO contractDO = contractMapper.selectById(id); + Long projectId = contractDO.getProjectId(); + 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.分包合同商议提示 √ +// 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()); + + //分包合同商议提示 + ExtContractDO extContractDO = extContractMapper.selectOne("project_id",projectId); + LocalDateTime reminderTime = extContractDO.getSubReminderTime(); + contractRespVO.setSubReminderTime(reminderTime); + + //暂定结算数 + BigDecimal provisionalSettlement = getProvisionalSettlement(id); + contractRespVO.setProvisionalSettlement(provisionalSettlement); + + + return contractRespVO; + } + + @Override + public PageResult getContractPage(ContractPageReqVO pageReqVO) { + PageResult contractDOPageResult = contractMapper.selectPage(pageReqVO); + List contractDOList = contractDOPageResult.getList(); + List contractRespVOList = new ArrayList<>(); + + + for (ContractDO contractDO : contractDOList) { + Long id = contractDO.getId(); + ContractRespVO contract = getContract(id); + contractRespVOList.add(contract); + } + PageResult pageResult = new PageResult<>(); + pageResult.setList(contractRespVOList); + return pageResult; + } + + @Override + public BigDecimal getProvisionalSettlement(Long id) { + ContractDO contractDO = contractMapper.selectById(id); + String type = contractDO.getType(); + BigDecimal amount = contractDO.getAmount(); + BigDecimal bigDecimal = new BigDecimal(String.valueOf(amount)); + BigDecimal mul = new BigDecimal("0.85"); + BigDecimal res = null; + if ("费率合同".equals(type)) { + res = bigDecimal.multiply(mul); + } else if ("总价合同".equals(type)) { + res = amount; + } + return res; + } + + +} \ 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/customerCompany/CustomerCompanyService.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/customerCompany/CustomerCompanyService.java deleted file mode 100644 index 2d710f6a6..000000000 --- a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/customerCompany/CustomerCompanyService.java +++ /dev/null @@ -1,61 +0,0 @@ -package cn.iocoder.yudao.module.cms.service.customerCompany; - -import java.util.*; -import jakarta.validation.*; -import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*; -import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.pojo.PageParam; - -/** - * 客户公司 Service 接口 - * - * @author hhyykk - */ -public interface CustomerCompanyService { - - /** - * 创建客户公司 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - Long createCustomerCompany(@Valid CustomerCompanySaveReqVO createReqVO); - - /** - * 更新客户公司 - * - * @param updateReqVO 更新信息 - */ - void updateCustomerCompany(@Valid CustomerCompanySaveReqVO updateReqVO); - - /** - * 删除客户公司 - * - * @param id 编号 - */ - void deleteCustomerCompany(Long id); - - /** - * 获得客户公司 - * - * @param id 编号 - * @return 客户公司 - */ - CustomerCompanyDO getCustomerCompany(Long id); - - /** - * 获得客户公司分页 - * - * @param pageReqVO 分页查询 - * @return 客户公司分页 - */ - PageResult getCustomerCompanyPage(CustomerCompanyPageReqVO pageReqVO); - - /** - * 获得客户公司列表 - * @param reqVO 查询参数 - * @return 列表信息 - */ - List getCustomerCompanyList(CustomerCompanyPageReqVO reqVO); -} \ 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/customerCompany/CustomerCompanyServiceImpl.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/customerCompany/CustomerCompanyServiceImpl.java deleted file mode 100644 index 7ecf122fe..000000000 --- a/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/customerCompany/CustomerCompanyServiceImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -package cn.iocoder.yudao.module.cms.service.customerCompany; - -import org.springframework.stereotype.Service; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; -import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*; -import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.pojo.PageParam; -import cn.iocoder.yudao.framework.common.util.object.BeanUtils; - -import cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper; - -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*; - -/** - * 客户公司 Service 实现类 - * - * @author hhyykk - */ -@Service -@Validated -public class CustomerCompanyServiceImpl implements CustomerCompanyService { - - @Resource - private CustomerCompanyMapper customerCompanyMapper; - - @Override - public Long createCustomerCompany(CustomerCompanySaveReqVO createReqVO) { - // 插入 - CustomerCompanyDO customerCompany = BeanUtils.toBean(createReqVO, CustomerCompanyDO.class); - customerCompanyMapper.insert(customerCompany); - // 返回 - return customerCompany.getId(); - } - - @Override - public void updateCustomerCompany(CustomerCompanySaveReqVO updateReqVO) { - // 校验存在 - validateCustomerCompanyExists(updateReqVO.getId()); - // 更新 - CustomerCompanyDO updateObj = BeanUtils.toBean(updateReqVO, CustomerCompanyDO.class); - customerCompanyMapper.updateById(updateObj); - } - - @Override - public void deleteCustomerCompany(Long id) { - // 校验存在 - validateCustomerCompanyExists(id); - // 删除 - customerCompanyMapper.deleteById(id); - } - - private void validateCustomerCompanyExists(Long id) { - if (customerCompanyMapper.selectById(id) == null) { - throw exception(CUSTOMER_COMPANY_NOT_EXISTS); - } - } - - @Override - public CustomerCompanyDO getCustomerCompany(Long id) { - return customerCompanyMapper.selectById(id); - } - - @Override - public PageResult getCustomerCompanyPage(CustomerCompanyPageReqVO pageReqVO) { - return customerCompanyMapper.selectPage(pageReqVO); - } - - @Override - public List getCustomerCompanyList(CustomerCompanyPageReqVO reqVO) { - return customerCompanyMapper.selectList(reqVO); - } - -} \ 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/extcontract/ExtContractService.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/extcontract/ExtContractService.java new file mode 100644 index 000000000..b426961ec --- /dev/null +++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/extcontract/ExtContractService.java @@ -0,0 +1,56 @@ +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.ExtContractRespVO; +import cn.iocoder.yudao.module.cms.controller.admin.extcontract.vo.ExtContractSaveReqVO; +import cn.iocoder.yudao.module.cms.dal.dataobject.extcontract.ExtContractDO; +import jakarta.validation.*; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 外部合同 Service 接口 + * + * @author 管理员 + */ +public interface ExtContractService { + + /** + * 创建外部合同 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createExtContract(@Valid ExtContractSaveReqVO createReqVO); + + /** + * 更新外部合同 + * + * @param updateReqVO 更新信息 + */ + void updateExtContract(@Valid ExtContractSaveReqVO updateReqVO); + + /** + * 删除外部合同 + * + * @param id 编号 + */ + void deleteExtContract(Long id); + + /** + * 获得外部合同 + * + * @param id 编号 + * @return 外部合同 + */ + ExtContractRespVO getExtContract(Long id); + + /** + * 获得外部合同分页 + * + * @param pageReqVO 分页查询 + * @return 外部合同分页 + */ + PageResult getExtContractPage(ExtContractPageReqVO 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/extcontract/ExtContractServiceImpl.java b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/extcontract/ExtContractServiceImpl.java new file mode 100644 index 000000000..5d407df7f --- /dev/null +++ b/yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/extcontract/ExtContractServiceImpl.java @@ -0,0 +1,83 @@ +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.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.mysql.extcontract.ExtContractMapper; +import cn.iocoder.yudao.module.pms.api.ProjectApi; +import org.springframework.stereotype.Service; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +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.EXT_CONTRACT_NOT_EXISTS; + +/** + * 外部合同 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class ExtContractServiceImpl implements ExtContractService { + + @Resource + private ExtContractMapper extContractMapper; + + @Resource + private ProjectApi projectApi; + + @Override + public Long createExtContract(ExtContractSaveReqVO createReqVO) { + // 插入 + ExtContractDO extContract = BeanUtils.toBean(createReqVO, ExtContractDO.class); + extContractMapper.insert(extContract); + // 返回 + return extContract.getId(); + } + + @Override + public void updateExtContract(ExtContractSaveReqVO updateReqVO) { + // 更新 + ExtContractDO updateObj = BeanUtils.toBean(updateReqVO, ExtContractDO.class); + extContractMapper.updateById(updateObj); + } + + @Override + public void deleteExtContract(Long id) { + // 校验存在 + validateExtContractExists(id); + // 删除 + extContractMapper.deleteById(id); + } + + private void validateExtContractExists(Long id) { + if (extContractMapper.selectById(id) == null) { + throw exception(EXT_CONTRACT_NOT_EXISTS); + } + } + + // 需要联表查询 + // 1.项目编号 pms_project 直接 + // 2.主控部门(跟踪部门) pms_project找到的是id 需要联表 + // 3.项目经理 pms_project找到的是id 需要联表 + // 4.客户名称 pms_project 联表 + // 5.合同总金额 + // 6.合同商议提示(和分包提示不一样) + @Override + public ExtContractRespVO getExtContract(Long id) { + ExtContractDO extContractDO = extContractMapper.selectById(id); + Long projectId = extContractDO.getProjectId(); + + return null; + } + + @Override + public PageResult getExtContractPage(ExtContractPageReqVO pageReqVO) { + return extContractMapper.selectPage(pageReqVO); + } + +} \ No newline at end of file diff --git a/yudao-module-cms/yudao-module-cms-biz/src/main/resources/mapper/customerCompany/CustomerCompanyMapper.xml b/yudao-module-cms/yudao-module-cms-biz/src/main/resources/mapper.extcontract/ExtContractMapper.xml similarity index 84% rename from yudao-module-cms/yudao-module-cms-biz/src/main/resources/mapper/customerCompany/CustomerCompanyMapper.xml rename to yudao-module-cms/yudao-module-cms-biz/src/main/resources/mapper.extcontract/ExtContractMapper.xml index a38c0f719..a122ca19f 100644 --- a/yudao-module-cms/yudao-module-cms-biz/src/main/resources/mapper/customerCompany/CustomerCompanyMapper.xml +++ b/yudao-module-cms/yudao-module-cms-biz/src/main/resources/mapper.extcontract/ExtContractMapper.xml @@ -1,6 +1,6 @@ - + + + \ No newline at end of file diff --git a/yudao-module-cms/yudao-module-cms-biz/src/test/java/cn/iocoder/yudao/module/cms/service/contact/ContactServiceTest.java b/yudao-module-cms/yudao-module-cms-biz/src/test/java/cn/iocoder/yudao/module/cms/service/contact/ContactServiceTest.java new file mode 100644 index 000000000..7c83d467c --- /dev/null +++ b/yudao-module-cms/yudao-module-cms-biz/src/test/java/cn/iocoder/yudao/module/cms/service/contact/ContactServiceTest.java @@ -0,0 +1,26 @@ +package cn.iocoder.yudao.module.cms.service.contact; + +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; +import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper; +import cn.iocoder.yudao.module.cms.service.contract.ContractService; +import cn.iocoder.yudao.module.cms.service.contract.ContractServiceImpl; +import jakarta.annotation.Resource; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Import; + +@Import(ContractServiceImpl.class) +@SpringBootTest(classes = ContractServiceImpl.class) + +public class ContactServiceTest extends BaseDbUnitTest { + @Resource + private ContractService contractService; + + @Resource + private ContractMapper contractMapper; + + + @Test + public void createContact() { + } +} diff --git a/yudao-module-cms/yudao-module-cms-biz/src/test/java/cn/iocoder/yudao/module/cms/service/customerCompany/CustomerCompanyServiceImplTest.java b/yudao-module-cms/yudao-module-cms-biz/src/test/java/cn/iocoder/yudao/module/cms/service/customerCompany/CustomerCompanyServiceImplTest.java deleted file mode 100644 index 49a7c521d..000000000 --- a/yudao-module-cms/yudao-module-cms-biz/src/test/java/cn/iocoder/yudao/module/cms/service/customerCompany/CustomerCompanyServiceImplTest.java +++ /dev/null @@ -1,146 +0,0 @@ -package cn.iocoder.yudao.module.cms.service.customerCompany; - -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.mock.mockito.MockBean; - -import jakarta.annotation.Resource; - -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; - -import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*; -import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO; -import cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import jakarta.annotation.Resource; -import org.springframework.context.annotation.Import; -import java.util.*; -import java.time.LocalDateTime; - -import static cn.hutool.core.util.RandomUtil.*; -import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*; -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*; -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*; -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; - -/** - * {@link CustomerCompanyServiceImpl} 的单元测试类 - * - * @author hhyykk - */ -@Import(CustomerCompanyServiceImpl.class) -public class CustomerCompanyServiceImplTest extends BaseDbUnitTest { - - @Resource - private CustomerCompanyServiceImpl customerCompanyService; - - @Resource - private CustomerCompanyMapper customerCompanyMapper; - - @Test - public void testCreateCustomerCompany_success() { - // 准备参数 - CustomerCompanySaveReqVO createReqVO = randomPojo(CustomerCompanySaveReqVO.class).setId(null); - - // 调用 - Long customerCompanyId = customerCompanyService.createCustomerCompany(createReqVO); - // 断言 - assertNotNull(customerCompanyId); - // 校验记录的属性是否正确 - CustomerCompanyDO customerCompany = customerCompanyMapper.selectById(customerCompanyId); - assertPojoEquals(createReqVO, customerCompany, "id"); - } - - @Test - public void testUpdateCustomerCompany_success() { - // mock 数据 - CustomerCompanyDO dbCustomerCompany = randomPojo(CustomerCompanyDO.class); - customerCompanyMapper.insert(dbCustomerCompany);// @Sql: 先插入出一条存在的数据 - // 准备参数 - CustomerCompanySaveReqVO updateReqVO = randomPojo(CustomerCompanySaveReqVO.class, o -> { - o.setId(dbCustomerCompany.getId()); // 设置更新的 ID - }); - - // 调用 - customerCompanyService.updateCustomerCompany(updateReqVO); - // 校验是否更新正确 - CustomerCompanyDO customerCompany = customerCompanyMapper.selectById(updateReqVO.getId()); // 获取最新的 - assertPojoEquals(updateReqVO, customerCompany); - } - - @Test - public void testUpdateCustomerCompany_notExists() { - // 准备参数 - CustomerCompanySaveReqVO updateReqVO = randomPojo(CustomerCompanySaveReqVO.class); - - // 调用, 并断言异常 - assertServiceException(() -> customerCompanyService.updateCustomerCompany(updateReqVO), CUSTOMER_COMPANY_NOT_EXISTS); - } - - @Test - public void testDeleteCustomerCompany_success() { - // mock 数据 - CustomerCompanyDO dbCustomerCompany = randomPojo(CustomerCompanyDO.class); - customerCompanyMapper.insert(dbCustomerCompany);// @Sql: 先插入出一条存在的数据 - // 准备参数 - Long id = dbCustomerCompany.getId(); - - // 调用 - customerCompanyService.deleteCustomerCompany(id); - // 校验数据不存在了 - assertNull(customerCompanyMapper.selectById(id)); - } - - @Test - public void testDeleteCustomerCompany_notExists() { - // 准备参数 - Long id = randomLongId(); - - // 调用, 并断言异常 - assertServiceException(() -> customerCompanyService.deleteCustomerCompany(id), CUSTOMER_COMPANY_NOT_EXISTS); - } - - @Test - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 - public void testGetCustomerCompanyPage() { - // mock 数据 - CustomerCompanyDO dbCustomerCompany = randomPojo(CustomerCompanyDO.class, o -> { // 等会查询到 - o.setContacts(null); - o.setCreateTime(null); - o.setName(null); - o.setAddress(null); - o.setPhone(null); - }); - customerCompanyMapper.insert(dbCustomerCompany); - // 测试 contacts 不匹配 - customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setContacts(null))); - // 测试 createTime 不匹配 - customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setCreateTime(null))); - // 测试 name 不匹配 - customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setName(null))); - // 测试 address 不匹配 - customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setAddress(null))); - // 测试 phone 不匹配 - customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setPhone(null))); - // 准备参数 - CustomerCompanyPageReqVO reqVO = new CustomerCompanyPageReqVO(); - reqVO.setContacts(null); - reqVO.setCreateTime(null); - reqVO.setName(null); - reqVO.setAddress(null); - reqVO.setPhone(null); - - // 调用 - PageResult pageResult = customerCompanyService.getCustomerCompanyPage(reqVO); - // 断言 - assertEquals(1, pageResult.getTotal()); - assertEquals(1, pageResult.getList().size()); - assertPojoEquals(dbCustomerCompany, pageResult.getList().get(0)); - } - -} \ No newline at end of file diff --git a/yudao-module-cms/yudao-module-cms-biz/src/test/resources/logback.xml b/yudao-module-cms/yudao-module-cms-biz/src/test/resources/logback.xml new file mode 100644 index 000000000..daf756bff --- /dev/null +++ b/yudao-module-cms/yudao-module-cms-biz/src/test/resources/logback.xml @@ -0,0 +1,4 @@ + + + + diff --git a/yudao-module-cms/yudao-module-cms-biz/src/test/resources/sql/clean.sql b/yudao-module-cms/yudao-module-cms-biz/src/test/resources/sql/clean.sql new file mode 100644 index 000000000..81b5d45bc --- /dev/null +++ b/yudao-module-cms/yudao-module-cms-biz/src/test/resources/sql/clean.sql @@ -0,0 +1,3 @@ +-- 将该删表 SQL 语句,添加到 yudao-module-cms-biz 模块的 test/resources/sql/clean.sql 文件里 +DELETE +FROM "cms_contract"; \ No newline at end of file diff --git a/yudao-module-cms/yudao-module-cms-biz/src/test/resources/sql/create_tables.sql b/yudao-module-cms/yudao-module-cms-biz/src/test/resources/sql/create_tables.sql new file mode 100644 index 000000000..af39f1d92 --- /dev/null +++ b/yudao-module-cms/yudao-module-cms-biz/src/test/resources/sql/create_tables.sql @@ -0,0 +1,39 @@ +-- 将该建表 SQL 语句,添加到 yudao-module-cms-biz 模块的 test/resources/sql/create_tables.sql 文件里 +CREATE TABLE IF NOT EXISTS "cms_contract" +( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "project_id" bigint NOT NULL, + "name" varchar NOT NULL, + "type" varchar NOT NULL, + "progress" varchar NOT NULL, + "expected_time" varchar NOT NULL, + "printing_time" varchar NOT NULL, + "signing_time" varchar, + "archive_time" varchar, + "status" varchar NOT NULL, + "count_type" varchar, + "remark" varchar, + "contract_file_url" varchar, + "construction_cost" varchar, + "source" varchar, + "discount" varchar, + "consortium" bit, + "consortium_company" varchar, + "ext_proportion" varchar, + "approved_amount" varchar NOT NULL, + "review_file_url" varchar, + "creator" varchar DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + "tenant_id" bigint NOT NULL, + "amount" varchar, + "pre_amount" varchar, + "design_amount" varchar, + "survey_fees" varchar, + "measurement_fee" varchar, + "other_fee" varchar, + PRIMARY KEY ("id") +) COMMENT '合同'; + 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..01f9482cf --- /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.project.dto.ProjectDetailRespDTO; +import cn.iocoder.yudao.module.pms.api.project.dto.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/project/dto/ProjectDetailRespDTO.java b/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/project/dto/ProjectDetailRespDTO.java new file mode 100644 index 000000000..b80a21395 --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/project/dto/ProjectDetailRespDTO.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.pms.api.project.dto; + +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/project/dto/ProjectRespDTO.java b/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/project/dto/ProjectRespDTO.java new file mode 100644 index 000000000..df6b6f91c --- /dev/null +++ b/yudao-module-pms/yudao-module-pms-api/src/main/java/cn/iocoder/yudao/module/pms/api/project/dto/ProjectRespDTO.java @@ -0,0 +1,46 @@ +package cn.iocoder.yudao.module.pms.api.project.dto; + +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..f03131aa0 --- /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,35 @@ +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.project.dto.ProjectDetailRespDTO; +import cn.iocoder.yudao.module.pms.api.project.dto.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; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +@Service +@Validated +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..cd734e3b5 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 @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.pms.dal.mysql.project; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; -import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO; import cn.iocoder.yudao.module.pms.controller.admin.project.vo.ProjectPageReqVO; import cn.iocoder.yudao.module.pms.dal.dataobject.project.ProjectDO; import cn.iocoder.yudao.module.pms.dal.dataobject.project.ProjectDetailDO; @@ -33,7 +32,6 @@ public interface ProjectMapper extends BaseMapperX { .selectAll(ProjectDO.class) .selectAs(DeptDO::getName, ProjectDetailDO::getTrackingDepName) // 映射到ProjectDetailDO的trackingDeptName .selectAs(AdminUserDO::getNickname, ProjectDetailDO::getProjectManagerName) // 映射到ProjectDetailDO的projectManagerName - .selectAs(CustomerCompanyDO::getName, ProjectDetailDO::getCustomerCompanyName) .likeIfExists(ProjectDO::getName, reqVO.getName()) .eqIfExists(ProjectDO::getTrackingCode, reqVO.getTrackingCode()) .eqIfExists(ProjectDO::getType, reqVO.getType()) @@ -41,8 +39,7 @@ public interface ProjectMapper extends BaseMapperX { .orderByDesc(ProjectDO::getId) .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) { @@ -50,11 +47,9 @@ public interface ProjectMapper extends BaseMapperX { .selectAll(ProjectDO.class) .selectAs(DeptDO::getName, ProjectDetailDO::getTrackingDepName) // 映射到ProjectDetailDO的trackingDeptName .selectAs(AdminUserDO::getNickname, ProjectDetailDO::getProjectManagerName) // 映射到ProjectDetailDO的projectManagerName - .selectAs(CustomerCompanyDO::getName, ProjectDetailDO::getCustomerCompanyName) .eqIfExists(ProjectDO::getId, id) .leftJoin(DeptDO.class, DeptDO::getId, ProjectDO::getTrackingDepId) .leftJoin(AdminUserDO.class, AdminUserDO::getId, ProjectDO::getProjectManagerId) - .leftJoin(CustomerCompanyDO.class, CustomerCompanyDO::getId, ProjectDO::getCustomerCompanyId) ); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java index 6eb55ef48..a37dc1b7d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java @@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.service.dept.DeptService; -import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import jakarta.annotation.Resource; diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index b4ebced1e..c74a4057f 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -133,6 +133,7 @@ yudao-spring-boot-starter-protection + diff --git a/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java b/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java index 57db3f942..905989d1d 100644 --- a/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java +++ b/yudao-server/src/main/java/cn/iocoder/yudao/server/YudaoServerApplication.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.server; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -12,6 +13,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; * * @author 芋道源码 */ + @SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package} @SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module"}) public class YudaoServerApplication { diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index e2ed2e5c0..aebad3541 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -45,7 +45,7 @@ spring: primary: master datasource: master: - url: jdbc:mysql://127.0.0.1:3306/hhyykk?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + url: jdbc:mysql://127.0.0.1:3307/hhyykk?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 @@ -54,7 +54,7 @@ spring: # url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss 连接的示例 username: root - password: we9085@z + password: root # username: sa # SQL Server 连接的示例 # password: Yudao@2024 # SQL Server 连接的示例 # username: SYSDBA # DM 连接的示例 @@ -63,9 +63,9 @@ spring: # password: Yudao@2024 # OpenGauss 连接的示例 slave: # 模拟从库,可根据自己需要修改 lazy: true # 开启懒加载,保证启动速度 - url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true + url: jdbc:mysql://127.0.0.1:3307/db1?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true username: root - password: we9085@z + password: root # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 data: diff --git a/yudao-ui/yudao-ui-admin-vue3-cms-ext/src/api/cms-ext/extcontract/index.ts b/yudao-ui/yudao-ui-admin-vue3-cms-ext/src/api/cms-ext/extcontract/index.ts new file mode 100644 index 000000000..440cc6730 --- /dev/null +++ b/yudao-ui/yudao-ui-admin-vue3-cms-ext/src/api/cms-ext/extcontract/index.ts @@ -0,0 +1,67 @@ +import request from '@/config/axios' + +// 外部合同 VO +export interface ExtContractVO { + id: number // 主键 + projectId: number // 项目id + name: string // 合同名称 + type: string // 合同类型 + customerCompanyId: number // 客户公司id + progress: string // 合同进展 + expectedTime: Date // 预计签订时间 + signingTime: Date // 签订时间 + archiveTime: Date // 归档时间 + status: string // 状态 + amount: number // 合同金额 + preAmount: number // 前期费用 + designFee: number // 设计费 + surveyFees: number // 勘测费 + testingFee: number // 检测费 + otherFee: string // 其他费 + countType: string // 计费方式 + remark: string // 备注 + contractFileUrl: string // 合同附件url + constructionCost: number // 建安费 + source: string // 资金来源 + chargingStandard: string // 收费标准 + discount: string // 优惠 + consortium: boolean // 是否联合体 + consortiumCompany: string // 联合体单位 + reminderTime: Date // 合同提示时间 + approvedAmount: number // 审定金额 + reviewFileUrl: string // 审核文件url + contractId: number // 合同id +} + +// 外部合同 API +export const ExtContractApi = { + // 查询外部合同分页 + getExtContractPage: async (params: any) => { + return await request.get({ url: `/cms-ext/ext-contract/page`, params }) + }, + + // 查询外部合同详情 + getExtContract: async (id: number) => { + return await request.get({ url: `/cms-ext/ext-contract/get?id=` + id }) + }, + + // 新增外部合同 + createExtContract: async (data: ExtContractVO) => { + return await request.post({ url: `/cms-ext/ext-contract/create`, data }) + }, + + // 修改外部合同 + updateExtContract: async (data: ExtContractVO) => { + return await request.put({ url: `/cms-ext/ext-contract/update`, data }) + }, + + // 删除外部合同 + deleteExtContract: async (id: number) => { + return await request.delete({ url: `/cms-ext/ext-contract/delete?id=` + id }) + }, + + // 导出外部合同 Excel + exportExtContract: async (params) => { + return await request.download({ url: `/cms-ext/ext-contract/export-excel`, params }) + }, +} \ No newline at end of file diff --git a/yudao-ui/yudao-ui-admin-vue3-cms-ext/src/views/cms-ext/extcontract/ExtContractForm.vue b/yudao-ui/yudao-ui-admin-vue3-cms-ext/src/views/cms-ext/extcontract/ExtContractForm.vue new file mode 100644 index 000000000..7632f7d51 --- /dev/null +++ b/yudao-ui/yudao-ui-admin-vue3-cms-ext/src/views/cms-ext/extcontract/ExtContractForm.vue @@ -0,0 +1,260 @@ + + \ No newline at end of file diff --git a/yudao-ui/yudao-ui-admin-vue3-cms-ext/src/views/cms-ext/extcontract/index.vue b/yudao-ui/yudao-ui-admin-vue3-cms-ext/src/views/cms-ext/extcontract/index.vue new file mode 100644 index 000000000..b4a868edd --- /dev/null +++ b/yudao-ui/yudao-ui-admin-vue3-cms-ext/src/views/cms-ext/extcontract/index.vue @@ -0,0 +1,520 @@ + + + \ No newline at end of file diff --git a/yudao-ui/yudao-ui-admin-vue3-cms/src/api/cms/contract/index.ts b/yudao-ui/yudao-ui-admin-vue3-cms/src/api/cms/contract/index.ts new file mode 100644 index 000000000..52592ee99 --- /dev/null +++ b/yudao-ui/yudao-ui-admin-vue3-cms/src/api/cms/contract/index.ts @@ -0,0 +1,69 @@ +import request from '@/config/axios' + +// 合同 VO +export interface ContractVO { + name: string // 合同名称 + type: string // 合同类型 + progress: string // 合同进展 + expectedTime: Date // 合同拟定时间 + printingTime: Date // 合同用印时间 + signingTime: Date // 签订时间 + archiveTime: Date // 归档时间 + status: string // 合同状态 + countType: string // 计费方式 + remark: string // 备注 + contractFileUrl: string // 合同url + constructionCost: number // 建安费 + source: string // 资金来源 + discount: string // 优惠 + consortium: boolean // 是否联合体 + consortiumCompany: string // 联合体单位 + extProportion: string // 占主合同比例 + approvedAmount: number // 审定金额 + reviewFileUrl: string // 审核文件url + creator: string // 创建者 + createTime: Date // 创建时间 + updater: string // 更新者 + updateTime: Date // 更新时间 + deleted: boolean // 是否删除 + tenantId: number // 租户编号 + amount: number // 签订合同总额 + preAmount: number // 前期费 + designAmount: number // 设计费 + surveyFees: number // 勘测费 + measurementFee: number // 测量费 + otherFee: number // 其他费 +} + +// 合同 API +export const ContractApi = { + // 查询合同分页 + getContractPage: async (params: any) => { + return await request.get({ url: `/cms/contract/page`, params }) + }, + + // 查询合同详情 + getContract: async (id: number) => { + return await request.get({ url: `/cms/contract/get?id=` + id }) + }, + + // 新增合同 + createContract: async (data: ContractVO) => { + return await request.post({ url: `/cms/contract/create`, data }) + }, + + // 修改合同 + updateContract: async (data: ContractVO) => { + return await request.put({ url: `/cms/contract/update`, data }) + }, + + // 删除合同 + deleteContract: async (id: number) => { + return await request.delete({ url: `/cms/contract/delete?id=` + id }) + }, + + // 导出合同 Excel + exportContract: async (params) => { + return await request.download({ url: `/cms/contract/export-excel`, params }) + }, +} \ No newline at end of file diff --git a/yudao-ui/yudao-ui-admin-vue3-cms/src/views/cms/contract/ContractForm.vue b/yudao-ui/yudao-ui-admin-vue3-cms/src/views/cms/contract/ContractForm.vue new file mode 100644 index 000000000..ad9477057 --- /dev/null +++ b/yudao-ui/yudao-ui-admin-vue3-cms/src/views/cms/contract/ContractForm.vue @@ -0,0 +1,290 @@ + + \ No newline at end of file diff --git a/yudao-ui/yudao-ui-admin-vue3-cms/src/views/cms/contract/index.vue b/yudao-ui/yudao-ui-admin-vue3-cms/src/views/cms/contract/index.vue new file mode 100644 index 000000000..a07459d51 --- /dev/null +++ b/yudao-ui/yudao-ui-admin-vue3-cms/src/views/cms/contract/index.vue @@ -0,0 +1,541 @@ + + + \ No newline at end of file diff --git a/yudao-ui/yudao-ui-admin-vue3/src/api/cms/contract/index.ts b/yudao-ui/yudao-ui-admin-vue3/src/api/cms/contract/index.ts new file mode 100644 index 000000000..52592ee99 --- /dev/null +++ b/yudao-ui/yudao-ui-admin-vue3/src/api/cms/contract/index.ts @@ -0,0 +1,69 @@ +import request from '@/config/axios' + +// 合同 VO +export interface ContractVO { + name: string // 合同名称 + type: string // 合同类型 + progress: string // 合同进展 + expectedTime: Date // 合同拟定时间 + printingTime: Date // 合同用印时间 + signingTime: Date // 签订时间 + archiveTime: Date // 归档时间 + status: string // 合同状态 + countType: string // 计费方式 + remark: string // 备注 + contractFileUrl: string // 合同url + constructionCost: number // 建安费 + source: string // 资金来源 + discount: string // 优惠 + consortium: boolean // 是否联合体 + consortiumCompany: string // 联合体单位 + extProportion: string // 占主合同比例 + approvedAmount: number // 审定金额 + reviewFileUrl: string // 审核文件url + creator: string // 创建者 + createTime: Date // 创建时间 + updater: string // 更新者 + updateTime: Date // 更新时间 + deleted: boolean // 是否删除 + tenantId: number // 租户编号 + amount: number // 签订合同总额 + preAmount: number // 前期费 + designAmount: number // 设计费 + surveyFees: number // 勘测费 + measurementFee: number // 测量费 + otherFee: number // 其他费 +} + +// 合同 API +export const ContractApi = { + // 查询合同分页 + getContractPage: async (params: any) => { + return await request.get({ url: `/cms/contract/page`, params }) + }, + + // 查询合同详情 + getContract: async (id: number) => { + return await request.get({ url: `/cms/contract/get?id=` + id }) + }, + + // 新增合同 + createContract: async (data: ContractVO) => { + return await request.post({ url: `/cms/contract/create`, data }) + }, + + // 修改合同 + updateContract: async (data: ContractVO) => { + return await request.put({ url: `/cms/contract/update`, data }) + }, + + // 删除合同 + deleteContract: async (id: number) => { + return await request.delete({ url: `/cms/contract/delete?id=` + id }) + }, + + // 导出合同 Excel + exportContract: async (params) => { + return await request.download({ url: `/cms/contract/export-excel`, params }) + }, +} \ No newline at end of file diff --git a/yudao-ui/yudao-ui-admin-vue3/src/views/cms/contract/ContractForm.vue b/yudao-ui/yudao-ui-admin-vue3/src/views/cms/contract/ContractForm.vue new file mode 100644 index 000000000..ad9477057 --- /dev/null +++ b/yudao-ui/yudao-ui-admin-vue3/src/views/cms/contract/ContractForm.vue @@ -0,0 +1,290 @@ + + \ No newline at end of file diff --git a/yudao-ui/yudao-ui-admin-vue3/src/views/cms/contract/index.vue b/yudao-ui/yudao-ui-admin-vue3/src/views/cms/contract/index.vue new file mode 100644 index 000000000..a07459d51 --- /dev/null +++ b/yudao-ui/yudao-ui-admin-vue3/src/views/cms/contract/index.vue @@ -0,0 +1,541 @@ + + + \ No newline at end of file