mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-06-19 15:01:59 +08:00
Merge remote-tracking branch 'origin/feature-outsContract-7.26-wyw' into feature-merage-7.31-zqc
# Conflicts: # yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/contract/ContractServiceImpl.java # yudao-module-cms/yudao-module-cms-biz/src/main/java/cn/iocoder/yudao/module/cms/service/extContract/ExtContractServiceImpl.java
This commit is contained in:
commit
e0ebf5c67e
55
sql/cms/codegen-cms-exthistory-sql.sql
Normal file
55
sql/cms/codegen-cms-exthistory-sql.sql
Normal file
@ -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-history', '', 'cms/extcontracthistory/index', 0, 'ExtContractHistory'
|
||||||
|
);
|
||||||
|
|
||||||
|
-- 按钮父菜单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-contract-history:query', 3, 1, @parentId,
|
||||||
|
'', '', '', 0
|
||||||
|
);
|
||||||
|
INSERT INTO system_menu(
|
||||||
|
name, permission, type, sort, parent_id,
|
||||||
|
path, icon, component, status
|
||||||
|
)
|
||||||
|
VALUES (
|
||||||
|
'外部合同创建', 'cms:ext-contract-history:create', 3, 2, @parentId,
|
||||||
|
'', '', '', 0
|
||||||
|
);
|
||||||
|
INSERT INTO system_menu(
|
||||||
|
name, permission, type, sort, parent_id,
|
||||||
|
path, icon, component, status
|
||||||
|
)
|
||||||
|
VALUES (
|
||||||
|
'外部合同更新', 'cms:ext-contract-history:update', 3, 3, @parentId,
|
||||||
|
'', '', '', 0
|
||||||
|
);
|
||||||
|
INSERT INTO system_menu(
|
||||||
|
name, permission, type, sort, parent_id,
|
||||||
|
path, icon, component, status
|
||||||
|
)
|
||||||
|
VALUES (
|
||||||
|
'外部合同删除', 'cms:ext-contract-history:delete', 3, 4, @parentId,
|
||||||
|
'', '', '', 0
|
||||||
|
);
|
||||||
|
INSERT INTO system_menu(
|
||||||
|
name, permission, type, sort, parent_id,
|
||||||
|
path, icon, component, status
|
||||||
|
)
|
||||||
|
VALUES (
|
||||||
|
'外部合同导出', 'cms:ext-contract-history:export', 3, 5, @parentId,
|
||||||
|
'', '', '', 0
|
||||||
|
);
|
@ -0,0 +1,43 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wyw
|
||||||
|
* @description 收费标注枚举
|
||||||
|
* @date 2024/7/31
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum ChargingStandardEnum {
|
||||||
|
//厦建设
|
||||||
|
XIA_BUILDING("xia_building","XB"),
|
||||||
|
//包干价
|
||||||
|
LUMP("lump","LU"),
|
||||||
|
//其他省份
|
||||||
|
OTHER("other","OT");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型编号
|
||||||
|
*/
|
||||||
|
private final String code;
|
||||||
|
/**
|
||||||
|
* 类型编码
|
||||||
|
*/
|
||||||
|
private final String no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过code获取no
|
||||||
|
* @param code 字典编号
|
||||||
|
* @return 类型编码
|
||||||
|
*/
|
||||||
|
public static String getNoByCode(String code) {
|
||||||
|
for (ChargingStandardEnum value : values()) {
|
||||||
|
if (value.getCode().equals(code)) {
|
||||||
|
return value.getNo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wyw
|
||||||
|
* @description 合同状态枚举
|
||||||
|
* @date 2024/7/31
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum ContractStatusEnum {
|
||||||
|
//应签未签
|
||||||
|
NO_SIGN("no_sign","NS"),
|
||||||
|
//已拟定
|
||||||
|
PREPARED("prepared","PP"),
|
||||||
|
//已盖章
|
||||||
|
STAMP("stamp","ST"),
|
||||||
|
//已签订
|
||||||
|
SIGN("sign","SI"),
|
||||||
|
//已终止
|
||||||
|
TERMINATION("termination","TE"),;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型编号
|
||||||
|
*/
|
||||||
|
private final String code;
|
||||||
|
/**
|
||||||
|
* 类型编码
|
||||||
|
*/
|
||||||
|
private final String no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过code获取no
|
||||||
|
* @param code 字典编号
|
||||||
|
* @return 类型编码
|
||||||
|
*/
|
||||||
|
public static String getNoByCode(String code) {
|
||||||
|
for (ContractStatusEnum value : values()) {
|
||||||
|
if (value.getCode().equals(code)) {
|
||||||
|
return value.getNo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wyw
|
||||||
|
* @description 合同类型枚举
|
||||||
|
* @date 2024/7/31
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum ContractTypeEnum {
|
||||||
|
//勘察设计
|
||||||
|
SURVEY("survey","KS"),
|
||||||
|
//检测
|
||||||
|
DETECTION("detection","JC"),
|
||||||
|
//总承包合同
|
||||||
|
GENERAL_CONTRACT("general_contract","GC"),
|
||||||
|
//全过程咨询
|
||||||
|
PROCESS_CONSULTATION("process_consultation","PC");
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型编号
|
||||||
|
*/
|
||||||
|
private final String code;
|
||||||
|
/**
|
||||||
|
* 类型编码
|
||||||
|
*/
|
||||||
|
private final String no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过code获取no
|
||||||
|
* @param code 字典编号
|
||||||
|
* @return 类型编码
|
||||||
|
*/
|
||||||
|
public static String getNoByCode(String code) {
|
||||||
|
for (ContractTypeEnum value : values()) {
|
||||||
|
if (value.getCode().equals(code)) {
|
||||||
|
return value.getNo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wyw
|
||||||
|
* @description 计费方式枚举
|
||||||
|
* @date 2024/7/31
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum CountTypeEnum {
|
||||||
|
//费率合同
|
||||||
|
RATE_CONTRACT("rate_contract","RC"),
|
||||||
|
//包干合同
|
||||||
|
RES_CONTRACT("res_contract","RC");
|
||||||
|
/**
|
||||||
|
* 类型编号
|
||||||
|
*/
|
||||||
|
private final String code;
|
||||||
|
/**
|
||||||
|
* 类型编码
|
||||||
|
*/
|
||||||
|
private final String no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过code获取no
|
||||||
|
* @param code 字典编号
|
||||||
|
* @return 类型编码
|
||||||
|
*/
|
||||||
|
public static String getNoByCode(String code) {
|
||||||
|
for (CountTypeEnum value : values()) {
|
||||||
|
if (value.getCode().equals(code)) {
|
||||||
|
return value.getNo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author hhyykk
|
||||||
|
* @description 字典枚举
|
||||||
|
* @date 2024/7/3
|
||||||
|
*/
|
||||||
|
public interface DictTypeConstants {
|
||||||
|
|
||||||
|
// ***** 字典名称 ******
|
||||||
|
String Contract_Type = "contract_type"; // 合同类型
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -8,11 +8,14 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
|||||||
* @date 2024/7/3
|
* @date 2024/7/3
|
||||||
*/
|
*/
|
||||||
public interface ErrorCodeConstants {
|
public interface ErrorCodeConstants {
|
||||||
ErrorCode CUSTOMER_COMPANY_NOT_EXISTS = new ErrorCode(1_020_000_000, "客户公司管理不存在");
|
// ========== 客户公司 1_020_000_000 ==========
|
||||||
|
ErrorCode CUSTOMER_COMPANY_NOT_EXISTS = new ErrorCode(1_020_000_000, "客户公司不存在");
|
||||||
|
// ========== 项目信息 1_021_000_000 ==========
|
||||||
ErrorCode PROJECT_NOT_EXISTS = new ErrorCode(1_021_000_000, "项目信息不存在");
|
ErrorCode PROJECT_NOT_EXISTS = new ErrorCode(1_021_000_000, "项目信息不存在");
|
||||||
|
// ========== 请求参数 1_022_000_000 ==========
|
||||||
|
ErrorCode PARAM_NOT_EXISTS = new ErrorCode(1_022_000_000, "请求参数不存在");
|
||||||
|
|
||||||
ErrorCode PARAM_NOT_EXISTS = new ErrorCode(1_022_000_000, "请求参数错误");
|
ErrorCode PARAM_ERROR = new ErrorCode(1_022_001_000, "请求参数错误");
|
||||||
|
|
||||||
// ========== 外包合同 2_021_000_000 ==========
|
// ========== 外包合同 2_021_000_000 ==========
|
||||||
ErrorCode OUTS_CONTRACT_NOT_EXISTS = new ErrorCode(2_021_000_000, "外包合同不存在");
|
ErrorCode OUTS_CONTRACT_NOT_EXISTS = new ErrorCode(2_021_000_000, "外包合同不存在");
|
||||||
@ -23,21 +26,27 @@ public interface ErrorCodeConstants {
|
|||||||
// ========== 外包合同关联 2_023_000_000 ==========
|
// ========== 外包合同关联 2_023_000_000 ==========
|
||||||
ErrorCode CONTRACT_OUTS_NOT_EXISTS = new ErrorCode(2_023_000_000, "外包合同关联不存在");
|
ErrorCode CONTRACT_OUTS_NOT_EXISTS = new ErrorCode(2_023_000_000, "外包合同关联不存在");
|
||||||
|
|
||||||
ErrorCode CONTRACT_OUTS_ALREADY_EXISTS = new ErrorCode(2_023_000_000, "外包合同关联已经存在");
|
ErrorCode CONTRACT_OUTS_ALREADY_EXISTS = new ErrorCode(2_023_001_000, "外包合同关联已经存在");
|
||||||
|
|
||||||
|
// ========== 合同信息 2_024_000_000 ==========
|
||||||
ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(2_024_000_000, "合同不存在");
|
ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(2_024_000_000, "合同不存在");
|
||||||
|
|
||||||
|
|
||||||
ErrorCode CONTRACT_NAME_NOT_EXISTS = new ErrorCode(2_024_001_000, "合同名称不存在");
|
ErrorCode CONTRACT_NAME_NOT_EXISTS = new ErrorCode(2_024_001_000, "合同名称不存在");
|
||||||
|
|
||||||
|
ErrorCode CONTRACT_ALREADY_EXISTS = new ErrorCode(2_024_002_000, "该合同已经创建");
|
||||||
|
|
||||||
|
|
||||||
|
// ========== 历史合同信息 2_025_000_000 ==========
|
||||||
ErrorCode CONTRACT_HISTORY_NOT_EXISTS = new ErrorCode(2_025_000_000, "历史合同不存在");
|
ErrorCode CONTRACT_HISTORY_NOT_EXISTS = new ErrorCode(2_025_000_000, "历史合同不存在");
|
||||||
|
|
||||||
|
// ========== 外部合同信息 2_026_000_000 ==========
|
||||||
ErrorCode EXT_CONTRACT_NOT_EXISTS = new ErrorCode(2_026_000_000, "外部合同不存在");
|
ErrorCode EXT_CONTRACT_NOT_EXISTS = new ErrorCode(2_026_000_000, "外部合同不存在");
|
||||||
|
|
||||||
|
// ========== 历史外部合同信息 2_027_000_000 ==========
|
||||||
ErrorCode EXT_CONTRACT_HISTORY_NOT_EXISTS = new ErrorCode(2_027_000_000, "历史外部合同不存在");
|
ErrorCode EXT_CONTRACT_HISTORY_NOT_EXISTS = new ErrorCode(2_027_000_000, "历史外部合同不存在");
|
||||||
|
|
||||||
|
// ========== 外部合同关联 2_028_000_000 ==========
|
||||||
ErrorCode CONTRACT_EXT_NOT_EXISTS = new ErrorCode(2_028_000_000, "外部合同关联不存在");
|
ErrorCode CONTRACT_EXT_NOT_EXISTS = new ErrorCode(2_028_000_000, "外部合同关联不存在");
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,47 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wyw
|
||||||
|
* @description 外包合同专业枚举
|
||||||
|
* @date 2024/7/31
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum OutsContractMajorEnum {
|
||||||
|
//地勘
|
||||||
|
GROUND_SERVICE("ground_service","GE"),
|
||||||
|
//景观
|
||||||
|
SCENERY("scenery","SC"),
|
||||||
|
//建筑
|
||||||
|
ARCHITECTURE("architecture","AR"),
|
||||||
|
//测量
|
||||||
|
MEASURE("measure","ME"),
|
||||||
|
//效果图
|
||||||
|
EFFECT_PICTURE("effect_picture","EF");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型编号
|
||||||
|
*/
|
||||||
|
private final String code;
|
||||||
|
/**
|
||||||
|
* 类型编码
|
||||||
|
*/
|
||||||
|
private final String no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过code获取no
|
||||||
|
* @param code 字典编号
|
||||||
|
* @return 类型编码
|
||||||
|
*/
|
||||||
|
public static String getNoByCode(String code) {
|
||||||
|
for (OutsContractMajorEnum value : values()) {
|
||||||
|
if (value.getCode().equals(code)) {
|
||||||
|
return value.getNo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wyw
|
||||||
|
* @description 资金来源枚举
|
||||||
|
* @date 2024/7/31
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum SourceEnum {
|
||||||
|
//市财政
|
||||||
|
MUNICIPAL_FINANCE("municipal_finance","MF"),
|
||||||
|
//区财政
|
||||||
|
DISTRICT_FINANCE("district_finance","DF"),
|
||||||
|
//业主自筹
|
||||||
|
OWNER_FINANCE("owner_finance","OF");
|
||||||
|
/**
|
||||||
|
* 类型编号
|
||||||
|
*/
|
||||||
|
private final String code;
|
||||||
|
/**
|
||||||
|
* 类型编码
|
||||||
|
*/
|
||||||
|
private final String no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过code获取no
|
||||||
|
* @param code 字典编号
|
||||||
|
* @return 类型编码
|
||||||
|
*/
|
||||||
|
public static String getNoByCode(String code) {
|
||||||
|
for (SourceEnum value : values()) {
|
||||||
|
if (value.getCode().equals(code)) {
|
||||||
|
return value.getNo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -14,14 +14,19 @@ import io.swagger.v3.oas.annotations.Parameter;
|
|||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import jakarta.validation.*;
|
import jakarta.validation.*;
|
||||||
import jakarta.servlet.http.*;
|
import jakarta.servlet.http.*;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
|
||||||
@ -38,14 +43,14 @@ public class ContractController {
|
|||||||
@Operation(summary = "创建合同")
|
@Operation(summary = "创建合同")
|
||||||
@PreAuthorize("@ss.hasPermission('cms:contract:create')")
|
@PreAuthorize("@ss.hasPermission('cms:contract:create')")
|
||||||
public CommonResult<Long> createContract(@Valid @RequestBody ContractSaveReqVO createReqVO) {
|
public CommonResult<Long> createContract(@Valid @RequestBody ContractSaveReqVO createReqVO) {
|
||||||
return success(contractService.createContract(getLoginUserId(),createReqVO));
|
return success(contractService.createContract(getLoginUserId(), createReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新合同")
|
@Operation(summary = "更新合同")
|
||||||
@PreAuthorize("@ss.hasPermission('cms:contract:update')")
|
@PreAuthorize("@ss.hasPermission('cms:contract:update')")
|
||||||
public CommonResult<Boolean> updateContract(@Valid @RequestBody ContractSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateContract(@Valid @RequestBody ContractSaveReqVO updateReqVO) {
|
||||||
contractService.updateContract(getLoginUserId(),updateReqVO);
|
contractService.updateContract(getLoginUserId(), updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,12 +85,11 @@ public class ContractController {
|
|||||||
@PreAuthorize("@ss.hasPermission('cms:contract:export')")
|
@PreAuthorize("@ss.hasPermission('cms:contract:export')")
|
||||||
@ApiAccessLog(operateType = EXPORT)
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
public void exportContractExcel(@Valid ContractPageReqVO pageReqVO,
|
public void exportContractExcel(@Valid ContractPageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<ContractRespVO> list = contractService.getContractPage(pageReqVO).getList();
|
List<ContractRespVO> list = contractService.getContractPage(pageReqVO).getList();
|
||||||
// 导出 Excel
|
// 导出 Excel
|
||||||
ExcelUtils.write(response, "合同.xls", "数据", ContractRespVO.class,
|
ExcelUtils.write(response, "合同.xls", "数据", ContractRespVO.class,
|
||||||
BeanUtils.toBean(list, ContractRespVO.class));
|
BeanUtils.toBean(list, ContractRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,14 +1,8 @@
|
|||||||
package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
|
package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
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")
|
@Schema(description = "管理后台 - 合同分页 Request VO")
|
||||||
@Data
|
@Data
|
||||||
@ -29,75 +23,9 @@ public class ContractPageReqVO extends PageParam {
|
|||||||
@Schema(description = "合同进展")
|
@Schema(description = "合同进展")
|
||||||
private String progress;
|
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")
|
@Schema(description = "合同状态", example = "1")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@Schema(description = "计费方式", example = "1")
|
@Schema(description = "计费方式", example = "1")
|
||||||
private String countType;
|
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 = "签订合同总额")
|
|
||||||
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;
|
|
||||||
|
|
||||||
}
|
}
|
@ -11,6 +11,7 @@ import com.alibaba.excel.annotation.*;
|
|||||||
@Schema(description = "管理后台 - 合同 Response VO")
|
@Schema(description = "管理后台 - 合同 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
|
@EqualsAndHashCode
|
||||||
public class ContractRespVO {
|
public class ContractRespVO {
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import java.time.LocalDateTime;
|
|||||||
|
|
||||||
@Schema(description = "管理后台 - 合同新增/修改 Request VO")
|
@Schema(description = "管理后台 - 合同新增/修改 Request VO")
|
||||||
@Data
|
@Data
|
||||||
|
@EqualsAndHashCode
|
||||||
public class ContractSaveReqVO {
|
public class ContractSaveReqVO {
|
||||||
|
|
||||||
@Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@ -30,7 +31,7 @@ public class ContractSaveReqVO {
|
|||||||
|
|
||||||
@Schema(description = "分包合同提示时间")
|
@Schema(description = "分包合同提示时间")
|
||||||
@ExcelProperty("分包合同提示时间")
|
@ExcelProperty("分包合同提示时间")
|
||||||
private LocalDateTime ReminderTime;
|
private LocalDateTime reminderTime;
|
||||||
|
|
||||||
@Schema(description = "暂定结算数")
|
@Schema(description = "暂定结算数")
|
||||||
@ExcelProperty("暂定结算数")
|
@ExcelProperty("暂定结算数")
|
||||||
@ -44,6 +45,8 @@ public class ContractSaveReqVO {
|
|||||||
@ExcelProperty("预计合同金额")
|
@ExcelProperty("预计合同金额")
|
||||||
private BigDecimal expectedContractAmount;
|
private BigDecimal expectedContractAmount;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
@NotEmpty(message = "合同名称不能为空")
|
@NotEmpty(message = "合同名称不能为空")
|
||||||
private String name;
|
private String name;
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.cms.controller.admin.contractHistory;
|
package cn.iocoder.yudao.module.cms.controller.admin.contractHistory;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractHistory.ContractHistoryDO;
|
|
||||||
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
|
|
||||||
import cn.iocoder.yudao.module.cms.service.contractHistory.ContractHistoryService;
|
import cn.iocoder.yudao.module.cms.service.contractHistory.ContractHistoryService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@ -14,7 +11,6 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||||||
import jakarta.validation.*;
|
import jakarta.validation.*;
|
||||||
import jakarta.servlet.http.*;
|
import jakarta.servlet.http.*;
|
||||||
|
|
||||||
import java.beans.Beans;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -28,6 +24,7 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo.*;
|
import cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo.*;
|
||||||
|
|
||||||
@ -40,33 +37,12 @@ public class ContractHistoryController {
|
|||||||
@Resource
|
@Resource
|
||||||
private ContractHistoryService contractHistoryService;
|
private ContractHistoryService contractHistoryService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ContractMapper contractMapper;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建历史合同")
|
|
||||||
@PreAuthorize("@ss.hasPermission('cms:contract-history:create')")
|
|
||||||
public CommonResult<Long> createContractHistory(@Valid @RequestBody ContractHistorySaveReqVO createReqVO) {
|
|
||||||
return success(contractHistoryService.createContractHistory(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新历史合同")
|
@Operation(summary = "更新历史合同")
|
||||||
@PreAuthorize("@ss.hasPermission('cms:contract-history:update')")
|
@PreAuthorize("@ss.hasPermission('cms:contract-history:update')")
|
||||||
public CommonResult<Boolean> updateContractHistory(@Valid @RequestBody ContractHistorySaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateContractHistory(@Valid @RequestBody ContractHistorySaveReqVO updateReqVO) {
|
||||||
contractHistoryService.updateContractHistory(updateReqVO);
|
contractHistoryService.updateContractHistory(getLoginUserId(),updateReqVO);
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除历史合同")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('cms:contract-history:delete')")
|
|
||||||
public CommonResult<Boolean> deleteContractHistory(@RequestParam("id") Long id) {
|
|
||||||
contractHistoryService.deleteContractHistory(id);
|
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,17 +50,17 @@ public class ContractHistoryController {
|
|||||||
@Operation(summary = "获得历史合同")
|
@Operation(summary = "获得历史合同")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('cms:contract-history:query')")
|
@PreAuthorize("@ss.hasPermission('cms:contract-history:query')")
|
||||||
public CommonResult<ContractHistoryDO> getContractHistory(@RequestParam("id") Long id) {
|
public CommonResult<ContractHistoryRespVO> getContractHistory(@RequestParam("id") Long id) {
|
||||||
ContractHistoryDO contractHistory = contractHistoryService.getContractHistory(id);
|
ContractHistoryRespVO contractHistory = contractHistoryService.getContractHistory(id);
|
||||||
return success(BeanUtils.toBean(contractHistory, ContractHistoryDO.class));
|
return success(contractHistory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得历史合同分页")
|
@Operation(summary = "获得历史合同分页")
|
||||||
@PreAuthorize("@ss.hasPermission('cms:contract-history:query')")
|
@PreAuthorize("@ss.hasPermission('cms:contract-history:query')")
|
||||||
public CommonResult<PageResult<ContractHistoryRespVO>> getContractHistoryPage(@Valid ContractHistoryPageReqVO pageReqVO) {
|
public CommonResult<PageResult<ContractHistoryRespVO>> getContractHistoryPage(@Valid ContractHistoryPageReqVO pageReqVO) {
|
||||||
PageResult<ContractHistoryDO> pageResult = contractHistoryService.getContractHistoryPage(pageReqVO);
|
PageResult<ContractHistoryRespVO> pageResult = contractHistoryService.getContractHistoryPage(pageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, ContractHistoryRespVO.class));
|
return success(pageResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@ -94,10 +70,9 @@ public class ContractHistoryController {
|
|||||||
public void exportContractHistoryExcel(@Valid ContractHistoryPageReqVO pageReqVO,
|
public void exportContractHistoryExcel(@Valid ContractHistoryPageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<ContractHistoryDO> list = contractHistoryService.getContractHistoryPage(pageReqVO).getList();
|
List<ContractHistoryRespVO> list = contractHistoryService.getContractHistoryPage(pageReqVO).getList();
|
||||||
// 导出 Excel
|
// 导出 Excel
|
||||||
ExcelUtils.write(response, "历史合同.xls", "数据", ContractHistoryRespVO.class,
|
ExcelUtils.write(response, "历史合同.xls", "数据", ContractHistoryRespVO.class,
|
||||||
BeanUtils.toBean(list, ContractHistoryRespVO.class));
|
BeanUtils.toBean(list, ContractHistoryRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -3,18 +3,18 @@ package cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo;
|
|||||||
import lombok.*;
|
import lombok.*;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
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")
|
@Schema(description = "管理后台 - 历史合同分页 Request VO")
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class ContractHistoryPageReqVO extends PageParam {
|
public class ContractHistoryPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "合同编号")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
@Schema(description = "流程实体id", example = "12536")
|
@Schema(description = "流程实体id", example = "12536")
|
||||||
private String processInstanceId;
|
private String processInstanceId;
|
||||||
|
|
||||||
@ -27,103 +27,13 @@ public class ContractHistoryPageReqVO extends PageParam {
|
|||||||
@Schema(description = "合同进展")
|
@Schema(description = "合同进展")
|
||||||
private String progress;
|
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")
|
@Schema(description = "合同状态", example = "1")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@Schema(description = "计费方式", example = "2")
|
@Schema(description = "计费方式")
|
||||||
private String countType;
|
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 = "18154")
|
|
||||||
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 = "创建者")
|
|
||||||
private String creator;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
@Schema(description = "更新者")
|
|
||||||
private String updater;
|
|
||||||
|
|
||||||
@Schema(description = "更新时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] updateTime;
|
|
||||||
|
|
||||||
@Schema(description = "是否删除")
|
|
||||||
private Boolean deleted;
|
|
||||||
|
|
||||||
@Schema(description = "租户编号", example = "23584")
|
|
||||||
private Long tenantId;
|
|
||||||
|
|
||||||
@Schema(description = "签订合同总额")
|
|
||||||
private BigDecimal amount;
|
|
||||||
|
|
||||||
@Schema(description = "前期费")
|
|
||||||
private BigDecimal preAmount;
|
|
||||||
|
|
||||||
@Schema(description = "设计费")
|
|
||||||
private BigDecimal designAmount;
|
|
||||||
|
|
||||||
@Schema(description = "勘测费")
|
|
||||||
private BigDecimal surveyFees;
|
|
||||||
|
|
||||||
@Schema(description = "测量费")
|
|
||||||
private BigDecimal measurementFee;
|
|
||||||
|
|
||||||
@Schema(description = "其他费")
|
|
||||||
private BigDecimal otherFee;
|
|
||||||
|
|
||||||
@Schema(description = "流程状态", example = "2")
|
@Schema(description = "流程状态", example = "2")
|
||||||
private String processStatus;
|
private String processStatus;
|
||||||
|
|
||||||
@Schema(description = "合同", example = "20704")
|
|
||||||
private Long contractId;
|
|
||||||
|
|
||||||
@Schema(description = "版本")
|
|
||||||
private String version;
|
|
||||||
|
|
||||||
}
|
}
|
@ -46,7 +46,6 @@ public class ContractHistoryRespVO {
|
|||||||
@ExcelProperty("流程实体id")
|
@ExcelProperty("流程实体id")
|
||||||
private String processInstanceId;
|
private String processInstanceId;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
@ExcelProperty("合同名称")
|
@ExcelProperty("合同名称")
|
||||||
private String name;
|
private String name;
|
||||||
@ -123,29 +122,6 @@ public class ContractHistoryRespVO {
|
|||||||
@ExcelProperty("审核文件url")
|
@ExcelProperty("审核文件url")
|
||||||
private String reviewFileUrl;
|
private String reviewFileUrl;
|
||||||
|
|
||||||
@Schema(description = "创建者")
|
|
||||||
@ExcelProperty("创建者")
|
|
||||||
private String creator;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@ExcelProperty("创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
@Schema(description = "更新者")
|
|
||||||
@ExcelProperty("更新者")
|
|
||||||
private String updater;
|
|
||||||
|
|
||||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@ExcelProperty("更新时间")
|
|
||||||
private LocalDateTime updateTime;
|
|
||||||
|
|
||||||
@Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@ExcelProperty("是否删除")
|
|
||||||
private Boolean deleted;
|
|
||||||
|
|
||||||
@Schema(description = "租户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23584")
|
|
||||||
@ExcelProperty("租户编号")
|
|
||||||
private Long tenantId;
|
|
||||||
|
|
||||||
@Schema(description = "签订合同总额")
|
@Schema(description = "签订合同总额")
|
||||||
@ExcelProperty("签订合同总额")
|
@ExcelProperty("签订合同总额")
|
||||||
@ -171,14 +147,14 @@ public class ContractHistoryRespVO {
|
|||||||
@ExcelProperty("其他费")
|
@ExcelProperty("其他费")
|
||||||
private BigDecimal otherFee;
|
private BigDecimal otherFee;
|
||||||
|
|
||||||
@Schema(description = "流程状态", example = "2")
|
|
||||||
@ExcelProperty("流程状态")
|
|
||||||
private String processStatus;
|
|
||||||
|
|
||||||
@Schema(description = "合同", example = "20704")
|
@Schema(description = "合同", example = "20704")
|
||||||
@ExcelProperty("合同")
|
@ExcelProperty("合同")
|
||||||
private Long contractId;
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "流程状态", example = "2")
|
||||||
|
@ExcelProperty("流程状态")
|
||||||
|
private String processStatus;
|
||||||
|
|
||||||
@Schema(description = "版本")
|
@Schema(description = "版本")
|
||||||
@ExcelProperty("版本")
|
@ExcelProperty("版本")
|
||||||
private String version;
|
private String version;
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
package cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo;
|
package cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@ -13,12 +15,40 @@ public class ContractHistorySaveReqVO {
|
|||||||
@Schema(description = "历史合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "历史合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
|
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
|
||||||
@Schema(description = "流程实体id", example = "12536")
|
@Schema(description = "流程实体id", example = "12536")
|
||||||
private String processInstanceId;
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||||
|
@ExcelProperty("项目编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||||
|
@ExcelProperty("主控部门")
|
||||||
|
private String trackingDep;
|
||||||
|
|
||||||
|
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("项目经理")
|
||||||
|
private String projectManager;
|
||||||
|
|
||||||
|
@Schema(description = "分包合同提示时间")
|
||||||
|
@ExcelProperty("分包合同提示时间")
|
||||||
|
private LocalDateTime ReminderTime;
|
||||||
|
|
||||||
|
@Schema(description = "暂定结算数")
|
||||||
|
@ExcelProperty("暂定结算数")
|
||||||
|
private BigDecimal provisionalSettlement;
|
||||||
|
|
||||||
|
@Schema(description = "出图公司", requiredMode = Schema.RequiredMode.REQUIRED, example = "***设计院")
|
||||||
|
@ExcelProperty("出图公司")
|
||||||
|
private String drawingCompany;
|
||||||
|
|
||||||
|
@Schema(description = "预计合同金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "200.0000")
|
||||||
|
@ExcelProperty("预计合同金额")
|
||||||
|
private BigDecimal expectedContractAmount;
|
||||||
|
|
||||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
@NotEmpty(message = "合同名称不能为空")
|
@NotEmpty(message = "合同名称不能为空")
|
||||||
private String name;
|
private String name;
|
||||||
@ -83,28 +113,6 @@ public class ContractHistorySaveReqVO {
|
|||||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||||
private String reviewFileUrl;
|
private String reviewFileUrl;
|
||||||
|
|
||||||
@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 = "23584")
|
|
||||||
@NotNull(message = "租户编号不能为空")
|
|
||||||
private Long tenantId;
|
|
||||||
|
|
||||||
@Schema(description = "签订合同总额")
|
@Schema(description = "签订合同总额")
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@ -30,76 +30,10 @@ public class ExtContractPageReqVO extends PageParam {
|
|||||||
@Schema(description = "合同进展")
|
@Schema(description = "合同进展")
|
||||||
private String progress;
|
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")
|
@Schema(description = "状态", example = "2")
|
||||||
private String status;
|
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 = "合同id", example = "27460")
|
@Schema(description = "合同id", example = "27460")
|
||||||
private Long contractId;
|
private Long contractId;
|
||||||
|
|
||||||
|
@ -39,11 +39,10 @@ public class ExtContractSaveReqVO {
|
|||||||
@ExcelProperty("合同提示时间")
|
@ExcelProperty("合同提示时间")
|
||||||
private LocalDateTime exReminderTime;
|
private LocalDateTime exReminderTime;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "客户公司id", example = "25191")
|
@Schema(description = "客户公司id", example = "25191")
|
||||||
private Long customerCompanyId;
|
private Long customerCompanyId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "合同名称", example = "芋艿")
|
@Schema(description = "合同名称", example = "芋艿")
|
||||||
@ExcelProperty("合同名称")
|
@ExcelProperty("合同名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
@ -0,0 +1,79 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory;
|
||||||
|
|
||||||
|
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.*;
|
||||||
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.cms.service.extcontracthistory.ExtContractHistoryService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 外部合同历史")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cms/ext-contract-history")
|
||||||
|
@Validated
|
||||||
|
public class ExtContractHistoryController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ExtContractHistoryService extContractHistoryService;
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新外部合同历史历史")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:ext-contract-history:update')")
|
||||||
|
public CommonResult<Boolean> updateExtContractHistory(@Valid @RequestBody ExtContractHistorySaveReqVO updateReqVO) {
|
||||||
|
extContractHistoryService.updateExtContractHistory(getLoginUserId(),updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得外部合同历史历史")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:ext-contract-history:query')")
|
||||||
|
public CommonResult<ExtContractHistoryRespVO> getExtContractHistory(@RequestParam("id") Long id) {
|
||||||
|
ExtContractHistoryRespVO extContractHistory = extContractHistoryService.getExtContractHistory(id);
|
||||||
|
return success(extContractHistory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得外部合同历史历史分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:ext-contract-history:query')")
|
||||||
|
public CommonResult<PageResult<ExtContractHistoryRespVO>> getExtContractHistoryPage(@Valid ExtContractHistoryPageReqVO pageReqVO) {
|
||||||
|
PageResult<ExtContractHistoryRespVO> pageResult = extContractHistoryService.getExtContractHistoryPage(pageReqVO);
|
||||||
|
return success(pageResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出外部合同历史历史 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:ext-contract-history:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportExtContractHistoryExcel(@Valid ExtContractHistoryPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ExtContractHistoryRespVO> list = extContractHistoryService.getExtContractHistoryPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "外部合同历史历史.xls", "数据", ExtContractHistoryRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ExtContractHistoryRespVO.class));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外部合同分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class ExtContractHistoryPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "项目id", example = "6935")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "张三")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "合同类型", example = "1")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "客户公司id", example = "28989")
|
||||||
|
private Long customerCompanyId;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "1")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "流程实体id", example = "8911")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "流程状态", example = "2")
|
||||||
|
private String processStatus;
|
||||||
|
|
||||||
|
@Schema(description = "合同id", example = "26795")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "外部合同id", example = "12093")
|
||||||
|
private Long extContractId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,170 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外部合同 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ExtContractHistoryRespVO {
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||||
|
@ExcelProperty("项目编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "客户名称")
|
||||||
|
@ExcelProperty("客户名称")
|
||||||
|
private String customerCompanyName;
|
||||||
|
|
||||||
|
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||||
|
@ExcelProperty("主控部门")
|
||||||
|
private String trackingDep;
|
||||||
|
|
||||||
|
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("项目经理")
|
||||||
|
private String projectManager;
|
||||||
|
|
||||||
|
@Schema(description = "合同提示时间")
|
||||||
|
@ExcelProperty("合同提示时间")
|
||||||
|
private LocalDateTime exReminderTime;
|
||||||
|
|
||||||
|
@Schema(description = "客户公司id", example = "28989")
|
||||||
|
@ExcelProperty("客户公司id")
|
||||||
|
private Long customerCompanyId;
|
||||||
|
|
||||||
|
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("合同金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "张三")
|
||||||
|
@ExcelProperty("合同名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "合同类型", example = "1")
|
||||||
|
@ExcelProperty("合同类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "合同进展")
|
||||||
|
@ExcelProperty("合同进展")
|
||||||
|
private String progress;
|
||||||
|
|
||||||
|
@Schema(description = "预计签订时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("预计签订时间")
|
||||||
|
private LocalDateTime expectedTime;
|
||||||
|
|
||||||
|
@Schema(description = "签订时间")
|
||||||
|
@ExcelProperty("签订时间")
|
||||||
|
private LocalDateTime signingTime;
|
||||||
|
|
||||||
|
@Schema(description = "归档时间")
|
||||||
|
@ExcelProperty("归档时间")
|
||||||
|
private LocalDateTime archiveTime;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "1")
|
||||||
|
@ExcelProperty("状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@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 = "2")
|
||||||
|
@ExcelProperty(value = "计费方式", converter = DictConvert.class)
|
||||||
|
@DictFormat("contract_billing_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||||
|
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(value = "资金来源", converter = DictConvert.class)
|
||||||
|
@DictFormat("funds_source") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@Schema(description = "收费标准", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("收费标准")
|
||||||
|
private String chargingStandard;
|
||||||
|
|
||||||
|
@Schema(description = "优惠", example = "7511")
|
||||||
|
@ExcelProperty("优惠")
|
||||||
|
private String discount;
|
||||||
|
|
||||||
|
@Schema(description = "是否联合体", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("是否联合体")
|
||||||
|
private Boolean consortium;
|
||||||
|
|
||||||
|
@Schema(description = "联合体单位")
|
||||||
|
@ExcelProperty("联合体单位")
|
||||||
|
private String consortiumCompany;
|
||||||
|
|
||||||
|
@Schema(description = "合同提示时间")
|
||||||
|
@ExcelProperty("合同提示时间")
|
||||||
|
private LocalDateTime reminderTime;
|
||||||
|
|
||||||
|
@Schema(description = "审定金额")
|
||||||
|
@ExcelProperty("审定金额")
|
||||||
|
private BigDecimal approvedAmount;
|
||||||
|
|
||||||
|
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||||
|
@ExcelProperty("审核文件url")
|
||||||
|
private String reviewFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "流程实体id", example = "8911")
|
||||||
|
@ExcelProperty("流程实体id")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "流程状态", example = "2")
|
||||||
|
@ExcelProperty(value = "流程状态", converter = DictConvert.class)
|
||||||
|
@DictFormat("bpm_process_instance_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||||
|
private String processStatus;
|
||||||
|
|
||||||
|
@Schema(description = "合同id", example = "26795")
|
||||||
|
@ExcelProperty("合同id")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "外部合同id", example = "12093")
|
||||||
|
@ExcelProperty("外部合同id")
|
||||||
|
private Long extContractId;
|
||||||
|
|
||||||
|
@Schema(description = "版本")
|
||||||
|
@ExcelProperty("版本")
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,145 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外部合同新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ExtContractHistorySaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "17790")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "6935")
|
||||||
|
@NotNull(message = "项目id不能为空")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "流程实体id", example = "8911")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||||
|
@ExcelProperty("项目编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "客户名称")
|
||||||
|
@ExcelProperty("客户名称")
|
||||||
|
private String customerCompanyName;
|
||||||
|
|
||||||
|
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||||
|
@ExcelProperty("主控部门")
|
||||||
|
private String trackingDep;
|
||||||
|
|
||||||
|
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("项目经理")
|
||||||
|
private String projectManager;
|
||||||
|
|
||||||
|
@Schema(description = "合同提示时间")
|
||||||
|
@ExcelProperty("合同提示时间")
|
||||||
|
private LocalDateTime exReminderTime;
|
||||||
|
|
||||||
|
@Schema(description = "客户公司id", example = "28989")
|
||||||
|
private Long customerCompanyId;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "张三")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "合同类型", example = "1")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@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 = "1")
|
||||||
|
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 = "2")
|
||||||
|
@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 = "7511")
|
||||||
|
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 = "流程状态", example = "2")
|
||||||
|
private String processStatus;
|
||||||
|
|
||||||
|
@Schema(description = "合同id", example = "26795")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "外部合同id", example = "12093")
|
||||||
|
private Long extContractId;
|
||||||
|
|
||||||
|
@Schema(description = "版本")
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
}
|
@ -9,7 +9,6 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|||||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryRespVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryRespVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistorySaveReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistorySaveReqVO;
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
|
||||||
import cn.iocoder.yudao.module.cms.service.outscontracthistory.OutsContractHistoryService;
|
import cn.iocoder.yudao.module.cms.service.outscontracthistory.OutsContractHistoryService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
@ -36,13 +35,6 @@ public class OutsContractHistoryController {
|
|||||||
@Resource
|
@Resource
|
||||||
private OutsContractHistoryService outsContractHistoryService;
|
private OutsContractHistoryService outsContractHistoryService;
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建外包合同历史")
|
|
||||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:create')")
|
|
||||||
public CommonResult<Long> createOutsContractHistory(@Valid @RequestBody OutsContractHistorySaveReqVO createReqVO) {
|
|
||||||
return success(outsContractHistoryService.createOutsContractHistory(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新外包合同历史")
|
@Operation(summary = "更新外包合同历史")
|
||||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:update')")
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:update')")
|
||||||
@ -51,30 +43,21 @@ public class OutsContractHistoryController {
|
|||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除外包合同历史")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:delete')")
|
|
||||||
public CommonResult<Boolean> deleteOutsContractHistory(@RequestParam("id") Long id) {
|
|
||||||
outsContractHistoryService.deleteOutsContractHistory(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得外包合同历史")
|
@Operation(summary = "获得外包合同历史")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:query')")
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:query')")
|
||||||
public CommonResult<OutsContractHistoryRespVO> getOutsContractHistory(@RequestParam("id") Long id) {
|
public CommonResult<OutsContractHistoryRespVO> getOutsContractHistory(@RequestParam("id") Long id) {
|
||||||
OutsContractHistoryDO outsContractHistory = outsContractHistoryService.getOutsContractHistory(id);
|
OutsContractHistoryRespVO outsContractHistory = outsContractHistoryService.getOutsContractHistory(id);
|
||||||
return success(BeanUtils.toBean(outsContractHistory, OutsContractHistoryRespVO.class));
|
return success(outsContractHistory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得外包合同历史分页")
|
@Operation(summary = "获得外包合同历史分页")
|
||||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:query')")
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:query')")
|
||||||
public CommonResult<PageResult<OutsContractHistoryRespVO>> getOutsContractHistoryPage(@Valid OutsContractHistoryPageReqVO pageReqVO) {
|
public CommonResult<PageResult<OutsContractHistoryRespVO>> getOutsContractHistoryPage(@Valid OutsContractHistoryPageReqVO pageReqVO) {
|
||||||
PageResult<OutsContractHistoryDO> pageResult = outsContractHistoryService.getOutsContractHistoryPage(pageReqVO);
|
PageResult<OutsContractHistoryRespVO> pageResult = outsContractHistoryService.getOutsContractHistoryPage(pageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, OutsContractHistoryRespVO.class));
|
return success(pageResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@ -84,7 +67,7 @@ public class OutsContractHistoryController {
|
|||||||
public void exportOutsContractHistoryExcel(@Valid OutsContractHistoryPageReqVO pageReqVO,
|
public void exportOutsContractHistoryExcel(@Valid OutsContractHistoryPageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<OutsContractHistoryDO> list = outsContractHistoryService.getOutsContractHistoryPage(pageReqVO).getList();
|
List<OutsContractHistoryRespVO> list = outsContractHistoryService.getOutsContractHistoryPage(pageReqVO).getList();
|
||||||
// 导出 Excel
|
// 导出 Excel
|
||||||
ExcelUtils.write(response, "外包合同历史.xls", "数据", OutsContractHistoryRespVO.class,
|
ExcelUtils.write(response, "外包合同历史.xls", "数据", OutsContractHistoryRespVO.class,
|
||||||
BeanUtils.toBean(list, OutsContractHistoryRespVO.class));
|
BeanUtils.toBean(list, OutsContractHistoryRespVO.class));
|
||||||
|
@ -30,32 +30,9 @@ public class OutsContractHistoryPageReqVO extends PageParam {
|
|||||||
@Schema(description = "类型", example = "1")
|
@Schema(description = "类型", example = "1")
|
||||||
private String countType;
|
private String countType;
|
||||||
|
|
||||||
@Schema(description = "合同金额")
|
|
||||||
private BigDecimal amount;
|
|
||||||
|
|
||||||
@Schema(description = "编号")
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
@Schema(description = "专业")
|
@Schema(description = "专业")
|
||||||
private String major;
|
private String major;
|
||||||
|
|
||||||
@Schema(description = "流程实体id", example = "32397")
|
|
||||||
private String processInstanceId;
|
|
||||||
|
|
||||||
@Schema(description = "签订时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] signingTime;
|
|
||||||
|
|
||||||
@Schema(description = "结算数")
|
|
||||||
private BigDecimal settlementAmount;
|
|
||||||
|
|
||||||
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
|
||||||
private String contractFileUrl;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
@Schema(description = "流程状态", example = "2")
|
@Schema(description = "流程状态", example = "2")
|
||||||
private String processStatus;
|
private String processStatus;
|
||||||
|
|
||||||
|
@ -15,18 +15,23 @@ import java.time.LocalDateTime;
|
|||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class OutsContractHistoryRespVO {
|
public class OutsContractHistoryRespVO {
|
||||||
|
|
||||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16040")
|
@Schema(description = "合同名称", example = "张三")
|
||||||
@ExcelProperty("主键")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31803")
|
|
||||||
@ExcelProperty("项目id")
|
|
||||||
private Long projectId;
|
|
||||||
|
|
||||||
@Schema(description = "合同名称", example = "芋艿")
|
|
||||||
@ExcelProperty("合同名称")
|
@ExcelProperty("合同名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@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 BigDecimal outsAmount;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "主合同id", example = "19949")
|
@Schema(description = "主合同id", example = "19949")
|
||||||
@ExcelProperty("主合同id")
|
@ExcelProperty("主合同id")
|
||||||
private Long contractId;
|
private Long contractId;
|
||||||
@ -65,10 +70,6 @@ public class OutsContractHistoryRespVO {
|
|||||||
@ExcelProperty("合同文件url")
|
@ExcelProperty("合同文件url")
|
||||||
private String contractFileUrl;
|
private String contractFileUrl;
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@ExcelProperty("创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
@Schema(description = "流程状态", example = "2")
|
@Schema(description = "流程状态", example = "2")
|
||||||
@ExcelProperty("流程状态")
|
@ExcelProperty("流程状态")
|
||||||
private String processStatus;
|
private String processStatus;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo;
|
package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -18,9 +19,25 @@ public class OutsContractHistorySaveReqVO {
|
|||||||
@NotNull(message = "项目id不能为空")
|
@NotNull(message = "项目id不能为空")
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
|
||||||
@Schema(description = "合同名称", example = "芋艿")
|
|
||||||
|
@Schema(description = "合同名称", example = "张三")
|
||||||
|
@ExcelProperty("合同名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@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 BigDecimal outsAmount;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "主合同id", example = "19949")
|
@Schema(description = "主合同id", example = "19949")
|
||||||
private Long contractId;
|
private Long contractId;
|
||||||
|
|
||||||
|
@ -148,5 +148,4 @@ public class ContractHistoryDO extends BaseDO {
|
|||||||
* 版本
|
* 版本
|
||||||
*/
|
*/
|
||||||
private String version;
|
private String version;
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,166 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory;
|
||||||
|
|
||||||
|
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_history")
|
||||||
|
@KeySequence("cms_ext_contract_history_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ExtContractHistoryDO 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;
|
||||||
|
/**
|
||||||
|
* 计费方式
|
||||||
|
*
|
||||||
|
* 枚举 {@link //TODO contract_billing_type 对应的类}
|
||||||
|
*/
|
||||||
|
private String countType;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 合同附件url
|
||||||
|
*/
|
||||||
|
private String contractFileUrl;
|
||||||
|
/**
|
||||||
|
* 建安费
|
||||||
|
*/
|
||||||
|
private BigDecimal constructionCost;
|
||||||
|
/**
|
||||||
|
* 资金来源
|
||||||
|
*
|
||||||
|
* 枚举 {@link //TODO funds_source 对应的类}
|
||||||
|
*/
|
||||||
|
private String source;
|
||||||
|
/**
|
||||||
|
* 收费标准
|
||||||
|
*/
|
||||||
|
private String chargingStandard;
|
||||||
|
/**
|
||||||
|
* 优惠
|
||||||
|
*/
|
||||||
|
private String discount;
|
||||||
|
/**
|
||||||
|
* 是否联合体
|
||||||
|
*/
|
||||||
|
private Boolean consortium;
|
||||||
|
/**
|
||||||
|
* 联合体单位
|
||||||
|
*/
|
||||||
|
private String consortiumCompany;
|
||||||
|
/**
|
||||||
|
* 合同提示时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime reminderTime;
|
||||||
|
/**
|
||||||
|
* 审定金额
|
||||||
|
*/
|
||||||
|
private BigDecimal approvedAmount;
|
||||||
|
/**
|
||||||
|
* 审核文件url
|
||||||
|
*/
|
||||||
|
private String reviewFileUrl;
|
||||||
|
/**
|
||||||
|
* 流程实体id
|
||||||
|
*/
|
||||||
|
private String processInstanceId;
|
||||||
|
/**
|
||||||
|
* 流程状态
|
||||||
|
*
|
||||||
|
* 枚举 {@link //TODO bpm_process_instance_status 对应的类}
|
||||||
|
*/
|
||||||
|
private String processStatus;
|
||||||
|
/**
|
||||||
|
* 合同id
|
||||||
|
*/
|
||||||
|
private Long contractId;
|
||||||
|
/**
|
||||||
|
* 外部合同id
|
||||||
|
*/
|
||||||
|
private Long extContractId;
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
}
|
@ -19,29 +19,10 @@ public interface ContractMapper extends BaseMapperX<ContractDO> {
|
|||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ContractDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ContractDO>()
|
||||||
.likeIfPresent(ContractDO::getName, reqVO.getName())
|
.likeIfPresent(ContractDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(ContractDO::getType, reqVO.getType())
|
.eqIfPresent(ContractDO::getType, reqVO.getType())
|
||||||
|
.eqIfPresent(ContractDO::getProjectId, reqVO.getProjectId())
|
||||||
.eqIfPresent(ContractDO::getProgress, reqVO.getProgress())
|
.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::getStatus, reqVO.getStatus())
|
||||||
.eqIfPresent(ContractDO::getCountType, reqVO.getCountType())
|
.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())
|
|
||||||
.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())
|
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,39 +19,13 @@ public interface ContractHistoryMapper extends BaseMapperX<ContractHistoryDO> {
|
|||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ContractHistoryDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ContractHistoryDO>()
|
||||||
.eqIfPresent(ContractHistoryDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
.eqIfPresent(ContractHistoryDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
||||||
.likeIfPresent(ContractHistoryDO::getName, reqVO.getName())
|
.likeIfPresent(ContractHistoryDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(ContractHistoryDO::getProjectId,reqVO.getProjectId())
|
||||||
.eqIfPresent(ContractHistoryDO::getType, reqVO.getType())
|
.eqIfPresent(ContractHistoryDO::getType, reqVO.getType())
|
||||||
.eqIfPresent(ContractHistoryDO::getProgress, reqVO.getProgress())
|
.eqIfPresent(ContractHistoryDO::getProgress, reqVO.getProgress())
|
||||||
.betweenIfPresent(ContractHistoryDO::getExpectedTime, reqVO.getExpectedTime())
|
|
||||||
.betweenIfPresent(ContractHistoryDO::getPrintingTime, reqVO.getPrintingTime())
|
|
||||||
.betweenIfPresent(ContractHistoryDO::getSigningTime, reqVO.getSigningTime())
|
|
||||||
.betweenIfPresent(ContractHistoryDO::getArchiveTime, reqVO.getArchiveTime())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getStatus, reqVO.getStatus())
|
.eqIfPresent(ContractHistoryDO::getStatus, reqVO.getStatus())
|
||||||
.eqIfPresent(ContractHistoryDO::getCountType, reqVO.getCountType())
|
.eqIfPresent(ContractHistoryDO::getCountType, reqVO.getCountType())
|
||||||
.eqIfPresent(ContractHistoryDO::getRemark, reqVO.getRemark())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getContractFileUrl, reqVO.getContractFileUrl())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getConstructionCost, reqVO.getConstructionCost())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getSource, reqVO.getSource())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getDiscount, reqVO.getDiscount())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getConsortium, reqVO.getConsortium())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getConsortiumCompany, reqVO.getConsortiumCompany())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getExtProportion, reqVO.getExtProportion())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getApprovedAmount, reqVO.getApprovedAmount())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getReviewFileUrl, reqVO.getReviewFileUrl())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getCreator, reqVO.getCreator())
|
|
||||||
.betweenIfPresent(ContractHistoryDO::getCreateTime, reqVO.getCreateTime())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getUpdater, reqVO.getUpdater())
|
|
||||||
.betweenIfPresent(ContractHistoryDO::getUpdateTime, reqVO.getUpdateTime())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getDeleted, reqVO.getDeleted())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getAmount, reqVO.getAmount())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getPreAmount, reqVO.getPreAmount())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getDesignAmount, reqVO.getDesignAmount())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getSurveyFees, reqVO.getSurveyFees())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getMeasurementFee, reqVO.getMeasurementFee())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getOtherFee, reqVO.getOtherFee())
|
|
||||||
.eqIfPresent(ContractHistoryDO::getProcessStatus, reqVO.getProcessStatus())
|
.eqIfPresent(ContractHistoryDO::getProcessStatus, reqVO.getProcessStatus())
|
||||||
.eqIfPresent(ContractHistoryDO::getContractId, reqVO.getContractId())
|
.eqIfPresent(ContractHistoryDO::getContractId, reqVO.getContractId()));
|
||||||
.eqIfPresent(ContractHistoryDO::getVersion, reqVO.getVersion())
|
|
||||||
.orderByDesc(ContractHistoryDO::getId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -21,30 +21,8 @@ public interface ExtContractMapper extends BaseMapperX<ExtContractDO> {
|
|||||||
.eqIfPresent(ExtContractDO::getType, reqVO.getType())
|
.eqIfPresent(ExtContractDO::getType, reqVO.getType())
|
||||||
.eqIfPresent(ExtContractDO::getCustomerCompanyId, reqVO.getCustomerCompanyId())
|
.eqIfPresent(ExtContractDO::getCustomerCompanyId, reqVO.getCustomerCompanyId())
|
||||||
.eqIfPresent(ExtContractDO::getProgress, reqVO.getProgress())
|
.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::getStatus, reqVO.getStatus())
|
||||||
.eqIfPresent(ExtContractDO::getAmount, reqVO.getAmount())
|
.eqIfPresent(ExtContractDO::getContractId, reqVO.getContractId()));
|
||||||
.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())
|
|
||||||
.eqIfPresent(ExtContractDO::getContractId, reqVO.getContractId())
|
|
||||||
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.dal.mysql.extcontracthistory;
|
||||||
|
|
||||||
|
|
||||||
|
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.extcontracthistory.ExtContractHistoryDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部合同 Mapper
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ExtContractHistoryMapper extends BaseMapperX<ExtContractHistoryDO> {
|
||||||
|
|
||||||
|
default PageResult<ExtContractHistoryDO> selectPage(ExtContractHistoryPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ExtContractHistoryDO>()
|
||||||
|
.eqIfPresent(ExtContractHistoryDO::getProjectId, reqVO.getProjectId())
|
||||||
|
.likeIfPresent(ExtContractHistoryDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(ExtContractHistoryDO::getType, reqVO.getType())
|
||||||
|
.eqIfPresent(ExtContractHistoryDO::getCustomerCompanyId, reqVO.getCustomerCompanyId())
|
||||||
|
.eqIfPresent(ExtContractHistoryDO::getStatus, reqVO.getStatus())
|
||||||
|
.eqIfPresent(ExtContractHistoryDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
||||||
|
.eqIfPresent(ExtContractHistoryDO::getProcessStatus, reqVO.getProcessStatus())
|
||||||
|
.eqIfPresent(ExtContractHistoryDO::getContractId, reqVO.getContractId())
|
||||||
|
.eqIfPresent(ExtContractHistoryDO::getExtContractId, reqVO.getExtContractId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -21,18 +21,10 @@ public interface OutsContractHistoryMapper extends BaseMapperX<OutsContractHisto
|
|||||||
.likeIfPresent(OutsContractHistoryDO::getName, reqVO.getName())
|
.likeIfPresent(OutsContractHistoryDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(OutsContractHistoryDO::getContractId, reqVO.getContractId())
|
.eqIfPresent(OutsContractHistoryDO::getContractId, reqVO.getContractId())
|
||||||
.eqIfPresent(OutsContractHistoryDO::getCountType, reqVO.getCountType())
|
.eqIfPresent(OutsContractHistoryDO::getCountType, reqVO.getCountType())
|
||||||
.eqIfPresent(OutsContractHistoryDO::getAmount, reqVO.getAmount())
|
|
||||||
.eqIfPresent(OutsContractHistoryDO::getCode, reqVO.getCode())
|
|
||||||
.eqIfPresent(OutsContractHistoryDO::getMajor, reqVO.getMajor())
|
.eqIfPresent(OutsContractHistoryDO::getMajor, reqVO.getMajor())
|
||||||
.eqIfPresent(OutsContractHistoryDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
|
||||||
.betweenIfPresent(OutsContractHistoryDO::getSigningTime, reqVO.getSigningTime())
|
|
||||||
.eqIfPresent(OutsContractHistoryDO::getSettlementAmount, reqVO.getSettlementAmount())
|
|
||||||
.eqIfPresent(OutsContractHistoryDO::getContractFileUrl, reqVO.getContractFileUrl())
|
|
||||||
.betweenIfPresent(OutsContractHistoryDO::getCreateTime, reqVO.getCreateTime())
|
|
||||||
.eqIfPresent(OutsContractHistoryDO::getProcessStatus, reqVO.getProcessStatus())
|
.eqIfPresent(OutsContractHistoryDO::getProcessStatus, reqVO.getProcessStatus())
|
||||||
.eqIfPresent(OutsContractHistoryDO::getOutsContractId, reqVO.getOutsContractId())
|
.eqIfPresent(OutsContractHistoryDO::getOutsContractId, reqVO.getOutsContractId())
|
||||||
.eqIfPresent(OutsContractHistoryDO::getVersion, reqVO.getVersion())
|
.eqIfPresent(OutsContractHistoryDO::getVersion, reqVO.getVersion()));
|
||||||
.orderByDesc(OutsContractHistoryDO::getId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -53,11 +53,18 @@ public interface ContractService {
|
|||||||
PageResult<ContractRespVO> getContractPage(ContractPageReqVO pageReqVO);
|
PageResult<ContractRespVO> getContractPage(ContractPageReqVO pageReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得暂定结算金额
|
* 通过id获得暂定结算金额
|
||||||
* @param id 合同编号
|
* @param id 合同编号
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
BigDecimal getProvisionalSettlement(Long id);
|
BigDecimal getProvisionalSettlementById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过输入的合同获得暂定结算金额
|
||||||
|
* @param contractSaveReqVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
BigDecimal getProvisionalSettlement(ContractSaveReqVO contractSaveReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断合同是否存在
|
* 判断合同是否存在
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
package cn.iocoder.yudao.module.cms.service.contract;
|
package cn.iocoder.yudao.module.cms.service.contract;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extContract.ExtContractDO;
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.contractHistory.ContractHistoryDO;
|
||||||
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
|
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.cms.dal.mysql.contractHistory.ContractHistoryMapper;
|
||||||
import cn.iocoder.yudao.module.pms.api.project.ProjectApi;
|
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.ProjectDetailRespDTO;
|
||||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -19,9 +19,9 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||||
@ -36,7 +36,16 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.USER_NOT_E
|
|||||||
@Validated
|
@Validated
|
||||||
public class ContractServiceImpl implements ContractService {
|
public class ContractServiceImpl implements ContractService {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(ContractServiceImpl.class);
|
/**
|
||||||
|
* 合同立项审批流程定义
|
||||||
|
*/
|
||||||
|
public static final String PROCESS_KEY = "contract_init";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
public static String VERSION = "1";
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ContractMapper contractMapper;
|
private ContractMapper contractMapper;
|
||||||
|
|
||||||
@ -46,42 +55,124 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
@Resource
|
@Resource
|
||||||
private AdminUserApi adminUserApi;
|
private AdminUserApi adminUserApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmProcessInstanceApi processInstanceApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ContractHistoryMapper contractHistoryMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createContract(Long loginUserId,ContractSaveReqVO createReqVO) {
|
public Long createContract(Long loginUserId, ContractSaveReqVO createReqVO) {
|
||||||
if (createReqVO == null){
|
|
||||||
throw exception(PARAM_NOT_EXISTS);
|
if (loginUserId == null) {
|
||||||
}
|
|
||||||
if (loginUserId == null){
|
|
||||||
throw exception(PARAM_NOT_EXISTS);
|
throw exception(PARAM_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||||
if (userName == null){
|
if (userName == null) {
|
||||||
throw exception(USER_NOT_EXISTS);
|
throw exception(USER_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
ContractDO contract = BeanUtils.toBean(createReqVO, ContractDO.class);
|
|
||||||
//校验,项目是否存在
|
|
||||||
projectApi.validProjectExist(contract.getProjectId());
|
|
||||||
|
|
||||||
|
//校验,项目是否存在
|
||||||
|
Long projectId = createReqVO.getProjectId();
|
||||||
|
projectApi.validProjectExist(projectId);
|
||||||
|
|
||||||
|
//校验联表的字段是否和所联系的表内容相同
|
||||||
|
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||||
|
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||||
|
|
||||||
|
|
||||||
|
//todo 待提取
|
||||||
|
String code = createReqVO.getCode();
|
||||||
|
String trackingDep = createReqVO.getTrackingDep();
|
||||||
|
String projectManager = createReqVO.getProjectManager();
|
||||||
|
String drawingCompany = createReqVO.getDrawingCompany();
|
||||||
|
BigDecimal expectedContractAmount = createReqVO.getExpectedContractAmount();
|
||||||
|
BigDecimal provisionalSettlement = createReqVO.getProvisionalSettlement();
|
||||||
|
|
||||||
|
//LocalDateTime reminderTime = createReqVO.getReminderTime();
|
||||||
|
|
||||||
|
if (!project.getCode().equals(code)) {
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
if (!projectDetail.getTrackingDepName().equals(trackingDep)) {
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
if (!projectDetail.getProjectManagerName().equals(projectManager)) {
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
if (!project.getDrawingCompany().equals(drawingCompany)) {
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
if (!Objects.equals(project.getContractAmount(), expectedContractAmount)) {
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
if (!Objects.equals(provisionalSettlement, getProvisionalSettlement(createReqVO))) {
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ContractDO contract = BeanUtils.toBean(createReqVO, ContractDO.class);
|
||||||
|
ContractRespVO contractResp = BeanUtils.toBean(contract, ContractRespVO.class);
|
||||||
contract.setCreator(userName);
|
contract.setCreator(userName);
|
||||||
contract.setUpdater(userName);
|
contract.setUpdater(userName);
|
||||||
|
|
||||||
|
|
||||||
|
//判断该合同是否已经存在,比较各个字段值是否完全一样
|
||||||
|
//得到所有的合同?逐个比较?
|
||||||
|
|
||||||
|
|
||||||
|
List<ContractDO> contractList = contractMapper.selectList("project_id", projectId);
|
||||||
|
List<ContractRespVO> respVOList = BeanUtils.toBean(contractList, ContractRespVO.class);
|
||||||
|
|
||||||
|
for (ContractRespVO respVO : respVOList) {
|
||||||
|
if (respVO.equals(contractResp)) {
|
||||||
|
throw exception(CONTRACT_ALREADY_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
contractMapper.insert(contract);
|
contractMapper.insert(contract);
|
||||||
|
|
||||||
|
|
||||||
|
Long contractId = contract.getId();
|
||||||
|
ContractHistoryDO contractHistory = BeanUtils.toBean(contract, ContractHistoryDO.class);
|
||||||
|
|
||||||
|
|
||||||
|
// 启动流程,同时写入历史合同
|
||||||
|
if (createReqVO.getId() == null) {
|
||||||
|
String processInstanceId = processInstanceApi.createProcessInstance(loginUserId,
|
||||||
|
new BpmProcessInstanceCreateReqDTO()
|
||||||
|
.setProcessDefinitionKey(PROCESS_KEY).setBusinessKey(String.valueOf(contractId)));
|
||||||
|
|
||||||
|
// 写入工作流编号
|
||||||
|
contractHistory.setProcessInstanceId(processInstanceId);
|
||||||
|
contractHistory.setContractId(contractId);
|
||||||
|
|
||||||
|
Long count = contractHistoryMapper.selectCount("project_id", projectId);
|
||||||
|
if (count < 1) {
|
||||||
|
contractHistory.setVersion(VERSION);
|
||||||
|
} else {
|
||||||
|
contractHistory.setVersion(String.valueOf(count + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
contractHistory.setProcessStatus("0");
|
||||||
|
contractHistoryMapper.insert(contractHistory);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//返回
|
//返回
|
||||||
return contract.getId();
|
return contract.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateContract(Long loginUserId,ContractSaveReqVO updateReqVO) {
|
public void updateContract(Long loginUserId, ContractSaveReqVO updateReqVO) {
|
||||||
//校验
|
//校验
|
||||||
validateContractExists(updateReqVO.getId());
|
validateContractExists(updateReqVO.getId());
|
||||||
projectApi.validProjectExist(updateReqVO.getProjectId());
|
projectApi.validProjectExist(updateReqVO.getProjectId());
|
||||||
// 更新
|
// 更新
|
||||||
ContractDO updateObj = BeanUtils.toBean(updateReqVO, ContractDO.class);
|
ContractDO updateObj = BeanUtils.toBean(updateReqVO, ContractDO.class);
|
||||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||||
if (userName == null){
|
if (userName == null) {
|
||||||
throw exception(USER_NOT_EXISTS);
|
throw exception(USER_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
updateObj.setUpdater(userName);
|
updateObj.setUpdater(userName);
|
||||||
@ -129,7 +220,6 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
contractRespVO.setCode(project.getCode());
|
contractRespVO.setCode(project.getCode());
|
||||||
contractRespVO.setDrawingCompany(project.getDrawingCompany());
|
contractRespVO.setDrawingCompany(project.getDrawingCompany());
|
||||||
contractRespVO.setExpectedContractAmount(project.getContractAmount());
|
contractRespVO.setExpectedContractAmount(project.getContractAmount());
|
||||||
|
|
||||||
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||||
contractRespVO.setTrackingDep(projectDetail.getTrackingDepName());
|
contractRespVO.setTrackingDep(projectDetail.getTrackingDepName());
|
||||||
contractRespVO.setProjectManager(projectDetail.getProjectManagerName());
|
contractRespVO.setProjectManager(projectDetail.getProjectManagerName());
|
||||||
@ -137,10 +227,10 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
//分包合同商议提示 TODO 待优化
|
//分包合同商议提示 TODO 待优化
|
||||||
// ExtContractDO extContractDO = extContractMapper.selectOne("project_id", projectId);
|
// ExtContractDO extContractDO = extContractMapper.selectOne("project_id", projectId);
|
||||||
// LocalDateTime reminderTime = extContractDO.getReminderTime();
|
// LocalDateTime reminderTime = extContractDO.getReminderTime();
|
||||||
contractRespVO.setReminderTime(LocalDateTime.now());
|
contractRespVO.setReminderTime(null);
|
||||||
|
|
||||||
//暂定结算数
|
//暂定结算数
|
||||||
BigDecimal provisionalSettlement = getProvisionalSettlement(id);
|
BigDecimal provisionalSettlement = getProvisionalSettlementById(id);
|
||||||
contractRespVO.setProvisionalSettlement(provisionalSettlement);
|
contractRespVO.setProvisionalSettlement(provisionalSettlement);
|
||||||
|
|
||||||
|
|
||||||
@ -150,7 +240,7 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
@Override
|
@Override
|
||||||
public PageResult<ContractRespVO> getContractPage(ContractPageReqVO pageReqVO) {
|
public PageResult<ContractRespVO> getContractPage(ContractPageReqVO pageReqVO) {
|
||||||
//校验
|
//校验
|
||||||
if (pageReqVO == null){
|
if (pageReqVO == null) {
|
||||||
throw exception(PARAM_NOT_EXISTS);
|
throw exception(PARAM_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,7 +266,7 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BigDecimal getProvisionalSettlement(Long id) {
|
public BigDecimal getProvisionalSettlementById(Long id) {
|
||||||
ContractDO contractDO = contractMapper.selectById(id);
|
ContractDO contractDO = contractMapper.selectById(id);
|
||||||
String type = contractDO.getCountType();
|
String type = contractDO.getCountType();
|
||||||
BigDecimal amount = contractDO.getAmount();
|
BigDecimal amount = contractDO.getAmount();
|
||||||
@ -191,6 +281,21 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BigDecimal getProvisionalSettlement(ContractSaveReqVO contractSaveReqVO) {
|
||||||
|
String type = contractSaveReqVO.getCountType();
|
||||||
|
BigDecimal amount = contractSaveReqVO.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void validateContractExists(Long id) {
|
public void validateContractExists(Long id) {
|
||||||
@ -200,5 +305,4 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -12,27 +12,12 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|||||||
*/
|
*/
|
||||||
public interface ContractHistoryService {
|
public interface ContractHistoryService {
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建历史合同
|
|
||||||
*
|
|
||||||
* @param createReqVO 创建信息
|
|
||||||
* @return 编号
|
|
||||||
*/
|
|
||||||
Long createContractHistory(@Valid ContractHistorySaveReqVO createReqVO);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新历史合同
|
* 更新历史合同
|
||||||
*
|
*
|
||||||
* @param updateReqVO 更新信息
|
* @param updateReqVO 更新信息
|
||||||
*/
|
*/
|
||||||
void updateContractHistory(@Valid ContractHistorySaveReqVO updateReqVO);
|
void updateContractHistory(Long loginUserId,@Valid ContractHistorySaveReqVO updateReqVO);
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除历史合同
|
|
||||||
*
|
|
||||||
* @param id 编号
|
|
||||||
*/
|
|
||||||
void deleteContractHistory(Long id);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得历史合同
|
* 获得历史合同
|
||||||
@ -40,7 +25,7 @@ public interface ContractHistoryService {
|
|||||||
* @param contractId 现有合同编号
|
* @param contractId 现有合同编号
|
||||||
* @return 历史合同
|
* @return 历史合同
|
||||||
*/
|
*/
|
||||||
ContractHistoryDO getContractHistory(Long contractId);
|
ContractHistoryRespVO getContractHistory(Long contractId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得历史合同分页
|
* 获得历史合同分页
|
||||||
@ -48,6 +33,6 @@ public interface ContractHistoryService {
|
|||||||
* @param pageReqVO 分页查询
|
* @param pageReqVO 分页查询
|
||||||
* @return 历史合同分页
|
* @return 历史合同分页
|
||||||
*/
|
*/
|
||||||
PageResult<ContractHistoryDO> getContractHistoryPage(ContractHistoryPageReqVO pageReqVO);
|
PageResult<ContractHistoryRespVO> getContractHistoryPage(ContractHistoryPageReqVO pageReqVO);
|
||||||
|
|
||||||
}
|
}
|
@ -1,19 +1,27 @@
|
|||||||
package cn.iocoder.yudao.module.cms.service.contractHistory;
|
package cn.iocoder.yudao.module.cms.service.contractHistory;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractRespVO;
|
||||||
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
|
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.service.contract.ContractService;
|
||||||
|
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.system.api.user.AdminUserApi;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo.*;
|
import cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo.*;
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractHistory.ContractHistoryDO;
|
import cn.iocoder.yudao.module.cms.dal.dataobject.contractHistory.ContractHistoryDO;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.cms.dal.mysql.contractHistory.ContractHistoryMapper;
|
import cn.iocoder.yudao.module.cms.dal.mysql.contractHistory.ContractHistoryMapper;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||||
|
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.USER_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 历史合同 Service 实现类
|
* 历史合同 Service 实现类
|
||||||
@ -27,47 +35,124 @@ public class ContractHistoryServiceImpl implements cn.iocoder.yudao.module.cms.s
|
|||||||
@Resource
|
@Resource
|
||||||
private ContractHistoryMapper contractHistoryMapper;
|
private ContractHistoryMapper contractHistoryMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AdminUserApi adminUserApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectApi projectApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ContractService contractService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createContractHistory(ContractHistorySaveReqVO createReqVO) {
|
public void updateContractHistory(Long loginUserId,ContractHistorySaveReqVO updateReqVO) {
|
||||||
// 插入
|
//校验
|
||||||
ContractHistoryDO contractHistory = BeanUtils.toBean(createReqVO, ContractHistoryDO.class);
|
Long id = updateReqVO.getId();
|
||||||
contractHistoryMapper.insert(contractHistory);
|
validateContractHistoryExists(id);
|
||||||
// 返回
|
if (loginUserId == null){
|
||||||
return contractHistory.getId();
|
throw exception(USER_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
Long projectId = updateReqVO.getProjectId();
|
||||||
@Override
|
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||||
public void updateContractHistory(ContractHistorySaveReqVO updateReqVO) {
|
if (project == null){
|
||||||
|
throw exception(PROJECT_NOT_EXISTS);
|
||||||
|
}
|
||||||
// 更新
|
// 更新
|
||||||
ContractHistoryDO updateObj = BeanUtils.toBean(updateReqVO, ContractHistoryDO.class);
|
ContractHistoryDO updateObj = BeanUtils.toBean(updateReqVO, ContractHistoryDO.class);
|
||||||
|
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||||
|
updateObj.setUpdater(userName);
|
||||||
contractHistoryMapper.updateById(updateObj);
|
contractHistoryMapper.updateById(updateObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteContractHistory(Long id) {
|
public ContractHistoryRespVO getContractHistory(Long id) {
|
||||||
// 校验存在
|
//校验
|
||||||
validateContractHistoryExists(id);
|
if (id == null) {
|
||||||
// 删除
|
throw exception(CONTRACT_NOT_EXISTS);
|
||||||
contractHistoryMapper.deleteById(id);
|
}
|
||||||
|
|
||||||
|
ContractHistoryDO contractHistoryDO = contractHistoryMapper.selectById(id);
|
||||||
|
if (contractHistoryDO == null) {
|
||||||
|
throw exception(CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
Long projectId = contractHistoryDO.getProjectId();
|
||||||
|
|
||||||
|
if (projectId == null) {
|
||||||
|
throw exception(PROJECT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
ContractHistoryRespVO contractHistoryRespVO = BeanUtils.toBean(contractHistoryDO, ContractHistoryRespVO.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);
|
||||||
|
contractHistoryRespVO.setCode(project.getCode());
|
||||||
|
contractHistoryRespVO.setDrawingCompany(project.getDrawingCompany());
|
||||||
|
contractHistoryRespVO.setExpectedContractAmount(project.getContractAmount());
|
||||||
|
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||||
|
contractHistoryRespVO.setTrackingDep(projectDetail.getTrackingDepName());
|
||||||
|
contractHistoryRespVO.setProjectManager(projectDetail.getProjectManagerName());
|
||||||
|
|
||||||
|
//分包合同商议提示 TODO 待优化
|
||||||
|
// ExtContractDO extContractDO = extContractMapper.selectOne("project_id", projectId);
|
||||||
|
// LocalDateTime reminderTime = extContractDO.getReminderTime();
|
||||||
|
contractHistoryRespVO.setReminderTime(null);
|
||||||
|
|
||||||
|
//暂定结算数
|
||||||
|
BigDecimal provisionalSettlement =contractService.getProvisionalSettlementById(id);
|
||||||
|
contractHistoryRespVO.setProvisionalSettlement(provisionalSettlement);
|
||||||
|
|
||||||
|
|
||||||
|
return contractHistoryRespVO;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ContractHistoryRespVO> getContractHistoryPage(ContractHistoryPageReqVO pageReqVO) {
|
||||||
|
//校验
|
||||||
|
if (pageReqVO == null) {
|
||||||
|
throw exception(PARAM_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
Long projectId = pageReqVO.getProjectId();
|
||||||
|
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||||
|
if (project == null) {
|
||||||
|
throw exception(PROJECT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
PageResult<ContractHistoryDO> contractHistoryDOPageResult = contractHistoryMapper.selectPage(pageReqVO);
|
||||||
|
List<ContractHistoryDO> pageResultList = contractHistoryDOPageResult.getList();
|
||||||
|
List<ContractHistoryRespVO> contractHistoryRespVOS = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
for (ContractHistoryDO contractHistoryDO : pageResultList) {
|
||||||
|
Long id = contractHistoryDO.getId();
|
||||||
|
ContractHistoryRespVO contractHistory = getContractHistory(id);
|
||||||
|
contractHistoryRespVOS.add(contractHistory);
|
||||||
|
}
|
||||||
|
|
||||||
|
PageResult<ContractHistoryRespVO> pageResult = new PageResult<>();
|
||||||
|
pageResult.setList(contractHistoryRespVOS);
|
||||||
|
return pageResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void validateContractHistoryExists(Long id) {
|
private void validateContractHistoryExists(Long id) {
|
||||||
if (contractHistoryMapper.selectById(id) == null) {
|
if (contractHistoryMapper.selectById(id) == null) {
|
||||||
throw exception(CONTRACT_HISTORY_NOT_EXISTS);
|
throw exception(CONTRACT_HISTORY_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ContractHistoryDO getContractHistory(Long id) {
|
|
||||||
return contractHistoryMapper.selectById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<ContractHistoryDO> getContractHistoryPage(ContractHistoryPageReqVO pageReqVO) {
|
|
||||||
return contractHistoryMapper.selectPage(pageReqVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -56,8 +56,14 @@ public interface ExtContractService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 合同总金额
|
* 合同总金额
|
||||||
* @param id
|
* @param id 通过id计算
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
BigDecimal getContractAmount(Long id);
|
BigDecimal getContractAmountById(Long id);
|
||||||
|
/**
|
||||||
|
* 合同总金额
|
||||||
|
* @param createReqVO 通过对象计算
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
BigDecimal getContractAmount(ExtContractSaveReqVO createReqVO);
|
||||||
}
|
}
|
@ -1,13 +1,17 @@
|
|||||||
package cn.iocoder.yudao.module.cms.service.extContract;
|
package cn.iocoder.yudao.module.cms.service.extContract;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractSaveReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extContract.ExtContractDO;
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extContract.ExtContractDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory.ExtContractHistoryDO;
|
||||||
import cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper;
|
import cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper;
|
||||||
import cn.iocoder.yudao.module.cms.dal.mysql.extContract.ExtContractMapper;
|
import cn.iocoder.yudao.module.cms.dal.mysql.extcontract.ExtContractMapper;
|
||||||
import cn.iocoder.yudao.module.pms.api.project.ProjectApi;
|
import cn.iocoder.yudao.module.cms.dal.mysql.extcontracthistory.ExtContractHistoryMapper;
|
||||||
|
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.ProjectDetailRespDTO;
|
||||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||||
@ -18,9 +22,9 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||||
@ -35,6 +39,16 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.USER_NOT_E
|
|||||||
@Validated
|
@Validated
|
||||||
public class ExtContractServiceImpl implements ExtContractService {
|
public class ExtContractServiceImpl implements ExtContractService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部合同立项审批流程定义
|
||||||
|
*/
|
||||||
|
public static final String PROCESS_KEY = "ext_contract_init";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
public static String VERSION = "1";
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ExtContractMapper extContractMapper;
|
private ExtContractMapper extContractMapper;
|
||||||
|
|
||||||
@ -47,38 +61,137 @@ public class ExtContractServiceImpl implements ExtContractService {
|
|||||||
@Resource
|
@Resource
|
||||||
private AdminUserApi adminUserApi;
|
private AdminUserApi adminUserApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmProcessInstanceApi processInstanceApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ExtContractHistoryMapper extContractHistoryMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createExtContract(Long loginUserId,ExtContractSaveReqVO createReqVO) {
|
public Long createExtContract(Long loginUserId, ExtContractSaveReqVO createReqVO) {
|
||||||
if (createReqVO == null){
|
|
||||||
|
|
||||||
|
if (createReqVO == null) {
|
||||||
|
throw exception(PARAM_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
if (loginUserId == null) {
|
||||||
throw exception(PARAM_NOT_EXISTS);
|
throw exception(PARAM_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
ExtContractDO extContract = BeanUtils.toBean(createReqVO, ExtContractDO.class);
|
|
||||||
//校验
|
|
||||||
projectApi.validProjectExist(extContract.getProjectId());
|
|
||||||
|
|
||||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||||
if (userName == null){
|
if (userName == null) {
|
||||||
throw exception(USER_NOT_EXISTS);
|
throw exception(USER_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
extContract.setCreator(userName);
|
|
||||||
extContract.setUpdater(userName);
|
ExtContractDO extContract = BeanUtils.toBean(createReqVO, ExtContractDO.class);
|
||||||
extContractMapper.insert(extContract);
|
//校验
|
||||||
|
Long projectId = extContract.getProjectId();
|
||||||
|
projectApi.validProjectExist(projectId);
|
||||||
|
|
||||||
|
|
||||||
|
//校验联表的字段是否和所联系的表内容相同
|
||||||
|
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||||
|
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||||
|
|
||||||
|
// 需要联表查询
|
||||||
|
// 1.项目编号 pms_project 直接 √
|
||||||
|
// 2.主控部门(跟踪部门) pms_project找到的是id 需要联表 √
|
||||||
|
// 3.项目经理 pms_project找到的是id 需要联表 √
|
||||||
|
// 4.客户公司名称 pms_project 联表 √
|
||||||
|
// 5.合同总金额 √
|
||||||
|
// 6.合同商议提示(和分包提示不一样)√
|
||||||
|
|
||||||
|
//todo 待提取
|
||||||
|
String code = createReqVO.getCode();
|
||||||
|
String trackingDep = createReqVO.getTrackingDep();
|
||||||
|
String projectManager = createReqVO.getProjectManager();
|
||||||
|
String customerCompanyName = createReqVO.getCustomerCompanyName();
|
||||||
|
//LocalDateTime exReminderTime = createReqVO.getExReminderTime();
|
||||||
|
BigDecimal amount = createReqVO.getAmount();
|
||||||
|
|
||||||
|
|
||||||
|
if (!project.getCode().equals(code)){
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
if (!projectDetail.getTrackingDepName().equals(trackingDep)){
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
if (!projectDetail.getProjectManagerName().equals(projectManager)){
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
String name = customerCompanyMapper.selectById(createReqVO.getCustomerCompanyId()).getName();
|
||||||
|
if (!name.equals(customerCompanyName)){
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
if (!Objects.equals(amount, getContractAmount(createReqVO))){
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ExtContractDO extContractDO = BeanUtils.toBean(createReqVO, ExtContractDO.class);
|
||||||
|
ExtContractRespVO contractRespVO = BeanUtils.toBean(extContractDO, ExtContractRespVO.class);
|
||||||
|
extContractDO.setCreator(userName);
|
||||||
|
extContractDO.setUpdater(userName);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//判断该合同是否已经存在,比较各个字段值是否完全一样
|
||||||
|
//得到所有的合同?逐个比较?
|
||||||
|
|
||||||
|
|
||||||
|
List<ExtContractDO> extContractList = extContractMapper.selectList("project_id",projectId);
|
||||||
|
List<ExtContractRespVO> respVOList = BeanUtils.toBean(extContractList, ExtContractRespVO.class);
|
||||||
|
|
||||||
|
for (ExtContractRespVO respVO : respVOList) {
|
||||||
|
if (respVO.equals(contractRespVO)){
|
||||||
|
throw exception(CONTRACT_ALREADY_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
extContractMapper.insert(extContractDO);
|
||||||
|
|
||||||
|
|
||||||
|
Long extContractId = extContractDO.getId();
|
||||||
|
ExtContractHistoryDO extContractHistory = BeanUtils.toBean(extContractDO, ExtContractHistoryDO.class);
|
||||||
|
|
||||||
|
|
||||||
|
// 启动流程,同时写入历史合同
|
||||||
|
if (createReqVO.getId() == null) {
|
||||||
|
String processInstanceId = processInstanceApi.createProcessInstance(loginUserId,
|
||||||
|
new BpmProcessInstanceCreateReqDTO()
|
||||||
|
.setProcessDefinitionKey(PROCESS_KEY).setBusinessKey(String.valueOf(extContractId)));
|
||||||
|
|
||||||
|
// 写入工作流编号
|
||||||
|
extContractHistory.setProcessInstanceId(processInstanceId);
|
||||||
|
extContractHistory.setExtContractId(extContractId);
|
||||||
|
|
||||||
|
Long count = extContractHistoryMapper.selectCount("project_id", projectId);
|
||||||
|
if (count < 1) {
|
||||||
|
extContractHistory.setVersion(VERSION);
|
||||||
|
} else {
|
||||||
|
extContractHistory.setVersion(String.valueOf(count+1));
|
||||||
|
}
|
||||||
|
|
||||||
|
extContractHistory.setProcessStatus("0");
|
||||||
|
extContractHistoryMapper.insert(extContractHistory);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//返回
|
//返回
|
||||||
return extContract.getId();
|
return extContract.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateExtContract(Long loginUserId,ExtContractSaveReqVO updateReqVO) {
|
public void updateExtContract(Long loginUserId, ExtContractSaveReqVO updateReqVO) {
|
||||||
//校验
|
//校验
|
||||||
if (updateReqVO == null){
|
if (updateReqVO == null) {
|
||||||
throw exception(PARAM_NOT_EXISTS);
|
throw exception(PARAM_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
validateExtContractExists(updateReqVO.getId());
|
validateExtContractExists(updateReqVO.getId());
|
||||||
projectApi.validProjectExist(updateReqVO.getProjectId());
|
projectApi.validProjectExist(updateReqVO.getProjectId());
|
||||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||||
if (userName == null){
|
if (userName == null) {
|
||||||
throw exception(USER_NOT_EXISTS);
|
throw exception(USER_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
// 更新
|
// 更新
|
||||||
@ -139,18 +252,18 @@ public class ExtContractServiceImpl implements ExtContractService {
|
|||||||
|
|
||||||
//合同总金额
|
//合同总金额
|
||||||
|
|
||||||
BigDecimal contractAmount = getContractAmount(id);
|
BigDecimal contractAmount = getContractAmountById(id);
|
||||||
extContractRespVO.setAmount(contractAmount);
|
extContractRespVO.setAmount(contractAmount);
|
||||||
|
|
||||||
//合同商议提示 // TODO 待优化
|
//合同商议提示 // TODO 待优化
|
||||||
extContractRespVO.setExReminderTime(LocalDateTime.now());
|
extContractRespVO.setExReminderTime(null);
|
||||||
|
|
||||||
return extContractRespVO;
|
return extContractRespVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<ExtContractRespVO> getExtContractPage(ExtContractPageReqVO pageReqVO) {
|
public PageResult<ExtContractRespVO> getExtContractPage(ExtContractPageReqVO pageReqVO) {
|
||||||
if (pageReqVO == null){
|
if (pageReqVO == null) {
|
||||||
throw exception(PARAM_NOT_EXISTS);
|
throw exception(PARAM_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,7 +283,7 @@ public class ExtContractServiceImpl implements ExtContractService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BigDecimal getContractAmount(Long id) {
|
public BigDecimal getContractAmountById(Long id) {
|
||||||
//前期+设计+地勘+其他+检测
|
//前期+设计+地勘+其他+检测
|
||||||
ExtContractDO extContract = extContractMapper.selectById(id);
|
ExtContractDO extContract = extContractMapper.selectById(id);
|
||||||
BigDecimal preAmount = new BigDecimal(String.valueOf(extContract.getPreAmount()));
|
BigDecimal preAmount = new BigDecimal(String.valueOf(extContract.getPreAmount()));
|
||||||
@ -181,6 +294,17 @@ public class ExtContractServiceImpl implements ExtContractService {
|
|||||||
return preAmount.add(designFee).add(surveyFees).add(testingFee).add(other);
|
return preAmount.add(designFee).add(surveyFees).add(testingFee).add(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BigDecimal getContractAmount(ExtContractSaveReqVO extContractSaveReqVO) {
|
||||||
|
//前期+设计+地勘+其他+检测
|
||||||
|
BigDecimal preAmount = new BigDecimal(String.valueOf(extContractSaveReqVO.getPreAmount()));
|
||||||
|
BigDecimal designFee = new BigDecimal(String.valueOf(extContractSaveReqVO.getDesignFee()));
|
||||||
|
BigDecimal surveyFees = new BigDecimal(String.valueOf(extContractSaveReqVO.getSurveyFees()));
|
||||||
|
BigDecimal testingFee = new BigDecimal(String.valueOf(extContractSaveReqVO.getTestingFee()));
|
||||||
|
BigDecimal other = new BigDecimal(extContractSaveReqVO.getOtherFee());
|
||||||
|
return preAmount.add(designFee).add(surveyFees).add(testingFee).add(other);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void validateExtContractExists(Long id) {
|
private void validateExtContractExists(Long id) {
|
||||||
if (extContractMapper.selectById(id) == null) {
|
if (extContractMapper.selectById(id) == null) {
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.service.extcontracthistory;
|
||||||
|
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部合同历史历史 Service 接口
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
public interface ExtContractHistoryService {
|
||||||
|
/**
|
||||||
|
* 更新外部合同历史历史
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateExtContractHistory(Long loginUserId,@Valid ExtContractHistorySaveReqVO updateReqVO);
|
||||||
|
/**
|
||||||
|
* 获得外部合同历史历史
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 外部合同历史历史
|
||||||
|
*/
|
||||||
|
ExtContractHistoryRespVO getExtContractHistory(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得外部合同历史历史分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 外部合同历史历史分页
|
||||||
|
*/
|
||||||
|
PageResult<ExtContractHistoryRespVO> getExtContractHistoryPage(ExtContractHistoryPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,155 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.service.extcontracthistory;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper;
|
||||||
|
import cn.iocoder.yudao.module.cms.service.extContract.ExtContractService;
|
||||||
|
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.system.api.user.AdminUserApi;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.extcontracthistory.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.extcontracthistory.ExtContractHistoryDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.mysql.extcontracthistory.ExtContractHistoryMapper;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||||
|
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.USER_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部合同历史 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ExtContractHistoryServiceImpl implements ExtContractHistoryService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ExtContractHistoryMapper extContractHistoryMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectApi projectApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AdminUserApi adminUserApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CustomerCompanyMapper customerCompanyMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ExtContractService extContractService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateExtContractHistory(Long loginUserId,ExtContractHistorySaveReqVO updateReqVO) {
|
||||||
|
//校验
|
||||||
|
if (updateReqVO == null) {
|
||||||
|
throw exception(PARAM_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
validateExtContractHistoryExists(updateReqVO.getId());
|
||||||
|
projectApi.validProjectExist(updateReqVO.getProjectId());
|
||||||
|
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||||
|
if (userName == null) {
|
||||||
|
throw exception(USER_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
//校验customer_id contract_id extract_id
|
||||||
|
|
||||||
|
|
||||||
|
// 更新
|
||||||
|
ExtContractHistoryDO updateObj = BeanUtils.toBean(updateReqVO, ExtContractHistoryDO.class);
|
||||||
|
updateObj.setUpdater(userName);
|
||||||
|
extContractHistoryMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ExtContractHistoryRespVO getExtContractHistory(Long id) {
|
||||||
|
//校验
|
||||||
|
if (id == null) {
|
||||||
|
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
ExtContractHistoryDO extContractHistoryDO = extContractHistoryMapper.selectById(id);
|
||||||
|
if (extContractHistoryDO == null) {
|
||||||
|
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
Long projectId = extContractHistoryDO.getProjectId();
|
||||||
|
if (projectApi.getProject(projectId) == null) {
|
||||||
|
throw exception(PROJECT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
Long customerCompanyId = extContractHistoryDO.getCustomerCompanyId();
|
||||||
|
ExtContractHistoryRespVO HistoryResp = BeanUtils.toBean(extContractHistoryDO, ExtContractHistoryRespVO.class);
|
||||||
|
|
||||||
|
|
||||||
|
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||||
|
HistoryResp.setCode(project.getCode());
|
||||||
|
|
||||||
|
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||||
|
HistoryResp.setTrackingDep(projectDetail.getTrackingDepName());
|
||||||
|
HistoryResp.setProjectManager(projectDetail.getProjectManagerName());
|
||||||
|
|
||||||
|
//用客户公司id查询
|
||||||
|
CustomerCompanyDO customerCompanyDO = customerCompanyMapper.selectById(customerCompanyId);
|
||||||
|
String name = customerCompanyDO.getName();
|
||||||
|
HistoryResp.setCustomerCompanyName(name);
|
||||||
|
|
||||||
|
|
||||||
|
//合同总金额
|
||||||
|
|
||||||
|
BigDecimal contractAmount = extContractService.getContractAmountById(id);
|
||||||
|
HistoryResp.setAmount(contractAmount);
|
||||||
|
|
||||||
|
//合同商议提示 // TODO 待优化
|
||||||
|
HistoryResp.setExReminderTime(null);
|
||||||
|
|
||||||
|
return HistoryResp;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ExtContractHistoryRespVO> getExtContractHistoryPage(ExtContractHistoryPageReqVO pageReqVO) {
|
||||||
|
//校验
|
||||||
|
if (pageReqVO == null) {
|
||||||
|
throw exception(PARAM_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
Long projectId = pageReqVO.getProjectId();
|
||||||
|
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||||
|
if (project == null) {
|
||||||
|
throw exception(PROJECT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
PageResult<ExtContractHistoryDO> extContractHistoryPageResult = extContractHistoryMapper.selectPage(pageReqVO);
|
||||||
|
List<ExtContractHistoryDO> pageResultList = extContractHistoryPageResult.getList();
|
||||||
|
List<ExtContractHistoryRespVO> contractHistoryRespVOS = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
for (ExtContractHistoryDO extContractHistoryDO : pageResultList) {
|
||||||
|
Long id = extContractHistoryDO.getId();
|
||||||
|
ExtContractHistoryRespVO extContractHistory = getExtContractHistory(id);
|
||||||
|
contractHistoryRespVOS.add(extContractHistory);
|
||||||
|
}
|
||||||
|
|
||||||
|
PageResult<ExtContractHistoryRespVO> pageResult = new PageResult<>();
|
||||||
|
pageResult.setList(contractHistoryRespVOS);
|
||||||
|
return pageResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void validateExtContractHistoryExists(Long id) {
|
||||||
|
if (extContractHistoryMapper.selectById(id) == null) {
|
||||||
|
throw exception(EXT_CONTRACT_HISTORY_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -2,12 +2,16 @@ package cn.iocoder.yudao.module.cms.service.outscontract;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractRespVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractRespVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractPageReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractPageReqVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractRespVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractRespVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractSaveReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO;
|
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
||||||
import cn.iocoder.yudao.module.cms.dal.mysql.outscontract.OutsContractMapper;
|
import cn.iocoder.yudao.module.cms.dal.mysql.outscontract.OutsContractMapper;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.mysql.outscontracthistory.OutsContractHistoryMapper;
|
||||||
import cn.iocoder.yudao.module.cms.service.contract.ContractService;
|
import cn.iocoder.yudao.module.cms.service.contract.ContractService;
|
||||||
import cn.iocoder.yudao.module.pms.api.project.ProjectApi;
|
import cn.iocoder.yudao.module.pms.api.project.ProjectApi;
|
||||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||||
@ -16,6 +20,7 @@ import jakarta.annotation.Resource;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -33,6 +38,15 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.USER_NOT_E
|
|||||||
@Validated
|
@Validated
|
||||||
public class OutsContractServiceImpl implements OutsContractService {
|
public class OutsContractServiceImpl implements OutsContractService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外包合同立项审批流程定义
|
||||||
|
*/
|
||||||
|
public static final String PROCESS_KEY = "outs_contract_init";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
public static String VERSION = "1";
|
||||||
@Resource
|
@Resource
|
||||||
private OutsContractMapper outsContractMapper;
|
private OutsContractMapper outsContractMapper;
|
||||||
|
|
||||||
@ -45,44 +59,110 @@ public class OutsContractServiceImpl implements OutsContractService {
|
|||||||
@Resource
|
@Resource
|
||||||
private AdminUserApi adminUserApi;
|
private AdminUserApi adminUserApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmProcessInstanceApi processInstanceApi;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OutsContractHistoryMapper outsContractHistoryMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createOutsContract(Long loginUserId,OutsContractSaveReqVO createReqVO) {
|
public Long createOutsContract(Long loginUserId,OutsContractSaveReqVO createReqVO) {
|
||||||
|
|
||||||
|
|
||||||
if (createReqVO == null) {
|
if (createReqVO == null) {
|
||||||
throw exception(PARAM_NOT_EXISTS);
|
throw exception(PARAM_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
if (loginUserId == null) {
|
||||||
OutsContractDO outsContract = BeanUtils.toBean(createReqVO, OutsContractDO.class);
|
throw exception(PARAM_NOT_EXISTS);
|
||||||
|
|
||||||
Long contractId = outsContract.getContractId();
|
|
||||||
|
|
||||||
ContractRespVO contract = contractService.getContract(contractId);
|
|
||||||
if (contract == null) {
|
|
||||||
throw exception(CONTRACT_NOT_EXISTS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Long projectId = outsContract.getProjectId();
|
|
||||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
|
||||||
if (project == null) {
|
|
||||||
throw exception(PROJECT_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
|
|
||||||
//合同名称错误
|
|
||||||
if (!Objects.equals(createReqVO.getName(), contract.getName())) {
|
|
||||||
throw exception(CONTRACT_NAME_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
//TODO 待优化
|
|
||||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||||
if (userName == null){
|
if (userName == null) {
|
||||||
throw exception(USER_NOT_EXISTS);
|
throw exception(USER_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
outsContract.setCreator(userName);
|
|
||||||
outsContract.setUpdater(userName);
|
OutsContractDO outsContractDO = BeanUtils.toBean(createReqVO, OutsContractDO.class);
|
||||||
|
//校验
|
||||||
|
Long projectId = outsContractDO.getProjectId();
|
||||||
|
projectApi.validProjectExist(projectId);
|
||||||
|
|
||||||
|
|
||||||
|
//校验联表的字段是否和所联系的表内容相同
|
||||||
|
ContractRespVO contract = contractService.getContract(createReqVO.getContractId());
|
||||||
|
// 需要联表查询
|
||||||
|
// 1.合同名称 √
|
||||||
|
// 2.主控部门(跟踪部门) √
|
||||||
|
// 3.项目经理 √
|
||||||
|
// 4.签订合同总额 √
|
||||||
|
|
||||||
|
//todo 待提取
|
||||||
|
String name = createReqVO.getName();
|
||||||
|
String trackingDep = createReqVO.getTrackingDep();
|
||||||
|
String projectManager = createReqVO.getProjectManager();
|
||||||
|
BigDecimal outsAmount = createReqVO.getOutsAmount();
|
||||||
|
|
||||||
|
|
||||||
|
if (!contract.getName().equals(name)){
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
if (!contract.getTrackingDep().equals(trackingDep)){
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
if (!contract.getProjectManager().equals(projectManager)){
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
if (contract.getAmount().compareTo(outsAmount) != 0){
|
||||||
|
throw exception(PARAM_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
outsContractMapper.insert(outsContract);
|
OutsContractRespVO outsContractRespVO = BeanUtils.toBean(outsContractDO, OutsContractRespVO.class);
|
||||||
return outsContract.getId();
|
outsContractDO.setCreator(userName);
|
||||||
|
outsContractDO.setUpdater(userName);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//判断该合同是否已经存在,比较各个字段值是否完全一样
|
||||||
|
//得到所有的合同?逐个比较?
|
||||||
|
|
||||||
|
|
||||||
|
List<OutsContractDO> outsContractDOList = outsContractMapper.selectList("project_id", projectId);
|
||||||
|
List<OutsContractRespVO> outsContractRespList = BeanUtils.toBean(outsContractDOList, OutsContractRespVO.class);
|
||||||
|
|
||||||
|
for (OutsContractRespVO respVO : outsContractRespList) {
|
||||||
|
if (respVO.equals(outsContractRespVO)){
|
||||||
|
throw exception(CONTRACT_ALREADY_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
outsContractMapper.insert(outsContractDO);
|
||||||
|
|
||||||
|
|
||||||
|
Long outsContractDOId = outsContractDO.getId();
|
||||||
|
OutsContractHistoryDO outsContractHistoryDO = BeanUtils.toBean(outsContractDO, OutsContractHistoryDO.class);
|
||||||
|
|
||||||
|
|
||||||
|
// 启动流程,同时写入历史合同
|
||||||
|
if (createReqVO.getId() == null) {
|
||||||
|
String processInstanceId = processInstanceApi.createProcessInstance(loginUserId,
|
||||||
|
new BpmProcessInstanceCreateReqDTO()
|
||||||
|
.setProcessDefinitionKey(PROCESS_KEY).setBusinessKey(String.valueOf(outsContractDOId)));
|
||||||
|
|
||||||
|
// 写入工作流编号
|
||||||
|
outsContractHistoryDO.setProcessInstanceId(processInstanceId);
|
||||||
|
outsContractHistoryDO.setOutsContractId(outsContractDOId);
|
||||||
|
|
||||||
|
Long count = outsContractHistoryMapper.selectCount("project_id", projectId);
|
||||||
|
if (count < 1) {
|
||||||
|
outsContractHistoryDO.setVersion(VERSION);
|
||||||
|
} else {
|
||||||
|
outsContractHistoryDO.setVersion(String.valueOf(count+1));
|
||||||
|
}
|
||||||
|
|
||||||
|
outsContractHistoryDO.setProcessStatus("0");
|
||||||
|
outsContractHistoryMapper.insert(outsContractHistoryDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
return outsContractDO.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.cms.service.outscontracthistory;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryRespVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistorySaveReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistorySaveReqVO;
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
@ -13,14 +14,6 @@ import jakarta.validation.Valid;
|
|||||||
*/
|
*/
|
||||||
public interface OutsContractHistoryService {
|
public interface OutsContractHistoryService {
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建外包合同历史
|
|
||||||
*
|
|
||||||
* @param createReqVO 创建信息
|
|
||||||
* @return 编号
|
|
||||||
*/
|
|
||||||
Long createOutsContractHistory(@Valid OutsContractHistorySaveReqVO createReqVO);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新外包合同历史
|
* 更新外包合同历史
|
||||||
*
|
*
|
||||||
@ -28,12 +21,6 @@ public interface OutsContractHistoryService {
|
|||||||
*/
|
*/
|
||||||
void updateOutsContractHistory(@Valid OutsContractHistorySaveReqVO updateReqVO);
|
void updateOutsContractHistory(@Valid OutsContractHistorySaveReqVO updateReqVO);
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除外包合同历史
|
|
||||||
*
|
|
||||||
* @param id 编号
|
|
||||||
*/
|
|
||||||
void deleteOutsContractHistory(Long id);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得外包合同历史
|
* 获得外包合同历史
|
||||||
@ -41,7 +28,7 @@ public interface OutsContractHistoryService {
|
|||||||
* @param id 编号
|
* @param id 编号
|
||||||
* @return 外包合同历史
|
* @return 外包合同历史
|
||||||
*/
|
*/
|
||||||
OutsContractHistoryDO getOutsContractHistory(Long id);
|
OutsContractHistoryRespVO getOutsContractHistory(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得外包合同历史分页
|
* 获得外包合同历史分页
|
||||||
@ -49,6 +36,6 @@ public interface OutsContractHistoryService {
|
|||||||
* @param pageReqVO 分页查询
|
* @param pageReqVO 分页查询
|
||||||
* @return 外包合同历史分页
|
* @return 外包合同历史分页
|
||||||
*/
|
*/
|
||||||
PageResult<OutsContractHistoryDO> getOutsContractHistoryPage(OutsContractHistoryPageReqVO pageReqVO);
|
PageResult<OutsContractHistoryRespVO> getOutsContractHistoryPage(OutsContractHistoryPageReqVO pageReqVO);
|
||||||
|
|
||||||
}
|
}
|
@ -2,16 +2,25 @@ package cn.iocoder.yudao.module.cms.service.outscontracthistory;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractRespVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryRespVO;
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistorySaveReqVO;
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistorySaveReqVO;
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
||||||
import cn.iocoder.yudao.module.cms.dal.mysql.outscontracthistory.OutsContractHistoryMapper;
|
import cn.iocoder.yudao.module.cms.dal.mysql.outscontracthistory.OutsContractHistoryMapper;
|
||||||
|
import cn.iocoder.yudao.module.cms.service.contract.ContractService;
|
||||||
|
import cn.iocoder.yudao.module.pms.api.ProjectApi;
|
||||||
|
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.OUTS_CONTRACT_HISTORY_NOT_EXISTS;
|
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||||
|
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.PROJECT_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 外包合同历史 Service 实现类
|
* 外包合同历史 Service 实现类
|
||||||
@ -25,14 +34,11 @@ public class OutsContractHistoryServiceImpl implements OutsContractHistoryServic
|
|||||||
@Resource
|
@Resource
|
||||||
private OutsContractHistoryMapper outsContractHistoryMapper;
|
private OutsContractHistoryMapper outsContractHistoryMapper;
|
||||||
|
|
||||||
@Override
|
@Resource
|
||||||
public Long createOutsContractHistory(OutsContractHistorySaveReqVO createReqVO) {
|
private ProjectApi projectApi;
|
||||||
// 插入
|
|
||||||
OutsContractHistoryDO outsContractHistory = BeanUtils.toBean(createReqVO, OutsContractHistoryDO.class);
|
@Resource
|
||||||
outsContractHistoryMapper.insert(outsContractHistory);
|
private ContractService contractService;
|
||||||
// 返回
|
|
||||||
return outsContractHistory.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateOutsContractHistory(OutsContractHistorySaveReqVO updateReqVO) {
|
public void updateOutsContractHistory(OutsContractHistorySaveReqVO updateReqVO) {
|
||||||
@ -43,14 +49,6 @@ public class OutsContractHistoryServiceImpl implements OutsContractHistoryServic
|
|||||||
outsContractHistoryMapper.updateById(updateObj);
|
outsContractHistoryMapper.updateById(updateObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteOutsContractHistory(Long id) {
|
|
||||||
// 校验存在
|
|
||||||
validateOutsContractHistoryExists(id);
|
|
||||||
// 删除
|
|
||||||
outsContractHistoryMapper.deleteById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void validateOutsContractHistoryExists(Long id) {
|
private void validateOutsContractHistoryExists(Long id) {
|
||||||
if (outsContractHistoryMapper.selectById(id) == null) {
|
if (outsContractHistoryMapper.selectById(id) == null) {
|
||||||
throw exception(OUTS_CONTRACT_HISTORY_NOT_EXISTS);
|
throw exception(OUTS_CONTRACT_HISTORY_NOT_EXISTS);
|
||||||
@ -58,13 +56,50 @@ public class OutsContractHistoryServiceImpl implements OutsContractHistoryServic
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OutsContractHistoryDO getOutsContractHistory(Long id) {
|
public OutsContractHistoryRespVO getOutsContractHistory(Long id) {
|
||||||
return outsContractHistoryMapper.selectById(id);
|
//校验
|
||||||
|
if (id == null) {
|
||||||
|
throw exception(OUTS_CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
OutsContractHistoryDO outsContractHistoryDO = outsContractHistoryMapper.selectById(id);
|
||||||
|
OutsContractHistoryRespVO outsContractHistoryResp = BeanUtils.toBean(outsContractHistoryDO, OutsContractHistoryRespVO.class);
|
||||||
|
Long contractId = outsContractHistoryResp.getContractId();
|
||||||
|
ContractRespVO contract = contractService.getContract(contractId);
|
||||||
|
|
||||||
|
outsContractHistoryResp.setName(contract.getName());
|
||||||
|
outsContractHistoryResp.setTrackingDep(contract.getTrackingDep());
|
||||||
|
outsContractHistoryResp.setProjectManager(contract.getProjectManager());
|
||||||
|
outsContractHistoryResp.setOutsAmount(contract.getAmount());
|
||||||
|
|
||||||
|
return outsContractHistoryResp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<OutsContractHistoryDO> getOutsContractHistoryPage(OutsContractHistoryPageReqVO pageReqVO) {
|
public PageResult<OutsContractHistoryRespVO> getOutsContractHistoryPage(OutsContractHistoryPageReqVO pageReqVO) {
|
||||||
return outsContractHistoryMapper.selectPage(pageReqVO);
|
if (pageReqVO == null) {
|
||||||
|
throw exception(PARAM_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
Long projectId = pageReqVO.getProjectId();
|
||||||
|
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||||
|
if (project == null) {
|
||||||
|
throw exception(PROJECT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
PageResult<OutsContractHistoryDO> outsContractHistoryPage = outsContractHistoryMapper.selectPage(pageReqVO);
|
||||||
|
List<OutsContractHistoryDO> outsContractDOList = outsContractHistoryPage.getList();
|
||||||
|
List<OutsContractHistoryRespVO> outsContractRespVOList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
for (OutsContractHistoryDO outsContractHistoryDO : outsContractDOList) {
|
||||||
|
Long id = outsContractHistoryDO.getId();
|
||||||
|
OutsContractHistoryRespVO outsContractHistory = getOutsContractHistory(id);
|
||||||
|
outsContractRespVOList.add(outsContractHistory);
|
||||||
|
}
|
||||||
|
|
||||||
|
PageResult<OutsContractHistoryRespVO> pageResult = new PageResult<>();
|
||||||
|
pageResult.setList(outsContractRespVOList);
|
||||||
|
return pageResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
package cn.iocoder.yudao.module.pms.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wyw
|
||||||
|
* @description 主控部门枚举
|
||||||
|
* @date 2024/7/31
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum TrackingDepEnum {
|
||||||
|
// 生产一部
|
||||||
|
FIRST_PRODUCE("first-produce", "FP"),
|
||||||
|
// 生产二部
|
||||||
|
SECOND_PRODUCE("second_produce", "DP"),
|
||||||
|
// 检测院
|
||||||
|
LOD("lod", "LO");
|
||||||
|
/**
|
||||||
|
* 类型编号
|
||||||
|
*/
|
||||||
|
private final String code;
|
||||||
|
/**
|
||||||
|
* 类型编码
|
||||||
|
*/
|
||||||
|
private final String no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过code获取no
|
||||||
|
* @param code 字典编号
|
||||||
|
* @return 类型编码
|
||||||
|
*/
|
||||||
|
public static String getNoByCode(String code) {
|
||||||
|
for (TrackingDepEnum value : values()) {
|
||||||
|
if (value.getCode().equals(code)) {
|
||||||
|
return value.getNo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 外部合同 VO
|
||||||
|
export interface ExtContractHistoryVO {
|
||||||
|
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
|
||||||
|
processInstanceId: string // 流程实体id
|
||||||
|
processStatus: string // 流程状态
|
||||||
|
contractId: number // 合同id
|
||||||
|
extContractId: number // 外部合同id
|
||||||
|
version: string // 版本
|
||||||
|
}
|
||||||
|
|
||||||
|
// 外部合同 API
|
||||||
|
export const ExtContractHistoryApi = {
|
||||||
|
// 查询外部合同分页
|
||||||
|
getExtContractHistoryPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/cms/ext-contract-history/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询外部合同详情
|
||||||
|
getExtContractHistory: async (id: number) => {
|
||||||
|
return await request.get({ url: `/cms/ext-contract-history/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增外部合同
|
||||||
|
createExtContractHistory: async (data: ExtContractHistoryVO) => {
|
||||||
|
return await request.post({ url: `/cms/ext-contract-history/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改外部合同
|
||||||
|
updateExtContractHistory: async (data: ExtContractHistoryVO) => {
|
||||||
|
return await request.put({ url: `/cms/ext-contract-history/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除外部合同
|
||||||
|
deleteExtContractHistory: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/cms/ext-contract-history/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出外部合同 Excel
|
||||||
|
exportExtContractHistory: async (params) => {
|
||||||
|
return await request.download({ url: `/cms/ext-contract-history/export-excel`, params })
|
||||||
|
},
|
||||||
|
}
|
@ -0,0 +1,300 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-form-item label="项目id" prop="projectId">
|
||||||
|
<el-input v-model="formData.projectId" placeholder="请输入项目id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同名称" prop="name">
|
||||||
|
<el-input v-model="formData.name" placeholder="请输入合同名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同类型" prop="type">
|
||||||
|
<el-select v-model="formData.type" placeholder="请选择合同类型">
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="客户公司id" prop="customerCompanyId">
|
||||||
|
<el-input v-model="formData.customerCompanyId" placeholder="请输入客户公司id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同进展" prop="progress">
|
||||||
|
<el-input v-model="formData.progress" placeholder="请输入合同进展" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预计签订时间" prop="expectedTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.expectedTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择预计签订时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="签订时间" prop="signingTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.signingTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择签订时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="归档时间" prop="archiveTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.archiveTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择归档时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-radio-group v-model="formData.status">
|
||||||
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同金额" prop="amount">
|
||||||
|
<el-input v-model="formData.amount" placeholder="请输入合同金额" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="前期费用" prop="preAmount">
|
||||||
|
<el-input v-model="formData.preAmount" placeholder="请输入前期费用" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设计费" prop="designFee">
|
||||||
|
<el-input v-model="formData.designFee" placeholder="请输入设计费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="勘测费" prop="surveyFees">
|
||||||
|
<el-input v-model="formData.surveyFees" placeholder="请输入勘测费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="检测费" prop="testingFee">
|
||||||
|
<el-input v-model="formData.testingFee" placeholder="请输入检测费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="其他费" prop="otherFee">
|
||||||
|
<el-input v-model="formData.otherFee" placeholder="请输入其他费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="计费方式" prop="countType">
|
||||||
|
<el-select v-model="formData.countType" placeholder="请选择计费方式">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.CONTRACT_BILLING_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同附件url" prop="contractFileUrl">
|
||||||
|
<UploadFile v-model="formData.contractFileUrl" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="建安费" prop="constructionCost">
|
||||||
|
<el-input v-model="formData.constructionCost" placeholder="请输入建安费" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资金来源" prop="source">
|
||||||
|
<el-select v-model="formData.source" placeholder="请选择资金来源">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.FUNDS_SOURCE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="收费标准" prop="chargingStandard">
|
||||||
|
<el-input v-model="formData.chargingStandard" placeholder="请输入收费标准" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="优惠" prop="discount">
|
||||||
|
<el-input v-model="formData.discount" placeholder="请输入优惠" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否联合体" prop="consortium">
|
||||||
|
<el-radio-group v-model="formData.consortium">
|
||||||
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联合体单位" prop="consortiumCompany">
|
||||||
|
<el-input v-model="formData.consortiumCompany" placeholder="请输入联合体单位" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同提示时间" prop="reminderTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.reminderTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择合同提示时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审定金额" prop="approvedAmount">
|
||||||
|
<el-input v-model="formData.approvedAmount" placeholder="请输入审定金额" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审核文件url" prop="reviewFileUrl">
|
||||||
|
<UploadFile v-model="formData.reviewFileUrl" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="流程实体id" prop="processInstanceId">
|
||||||
|
<el-input v-model="formData.processInstanceId" placeholder="请输入流程实体id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="流程状态" prop="processStatus">
|
||||||
|
<el-select v-model="formData.processStatus" placeholder="请选择流程状态">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同id" prop="contractId">
|
||||||
|
<el-input v-model="formData.contractId" placeholder="请输入合同id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="外部合同id" prop="extContractId">
|
||||||
|
<el-input v-model="formData.extContractId" placeholder="请输入外部合同id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="版本" prop="version">
|
||||||
|
<el-input v-model="formData.version" placeholder="请输入版本" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { ExtContractHistoryApi, ExtContractHistoryVO } from '@/api/cms/extcontracthistory'
|
||||||
|
|
||||||
|
/** 外部合同 表单 */
|
||||||
|
defineOptions({ name: 'ExtContractHistoryForm' })
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
name: undefined,
|
||||||
|
type: undefined,
|
||||||
|
customerCompanyId: undefined,
|
||||||
|
progress: undefined,
|
||||||
|
expectedTime: undefined,
|
||||||
|
signingTime: undefined,
|
||||||
|
archiveTime: undefined,
|
||||||
|
status: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
preAmount: undefined,
|
||||||
|
designFee: undefined,
|
||||||
|
surveyFees: undefined,
|
||||||
|
testingFee: undefined,
|
||||||
|
otherFee: undefined,
|
||||||
|
countType: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
contractFileUrl: undefined,
|
||||||
|
constructionCost: undefined,
|
||||||
|
source: undefined,
|
||||||
|
chargingStandard: undefined,
|
||||||
|
discount: undefined,
|
||||||
|
consortium: undefined,
|
||||||
|
consortiumCompany: undefined,
|
||||||
|
reminderTime: undefined,
|
||||||
|
approvedAmount: undefined,
|
||||||
|
reviewFileUrl: undefined,
|
||||||
|
processInstanceId: undefined,
|
||||||
|
processStatus: undefined,
|
||||||
|
contractId: undefined,
|
||||||
|
extContractId: undefined,
|
||||||
|
version: undefined,
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
|
||||||
|
expectedTime: [{ required: true, message: '预计签订时间不能为空', trigger: 'blur' }],
|
||||||
|
amount: [{ required: true, message: '合同金额不能为空', trigger: 'blur' }],
|
||||||
|
countType: [{ required: true, message: '计费方式不能为空', trigger: 'change' }],
|
||||||
|
chargingStandard: [{ required: true, message: '收费标准不能为空', trigger: 'blur' }],
|
||||||
|
consortium: [{ required: true, message: '是否联合体不能为空', trigger: 'blur' }],
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await ExtContractHistoryApi.getExtContractHistory(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
await formRef.value.validate()
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = formData.value as unknown as ExtContractHistoryVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await ExtContractHistoryApi.createExtContractHistory(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ExtContractHistoryApi.updateExtContractHistory(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
name: undefined,
|
||||||
|
type: undefined,
|
||||||
|
customerCompanyId: undefined,
|
||||||
|
progress: undefined,
|
||||||
|
expectedTime: undefined,
|
||||||
|
signingTime: undefined,
|
||||||
|
archiveTime: undefined,
|
||||||
|
status: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
preAmount: undefined,
|
||||||
|
designFee: undefined,
|
||||||
|
surveyFees: undefined,
|
||||||
|
testingFee: undefined,
|
||||||
|
otherFee: undefined,
|
||||||
|
countType: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
contractFileUrl: undefined,
|
||||||
|
constructionCost: undefined,
|
||||||
|
source: undefined,
|
||||||
|
chargingStandard: undefined,
|
||||||
|
discount: undefined,
|
||||||
|
consortium: undefined,
|
||||||
|
consortiumCompany: undefined,
|
||||||
|
reminderTime: undefined,
|
||||||
|
approvedAmount: undefined,
|
||||||
|
reviewFileUrl: undefined,
|
||||||
|
processInstanceId: undefined,
|
||||||
|
processStatus: undefined,
|
||||||
|
contractId: undefined,
|
||||||
|
extContractId: undefined,
|
||||||
|
version: undefined,
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
@ -0,0 +1,567 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="主键" prop="id">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.id"
|
||||||
|
placeholder="请输入主键"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="项目id" prop="projectId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.projectId"
|
||||||
|
placeholder="请输入项目id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同名称" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入合同名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同类型" prop="type">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.type"
|
||||||
|
placeholder="请选择合同类型"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="客户公司id" prop="customerCompanyId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.customerCompanyId"
|
||||||
|
placeholder="请输入客户公司id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同进展" prop="progress">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.progress"
|
||||||
|
placeholder="请输入合同进展"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预计签订时间" prop="expectedTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.expectedTime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="daterange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="签订时间" prop="signingTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.signingTime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="daterange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="归档时间" prop="archiveTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.archiveTime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="daterange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.status"
|
||||||
|
placeholder="请选择状态"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同金额" prop="amount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.amount"
|
||||||
|
placeholder="请输入合同金额"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="前期费用" prop="preAmount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.preAmount"
|
||||||
|
placeholder="请输入前期费用"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设计费" prop="designFee">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.designFee"
|
||||||
|
placeholder="请输入设计费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="勘测费" prop="surveyFees">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.surveyFees"
|
||||||
|
placeholder="请输入勘测费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="检测费" prop="testingFee">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.testingFee"
|
||||||
|
placeholder="请输入检测费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="其他费" prop="otherFee">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.otherFee"
|
||||||
|
placeholder="请输入其他费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="计费方式" prop="countType">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.countType"
|
||||||
|
placeholder="请选择计费方式"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.CONTRACT_BILLING_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.remark"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="建安费" prop="constructionCost">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.constructionCost"
|
||||||
|
placeholder="请输入建安费"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资金来源" prop="source">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.source"
|
||||||
|
placeholder="请选择资金来源"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.FUNDS_SOURCE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="收费标准" prop="chargingStandard">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.chargingStandard"
|
||||||
|
placeholder="请输入收费标准"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="优惠" prop="discount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.discount"
|
||||||
|
placeholder="请输入优惠"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否联合体" prop="consortium">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.consortium"
|
||||||
|
placeholder="请选择是否联合体"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联合体单位" prop="consortiumCompany">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.consortiumCompany"
|
||||||
|
placeholder="请输入联合体单位"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同提示时间" prop="reminderTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.reminderTime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="daterange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审定金额" prop="approvedAmount">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.approvedAmount"
|
||||||
|
placeholder="请输入审定金额"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="流程实体id" prop="processInstanceId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.processInstanceId"
|
||||||
|
placeholder="请输入流程实体id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="流程状态" prop="processStatus">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.processStatus"
|
||||||
|
placeholder="请选择流程状态"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="合同id" prop="contractId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.contractId"
|
||||||
|
placeholder="请输入合同id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="外部合同id" prop="extContractId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.extContractId"
|
||||||
|
placeholder="请输入外部合同id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="版本" prop="version">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.version"
|
||||||
|
placeholder="请输入版本"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="openForm('create')"
|
||||||
|
v-hasPermi="['cms:ext-contract-history:create']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['cms:ext-contract-history:export']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<el-table-column label="主键" align="center" prop="id" />
|
||||||
|
<el-table-column label="项目id" align="center" prop="projectId" />
|
||||||
|
<el-table-column label="合同名称" align="center" prop="name" />
|
||||||
|
<el-table-column label="合同类型" align="center" prop="type" />
|
||||||
|
<el-table-column label="客户公司id" align="center" prop="customerCompanyId" />
|
||||||
|
<el-table-column label="合同进展" align="center" prop="progress" />
|
||||||
|
<el-table-column
|
||||||
|
label="预计签订时间"
|
||||||
|
align="center"
|
||||||
|
prop="expectedTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="签订时间"
|
||||||
|
align="center"
|
||||||
|
prop="signingTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="归档时间"
|
||||||
|
align="center"
|
||||||
|
prop="archiveTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="状态" align="center" prop="status" />
|
||||||
|
<el-table-column label="合同金额" align="center" prop="amount" />
|
||||||
|
<el-table-column label="前期费用" align="center" prop="preAmount" />
|
||||||
|
<el-table-column label="设计费" align="center" prop="designFee" />
|
||||||
|
<el-table-column label="勘测费" align="center" prop="surveyFees" />
|
||||||
|
<el-table-column label="检测费" align="center" prop="testingFee" />
|
||||||
|
<el-table-column label="其他费" align="center" prop="otherFee" />
|
||||||
|
<el-table-column label="计费方式" align="center" prop="countType">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.CONTRACT_BILLING_TYPE" :value="scope.row.countType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="合同附件url" align="center" prop="contractFileUrl" />
|
||||||
|
<el-table-column label="建安费" align="center" prop="constructionCost" />
|
||||||
|
<el-table-column label="资金来源" align="center" prop="source">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.FUNDS_SOURCE" :value="scope.row.source" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="收费标准" align="center" prop="chargingStandard" />
|
||||||
|
<el-table-column label="优惠" align="center" prop="discount" />
|
||||||
|
<el-table-column label="是否联合体" align="center" prop="consortium" />
|
||||||
|
<el-table-column label="联合体单位" align="center" prop="consortiumCompany" />
|
||||||
|
<el-table-column
|
||||||
|
label="合同提示时间"
|
||||||
|
align="center"
|
||||||
|
prop="reminderTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="审定金额" align="center" prop="approvedAmount" />
|
||||||
|
<el-table-column label="审核文件url" align="center" prop="reviewFileUrl" />
|
||||||
|
<el-table-column label="流程实体id" align="center" prop="processInstanceId" />
|
||||||
|
<el-table-column label="流程状态" align="center" prop="processStatus">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.processStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="合同id" align="center" prop="contractId" />
|
||||||
|
<el-table-column label="外部合同id" align="center" prop="extContractId" />
|
||||||
|
<el-table-column label="版本" align="center" prop="version" />
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['cms:ext-contract-history:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['cms:ext-contract-history:delete']"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<ExtContractHistoryForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { ExtContractHistoryApi, ExtContractHistoryVO } from '@/api/cms/extcontracthistory'
|
||||||
|
import ExtContractHistoryForm from './ExtContractHistoryForm.vue'
|
||||||
|
|
||||||
|
/** 外部合同 列表 */
|
||||||
|
defineOptions({ name: 'ExtContractHistory' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<ExtContractHistoryVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
id: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
name: undefined,
|
||||||
|
type: undefined,
|
||||||
|
customerCompanyId: undefined,
|
||||||
|
progress: undefined,
|
||||||
|
expectedTime: [],
|
||||||
|
signingTime: [],
|
||||||
|
archiveTime: [],
|
||||||
|
status: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
preAmount: undefined,
|
||||||
|
designFee: undefined,
|
||||||
|
surveyFees: undefined,
|
||||||
|
testingFee: undefined,
|
||||||
|
otherFee: undefined,
|
||||||
|
countType: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
contractFileUrl: undefined,
|
||||||
|
constructionCost: undefined,
|
||||||
|
source: undefined,
|
||||||
|
chargingStandard: undefined,
|
||||||
|
discount: undefined,
|
||||||
|
consortium: undefined,
|
||||||
|
consortiumCompany: undefined,
|
||||||
|
reminderTime: [],
|
||||||
|
approvedAmount: undefined,
|
||||||
|
reviewFileUrl: undefined,
|
||||||
|
processInstanceId: undefined,
|
||||||
|
processStatus: undefined,
|
||||||
|
contractId: undefined,
|
||||||
|
extContractId: undefined,
|
||||||
|
version: undefined,
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await ExtContractHistoryApi.getExtContractHistoryPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const formRef = ref()
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await ExtContractHistoryApi.deleteExtContractHistory(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await ExtContractHistoryApi.exportExtContractHistory(queryParams)
|
||||||
|
download.excel(data, '外部合同.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
Loading…
x
Reference in New Issue
Block a user