mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-20 05:55:07 +08:00
[feat] 新增合同管理功能
This commit is contained in:
@ -9,4 +9,10 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
ErrorCode CUSTOMER_COMPANY_NOT_EXISTS = new ErrorCode(1_020_000_000, "客户公司管理不存在");
|
||||
|
||||
ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(2_020_000_000, "合同不存在");
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -29,6 +29,12 @@
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-pms-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
|
@ -0,0 +1,91 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||
import cn.iocoder.yudao.module.cms.service.contract.ContractService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 合同管理")
|
||||
@RestController
|
||||
@RequestMapping("/cms/contract")
|
||||
@Validated
|
||||
public class ContractController {
|
||||
|
||||
@Resource
|
||||
private ContractService contractService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:create')")
|
||||
public CommonResult<Long> createContract(@Valid @RequestBody ContractSaveReqVO createReqVO) {
|
||||
return success(contractService.createContract(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:update')")
|
||||
public CommonResult<Boolean> updateContract(@Valid @RequestBody ContractSaveReqVO updateReqVO) {
|
||||
contractService.updateContract(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除合同")
|
||||
@Parameter(name = "projectId", description = "项目id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:delete')")
|
||||
public CommonResult<Boolean> deleteContract(@RequestParam("projectId") Long projectId) {
|
||||
contractService.deleteContract(projectId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得合同")
|
||||
@Parameter(name = "projectId", description = "项目id", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:query')")
|
||||
public CommonResult<ContractRespVO> getContract(@RequestParam("projectId") Long projectId) {
|
||||
ContractRespVO contractRespVO = contractService.getContract(projectId);
|
||||
return success(contractRespVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得合同分页")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:query')")
|
||||
public CommonResult<PageResult<ContractRespVO>> getContractPage(@Valid ContractPageReqVO pageReqVO) {
|
||||
PageResult<ContractDO> pageResult = contractService.getContractPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ContractRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出合同 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportContractExcel(@Valid ContractPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ContractDO> list = contractService.getContractPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "合同.xls", "数据", ContractRespVO.class,
|
||||
BeanUtils.toBean(list, ContractRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 合同分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ContractPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "合同名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", example = "2")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "合同拟定时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] expectedTime;
|
||||
|
||||
@Schema(description = "合同用印时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] printingTime;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] signingTime;
|
||||
|
||||
@Schema(description = "归档时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] archiveTime;
|
||||
|
||||
@Schema(description = "合同状态", example = "1")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式", example = "1")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "合同url", example = "https://www.iocoder.cn")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "建安费")
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "优惠", example = "17910")
|
||||
private String discount;
|
||||
|
||||
@Schema(description = "是否联合体")
|
||||
private Boolean consortium;
|
||||
|
||||
@Schema(description = "联合体单位")
|
||||
private String consortiumCompany;
|
||||
|
||||
@Schema(description = "占主合同比例")
|
||||
private String extProportion;
|
||||
|
||||
@Schema(description = "审定金额")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
private String reviewFileUrl;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "前期费")
|
||||
private BigDecimal preAmount;
|
||||
|
||||
@Schema(description = "设计费")
|
||||
private BigDecimal designAmount;
|
||||
|
||||
@Schema(description = "勘测费")
|
||||
private BigDecimal surveyFees;
|
||||
|
||||
@Schema(description = "测量费")
|
||||
private BigDecimal measurementFee;
|
||||
|
||||
@Schema(description = "其他费")
|
||||
private BigDecimal otherFee;
|
||||
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 合同 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ContractRespVO {
|
||||
|
||||
|
||||
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||
@ExcelProperty("项目编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||
@ExcelProperty("主控部门")
|
||||
private String trackingDep;
|
||||
|
||||
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "出图公司", requiredMode = Schema.RequiredMode.REQUIRED,example = "***设计院")
|
||||
@ExcelProperty("出图公司")
|
||||
private String drawingCompany;
|
||||
|
||||
@Schema(description = "预计合同金额", requiredMode = Schema.RequiredMode.REQUIRED,example = "200.0000")
|
||||
@ExcelProperty("预计合同金额")
|
||||
private BigDecimal expectedContractAmount;
|
||||
|
||||
@Schema(description = "分包合同商议提示", requiredMode = Schema.RequiredMode.REQUIRED,example = "2024年6月28日")
|
||||
@ExcelProperty("分包合同商议提示")
|
||||
private Date subcontractNegotiationTips;
|
||||
|
||||
@Schema(description = "暂定结算数", requiredMode = Schema.RequiredMode.REQUIRED,example = "68.0000")
|
||||
@ExcelProperty("暂定结算数")
|
||||
private Double ProvisionalSettlement;
|
||||
|
||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("合同名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("合同类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("合同进展")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "合同拟定时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("合同拟定时间")
|
||||
private LocalDateTime expectedTime;
|
||||
|
||||
@Schema(description = "合同用印时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("合同用印时间")
|
||||
private LocalDateTime printingTime;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@ExcelProperty("签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "归档时间")
|
||||
@ExcelProperty("归档时间")
|
||||
private LocalDateTime archiveTime;
|
||||
|
||||
@Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("合同状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式", example = "1")
|
||||
@ExcelProperty("计费方式")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "合同url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("合同url")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "建安费")
|
||||
@ExcelProperty("建安费")
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
@ExcelProperty("资金来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "优惠", example = "17910")
|
||||
@ExcelProperty("优惠")
|
||||
private String discount;
|
||||
|
||||
@Schema(description = "是否联合体")
|
||||
@ExcelProperty("是否联合体")
|
||||
private Boolean consortium;
|
||||
|
||||
@Schema(description = "联合体单位")
|
||||
@ExcelProperty("联合体单位")
|
||||
private String consortiumCompany;
|
||||
|
||||
@Schema(description = "占主合同比例")
|
||||
@ExcelProperty("占主合同比例")
|
||||
private String extProportion;
|
||||
|
||||
@Schema(description = "审定金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("审定金额")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("审核文件url")
|
||||
private String reviewFileUrl;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
@ExcelProperty("签订合同总额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "前期费")
|
||||
@ExcelProperty("前期费")
|
||||
private BigDecimal preAmount;
|
||||
|
||||
@Schema(description = "设计费")
|
||||
@ExcelProperty("设计费")
|
||||
private BigDecimal designAmount;
|
||||
|
||||
@Schema(description = "勘测费")
|
||||
@ExcelProperty("勘测费")
|
||||
private BigDecimal surveyFees;
|
||||
|
||||
@Schema(description = "测量费")
|
||||
@ExcelProperty("测量费")
|
||||
private BigDecimal measurementFee;
|
||||
|
||||
@Schema(description = "其他费")
|
||||
@ExcelProperty("其他费")
|
||||
private BigDecimal otherFee;
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 合同新增/修改 Request VO")
|
||||
@Data
|
||||
public class ContractSaveReqVO {
|
||||
|
||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "合同名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "合同类型不能为空")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "合同进展不能为空")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "合同拟定时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "合同拟定时间不能为空")
|
||||
private LocalDateTime expectedTime;
|
||||
|
||||
@Schema(description = "合同用印时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "合同用印时间不能为空")
|
||||
private LocalDateTime printingTime;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "归档时间")
|
||||
private LocalDateTime archiveTime;
|
||||
|
||||
@Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "合同状态不能为空")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式", example = "1")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "合同url", example = "https://www.iocoder.cn")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "建安费")
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "优惠", example = "17910")
|
||||
private String discount;
|
||||
|
||||
@Schema(description = "是否联合体")
|
||||
private Boolean consortium;
|
||||
|
||||
@Schema(description = "联合体单位")
|
||||
private String consortiumCompany;
|
||||
|
||||
@Schema(description = "占主合同比例")
|
||||
private String extProportion;
|
||||
|
||||
@Schema(description = "审定金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "审定金额不能为空")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
private String reviewFileUrl;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "前期费")
|
||||
private BigDecimal preAmount;
|
||||
|
||||
@Schema(description = "设计费")
|
||||
private BigDecimal designAmount;
|
||||
|
||||
@Schema(description = "勘测费")
|
||||
private BigDecimal surveyFees;
|
||||
|
||||
@Schema(description = "测量费")
|
||||
private BigDecimal measurementFee;
|
||||
|
||||
@Schema(description = "其他费")
|
||||
private BigDecimal otherFee;
|
||||
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.contract;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 合同 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("cms_contract")
|
||||
@KeySequence("cms_contract_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ContractDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 合同进展
|
||||
*/
|
||||
private String progress;
|
||||
/**
|
||||
* 合同拟定时间
|
||||
*/
|
||||
private LocalDateTime expectedTime;
|
||||
/**
|
||||
* 合同用印时间
|
||||
*/
|
||||
private LocalDateTime printingTime;
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
private LocalDateTime signingTime;
|
||||
/**
|
||||
* 归档时间
|
||||
*/
|
||||
private LocalDateTime archiveTime;
|
||||
/**
|
||||
* 合同状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 计费方式
|
||||
*/
|
||||
private String countType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 合同url
|
||||
*/
|
||||
private String contractFileUrl;
|
||||
/**
|
||||
* 建安费
|
||||
*/
|
||||
private BigDecimal constructionCost;
|
||||
/**
|
||||
* 资金来源
|
||||
*/
|
||||
private String source;
|
||||
/**
|
||||
* 优惠
|
||||
*/
|
||||
private String discount;
|
||||
/**
|
||||
* 是否联合体
|
||||
*/
|
||||
private Boolean consortium;
|
||||
/**
|
||||
* 联合体单位
|
||||
*/
|
||||
private String consortiumCompany;
|
||||
/**
|
||||
* 占主合同比例
|
||||
*/
|
||||
private String extProportion;
|
||||
/**
|
||||
* 审定金额
|
||||
*/
|
||||
private BigDecimal approvedAmount;
|
||||
/**
|
||||
* 审核文件url
|
||||
*/
|
||||
private String reviewFileUrl;
|
||||
/**
|
||||
* 签订合同总额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 前期费
|
||||
*/
|
||||
private BigDecimal preAmount;
|
||||
/**
|
||||
* 设计费
|
||||
*/
|
||||
private BigDecimal designAmount;
|
||||
/**
|
||||
* 勘测费
|
||||
*/
|
||||
private BigDecimal surveyFees;
|
||||
/**
|
||||
* 测量费
|
||||
*/
|
||||
private BigDecimal measurementFee;
|
||||
/**
|
||||
* 其他费
|
||||
*/
|
||||
private BigDecimal otherFee;
|
||||
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.mysql.contract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.*;
|
||||
|
||||
/**
|
||||
* 合同 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContractMapper extends BaseMapperX<ContractDO> {
|
||||
|
||||
default PageResult<ContractDO> selectPage(ContractPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ContractDO>()
|
||||
.likeIfPresent(ContractDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ContractDO::getType, reqVO.getType())
|
||||
.eqIfPresent(ContractDO::getProgress, reqVO.getProgress())
|
||||
.betweenIfPresent(ContractDO::getExpectedTime, reqVO.getExpectedTime())
|
||||
.betweenIfPresent(ContractDO::getPrintingTime, reqVO.getPrintingTime())
|
||||
.betweenIfPresent(ContractDO::getSigningTime, reqVO.getSigningTime())
|
||||
.betweenIfPresent(ContractDO::getArchiveTime, reqVO.getArchiveTime())
|
||||
.eqIfPresent(ContractDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ContractDO::getCountType, reqVO.getCountType())
|
||||
.eqIfPresent(ContractDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(ContractDO::getContractFileUrl, reqVO.getContractFileUrl())
|
||||
.eqIfPresent(ContractDO::getConstructionCost, reqVO.getConstructionCost())
|
||||
.eqIfPresent(ContractDO::getSource, reqVO.getSource())
|
||||
.eqIfPresent(ContractDO::getDiscount, reqVO.getDiscount())
|
||||
.eqIfPresent(ContractDO::getConsortium, reqVO.getConsortium())
|
||||
.eqIfPresent(ContractDO::getConsortiumCompany, reqVO.getConsortiumCompany())
|
||||
.eqIfPresent(ContractDO::getExtProportion, reqVO.getExtProportion())
|
||||
.eqIfPresent(ContractDO::getApprovedAmount, reqVO.getApprovedAmount())
|
||||
.eqIfPresent(ContractDO::getReviewFileUrl, reqVO.getReviewFileUrl())
|
||||
.betweenIfPresent(ContractDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(ContractDO::getAmount, reqVO.getAmount())
|
||||
.eqIfPresent(ContractDO::getPreAmount, reqVO.getPreAmount())
|
||||
.eqIfPresent(ContractDO::getDesignAmount, reqVO.getDesignAmount())
|
||||
.eqIfPresent(ContractDO::getSurveyFees, reqVO.getSurveyFees())
|
||||
.eqIfPresent(ContractDO::getMeasurementFee, reqVO.getMeasurementFee())
|
||||
.eqIfPresent(ContractDO::getOtherFee, reqVO.getOtherFee())
|
||||
|
||||
.orderByDesc(ContractDO::getId)
|
||||
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.cms.service.contract;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.*;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 合同 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface ContractService {
|
||||
|
||||
/**
|
||||
* 创建合同
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createContract(@Valid ContractSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新合同
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateContract(@Valid ContractSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除合同
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteContract(Long id);
|
||||
|
||||
/**
|
||||
* 获得合同
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 合同
|
||||
*/
|
||||
ContractRespVO getContract(Long id);
|
||||
|
||||
/**
|
||||
* 获得合同分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 合同分页
|
||||
*/
|
||||
PageResult<ContractDO> getContractPage(ContractPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package cn.iocoder.yudao.module.cms.service.contract;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
|
||||
import cn.iocoder.yudao.module.pms.api.ProjectApi;
|
||||
import cn.iocoder.yudao.module.pms.api.dto.project.ProjectDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.api.dto.project.ProjectRespDTO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.*;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 合同 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ContractServiceImpl implements ContractService {
|
||||
|
||||
@Resource
|
||||
private ContractMapper contractMapper;
|
||||
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
|
||||
@Override
|
||||
public Long createContract(ContractSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ContractDO contract = BeanUtils.toBean(createReqVO, ContractDO.class);
|
||||
contractMapper.insert(contract);
|
||||
// 返回
|
||||
return contract.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateContract(ContractSaveReqVO updateReqVO) {
|
||||
// 更新
|
||||
ContractDO updateObj = BeanUtils.toBean(updateReqVO, ContractDO.class);
|
||||
contractMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteContract(Long id) {
|
||||
// 校验存在
|
||||
validateContractExists(id);
|
||||
// 删除
|
||||
contractMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateContractExists(Long projectId) {
|
||||
if (contractMapper.selectById(projectId) == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractRespVO getContract(Long projectId) {
|
||||
ContractDO contractDO = contractMapper.selectById(projectId);
|
||||
ContractRespVO contractRespVO = BeanUtils.toBean(contractDO, ContractRespVO.class);
|
||||
|
||||
// 需要联表查询
|
||||
// 1.项目编号 pms_project 直接 √
|
||||
// 2.主控部门(跟踪部门) pms_project找到的是id 需要联表 √
|
||||
// 3.项目经理 pms_project找到的是id 需要联表 √
|
||||
// 4.出图公司 pms_project 直接 √
|
||||
// 5.预计合同金额 pms_project 直接 √
|
||||
// 6.分包合同商议提示 pms_project_schedule
|
||||
// 7.暂定结算数
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
contractRespVO.setCode(project.getCode());
|
||||
contractRespVO.setDrawingCompany(project.getDrawingCompany());
|
||||
contractRespVO.setExpectedContractAmount(project.getContractAmount());
|
||||
|
||||
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||
contractRespVO.setTrackingDep(projectDetail.getTrackingDepName());
|
||||
contractRespVO.setProjectManager(projectDetail.getProjectManagerName());
|
||||
|
||||
|
||||
|
||||
|
||||
return contractRespVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ContractDO> getContractPage(ContractPageReqVO pageReqVO) {
|
||||
return contractMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.pms.api;
|
||||
|
||||
import cn.iocoder.yudao.module.pms.api.dto.project.ProjectDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.api.dto.project.ProjectRespDTO;
|
||||
|
||||
public interface ProjectApi {
|
||||
/**
|
||||
* 获得项目部分信息
|
||||
*/
|
||||
ProjectRespDTO getProject(Long projectId);
|
||||
|
||||
/**
|
||||
* 获得项目detail信息
|
||||
*/
|
||||
ProjectDetailRespDTO getProjectDetailById(Long projectId);
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.pms.api.dto.project;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProjectDetailRespDTO {
|
||||
|
||||
/**
|
||||
* 跟踪部门
|
||||
*/
|
||||
private String trackingDepName;
|
||||
/**
|
||||
* 项目经理
|
||||
*/
|
||||
private String projectManagerName;
|
||||
/**
|
||||
* 客户公司
|
||||
*/
|
||||
private String customerCompanyName;
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.pms.api.dto.project;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 项目基本信息 dto
|
||||
*/
|
||||
@Data
|
||||
public class ProjectRespDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 项目编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 出图公司
|
||||
*/
|
||||
private String drawingCompany;
|
||||
|
||||
/**
|
||||
* 跟踪部门id
|
||||
*/
|
||||
private Long trackingDepId;
|
||||
|
||||
/**
|
||||
* 客户公司id
|
||||
*/
|
||||
private Long customerCompanyId;
|
||||
|
||||
/**
|
||||
* 项目经理id
|
||||
*/
|
||||
private Long projectManagerId;
|
||||
|
||||
/**
|
||||
* 预计合同金额
|
||||
*/
|
||||
private BigDecimal contractAmount;
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.pms.api.project;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.pms.api.ProjectApi;
|
||||
import cn.iocoder.yudao.module.pms.api.dto.project.ProjectDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.api.dto.project.ProjectRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.dal.dataobject.project.ProjectDO;
|
||||
import cn.iocoder.yudao.module.pms.dal.dataobject.project.ProjectDetailDO;
|
||||
import cn.iocoder.yudao.module.pms.dal.mysql.project.ProjectMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
public class ProjectImpl implements ProjectApi {
|
||||
@Resource
|
||||
private ProjectMapper projectMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public ProjectRespDTO getProject(Long projectId) {
|
||||
ProjectDO projectDO = projectMapper.selectById(projectId);
|
||||
ProjectRespDTO projectRespDTO = BeanUtils.toBean(projectDO, ProjectRespDTO.class);
|
||||
return projectRespDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectDetailRespDTO getProjectDetailById(Long projectId) {
|
||||
ProjectDetailDO projectMapperDetail = projectMapper.getDetailById(projectId);
|
||||
ProjectDetailRespDTO detailRespDTO = BeanUtils.toBean(projectMapperDetail, ProjectDetailRespDTO.class);
|
||||
return detailRespDTO;
|
||||
}
|
||||
}
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user