mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-23 14:41:54 +08:00
Compare commits
51 Commits
e5716bdfc2
...
feature-me
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4c72939f29 | ||
![]() |
e0ebf5c67e | ||
![]() |
194383276a | ||
![]() |
791ec26468 | ||
![]() |
6d4885c051 | ||
![]() |
2e9937cad2 | ||
![]() |
e0c60dd15b | ||
![]() |
83e39a0197 | ||
![]() |
365d3de0dd | ||
![]() |
6ca5de888f | ||
![]() |
bff455be96 | ||
![]() |
ad63ca24c0 | ||
![]() |
44c6558602 | ||
![]() |
7446e57a48 | ||
![]() |
982f817f4c | ||
![]() |
d6725f3040 | ||
![]() |
8ebbf12016 | ||
![]() |
504f7f7615 | ||
![]() |
a224d73203 | ||
![]() |
698906fb08 | ||
![]() |
027a5d1e1c | ||
![]() |
0a52eddbc6 | ||
![]() |
787f153bf1 | ||
![]() |
3114d32995 | ||
![]() |
ca58994bd6 | ||
![]() |
73d09ffea0 | ||
![]() |
871ddf4aab | ||
![]() |
47adca8394 | ||
![]() |
171c0cc018 | ||
![]() |
9d82236a89 | ||
![]() |
7ec73544f6 | ||
![]() |
dafc8cb432 | ||
![]() |
05b6707709 | ||
![]() |
b0ff4a7666 | ||
![]() |
7003b2a5eb | ||
![]() |
64c9b06f91 | ||
![]() |
e721f62821 | ||
![]() |
591d5bc495 | ||
![]() |
99a33c9c41 | ||
![]() |
340358e8d1 | ||
![]() |
ee17a3935c | ||
![]() |
8886aa269d | ||
![]() |
f0dc469105 | ||
![]() |
4a4d150fdc | ||
![]() |
967a83948b | ||
![]() |
b06e9b7d56 | ||
![]() |
c46f14c630 | ||
![]() |
57b1000fc5 | ||
![]() |
163ac1e5de | ||
![]() |
c44b48ec3f | ||
![]() |
5c4b2e1271 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -50,4 +50,5 @@ rebel.xml
|
||||
|
||||
application-my.yaml
|
||||
|
||||
application-local.yaml
|
||||
/yudao-ui-app/unpackage/
|
||||
|
55
sql/cms/ContractOuts-sql.sql
Normal file
55
sql/cms/ContractOuts-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,
|
||||
'contract-outs', '', 'cms/contractouts/index', 0, 'ContractOuts'
|
||||
);
|
||||
|
||||
-- 按钮父菜单ID
|
||||
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外包合同关联查询', 'cms:contract-outs:query', 3, 1, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外包合同关联创建', 'cms:contract-outs:create', 3, 2, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外包合同关联更新', 'cms:contract-outs:update', 3, 3, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外包合同关联删除', 'cms:contract-outs:delete', 3, 4, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外包合同关联导出', 'cms:contract-outs:export', 3, 5, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
55
sql/cms/codegen-OutsContract-sql.sql
Normal file
55
sql/cms/codegen-OutsContract-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, 2759,
|
||||
'outs-contract', '', 'cms/outscontract/index', 0, 'OutsContract'
|
||||
);
|
||||
|
||||
-- 按钮父菜单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:outs-contract:query', 3, 1, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外包合同创建', 'cms:outs-contract:create', 3, 2, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外包合同更新', 'cms:outs-contract:update', 3, 3, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外包合同删除', 'cms:outs-contract:delete', 3, 4, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外包合同导出', 'cms:outs-contract:export', 3, 5, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
55
sql/cms/codegen-OutsContractHistory-sql.sql
Normal file
55
sql/cms/codegen-OutsContractHistory-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,
|
||||
'outs-contract-history', '', 'cms/outscontracthistory/index', 0, 'OutsContractHistory'
|
||||
);
|
||||
|
||||
-- 按钮父菜单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:outs-contract-history:query', 3, 1, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外包合同历史创建', 'cms:outs-contract-history:create', 3, 2, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外包合同历史更新', 'cms:outs-contract-history:update', 3, 3, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外包合同历史删除', 'cms:outs-contract-history:delete', 3, 4, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外包合同历史导出', 'cms:outs-contract-history:export', 3, 5, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
55
sql/cms/codegen-cms-contractHistory-sql.sql
Normal file
55
sql/cms/codegen-cms-contractHistory-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,
|
||||
'contract-history', '', 'cms/contracthistory/index', 0, 'ContractHistory'
|
||||
);
|
||||
|
||||
-- 按钮父菜单ID
|
||||
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'历史合同查询', 'cms:contract-history:query', 3, 1, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'历史合同创建', 'cms:contract-history:create', 3, 2, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'历史合同更新', 'cms:contract-history:update', 3, 3, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'历史合同删除', 'cms:contract-history:delete', 3, 4, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'历史合同导出', 'cms:contract-history:export', 3, 5, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
55
sql/cms/codegen-cms-ext-sql.sql
Normal file
55
sql/cms/codegen-cms-ext-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', '', 'cms-ext/extcontract/index', 0, 'ExtContract'
|
||||
);
|
||||
|
||||
-- 按钮父菜单ID
|
||||
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外部合同查询', 'cms-ext:ext-contract:query', 3, 1, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外部合同创建', 'cms-ext:ext-contract:create', 3, 2, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外部合同更新', 'cms-ext:ext-contract:update', 3, 3, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外部合同删除', 'cms-ext:ext-contract:delete', 3, 4, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'外部合同导出', 'cms-ext:ext-contract:export', 3, 5, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
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
|
||||
);
|
31
sql/cms/codegen-cms-sql.sql
Normal file
31
sql/cms/codegen-cms-sql.sql
Normal file
@@ -0,0 +1,31 @@
|
||||
-- 菜单 SQL
|
||||
INSERT INTO system_menu(name, permission, type, sort, parent_id,
|
||||
path, icon, component, status, component_name)
|
||||
VALUES ('合同管理', '', 2, 0, 2758,
|
||||
'contract', '', 'cms/contract/index', 0, 'Contract');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
INSERT INTO system_menu(name, permission, type, sort, parent_id,
|
||||
path, icon, component, status)
|
||||
VALUES ('合同查询', 'cms:contract:query', 3, 1, @parentId,
|
||||
'', '', '', 0);
|
||||
INSERT INTO system_menu(name, permission, type, sort, parent_id,
|
||||
path, icon, component, status)
|
||||
VALUES ('合同创建', 'cms:contract:create', 3, 2, @parentId,
|
||||
'', '', '', 0);
|
||||
INSERT INTO system_menu(name, permission, type, sort, parent_id,
|
||||
path, icon, component, status)
|
||||
VALUES ('合同更新', 'cms:contract:update', 3, 3, @parentId,
|
||||
'', '', '', 0);
|
||||
INSERT INTO system_menu(name, permission, type, sort, parent_id,
|
||||
path, icon, component, status)
|
||||
VALUES ('合同删除', 'cms:contract:delete', 3, 4, @parentId,
|
||||
'', '', '', 0);
|
||||
INSERT INTO system_menu(name, permission, type, sort, parent_id,
|
||||
path, icon, component, status)
|
||||
VALUES ('合同导出', 'cms:contract:export', 3, 5, @parentId,
|
||||
'', '', '', 0);
|
55
sql/pms/codegen-Budget-sql.sql
Normal file
55
sql/pms/codegen-Budget-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, 2759,
|
||||
'budget', '', 'pms/budget/index', 0, 'Budget'
|
||||
);
|
||||
|
||||
-- 按钮父菜单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 (
|
||||
'预算管理查询', 'pms:budget:query', 3, 1, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'预算管理创建', 'pms:budget:create', 3, 2, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'预算管理更新', 'pms:budget:update', 3, 3, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'预算管理删除', 'pms:budget:delete', 3, 4, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'预算管理导出', 'pms:budget:export', 3, 5, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
57
sql/pms/codegen-BudgetHistory-sql.sql
Normal file
57
sql/pms/codegen-BudgetHistory-sql.sql
Normal file
@@ -0,0 +1,57 @@
|
||||
|
||||
-- 历史预算管理
|
||||
-- 菜单 SQL
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status, component_name
|
||||
)
|
||||
VALUES (
|
||||
'历史预算管理管理', '', 2, 0, 2759,
|
||||
'budget-history', '', 'pms/budgethistory/index', 0, 'BudgetHistory'
|
||||
);
|
||||
|
||||
-- 按钮父菜单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 (
|
||||
'预算管理查询', 'pms:budget-history:query', 3, 1, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'预算管理创建', 'pms:budget-history:create', 3, 2, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'预算管理更新', 'pms:budget-history:update', 3, 3, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'预算管理删除', 'pms:budget-history:delete', 3, 4, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'预算管理导出', 'pms:budget-history:export', 3, 5, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
55
sql/pms/codegen-Receivables-sql.sql
Normal file
55
sql/pms/codegen-Receivables-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, 2759,
|
||||
'receivables', '', 'pms/receivables/index', 0, 'Receivables'
|
||||
);
|
||||
|
||||
-- 按钮父菜单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 (
|
||||
'应收款管理查询', 'pms:receivables:query', 3, 1, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'应收款管理创建', 'pms:receivables:create', 3, 2, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'应收款管理更新', 'pms:receivables:update', 3, 3, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'应收款管理删除', 'pms:receivables:delete', 3, 4, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'应收款管理导出', 'pms:receivables:export', 3, 5, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
55
sql/pms/codegen-ReceivablesHistory-sql.sql
Normal file
55
sql/pms/codegen-ReceivablesHistory-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, 2759,
|
||||
'receivables-history', '', 'pms/receivableshistory/index', 0, 'ReceivablesHistory'
|
||||
);
|
||||
|
||||
-- 按钮父菜单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 (
|
||||
'应收款管理历史记录查询', 'pms:receivables-history:query', 3, 1, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'应收款管理历史记录创建', 'pms:receivables-history:create', 3, 2, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'应收款管理历史记录更新', 'pms:receivables-history:update', 3, 3, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'应收款管理历史记录删除', 'pms:receivables-history:delete', 3, 4, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'应收款管理历史记录导出', 'pms:receivables-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,5 +8,46 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
* @date 2024/7/3
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
ErrorCode CUSTOMER_COMPANY_NOT_EXISTS = new ErrorCode(1_020_000_000, "客户公司管理不存在");
|
||||
// ========== 客户公司 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, "项目信息不存在");
|
||||
// ========== 请求参数 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 ==========
|
||||
ErrorCode OUTS_CONTRACT_NOT_EXISTS = new ErrorCode(2_021_000_000, "外包合同不存在");
|
||||
|
||||
// ========== 外包合同历史 2_022_000_000 ==========
|
||||
ErrorCode OUTS_CONTRACT_HISTORY_NOT_EXISTS = new ErrorCode(2_022_000_000, "外包合同历史不存在");
|
||||
|
||||
// ========== 外包合同关联 2_023_000_000 ==========
|
||||
ErrorCode CONTRACT_OUTS_NOT_EXISTS = new ErrorCode(2_023_000_000, "外包合同关联不存在");
|
||||
|
||||
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_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, "历史合同不存在");
|
||||
|
||||
// ========== 外部合同信息 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, "历史外部合同不存在");
|
||||
|
||||
// ========== 外部合同关联 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;
|
||||
}
|
||||
}
|
@@ -29,6 +29,12 @@
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-pms-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
|
@@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.ContractSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.service.contract.ContractService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Tag(name = "管理后台 - 合同管理")
|
||||
@RestController
|
||||
@RequestMapping("/cms/contract")
|
||||
@Validated
|
||||
public class ContractController {
|
||||
|
||||
@Resource
|
||||
private ContractService contractService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:create')")
|
||||
public CommonResult<Long> createContract(@Valid @RequestBody ContractSaveReqVO createReqVO) {
|
||||
return success(contractService.createContract(getLoginUserId(), createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:update')")
|
||||
public CommonResult<Boolean> updateContract(@Valid @RequestBody ContractSaveReqVO updateReqVO) {
|
||||
contractService.updateContract(getLoginUserId(), updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除合同")
|
||||
@Parameter(name = "id", description = "合同id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:delete')")
|
||||
public CommonResult<Boolean> deleteContract(@RequestParam("id") Long id) {
|
||||
contractService.deleteContract(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得合同")
|
||||
@Parameter(name = "id", description = "合同id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:query')")
|
||||
public CommonResult<ContractRespVO> getContract(@RequestParam("id") Long id) {
|
||||
ContractRespVO contractRespVO = contractService.getContract(id);
|
||||
return success(contractRespVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得合同分页")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:query')")
|
||||
public CommonResult<PageResult<ContractRespVO>> getContractPage(@Valid ContractPageReqVO pageReqVO) {
|
||||
PageResult<ContractRespVO> pageResult = contractService.getContractPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出合同 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportContractExcel(@Valid ContractPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ContractRespVO> list = contractService.getContractPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "合同.xls", "数据", ContractRespVO.class,
|
||||
BeanUtils.toBean(list, ContractRespVO.class));
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contract.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 ContractPageReqVO extends PageParam {
|
||||
|
||||
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "合同名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", example = "2")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "合同状态", example = "1")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式", example = "1")
|
||||
private String countType;
|
||||
}
|
@@ -0,0 +1,147 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 合同 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@EqualsAndHashCode
|
||||
public class ContractRespVO {
|
||||
|
||||
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||
@ExcelProperty("项目编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||
@ExcelProperty("主控部门")
|
||||
private String trackingDep;
|
||||
|
||||
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "分包合同提示时间")
|
||||
@ExcelProperty("分包合同提示时间")
|
||||
private LocalDateTime 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 = "芋艿")
|
||||
@ExcelProperty("合同名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("合同类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("合同进展")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "合同拟定时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("合同拟定时间")
|
||||
private LocalDateTime expectedTime;
|
||||
|
||||
@Schema(description = "合同用印时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("合同用印时间")
|
||||
private LocalDateTime printingTime;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@ExcelProperty("签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "归档时间")
|
||||
@ExcelProperty("归档时间")
|
||||
private LocalDateTime archiveTime;
|
||||
|
||||
@Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("合同状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式", example = "1")
|
||||
@ExcelProperty("计费方式")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "合同url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("合同url")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "建安费")
|
||||
@ExcelProperty("建安费")
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
@ExcelProperty("资金来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "优惠", example = "17910")
|
||||
@ExcelProperty("优惠")
|
||||
private String discount;
|
||||
|
||||
@Schema(description = "是否联合体")
|
||||
@ExcelProperty("是否联合体")
|
||||
private Boolean consortium;
|
||||
|
||||
@Schema(description = "联合体单位")
|
||||
@ExcelProperty("联合体单位")
|
||||
private String consortiumCompany;
|
||||
|
||||
@Schema(description = "占主合同比例")
|
||||
@ExcelProperty("占主合同比例")
|
||||
private String extProportion;
|
||||
|
||||
@Schema(description = "审定金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("审定金额")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("审核文件url")
|
||||
private String reviewFileUrl;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
@ExcelProperty("签订合同总额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "前期费")
|
||||
@ExcelProperty("前期费")
|
||||
private BigDecimal preAmount;
|
||||
|
||||
@Schema(description = "设计费")
|
||||
@ExcelProperty("设计费")
|
||||
private BigDecimal designAmount;
|
||||
|
||||
@Schema(description = "勘测费")
|
||||
@ExcelProperty("勘测费")
|
||||
private BigDecimal surveyFees;
|
||||
|
||||
@Schema(description = "测量费")
|
||||
@ExcelProperty("测量费")
|
||||
private BigDecimal measurementFee;
|
||||
|
||||
@Schema(description = "其他费")
|
||||
@ExcelProperty("其他费")
|
||||
private BigDecimal otherFee;
|
||||
|
||||
}
|
@@ -0,0 +1,132 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 合同新增/修改 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode
|
||||
public class ContractSaveReqVO {
|
||||
|
||||
@Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||
@ExcelProperty("项目编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||
@ExcelProperty("主控部门")
|
||||
private String trackingDep;
|
||||
|
||||
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "分包合同提示时间")
|
||||
@ExcelProperty("分包合同提示时间")
|
||||
private LocalDateTime reminderTime;
|
||||
|
||||
@Schema(description = "暂定结算数")
|
||||
@ExcelProperty("暂定结算数")
|
||||
private BigDecimal provisionalSettlement;
|
||||
|
||||
@Schema(description = "出图公司", requiredMode = Schema.RequiredMode.REQUIRED,example = "***设计院")
|
||||
@ExcelProperty("出图公司")
|
||||
private String drawingCompany;
|
||||
|
||||
@Schema(description = "预计合同金额", requiredMode = Schema.RequiredMode.REQUIRED,example = "200.0000")
|
||||
@ExcelProperty("预计合同金额")
|
||||
private BigDecimal expectedContractAmount;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "合同名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "合同类型不能为空")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "合同进展不能为空")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "合同拟定时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "合同拟定时间不能为空")
|
||||
private LocalDateTime expectedTime;
|
||||
|
||||
@Schema(description = "合同用印时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "合同用印时间不能为空")
|
||||
private LocalDateTime printingTime;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "归档时间")
|
||||
private LocalDateTime archiveTime;
|
||||
|
||||
@Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "合同状态不能为空")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式", example = "1")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "合同url", example = "https://www.iocoder.cn")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "建安费")
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "优惠", example = "17910")
|
||||
private String discount;
|
||||
|
||||
@Schema(description = "是否联合体")
|
||||
private Boolean consortium;
|
||||
|
||||
@Schema(description = "联合体单位")
|
||||
private String consortiumCompany;
|
||||
|
||||
@Schema(description = "占主合同比例")
|
||||
private String extProportion;
|
||||
|
||||
@Schema(description = "审定金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "审定金额不能为空")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
private String reviewFileUrl;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "前期费")
|
||||
private BigDecimal preAmount;
|
||||
|
||||
@Schema(description = "设计费")
|
||||
private BigDecimal designAmount;
|
||||
|
||||
@Schema(description = "勘测费")
|
||||
private BigDecimal surveyFees;
|
||||
|
||||
@Schema(description = "测量费")
|
||||
private BigDecimal measurementFee;
|
||||
|
||||
@Schema(description = "其他费")
|
||||
private BigDecimal otherFee;
|
||||
|
||||
}
|
@@ -0,0 +1,78 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractHistory;
|
||||
import cn.iocoder.yudao.module.cms.service.contractHistory.ContractHistoryService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.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.contractHistory.vo.*;
|
||||
|
||||
@Tag(name = "管理后台 - 历史合同管理")
|
||||
@RestController
|
||||
@RequestMapping("/cms/contract-history")
|
||||
@Validated
|
||||
public class ContractHistoryController {
|
||||
|
||||
@Resource
|
||||
private ContractHistoryService contractHistoryService;
|
||||
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新历史合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-history:update')")
|
||||
public CommonResult<Boolean> updateContractHistory(@Valid @RequestBody ContractHistorySaveReqVO updateReqVO) {
|
||||
contractHistoryService.updateContractHistory(getLoginUserId(),updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得历史合同")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-history:query')")
|
||||
public CommonResult<ContractHistoryRespVO> getContractHistory(@RequestParam("id") Long id) {
|
||||
ContractHistoryRespVO contractHistory = contractHistoryService.getContractHistory(id);
|
||||
return success(contractHistory);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得历史合同分页")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-history:query')")
|
||||
public CommonResult<PageResult<ContractHistoryRespVO>> getContractHistoryPage(@Valid ContractHistoryPageReqVO pageReqVO) {
|
||||
PageResult<ContractHistoryRespVO> pageResult = contractHistoryService.getContractHistoryPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出历史合同 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-history:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportContractHistoryExcel(@Valid ContractHistoryPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ContractHistoryRespVO> list = contractHistoryService.getContractHistoryPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "历史合同.xls", "数据", ContractHistoryRespVO.class,
|
||||
BeanUtils.toBean(list, ContractHistoryRespVO.class));
|
||||
}
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractHistory.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 ContractHistoryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "合同编号")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "流程实体id", example = "12536")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "合同名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", example = "2")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "合同状态", example = "1")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
private String processStatus;
|
||||
|
||||
}
|
@@ -0,0 +1,162 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 历史合同 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ContractHistoryRespVO {
|
||||
|
||||
@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 = "流程实体id", example = "12536")
|
||||
@ExcelProperty("流程实体id")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("合同名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("合同类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("合同进展")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "合同拟定时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("合同拟定时间")
|
||||
private LocalDateTime expectedTime;
|
||||
|
||||
@Schema(description = "合同用印时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("合同用印时间")
|
||||
private LocalDateTime printingTime;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@ExcelProperty("签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "归档时间")
|
||||
@ExcelProperty("归档时间")
|
||||
private LocalDateTime archiveTime;
|
||||
|
||||
@Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("合同状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式", example = "2")
|
||||
@ExcelProperty("计费方式")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "合同url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("合同url")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "建安费")
|
||||
@ExcelProperty("建安费")
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
@ExcelProperty("资金来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "优惠", example = "18154")
|
||||
@ExcelProperty("优惠")
|
||||
private String discount;
|
||||
|
||||
@Schema(description = "是否联合体")
|
||||
@ExcelProperty("是否联合体")
|
||||
private Boolean consortium;
|
||||
|
||||
@Schema(description = "联合体单位")
|
||||
@ExcelProperty("联合体单位")
|
||||
private String consortiumCompany;
|
||||
|
||||
@Schema(description = "占主合同比例")
|
||||
@ExcelProperty("占主合同比例")
|
||||
private String extProportion;
|
||||
|
||||
@Schema(description = "审定金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("审定金额")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("审核文件url")
|
||||
private String reviewFileUrl;
|
||||
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
@ExcelProperty("签订合同总额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "前期费")
|
||||
@ExcelProperty("前期费")
|
||||
private BigDecimal preAmount;
|
||||
|
||||
@Schema(description = "设计费")
|
||||
@ExcelProperty("设计费")
|
||||
private BigDecimal designAmount;
|
||||
|
||||
@Schema(description = "勘测费")
|
||||
@ExcelProperty("勘测费")
|
||||
private BigDecimal surveyFees;
|
||||
|
||||
@Schema(description = "测量费")
|
||||
@ExcelProperty("测量费")
|
||||
private BigDecimal measurementFee;
|
||||
|
||||
@Schema(description = "其他费")
|
||||
@ExcelProperty("其他费")
|
||||
private BigDecimal otherFee;
|
||||
|
||||
@Schema(description = "合同", example = "20704")
|
||||
@ExcelProperty("合同")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
@ExcelProperty("流程状态")
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "版本")
|
||||
@ExcelProperty("版本")
|
||||
private String version;
|
||||
|
||||
}
|
@@ -0,0 +1,143 @@
|
||||
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 lombok.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 历史合同新增/修改 Request VO")
|
||||
@Data
|
||||
public class ContractHistorySaveReqVO {
|
||||
|
||||
@Schema(description = "历史合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "流程实体id", example = "12536")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||
@ExcelProperty("项目编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||
@ExcelProperty("主控部门")
|
||||
private String trackingDep;
|
||||
|
||||
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "分包合同提示时间")
|
||||
@ExcelProperty("分包合同提示时间")
|
||||
private LocalDateTime ReminderTime;
|
||||
|
||||
@Schema(description = "暂定结算数")
|
||||
@ExcelProperty("暂定结算数")
|
||||
private BigDecimal provisionalSettlement;
|
||||
|
||||
@Schema(description = "出图公司", requiredMode = Schema.RequiredMode.REQUIRED, example = "***设计院")
|
||||
@ExcelProperty("出图公司")
|
||||
private String drawingCompany;
|
||||
|
||||
@Schema(description = "预计合同金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "200.0000")
|
||||
@ExcelProperty("预计合同金额")
|
||||
private BigDecimal expectedContractAmount;
|
||||
|
||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "合同名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "合同类型不能为空")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "合同进展", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "合同进展不能为空")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "合同拟定时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "合同拟定时间不能为空")
|
||||
private LocalDateTime expectedTime;
|
||||
|
||||
@Schema(description = "合同用印时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "合同用印时间不能为空")
|
||||
private LocalDateTime printingTime;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "归档时间")
|
||||
private LocalDateTime archiveTime;
|
||||
|
||||
@Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "合同状态不能为空")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "计费方式", example = "2")
|
||||
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 = "审定金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "审定金额不能为空")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
private String reviewFileUrl;
|
||||
|
||||
@Schema(description = "签订合同总额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "前期费")
|
||||
private BigDecimal preAmount;
|
||||
|
||||
@Schema(description = "设计费")
|
||||
private BigDecimal designAmount;
|
||||
|
||||
@Schema(description = "勘测费")
|
||||
private BigDecimal surveyFees;
|
||||
|
||||
@Schema(description = "测量费")
|
||||
private BigDecimal measurementFee;
|
||||
|
||||
@Schema(description = "其他费")
|
||||
private BigDecimal otherFee;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "合同", example = "20704")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "版本")
|
||||
private String version;
|
||||
|
||||
}
|
@@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractouts;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO;
|
||||
import cn.iocoder.yudao.module.cms.service.contractouts.ContractOutsService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Tag(name = "管理后台 - 外包合同关联")
|
||||
@RestController
|
||||
@RequestMapping("/cms/contract-outs")
|
||||
@Validated
|
||||
public class ContractOutsController {
|
||||
|
||||
@Resource
|
||||
private ContractOutsService contractOutsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建外包合同关联")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-outs:create')")
|
||||
public CommonResult<Long> createContractOuts(@Valid @RequestBody ContractOutsSaveReqVO createReqVO) {
|
||||
return success(contractOutsService.createContractOuts(getLoginUserId(),createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新外包合同关联")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-outs:update')")
|
||||
public CommonResult<Boolean> updateContractOuts(@Valid @RequestBody ContractOutsSaveReqVO updateReqVO) {
|
||||
contractOutsService.updateContractOuts(getLoginUserId(),updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除外包合同关联")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-outs:delete')")
|
||||
public CommonResult<Boolean> deleteContractOuts(@RequestParam("id") Long id) {
|
||||
contractOutsService.deleteContractOuts(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得外包合同关联")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-outs:query')")
|
||||
public CommonResult<ContractOutsRespVO> getContractOuts(@RequestParam("id") Long id) {
|
||||
ContractOutsDO contractOuts = contractOutsService.getContractOuts(id);
|
||||
return success(BeanUtils.toBean(contractOuts, ContractOutsRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得外包合同关联分页")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-outs:query')")
|
||||
public CommonResult<PageResult<ContractOutsRespVO>> getContractOutsPage(@Valid ContractOutsPageReqVO pageReqVO) {
|
||||
PageResult<ContractOutsDO> pageResult = contractOutsService.getContractOutsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ContractOutsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出外包合同关联 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('cms:contract-outs:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportContractOutsExcel(@Valid ContractOutsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ContractOutsDO> list = contractOutsService.getContractOutsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "外包合同关联.xls", "数据", ContractOutsRespVO.class,
|
||||
BeanUtils.toBean(list, ContractOutsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同关联分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ContractOutsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "合同id", example = "16187")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "外包合同id", example = "9277")
|
||||
private Long outsContractId;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同关联 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ContractOutsRespVO {
|
||||
|
||||
@Schema(description = "合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16187")
|
||||
@ExcelProperty("合同id")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "外包合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9277")
|
||||
@ExcelProperty("外包合同id")
|
||||
private Long outsContractId;
|
||||
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同关联新增/修改 Request VO")
|
||||
@Data
|
||||
public class ContractOutsSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7688")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16187")
|
||||
@NotNull(message = "合同id不能为空")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "外包合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9277")
|
||||
@NotNull(message = "外包合同id不能为空")
|
||||
private Long outsContractId;
|
||||
|
||||
}
|
@@ -8,7 +8,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
@@ -79,14 +78,6 @@ public class CustomerCompanyController {
|
||||
return success(BeanUtils.toBean(pageResult, CustomerCompanyRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得客户公司列表")
|
||||
@PreAuthorize("@ss.hasPermission('cms:customer-company:query')")
|
||||
public CommonResult<List<CustomerCompanyRespVO>> getCustomerCompanyList(CustomerCompanyPageReqVO reqVO) {
|
||||
List<CustomerCompanyDO> list = customerCompanyService.getCustomerCompanyList(reqVO);
|
||||
return success(BeanUtils.toBean(list, CustomerCompanyRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出客户公司 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('cms:customer-company:export')")
|
||||
|
@@ -18,9 +18,6 @@ public class CustomerCompanyPageReqVO extends PageParam {
|
||||
@Schema(description = "联系人", example = "张三")
|
||||
private String contacts;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "公司名称", example = "电力公司")
|
||||
private String name;
|
||||
|
||||
|
@@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 客户公司 Response VO")
|
||||
@@ -20,10 +18,6 @@ public class CustomerCompanyRespVO {
|
||||
@ExcelProperty("联系人")
|
||||
private String contacts;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "电力公司")
|
||||
@ExcelProperty("公司名称")
|
||||
private String name;
|
||||
|
@@ -0,0 +1,96 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.extContract;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.service.extContract.ExtContractService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 外部合同")
|
||||
@RestController
|
||||
@RequestMapping("/cms/ext-contract")
|
||||
@Validated
|
||||
public class ExtContractController {
|
||||
|
||||
@Resource
|
||||
private ExtContractService extContractService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建外部合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:create')")
|
||||
public CommonResult<Long> createExtContract(@Valid @RequestBody ExtContractSaveReqVO createReqVO) {
|
||||
return success(extContractService.createExtContract(getLoginUserId(),createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新外部合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:update')")
|
||||
public CommonResult<Boolean> updateExtContract(@Valid @RequestBody ExtContractSaveReqVO updateReqVO) {
|
||||
extContractService.updateExtContract(getLoginUserId(),updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除外部合同")
|
||||
@Parameter(name = "id", description = "外部合同编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:delete')")
|
||||
public CommonResult<Boolean> deleteExtContract(@RequestParam("id") Long id) {
|
||||
extContractService.deleteExtContract(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得外部合同")
|
||||
@Parameter(name = "id", description = "外部合同编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:query')")
|
||||
public CommonResult<ExtContractRespVO> getExtContract(@RequestParam("id") Long id) {
|
||||
ExtContractRespVO extContract = extContractService.getExtContract(id);
|
||||
return success(extContract);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得外部合同分页")
|
||||
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:query')")
|
||||
public CommonResult<PageResult<ExtContractRespVO>> getExtContractPage(@Valid ExtContractPageReqVO pageReqVO) {
|
||||
PageResult<ExtContractRespVO> pageResult = extContractService.getExtContractPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出外部合同 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('cms-ext:ext-contract:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportExtContractExcel(@Valid ExtContractPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ExtContractRespVO> list = extContractService.getExtContractPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "外部合同.xls", "数据", ExtContractRespVO.class,
|
||||
BeanUtils.toBean(list, ExtContractRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.extContract.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 外部合同分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ExtContractPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "项目id", example = "30598")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "合同名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "客户公司id", example = "25191")
|
||||
private Long customerCompanyId;
|
||||
|
||||
@Schema(description = "合同进展")
|
||||
private String progress;
|
||||
|
||||
|
||||
@Schema(description = "状态", example = "2")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "合同id", example = "27460")
|
||||
private Long contractId;
|
||||
|
||||
}
|
@@ -0,0 +1,145 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.extContract.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 外部合同 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ExtContractRespVO {
|
||||
|
||||
|
||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
|
||||
@ExcelProperty("项目编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "合同名称", example = "芋艿")
|
||||
@ExcelProperty("合同名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", example = "1")
|
||||
@ExcelProperty("合同类型")
|
||||
private String type;
|
||||
|
||||
|
||||
@Schema(description = "客户名称")
|
||||
@ExcelProperty("客户名称")
|
||||
private String customerCompanyName;
|
||||
|
||||
@Schema(description = "主控部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "生产一部")
|
||||
@ExcelProperty("主控部门")
|
||||
private String trackingDep;
|
||||
|
||||
@Schema(description = "项目经理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目经理")
|
||||
private String projectManager;
|
||||
|
||||
@Schema(description = "合同商议提示时间")
|
||||
@ExcelProperty("合同商议提示时间")
|
||||
private LocalDateTime exReminderTime;
|
||||
|
||||
@Schema(description = "合同进展")
|
||||
@ExcelProperty("合同进展")
|
||||
private String progress;
|
||||
|
||||
@Schema(description = "预计签订时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("预计签订时间")
|
||||
private LocalDateTime expectedTime;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@ExcelProperty("签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "归档时间")
|
||||
@ExcelProperty("归档时间")
|
||||
private LocalDateTime archiveTime;
|
||||
|
||||
@Schema(description = "状态", example = "2")
|
||||
@ExcelProperty("状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("合同金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "前期费用")
|
||||
@ExcelProperty("前期费用")
|
||||
private BigDecimal preAmount;
|
||||
|
||||
@Schema(description = "设计费")
|
||||
@ExcelProperty("设计费")
|
||||
private BigDecimal designFee;
|
||||
|
||||
@Schema(description = "勘测费")
|
||||
@ExcelProperty("勘测费")
|
||||
private BigDecimal surveyFees;
|
||||
|
||||
@Schema(description = "检测费")
|
||||
@ExcelProperty("检测费")
|
||||
private BigDecimal testingFee;
|
||||
|
||||
@Schema(description = "其他费")
|
||||
@ExcelProperty("其他费")
|
||||
private String otherFee;
|
||||
|
||||
@Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("计费方式")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "合同附件url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("合同附件url")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "建安费")
|
||||
@ExcelProperty("建安费")
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
@ExcelProperty("资金来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "分包合同提示时间")
|
||||
@ExcelProperty("分包合同提示时间")
|
||||
private LocalDateTime reminderTime;
|
||||
|
||||
@Schema(description = "收费标准", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("收费标准")
|
||||
private String chargingStandard;
|
||||
|
||||
@Schema(description = "优惠", example = "15529")
|
||||
@ExcelProperty("优惠")
|
||||
private String discount;
|
||||
|
||||
@Schema(description = "是否联合体", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否联合体")
|
||||
private Boolean consortium;
|
||||
|
||||
@Schema(description = "联合体单位")
|
||||
@ExcelProperty("联合体单位")
|
||||
private String consortiumCompany;
|
||||
|
||||
|
||||
@Schema(description = "审定金额")
|
||||
@ExcelProperty("审定金额")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("审核文件url")
|
||||
private String reviewFileUrl;
|
||||
|
||||
|
||||
@Schema(description = "合同id", example = "27460")
|
||||
@ExcelProperty("合同id")
|
||||
private Long contractId;
|
||||
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,132 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.extContract.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 外部合同新增/修改 Request VO")
|
||||
@Data
|
||||
public class ExtContractSaveReqVO {
|
||||
|
||||
@Schema(description = "外部合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "30598")
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "项目编号", 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 = "25191")
|
||||
private Long customerCompanyId;
|
||||
|
||||
@Schema(description = "合同名称", example = "芋艿")
|
||||
@ExcelProperty("合同名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同类型", example = "1")
|
||||
@ExcelProperty("合同类型")
|
||||
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 = "2")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "合同金额不能为空")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "前期费用")
|
||||
private BigDecimal preAmount;
|
||||
|
||||
@Schema(description = "设计费")
|
||||
private BigDecimal designFee;
|
||||
|
||||
@Schema(description = "勘测费")
|
||||
private BigDecimal surveyFees;
|
||||
|
||||
@Schema(description = "检测费")
|
||||
private BigDecimal testingFee;
|
||||
|
||||
@Schema(description = "其他费")
|
||||
private String otherFee;
|
||||
|
||||
@Schema(description = "计费方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "计费方式不能为空")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "合同附件url", example = "https://www.iocoder.cn")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "建安费")
|
||||
private BigDecimal constructionCost;
|
||||
|
||||
@Schema(description = "资金来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "收费标准", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "收费标准不能为空")
|
||||
private String chargingStandard;
|
||||
|
||||
@Schema(description = "优惠", example = "15529")
|
||||
private String discount;
|
||||
|
||||
@Schema(description = "是否联合体", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否联合体不能为空")
|
||||
private Boolean consortium;
|
||||
|
||||
@Schema(description = "联合体单位")
|
||||
private String consortiumCompany;
|
||||
|
||||
@Schema(description = "分包合同提示时间")
|
||||
private LocalDateTime reminderTime;
|
||||
|
||||
@Schema(description = "审定金额")
|
||||
private BigDecimal approvedAmount;
|
||||
|
||||
@Schema(description = "审核文件url", example = "https://www.iocoder.cn")
|
||||
private String reviewFileUrl;
|
||||
|
||||
@Schema(description = "合同id", example = "27460")
|
||||
private Long contractId;
|
||||
|
||||
|
||||
}
|
@@ -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;
|
||||
|
||||
}
|
@@ -0,0 +1,94 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontract;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
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.OutsContractRespVO;
|
||||
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.service.outscontract.OutsContractService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Tag(name = "管理后台 - 外包合同")
|
||||
@RestController
|
||||
@RequestMapping("/cms/outs-contract")
|
||||
@Validated
|
||||
public class OutsContractController {
|
||||
|
||||
@Resource
|
||||
private OutsContractService outsContractService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建外包合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract:create')")
|
||||
public CommonResult<Long> createOutsContract(@Valid @RequestBody OutsContractSaveReqVO createReqVO) {
|
||||
return success(outsContractService.createOutsContract(getLoginUserId(),createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新外包合同")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract:update')")
|
||||
public CommonResult<Boolean> updateOutsContract(@Valid @RequestBody OutsContractSaveReqVO updateReqVO) {
|
||||
outsContractService.updateOutsContract(getLoginUserId(),updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除外包合同")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract:delete')")
|
||||
public CommonResult<Boolean> deleteOutsContract(@RequestParam("id") Long id) {
|
||||
outsContractService.deleteOutsContract(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得外包合同")
|
||||
@Parameter(name = "id", description = "主合同编号", required = true, example = "1")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract:query')")
|
||||
public CommonResult<OutsContractRespVO> getOutsContract(@RequestParam("id") Long id) {
|
||||
OutsContractRespVO outsContractRespVO = outsContractService.getOutsContract(id);
|
||||
return success(outsContractRespVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得外包合同分页")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract:query')")
|
||||
public CommonResult<PageResult<OutsContractRespVO>> getOutsContractPage(@Valid OutsContractPageReqVO pageReqVO) {
|
||||
PageResult<OutsContractRespVO> pageResult = outsContractService.getOutsContractPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出外包合同 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportOutsContractExcel(@Valid OutsContractPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<OutsContractRespVO> list = outsContractService.getOutsContractPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "外包合同.xls", "数据", OutsContractRespVO.class,
|
||||
BeanUtils.toBean(list, OutsContractRespVO.class));
|
||||
}
|
||||
}
|
@@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OutsContractPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "项目id", example = "27415")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "合同名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "主合同id", example = "19816")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "类型", example = "2")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "合同金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "专业")
|
||||
private String major;
|
||||
|
||||
@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;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class OutsContractRespVO {
|
||||
|
||||
@Schema(description = "合同名称", example = "张三")
|
||||
@ExcelProperty("合同名称")
|
||||
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 = "外包合同编号")
|
||||
@ExcelProperty("编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "外包单位")
|
||||
@ExcelProperty("外包单位")
|
||||
private String outsCompany;
|
||||
|
||||
@Schema(description = "主合同id", example = "19816")
|
||||
@ExcelProperty("主合同id")
|
||||
private Long contractId;
|
||||
|
||||
|
||||
@Schema(description = "外包合同类型", example = "2")
|
||||
@ExcelProperty(value = "外包合同类型", converter = DictConvert.class)
|
||||
@DictFormat("contract_billing_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "外包合同总额")
|
||||
@ExcelProperty("外包合同总额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "专业")
|
||||
@ExcelProperty(value = "专业", converter = DictConvert.class)
|
||||
@DictFormat("major") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String major;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@ExcelProperty("签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "结算数")
|
||||
@ExcelProperty("结算数")
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("合同文件url")
|
||||
private String contractFileUrl;
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,82 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同新增/修改 Request VO")
|
||||
@Data
|
||||
public class OutsContractSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2034")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "27415")
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
|
||||
@Schema(description = "合同名称", example = "张三")
|
||||
@ExcelProperty("合同名称")
|
||||
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 amount;
|
||||
|
||||
@Schema(description = "外包合同编号")
|
||||
@ExcelProperty("编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "外包单位")
|
||||
@ExcelProperty("外包单位")
|
||||
private String outsCompany;
|
||||
|
||||
@Schema(description = "主合同id", example = "19816")
|
||||
@ExcelProperty("主合同id")
|
||||
private Long contractId;
|
||||
|
||||
|
||||
@Schema(description = "外包合同类型", example = "2")
|
||||
@ExcelProperty(value = "外包合同类型", converter = DictConvert.class)
|
||||
@DictFormat("contract_billing_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String countType;
|
||||
|
||||
|
||||
@Schema(description = "外包合同金额")
|
||||
@ExcelProperty("外包合同金额")
|
||||
private BigDecimal outsAmount;
|
||||
|
||||
|
||||
@Schema(description = "专业")
|
||||
@ExcelProperty(value = "专业", converter = DictConvert.class)
|
||||
@DictFormat("major") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String major;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@ExcelProperty("签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "结算数")
|
||||
@ExcelProperty("结算数")
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("合同文件url")
|
||||
private String contractFileUrl;
|
||||
|
||||
}
|
@@ -0,0 +1,76 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
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.OutsContractHistoryRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistorySaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.service.outscontracthistory.OutsContractHistoryService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 外包合同历史")
|
||||
@RestController
|
||||
@RequestMapping("/cms/outs-contract-history")
|
||||
@Validated
|
||||
public class OutsContractHistoryController {
|
||||
|
||||
@Resource
|
||||
private OutsContractHistoryService outsContractHistoryService;
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新外包合同历史")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:update')")
|
||||
public CommonResult<Boolean> updateOutsContractHistory(@Valid @RequestBody OutsContractHistorySaveReqVO updateReqVO) {
|
||||
outsContractHistoryService.updateOutsContractHistory(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得外包合同历史")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:query')")
|
||||
public CommonResult<OutsContractHistoryRespVO> getOutsContractHistory(@RequestParam("id") Long id) {
|
||||
OutsContractHistoryRespVO outsContractHistory = outsContractHistoryService.getOutsContractHistory(id);
|
||||
return success(outsContractHistory);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得外包合同历史分页")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:query')")
|
||||
public CommonResult<PageResult<OutsContractHistoryRespVO>> getOutsContractHistoryPage(@Valid OutsContractHistoryPageReqVO pageReqVO) {
|
||||
PageResult<OutsContractHistoryRespVO> pageResult = outsContractHistoryService.getOutsContractHistoryPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出外包合同历史 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportOutsContractHistoryExcel(@Valid OutsContractHistoryPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<OutsContractHistoryRespVO> list = outsContractHistoryService.getOutsContractHistoryPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "外包合同历史.xls", "数据", OutsContractHistoryRespVO.class,
|
||||
BeanUtils.toBean(list, OutsContractHistoryRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同历史分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OutsContractHistoryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "项目id", example = "31803")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "合同名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "主合同id", example = "19949")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "专业")
|
||||
private String major;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "外包合同id", example = "24736")
|
||||
private Long outsContractId;
|
||||
|
||||
@Schema(description = "版本")
|
||||
private String version;
|
||||
|
||||
}
|
@@ -0,0 +1,85 @@
|
||||
package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同历史 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class OutsContractHistoryRespVO {
|
||||
|
||||
@Schema(description = "合同名称", example = "张三")
|
||||
@ExcelProperty("合同名称")
|
||||
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")
|
||||
@ExcelProperty("主合同id")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
@ExcelProperty(value = "类型", converter = DictConvert.class)
|
||||
@DictFormat("contract_billing_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "合同金额")
|
||||
@ExcelProperty("合同金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "编号")
|
||||
@ExcelProperty("编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "专业")
|
||||
@ExcelProperty(value = "专业", converter = DictConvert.class)
|
||||
@DictFormat("major") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String major;
|
||||
|
||||
@Schema(description = "流程实体id", example = "32397")
|
||||
@ExcelProperty("流程实体id")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
@ExcelProperty("签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "结算数")
|
||||
@ExcelProperty("结算数")
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("合同文件url")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
@ExcelProperty("流程状态")
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "外包合同id", example = "24736")
|
||||
@ExcelProperty("外包合同id")
|
||||
private Long outsContractId;
|
||||
|
||||
@Schema(description = "版本")
|
||||
@ExcelProperty("版本")
|
||||
private String version;
|
||||
|
||||
}
|
@@ -0,0 +1,77 @@
|
||||
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 jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 外包合同历史新增/修改 Request VO")
|
||||
@Data
|
||||
public class OutsContractHistorySaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16040")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31803")
|
||||
@NotNull(message = "项目id不能为空")
|
||||
private Long projectId;
|
||||
|
||||
|
||||
@Schema(description = "合同名称", example = "张三")
|
||||
@ExcelProperty("合同名称")
|
||||
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")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
private String countType;
|
||||
|
||||
@Schema(description = "合同金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "专业")
|
||||
private String major;
|
||||
|
||||
@Schema(description = "流程实体id", example = "32397")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "签订时间")
|
||||
private LocalDateTime signingTime;
|
||||
|
||||
@Schema(description = "结算数")
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||
private String contractFileUrl;
|
||||
|
||||
@Schema(description = "流程状态", example = "2")
|
||||
private String processStatus;
|
||||
|
||||
@Schema(description = "外包合同id", example = "24736")
|
||||
private Long outsContractId;
|
||||
|
||||
@Schema(description = "版本")
|
||||
private String version;
|
||||
|
||||
}
|
@@ -0,0 +1,136 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.contract;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 合同 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("cms_contract")
|
||||
@KeySequence("cms_contract_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ContractDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 合同进展
|
||||
*/
|
||||
private String progress;
|
||||
/**
|
||||
* 合同拟定时间
|
||||
*/
|
||||
private LocalDateTime expectedTime;
|
||||
/**
|
||||
* 合同用印时间
|
||||
*/
|
||||
private LocalDateTime printingTime;
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
private LocalDateTime signingTime;
|
||||
/**
|
||||
* 归档时间
|
||||
*/
|
||||
private LocalDateTime archiveTime;
|
||||
/**
|
||||
* 合同状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 计费方式
|
||||
*/
|
||||
private String countType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 合同url
|
||||
*/
|
||||
private String contractFileUrl;
|
||||
/**
|
||||
* 建安费
|
||||
*/
|
||||
private BigDecimal constructionCost;
|
||||
/**
|
||||
* 资金来源
|
||||
*/
|
||||
private String source;
|
||||
/**
|
||||
* 优惠
|
||||
*/
|
||||
private String discount;
|
||||
/**
|
||||
* 是否联合体
|
||||
*/
|
||||
private Boolean consortium;
|
||||
/**
|
||||
* 联合体单位
|
||||
*/
|
||||
private String consortiumCompany;
|
||||
/**
|
||||
* 占主合同比例
|
||||
*/
|
||||
private String extProportion;
|
||||
/**
|
||||
* 审定金额
|
||||
*/
|
||||
private BigDecimal approvedAmount;
|
||||
/**
|
||||
* 审核文件url
|
||||
*/
|
||||
private String reviewFileUrl;
|
||||
/**
|
||||
* 签订合同总额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 前期费
|
||||
*/
|
||||
private BigDecimal preAmount;
|
||||
/**
|
||||
* 设计费
|
||||
*/
|
||||
private BigDecimal designAmount;
|
||||
/**
|
||||
* 勘测费
|
||||
*/
|
||||
private BigDecimal surveyFees;
|
||||
/**
|
||||
* 测量费
|
||||
*/
|
||||
private BigDecimal measurementFee;
|
||||
/**
|
||||
* 其他费
|
||||
*/
|
||||
private BigDecimal otherFee;
|
||||
|
||||
}
|
@@ -0,0 +1,151 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.contractHistory;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 历史合同 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("cms_contract_history")
|
||||
@KeySequence("cms_contract_history_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ContractHistoryDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 流程实体id
|
||||
*/
|
||||
private String processInstanceId;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 合同进展
|
||||
*/
|
||||
private String progress;
|
||||
/**
|
||||
* 合同拟定时间
|
||||
*/
|
||||
private LocalDateTime expectedTime;
|
||||
/**
|
||||
* 合同用印时间
|
||||
*/
|
||||
private LocalDateTime printingTime;
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
private LocalDateTime signingTime;
|
||||
/**
|
||||
* 归档时间
|
||||
*/
|
||||
private LocalDateTime archiveTime;
|
||||
/**
|
||||
* 合同状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 计费方式
|
||||
*/
|
||||
private String countType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 合同url
|
||||
*/
|
||||
private String contractFileUrl;
|
||||
/**
|
||||
* 建安费
|
||||
*/
|
||||
private BigDecimal constructionCost;
|
||||
/**
|
||||
* 资金来源
|
||||
*/
|
||||
private String source;
|
||||
/**
|
||||
* 优惠
|
||||
*/
|
||||
private String discount;
|
||||
/**
|
||||
* 是否联合体
|
||||
*/
|
||||
private Boolean consortium;
|
||||
/**
|
||||
* 联合体单位
|
||||
*/
|
||||
private String consortiumCompany;
|
||||
/**
|
||||
* 占主合同比例
|
||||
*/
|
||||
private String extProportion;
|
||||
/**
|
||||
* 审定金额
|
||||
*/
|
||||
private BigDecimal approvedAmount;
|
||||
/**
|
||||
* 审核文件url
|
||||
*/
|
||||
private String reviewFileUrl;
|
||||
/**
|
||||
* 签订合同总额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 前期费
|
||||
*/
|
||||
private BigDecimal preAmount;
|
||||
/**
|
||||
* 设计费
|
||||
*/
|
||||
private BigDecimal designAmount;
|
||||
/**
|
||||
* 勘测费
|
||||
*/
|
||||
private BigDecimal surveyFees;
|
||||
/**
|
||||
* 测量费
|
||||
*/
|
||||
private BigDecimal measurementFee;
|
||||
/**
|
||||
* 其他费
|
||||
*/
|
||||
private BigDecimal otherFee;
|
||||
/**
|
||||
* 流程状态
|
||||
*/
|
||||
private String processStatus;
|
||||
/**
|
||||
* 合同
|
||||
*/
|
||||
private Long contractId;
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
private String version;
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.contractouts;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 外包合同关联 DO
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@TableName("cms_contract_outs")
|
||||
@KeySequence("cms_contract_outs_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ContractOutsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 合同id
|
||||
*/
|
||||
private Long contractId;
|
||||
/**
|
||||
* 外包合同id
|
||||
*/
|
||||
private Long outsContractId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updater;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
private String tenantId;
|
||||
}
|
@@ -1,9 +1,6 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
|
@@ -0,0 +1,143 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.extContract;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 外部合同 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("cms_ext_contract")
|
||||
@KeySequence("cms_ext_contract_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ExtContractDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 合同类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 客户公司id
|
||||
*/
|
||||
private Long customerCompanyId;
|
||||
/**
|
||||
* 合同进展
|
||||
*/
|
||||
private String progress;
|
||||
/**
|
||||
* 预计签订时间
|
||||
*/
|
||||
private LocalDateTime expectedTime;
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
private LocalDateTime signingTime;
|
||||
/**
|
||||
* 归档时间
|
||||
*/
|
||||
private LocalDateTime archiveTime;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 前期费用
|
||||
*/
|
||||
private BigDecimal preAmount;
|
||||
/**
|
||||
* 设计费
|
||||
*/
|
||||
private BigDecimal designFee;
|
||||
/**
|
||||
* 勘测费
|
||||
*/
|
||||
private BigDecimal surveyFees;
|
||||
/**
|
||||
* 检测费
|
||||
*/
|
||||
private BigDecimal testingFee;
|
||||
/**
|
||||
* 其他费
|
||||
*/
|
||||
private String otherFee;
|
||||
/**
|
||||
* 计费方式
|
||||
*/
|
||||
private String countType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 合同附件url
|
||||
*/
|
||||
private String contractFileUrl;
|
||||
/**
|
||||
* 建安费
|
||||
*/
|
||||
private BigDecimal constructionCost;
|
||||
/**
|
||||
* 资金来源
|
||||
*/
|
||||
private String source;
|
||||
/**
|
||||
* 收费标准
|
||||
*/
|
||||
private String chargingStandard;
|
||||
/**
|
||||
* 优惠
|
||||
*/
|
||||
private String discount;
|
||||
/**
|
||||
* 是否联合体
|
||||
*/
|
||||
private Boolean consortium;
|
||||
/**
|
||||
* 联合体单位
|
||||
*/
|
||||
private String consortiumCompany;
|
||||
|
||||
/**
|
||||
* 审定金额
|
||||
*/
|
||||
private BigDecimal approvedAmount;
|
||||
/**
|
||||
* 审核文件url
|
||||
*/
|
||||
private String reviewFileUrl;
|
||||
/**
|
||||
* 合同id
|
||||
*/
|
||||
private Long contractId;
|
||||
|
||||
/**
|
||||
* 分包合同提示时间
|
||||
*/
|
||||
private LocalDateTime reminderTime;
|
||||
|
||||
}
|
@@ -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;
|
||||
|
||||
}
|
@@ -0,0 +1,77 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.outscontract;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 外包合同 DO
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@TableName("cms_outs_contract")
|
||||
@KeySequence("cms_outs_contract_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OutsContractDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 主合同id
|
||||
*/
|
||||
private Long contractId;
|
||||
/**
|
||||
* 类型
|
||||
*
|
||||
* 枚举 //// TODO 搞成枚举
|
||||
*/
|
||||
private String countType;
|
||||
/**
|
||||
* 外包合同金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 专业
|
||||
*
|
||||
* 枚举 // TODO 搞成枚举
|
||||
*/
|
||||
private String major;
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
private LocalDateTime signingTime;
|
||||
/**
|
||||
* 结算数
|
||||
*/
|
||||
private BigDecimal settlementAmount;
|
||||
/**
|
||||
* 合同文件url
|
||||
*/
|
||||
private String contractFileUrl;
|
||||
|
||||
}
|
@@ -0,0 +1,94 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 外包合同历史 DO
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@TableName("cms_outs_contract_history")
|
||||
@KeySequence("cms_outs_contract_history_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OutsContractHistoryDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 主合同id
|
||||
*/
|
||||
private Long contractId;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*
|
||||
* 枚举 {@link // TODO contract_billing_type 对应的类}
|
||||
*/
|
||||
private String countType;
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 专业
|
||||
*
|
||||
* 枚举 {@link //TODO major 对应的类}
|
||||
*/
|
||||
private String major;
|
||||
/**
|
||||
* 流程实体id
|
||||
*/
|
||||
private String processInstanceId;
|
||||
/**
|
||||
* 签订时间
|
||||
*/
|
||||
private LocalDateTime signingTime;
|
||||
/**
|
||||
* 结算数
|
||||
*/
|
||||
private BigDecimal settlementAmount;
|
||||
/**
|
||||
* 合同文件url
|
||||
*/
|
||||
private String contractFileUrl;
|
||||
/**
|
||||
* 流程状态
|
||||
*/
|
||||
private String processStatus;
|
||||
/**
|
||||
* 外包合同id
|
||||
*/
|
||||
private Long outsContractId;
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
private String version;
|
||||
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.mysql.contract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.*;
|
||||
|
||||
/**
|
||||
* 合同 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContractMapper extends BaseMapperX<ContractDO> {
|
||||
|
||||
default PageResult<ContractDO> selectPage(ContractPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ContractDO>()
|
||||
.likeIfPresent(ContractDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ContractDO::getType, reqVO.getType())
|
||||
.eqIfPresent(ContractDO::getProjectId, reqVO.getProjectId())
|
||||
.eqIfPresent(ContractDO::getProgress, reqVO.getProgress())
|
||||
.eqIfPresent(ContractDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ContractDO::getCountType, reqVO.getCountType())
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.mysql.contractHistory;
|
||||
|
||||
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.contractHistory.ContractHistoryDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo.*;
|
||||
|
||||
/**
|
||||
* 历史合同 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContractHistoryMapper extends BaseMapperX<ContractHistoryDO> {
|
||||
|
||||
default PageResult<ContractHistoryDO> selectPage(ContractHistoryPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ContractHistoryDO>()
|
||||
.eqIfPresent(ContractHistoryDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
||||
.likeIfPresent(ContractHistoryDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ContractHistoryDO::getProjectId,reqVO.getProjectId())
|
||||
.eqIfPresent(ContractHistoryDO::getType, reqVO.getType())
|
||||
.eqIfPresent(ContractHistoryDO::getProgress, reqVO.getProgress())
|
||||
.eqIfPresent(ContractHistoryDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ContractHistoryDO::getCountType, reqVO.getCountType())
|
||||
.eqIfPresent(ContractHistoryDO::getProcessStatus, reqVO.getProcessStatus())
|
||||
.eqIfPresent(ContractHistoryDO::getContractId, reqVO.getContractId()));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.mysql.contractouts;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 外包合同关联 Mapper
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@Mapper
|
||||
public interface ContractOutsMapper extends BaseMapperX<ContractOutsDO> {
|
||||
|
||||
default PageResult<ContractOutsDO> selectPage(ContractOutsPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ContractOutsDO>()
|
||||
.eqIfPresent(ContractOutsDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(ContractOutsDO::getOutsContractId, reqVO.getOutsContractId())
|
||||
.orderByDesc(ContractOutsDO::getId));
|
||||
}
|
||||
|
||||
}
|
@@ -20,15 +20,10 @@ public interface CustomerCompanyMapper extends BaseMapperX<CustomerCompanyDO> {
|
||||
default PageResult<CustomerCompanyDO> selectPage(CustomerCompanyPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<CustomerCompanyDO>()
|
||||
.likeIfPresent(CustomerCompanyDO::getContacts, reqVO.getContacts())
|
||||
.eqIfPresent(CustomerCompanyDO::getCreateTime, reqVO.getCreateTime())
|
||||
.likeIfPresent(CustomerCompanyDO::getName, reqVO.getName())
|
||||
.eqIfPresent(CustomerCompanyDO::getAddress, reqVO.getAddress())
|
||||
.eqIfPresent(CustomerCompanyDO::getPhone, reqVO.getPhone())
|
||||
.orderByDesc(CustomerCompanyDO::getId));
|
||||
}
|
||||
|
||||
default List<CustomerCompanyDO> selectList(CustomerCompanyPageReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<CustomerCompanyDO>());
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.mysql.extContract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.extContract.ExtContractDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 外部合同 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExtContractMapper extends BaseMapperX<ExtContractDO> {
|
||||
|
||||
default PageResult<ExtContractDO> selectPage(ExtContractPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ExtContractDO>()
|
||||
.likeIfPresent(ExtContractDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ExtContractDO::getType, reqVO.getType())
|
||||
.eqIfPresent(ExtContractDO::getCustomerCompanyId, reqVO.getCustomerCompanyId())
|
||||
.eqIfPresent(ExtContractDO::getProgress, reqVO.getProgress())
|
||||
.eqIfPresent(ExtContractDO::getStatus, reqVO.getStatus())
|
||||
.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()));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.mysql.outscontract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 外包合同 Mapper
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@Mapper
|
||||
public interface OutsContractMapper extends BaseMapperX<OutsContractDO> {
|
||||
|
||||
default PageResult<OutsContractDO> selectPage(OutsContractPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<OutsContractDO>()
|
||||
.eqIfPresent(OutsContractDO::getProjectId, reqVO.getProjectId())
|
||||
.likeIfPresent(OutsContractDO::getName, reqVO.getName())
|
||||
.eqIfPresent(OutsContractDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(OutsContractDO::getCountType, reqVO.getCountType())
|
||||
.eqIfPresent(OutsContractDO::getAmount, reqVO.getAmount())
|
||||
.eqIfPresent(OutsContractDO::getCode, reqVO.getCode())
|
||||
.eqIfPresent(OutsContractDO::getMajor, reqVO.getMajor())
|
||||
.betweenIfPresent(OutsContractDO::getSigningTime, reqVO.getSigningTime())
|
||||
.eqIfPresent(OutsContractDO::getSettlementAmount, reqVO.getSettlementAmount())
|
||||
.eqIfPresent(OutsContractDO::getContractFileUrl, reqVO.getContractFileUrl())
|
||||
.orderByDesc(OutsContractDO::getId));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.cms.dal.mysql.outscontracthistory;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 外包合同历史 Mapper
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@Mapper
|
||||
public interface OutsContractHistoryMapper extends BaseMapperX<OutsContractHistoryDO> {
|
||||
|
||||
default PageResult<OutsContractHistoryDO> selectPage(OutsContractHistoryPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<OutsContractHistoryDO>()
|
||||
.eqIfPresent(OutsContractHistoryDO::getProjectId, reqVO.getProjectId())
|
||||
.likeIfPresent(OutsContractHistoryDO::getName, reqVO.getName())
|
||||
.eqIfPresent(OutsContractHistoryDO::getContractId, reqVO.getContractId())
|
||||
.eqIfPresent(OutsContractHistoryDO::getCountType, reqVO.getCountType())
|
||||
.eqIfPresent(OutsContractHistoryDO::getMajor, reqVO.getMajor())
|
||||
.eqIfPresent(OutsContractHistoryDO::getProcessStatus, reqVO.getProcessStatus())
|
||||
.eqIfPresent(OutsContractHistoryDO::getOutsContractId, reqVO.getOutsContractId())
|
||||
.eqIfPresent(OutsContractHistoryDO::getVersion, reqVO.getVersion()));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,76 @@
|
||||
package cn.iocoder.yudao.module.cms.service.contract;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contract.vo.*;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 合同 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface ContractService {
|
||||
|
||||
/**
|
||||
* 创建合同
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createContract(Long loginUserId,@Valid ContractSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新合同
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateContract(Long loginUserId,@Valid ContractSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除合同
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteContract(Long id);
|
||||
|
||||
/**
|
||||
* 获得合同
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 合同
|
||||
*/
|
||||
ContractRespVO getContract(Long id);
|
||||
|
||||
/**
|
||||
* 获得合同分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 合同分页
|
||||
*/
|
||||
PageResult<ContractRespVO> getContractPage(ContractPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 通过id获得暂定结算金额
|
||||
* @param id 合同编号
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getProvisionalSettlementById(Long id);
|
||||
|
||||
/**
|
||||
* 通过输入的合同获得暂定结算金额
|
||||
* @param contractSaveReqVO
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getProvisionalSettlement(ContractSaveReqVO contractSaveReqVO);
|
||||
|
||||
/**
|
||||
* 判断合同是否存在
|
||||
* @param id 合同id
|
||||
*/
|
||||
void validateContractExists(Long id);
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,308 @@
|
||||
package cn.iocoder.yudao.module.cms.service.contract;
|
||||
|
||||
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.contractHistory.ContractHistoryMapper;
|
||||
import cn.iocoder.yudao.module.pms.api.project.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 cn.iocoder.yudao.module.cms.controller.admin.contract.vo.*;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contract.ContractDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
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 ContractServiceImpl implements ContractService {
|
||||
|
||||
/**
|
||||
* 合同立项审批流程定义
|
||||
*/
|
||||
public static final String PROCESS_KEY = "contract_init";
|
||||
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
public static String VERSION = "1";
|
||||
|
||||
@Resource
|
||||
private ContractMapper contractMapper;
|
||||
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceApi processInstanceApi;
|
||||
|
||||
@Resource
|
||||
private ContractHistoryMapper contractHistoryMapper;
|
||||
|
||||
@Override
|
||||
public Long createContract(Long loginUserId, ContractSaveReqVO createReqVO) {
|
||||
|
||||
if (loginUserId == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
if (userName == null) {
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
|
||||
|
||||
//校验,项目是否存在
|
||||
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.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);
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateContract(Long loginUserId, ContractSaveReqVO updateReqVO) {
|
||||
//校验
|
||||
validateContractExists(updateReqVO.getId());
|
||||
projectApi.validProjectExist(updateReqVO.getProjectId());
|
||||
// 更新
|
||||
ContractDO updateObj = BeanUtils.toBean(updateReqVO, ContractDO.class);
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
if (userName == null) {
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
updateObj.setUpdater(userName);
|
||||
contractMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteContract(Long id) {
|
||||
// 校验存在
|
||||
validateContractExists(id);
|
||||
// 删除
|
||||
contractMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ContractRespVO getContract(Long id) {
|
||||
//校验
|
||||
if (id == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
ContractDO contractDO = contractMapper.selectById(id);
|
||||
if (contractDO == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Long projectId = contractDO.getProjectId();
|
||||
|
||||
if (projectId == null) {
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
ContractRespVO contractRespVO = BeanUtils.toBean(contractDO, ContractRespVO.class);
|
||||
|
||||
// 需要联表查询
|
||||
// 1.项目编号 pms_project 直接 √
|
||||
// 2.主控部门(跟踪部门) pms_project找到的是id 需要联表 √
|
||||
// 3.项目经理 pms_project找到的是id 需要联表 √
|
||||
// 4.出图公司 pms_project 直接 √
|
||||
// 5.预计合同金额 pms_project 直接 √
|
||||
// 6.分包合同商议提示 √
|
||||
// 7.暂定结算数 √
|
||||
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
contractRespVO.setCode(project.getCode());
|
||||
contractRespVO.setDrawingCompany(project.getDrawingCompany());
|
||||
contractRespVO.setExpectedContractAmount(project.getContractAmount());
|
||||
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||
contractRespVO.setTrackingDep(projectDetail.getTrackingDepName());
|
||||
contractRespVO.setProjectManager(projectDetail.getProjectManagerName());
|
||||
|
||||
//分包合同商议提示 TODO 待优化
|
||||
// ExtContractDO extContractDO = extContractMapper.selectOne("project_id", projectId);
|
||||
// LocalDateTime reminderTime = extContractDO.getReminderTime();
|
||||
contractRespVO.setReminderTime(null);
|
||||
|
||||
//暂定结算数
|
||||
BigDecimal provisionalSettlement = getProvisionalSettlementById(id);
|
||||
contractRespVO.setProvisionalSettlement(provisionalSettlement);
|
||||
|
||||
|
||||
return contractRespVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ContractRespVO> getContractPage(ContractPageReqVO 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<ContractDO> contractDOPageResult = contractMapper.selectPage(pageReqVO);
|
||||
List<ContractDO> contractDOList = contractDOPageResult.getList();
|
||||
List<ContractRespVO> contractRespVOList = new ArrayList<>();
|
||||
|
||||
|
||||
for (ContractDO contractDO : contractDOList) {
|
||||
Long id = contractDO.getId();
|
||||
ContractRespVO contract = getContract(id);
|
||||
contractRespVOList.add(contract);
|
||||
}
|
||||
PageResult<ContractRespVO> pageResult = new PageResult<>();
|
||||
pageResult.setList(contractRespVOList);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getProvisionalSettlementById(Long id) {
|
||||
ContractDO contractDO = contractMapper.selectById(id);
|
||||
String type = contractDO.getCountType();
|
||||
BigDecimal amount = contractDO.getAmount();
|
||||
BigDecimal bigDecimal = new BigDecimal(String.valueOf(amount));
|
||||
BigDecimal mul = new BigDecimal("0.85");
|
||||
BigDecimal res = null;
|
||||
if ("费率合同".equals(type)) {
|
||||
res = bigDecimal.multiply(mul);
|
||||
} else if ("总价合同".equals(type)) {
|
||||
res = amount;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@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
|
||||
public void validateContractExists(Long id) {
|
||||
if (contractMapper.selectById(id) == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.cms.service.contractHistory;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo.*;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractHistory.ContractHistoryDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 历史合同 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface ContractHistoryService {
|
||||
|
||||
/**
|
||||
* 更新历史合同
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateContractHistory(Long loginUserId,@Valid ContractHistorySaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 获得历史合同
|
||||
*
|
||||
* @param contractId 现有合同编号
|
||||
* @return 历史合同
|
||||
*/
|
||||
ContractHistoryRespVO getContractHistory(Long contractId);
|
||||
|
||||
/**
|
||||
* 获得历史合同分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 历史合同分页
|
||||
*/
|
||||
PageResult<ContractHistoryRespVO> getContractHistoryPage(ContractHistoryPageReqVO pageReqVO);
|
||||
|
||||
}
|
@@ -0,0 +1,158 @@
|
||||
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.dataobject.contract.ContractDO;
|
||||
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.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 cn.iocoder.yudao.module.cms.controller.admin.contractHistory.vo.*;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractHistory.ContractHistoryDO;
|
||||
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.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.module.cms.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.USER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 历史合同 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ContractHistoryServiceImpl implements cn.iocoder.yudao.module.cms.service.contractHistory.ContractHistoryService {
|
||||
|
||||
@Resource
|
||||
private ContractHistoryMapper contractHistoryMapper;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@Resource
|
||||
private ContractService contractService;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void updateContractHistory(Long loginUserId,ContractHistorySaveReqVO updateReqVO) {
|
||||
//校验
|
||||
Long id = updateReqVO.getId();
|
||||
validateContractHistoryExists(id);
|
||||
if (loginUserId == null){
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
Long projectId = updateReqVO.getProjectId();
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
if (project == null){
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
// 更新
|
||||
ContractHistoryDO updateObj = BeanUtils.toBean(updateReqVO, ContractHistoryDO.class);
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
updateObj.setUpdater(userName);
|
||||
contractHistoryMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ContractHistoryRespVO getContractHistory(Long id) {
|
||||
//校验
|
||||
if (id == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
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) {
|
||||
if (contractHistoryMapper.selectById(id) == null) {
|
||||
throw exception(CONTRACT_HISTORY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.cms.service.contractouts;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* 外包合同关联 Service 接口
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
public interface ContractOutsService {
|
||||
|
||||
/**
|
||||
* 创建外包合同关联
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createContractOuts(Long loginUserId ,@Valid ContractOutsSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新外包合同关联
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateContractOuts(Long loginUserId,@Valid ContractOutsSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除外包合同关联
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteContractOuts(Long id);
|
||||
|
||||
/**
|
||||
* 获得外包合同关联
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 外包合同关联
|
||||
*/
|
||||
ContractOutsDO getContractOuts(Long id);
|
||||
|
||||
/**
|
||||
* 获得外包合同关联分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 外包合同关联分页
|
||||
*/
|
||||
PageResult<ContractOutsDO> getContractOutsPage(ContractOutsPageReqVO pageReqVO);
|
||||
|
||||
}
|
@@ -0,0 +1,116 @@
|
||||
package cn.iocoder.yudao.module.cms.service.contractouts;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.contractouts.ContractOutsMapper;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
|
||||
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 zqc
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ContractOutsServiceImpl implements ContractOutsService {
|
||||
|
||||
@Resource
|
||||
private ContractOutsMapper contractOutsMapper;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Override
|
||||
public Long createContractOuts(Long loginUserId, ContractOutsSaveReqVO createReqVO) {
|
||||
ContractOutsDO outsDO = BeanUtils.toBean(createReqVO, ContractOutsDO.class);
|
||||
Long contractId = createReqVO.getContractId();
|
||||
Long outsContractId = createReqVO.getOutsContractId();
|
||||
if (contractId == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
if (outsContractId == null) {
|
||||
throw exception(CONTRACT_OUTS_NOT_EXISTS);
|
||||
}
|
||||
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
//用户不存在
|
||||
if (userName == null || userName.isEmpty()) {
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
//如果这条记录不存在,则创建者就是登陆者,如果存在,只更新更新者,创建者不再改变
|
||||
QueryWrapper<ContractOutsDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("contract_id", contractId);
|
||||
queryWrapper.eq("outs_contract_id", outsContractId);
|
||||
Long count = contractOutsMapper.selectCount(queryWrapper);
|
||||
if (count >= 1) {
|
||||
throw exception(CONTRACT_OUTS_ALREADY_EXISTS);
|
||||
}
|
||||
ContractOutsDO contractOutsDO = contractOutsMapper.selectOne(queryWrapper);
|
||||
|
||||
if (contractOutsDO == null) {
|
||||
outsDO.setCreator(userName);
|
||||
outsDO.setUpdater(userName);
|
||||
}
|
||||
|
||||
// 返回
|
||||
return (long) contractOutsMapper.insert(outsDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateContractOuts(Long loginUserId,ContractOutsSaveReqVO updateReqVO) {
|
||||
|
||||
// 校验存在
|
||||
validateContractOutsExists(updateReqVO.getId());
|
||||
if (loginUserId == null){
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
// 更新
|
||||
ContractOutsDO updateObj = BeanUtils.toBean(updateReqVO, ContractOutsDO.class);
|
||||
//校验
|
||||
ContractOutsDO contractOutsDO = contractOutsMapper.selectById(updateObj.getId());
|
||||
if (contractOutsDO == null) {
|
||||
throw exception(CONTRACT_OUTS_NOT_EXISTS);
|
||||
}
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
updateObj.setUpdater(userName);
|
||||
|
||||
contractOutsMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteContractOuts(Long id) {
|
||||
// 校验存在
|
||||
validateContractOutsExists(id);
|
||||
// 删除
|
||||
contractOutsMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateContractOutsExists(Long id) {
|
||||
if (contractOutsMapper.selectById(id) == null) {
|
||||
throw exception(CONTRACT_OUTS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContractOutsDO getContractOuts(Long id) {
|
||||
return contractOutsMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ContractOutsDO> getContractOutsPage(ContractOutsPageReqVO pageReqVO) {
|
||||
return contractOutsMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@@ -1,11 +1,9 @@
|
||||
package cn.iocoder.yudao.module.cms.service.customerCompany;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 客户公司 Service 接口
|
||||
@@ -52,10 +50,4 @@ public interface CustomerCompanyService {
|
||||
*/
|
||||
PageResult<CustomerCompanyDO> getCustomerCompanyPage(CustomerCompanyPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得客户公司列表
|
||||
* @param reqVO 查询参数
|
||||
* @return 列表信息
|
||||
*/
|
||||
List<CustomerCompanyDO> getCustomerCompanyList(CustomerCompanyPageReqVO reqVO);
|
||||
}
|
@@ -3,13 +3,10 @@ package cn.iocoder.yudao.module.cms.service.customerCompany;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper;
|
||||
@@ -71,9 +68,4 @@ public class CustomerCompanyServiceImpl implements CustomerCompanyService {
|
||||
return customerCompanyMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CustomerCompanyDO> getCustomerCompanyList(CustomerCompanyPageReqVO reqVO) {
|
||||
return customerCompanyMapper.selectList(reqVO);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.cms.service.extContract;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.extContract.vo.ExtContractSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 外部合同 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface ExtContractService {
|
||||
|
||||
/**
|
||||
* 创建外部合同
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createExtContract(Long loginUserId,@Valid ExtContractSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新外部合同
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateExtContract(Long loginUserId,@Valid ExtContractSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除外部合同
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteExtContract(Long id);
|
||||
|
||||
/**
|
||||
* 获得外部合同
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 外部合同
|
||||
*/
|
||||
ExtContractRespVO getExtContract(Long id);
|
||||
|
||||
/**
|
||||
* 获得外部合同分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 外部合同分页
|
||||
*/
|
||||
PageResult<ExtContractRespVO> getExtContractPage(ExtContractPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 合同总金额
|
||||
* @param id 通过id计算
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getContractAmountById(Long id);
|
||||
/**
|
||||
* 合同总金额
|
||||
* @param createReqVO 通过对象计算
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getContractAmount(ExtContractSaveReqVO createReqVO);
|
||||
}
|
@@ -0,0 +1,315 @@
|
||||
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.ExtContractRespVO;
|
||||
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.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.extContract.ExtContractMapper;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.extcontracthistory.ExtContractHistoryMapper;
|
||||
import cn.iocoder.yudao.module.pms.api.project.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 cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
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 ExtContractServiceImpl implements ExtContractService {
|
||||
|
||||
/**
|
||||
* 外部合同立项审批流程定义
|
||||
*/
|
||||
public static final String PROCESS_KEY = "ext_contract_init";
|
||||
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
public static String VERSION = "1";
|
||||
|
||||
@Resource
|
||||
private ExtContractMapper extContractMapper;
|
||||
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@Resource
|
||||
private CustomerCompanyMapper customerCompanyMapper;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceApi processInstanceApi;
|
||||
|
||||
@Resource
|
||||
private ExtContractHistoryMapper extContractHistoryMapper;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Long createExtContract(Long loginUserId, ExtContractSaveReqVO createReqVO) {
|
||||
|
||||
|
||||
if (createReqVO == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
if (loginUserId == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
if (userName == null) {
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
|
||||
ExtContractDO extContract = BeanUtils.toBean(createReqVO, ExtContractDO.class);
|
||||
//校验
|
||||
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();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExtContract(Long loginUserId, ExtContractSaveReqVO updateReqVO) {
|
||||
//校验
|
||||
if (updateReqVO == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
|
||||
validateExtContractExists(updateReqVO.getId());
|
||||
projectApi.validProjectExist(updateReqVO.getProjectId());
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
if (userName == null) {
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
// 更新
|
||||
ExtContractDO updateObj = BeanUtils.toBean(updateReqVO, ExtContractDO.class);
|
||||
updateObj.setUpdater(userName);
|
||||
extContractMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteExtContract(Long id) {
|
||||
// 校验存在
|
||||
validateExtContractExists(id);
|
||||
// 删除
|
||||
extContractMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
// 需要联表查询
|
||||
// 1.项目编号 pms_project 直接 √
|
||||
// 2.主控部门(跟踪部门) pms_project找到的是id 需要联表 √
|
||||
// 3.项目经理 pms_project找到的是id 需要联表 √
|
||||
// 4.客户公司名称 pms_project 联表 √
|
||||
// 5.合同总金额 √
|
||||
// 6.合同商议提示(和分包提示不一样)√
|
||||
@Override
|
||||
public ExtContractRespVO getExtContract(Long id) {
|
||||
//校验
|
||||
if (id == null) {
|
||||
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
ExtContractDO extContractDO = extContractMapper.selectById(id);
|
||||
if (extContractDO == null) {
|
||||
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Long projectId = extContractDO.getProjectId();
|
||||
if (projectApi.getProject(projectId) == null) {
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Long customerCompanyId = extContractDO.getCustomerCompanyId();
|
||||
ExtContractRespVO extContractRespVO = BeanUtils.toBean(extContractDO, ExtContractRespVO.class);
|
||||
|
||||
|
||||
ProjectRespDTO project = projectApi.getProject(projectId);
|
||||
extContractRespVO.setCode(project.getCode());
|
||||
|
||||
ProjectDetailRespDTO projectDetail = projectApi.getProjectDetailById(projectId);
|
||||
extContractRespVO.setTrackingDep(projectDetail.getTrackingDepName());
|
||||
extContractRespVO.setProjectManager(projectDetail.getProjectManagerName());
|
||||
|
||||
//用客户公司id查询
|
||||
CustomerCompanyDO customerCompanyDO = customerCompanyMapper.selectById(customerCompanyId);
|
||||
String name = customerCompanyDO.getName();
|
||||
extContractRespVO.setCustomerCompanyName(name);
|
||||
|
||||
|
||||
//合同总金额
|
||||
|
||||
BigDecimal contractAmount = getContractAmountById(id);
|
||||
extContractRespVO.setAmount(contractAmount);
|
||||
|
||||
//合同商议提示 // TODO 待优化
|
||||
extContractRespVO.setExReminderTime(null);
|
||||
|
||||
return extContractRespVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ExtContractRespVO> getExtContractPage(ExtContractPageReqVO pageReqVO) {
|
||||
if (pageReqVO == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
|
||||
PageResult<ExtContractDO> extContractDOPageResult = extContractMapper.selectPage(pageReqVO);
|
||||
List<ExtContractDO> excontractDOList = extContractDOPageResult.getList();
|
||||
List<ExtContractRespVO> extContractRespVOList = new ArrayList<>();
|
||||
|
||||
|
||||
for (ExtContractDO extContractDO : excontractDOList) {
|
||||
Long id = extContractDO.getId();
|
||||
ExtContractRespVO extContractRespVO = getExtContract(id);
|
||||
extContractRespVOList.add(extContractRespVO);
|
||||
}
|
||||
PageResult<ExtContractRespVO> pageResult = new PageResult<>();
|
||||
pageResult.setList(extContractRespVOList);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getContractAmountById(Long id) {
|
||||
//前期+设计+地勘+其他+检测
|
||||
ExtContractDO extContract = extContractMapper.selectById(id);
|
||||
BigDecimal preAmount = new BigDecimal(String.valueOf(extContract.getPreAmount()));
|
||||
BigDecimal designFee = new BigDecimal(String.valueOf(extContract.getDesignFee()));
|
||||
BigDecimal surveyFees = new BigDecimal(String.valueOf(extContract.getSurveyFees()));
|
||||
BigDecimal testingFee = new BigDecimal(String.valueOf(extContract.getTestingFee()));
|
||||
BigDecimal other = new BigDecimal(extContract.getOtherFee());
|
||||
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) {
|
||||
if (extContractMapper.selectById(id) == null) {
|
||||
throw exception(EXT_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -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.project.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);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.cms.service.outscontract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
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.OutsContractRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractSaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 外包合同 Service 接口
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
public interface OutsContractService {
|
||||
|
||||
/**
|
||||
* 创建外包合同
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createOutsContract(Long loginUserId,@Valid OutsContractSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新外包合同
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateOutsContract(Long loginUserId,@Valid OutsContractSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除外包合同
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteOutsContract(Long id);
|
||||
|
||||
/**
|
||||
* 获得外包合同
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 外包合同
|
||||
*/
|
||||
OutsContractRespVO getOutsContract(Long id);
|
||||
|
||||
/**
|
||||
* 获得外包合同分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 外包合同分页
|
||||
*/
|
||||
PageResult<OutsContractRespVO> getOutsContractPage(OutsContractPageReqVO pageReqVO);
|
||||
|
||||
}
|
@@ -0,0 +1,261 @@
|
||||
package cn.iocoder.yudao.module.cms.service.outscontract;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
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.outscontract.vo.OutsContractPageReqVO;
|
||||
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.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.outscontracthistory.OutsContractHistoryMapper;
|
||||
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.dto.ProjectRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
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 zqc
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class OutsContractServiceImpl implements OutsContractService {
|
||||
|
||||
/**
|
||||
* 外包合同立项审批流程定义
|
||||
*/
|
||||
public static final String PROCESS_KEY = "outs_contract_init";
|
||||
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
public static String VERSION = "1";
|
||||
@Resource
|
||||
private OutsContractMapper outsContractMapper;
|
||||
|
||||
@Resource
|
||||
private ContractService contractService;
|
||||
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceApi processInstanceApi;
|
||||
|
||||
@Resource
|
||||
private OutsContractHistoryMapper outsContractHistoryMapper;
|
||||
|
||||
@Override
|
||||
public Long createOutsContract(Long loginUserId,OutsContractSaveReqVO createReqVO) {
|
||||
|
||||
|
||||
if (createReqVO == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
if (loginUserId == null) {
|
||||
throw exception(PARAM_NOT_EXISTS);
|
||||
}
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
if (userName == null) {
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
OutsContractRespVO outsContractRespVO = BeanUtils.toBean(outsContractDO, OutsContractRespVO.class);
|
||||
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
|
||||
public void updateOutsContract(Long loginUserId,OutsContractSaveReqVO updateReqVO) {
|
||||
// 校验
|
||||
validateOutsContractExists(updateReqVO.getId());
|
||||
|
||||
Long contractId = updateReqVO.getContractId();
|
||||
ContractRespVO contract = contractService.getContract(contractId);
|
||||
if (contract == null) {
|
||||
throw exception(CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
OutsContractDO outsContractDO = outsContractMapper.selectById(updateReqVO.getId());
|
||||
if (!Objects.equals(updateReqVO.getProjectId(), outsContractDO.getProjectId())) {
|
||||
throw exception(PROJECT_NOT_EXISTS);
|
||||
}
|
||||
String userName = adminUserApi.getUser(loginUserId).getNickname();
|
||||
if (userName == null){
|
||||
throw exception(USER_NOT_EXISTS);
|
||||
}
|
||||
// 更新
|
||||
OutsContractDO updateObj = BeanUtils.toBean(updateReqVO, OutsContractDO.class);
|
||||
updateObj.setUpdater(userName);
|
||||
outsContractMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOutsContract(Long id) {
|
||||
// 校验
|
||||
validateOutsContractExists(id);
|
||||
// 删除
|
||||
outsContractMapper.deleteById(id);
|
||||
}
|
||||
|
||||
// 需要联表查询
|
||||
// 1.合同名称 √
|
||||
// 2.主控部门(跟踪部门) √
|
||||
// 3.项目经理 √
|
||||
// 4.签订合同总额 √
|
||||
|
||||
@Override
|
||||
public OutsContractRespVO getOutsContract(Long id) {
|
||||
//校验
|
||||
if (id == null) {
|
||||
throw exception(OUTS_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
OutsContractDO outsContractDO = outsContractMapper.selectById(id);
|
||||
OutsContractRespVO outsContractRespVO = BeanUtils.toBean(outsContractDO, OutsContractRespVO.class);
|
||||
Long contractId = outsContractDO.getContractId();
|
||||
ContractRespVO contract = contractService.getContract(contractId);
|
||||
|
||||
outsContractRespVO.setName(contract.getName());
|
||||
outsContractRespVO.setTrackingDep(contract.getTrackingDep());
|
||||
outsContractRespVO.setProjectManager(contract.getProjectManager());
|
||||
outsContractRespVO.setOutsAmount(contract.getAmount());
|
||||
|
||||
return outsContractRespVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OutsContractRespVO> getOutsContractPage(OutsContractPageReqVO 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<OutsContractDO> outsContractDOPageResult = outsContractMapper.selectPage(pageReqVO);
|
||||
List<OutsContractDO> outsContractDOList = outsContractDOPageResult.getList();
|
||||
List<OutsContractRespVO> outsContractRespVOList = new ArrayList<>();
|
||||
|
||||
|
||||
for (OutsContractDO outsContractDO : outsContractDOList) {
|
||||
Long id = outsContractDO.getId();
|
||||
OutsContractRespVO outsContract = getOutsContract(id);
|
||||
outsContractRespVOList.add(outsContract);
|
||||
}
|
||||
|
||||
PageResult<OutsContractRespVO> pageResult = new PageResult<>();
|
||||
pageResult.setList(outsContractRespVOList);
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
private void validateOutsContractExists(Long id) {
|
||||
if (outsContractMapper.selectById(id) == null) {
|
||||
throw exception(OUTS_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.cms.service.outscontracthistory;
|
||||
|
||||
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.OutsContractHistoryRespVO;
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistorySaveReqVO;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* 外包合同历史 Service 接口
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
public interface OutsContractHistoryService {
|
||||
|
||||
/**
|
||||
* 更新外包合同历史
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateOutsContractHistory(@Valid OutsContractHistorySaveReqVO updateReqVO);
|
||||
|
||||
|
||||
/**
|
||||
* 获得外包合同历史
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 外包合同历史
|
||||
*/
|
||||
OutsContractHistoryRespVO getOutsContractHistory(Long id);
|
||||
|
||||
/**
|
||||
* 获得外包合同历史分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 外包合同历史分页
|
||||
*/
|
||||
PageResult<OutsContractHistoryRespVO> getOutsContractHistoryPage(OutsContractHistoryPageReqVO pageReqVO);
|
||||
|
||||
}
|
@@ -0,0 +1,105 @@
|
||||
package cn.iocoder.yudao.module.cms.service.outscontracthistory;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
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.OutsContractHistoryRespVO;
|
||||
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.mysql.outscontracthistory.OutsContractHistoryMapper;
|
||||
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.dto.ProjectRespDTO;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
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.module.cms.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.PROJECT_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 外包合同历史 Service 实现类
|
||||
*
|
||||
* @author zqc
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class OutsContractHistoryServiceImpl implements OutsContractHistoryService {
|
||||
|
||||
@Resource
|
||||
private OutsContractHistoryMapper outsContractHistoryMapper;
|
||||
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@Resource
|
||||
private ContractService contractService;
|
||||
|
||||
@Override
|
||||
public void updateOutsContractHistory(OutsContractHistorySaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateOutsContractHistoryExists(updateReqVO.getId());
|
||||
// 更新
|
||||
OutsContractHistoryDO updateObj = BeanUtils.toBean(updateReqVO, OutsContractHistoryDO.class);
|
||||
outsContractHistoryMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
private void validateOutsContractHistoryExists(Long id) {
|
||||
if (outsContractHistoryMapper.selectById(id) == null) {
|
||||
throw exception(OUTS_CONTRACT_HISTORY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OutsContractHistoryRespVO getOutsContractHistory(Long 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
|
||||
public PageResult<OutsContractHistoryRespVO> getOutsContractHistoryPage(OutsContractHistoryPageReqVO 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;
|
||||
}
|
||||
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper">
|
||||
<mapper namespace="cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.cms.dal.mysql.contractouts.ContractOutsMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.cms.dal.mysql.extContract.ExtContractMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.cms.dal.mysql.outscontract.OutsContractMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.cms.dal.mysql.outscontracthistory.OutsContractHistoryMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.cms.service.contact;
|
||||
|
||||
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
|
||||
import cn.iocoder.yudao.module.cms.service.contract.ContractService;
|
||||
import cn.iocoder.yudao.module.cms.service.contract.ContractServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@Import(ContractServiceImpl.class)
|
||||
@SpringBootTest(classes = ContractServiceImpl.class)
|
||||
|
||||
public class ContactServiceTest extends BaseDbUnitTest {
|
||||
@Resource
|
||||
private ContractService contractService;
|
||||
|
||||
@Resource
|
||||
private ContractMapper contractMapper;
|
||||
|
||||
|
||||
@Test
|
||||
public void createContact() {
|
||||
}
|
||||
}
|
@@ -1,146 +0,0 @@
|
||||
package cn.iocoder.yudao.module.cms.service.customerCompany;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
|
||||
|
||||
import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*;
|
||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
||||
import cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.hutool.core.util.RandomUtil.*;
|
||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*;
|
||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
|
||||
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*;
|
||||
import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*;
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
/**
|
||||
* {@link CustomerCompanyServiceImpl} 的单元测试类
|
||||
*
|
||||
* @author hhyykk
|
||||
*/
|
||||
@Import(CustomerCompanyServiceImpl.class)
|
||||
public class CustomerCompanyServiceImplTest extends BaseDbUnitTest {
|
||||
|
||||
@Resource
|
||||
private CustomerCompanyServiceImpl customerCompanyService;
|
||||
|
||||
@Resource
|
||||
private CustomerCompanyMapper customerCompanyMapper;
|
||||
|
||||
@Test
|
||||
public void testCreateCustomerCompany_success() {
|
||||
// 准备参数
|
||||
CustomerCompanySaveReqVO createReqVO = randomPojo(CustomerCompanySaveReqVO.class).setId(null);
|
||||
|
||||
// 调用
|
||||
Long customerCompanyId = customerCompanyService.createCustomerCompany(createReqVO);
|
||||
// 断言
|
||||
assertNotNull(customerCompanyId);
|
||||
// 校验记录的属性是否正确
|
||||
CustomerCompanyDO customerCompany = customerCompanyMapper.selectById(customerCompanyId);
|
||||
assertPojoEquals(createReqVO, customerCompany, "id");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateCustomerCompany_success() {
|
||||
// mock 数据
|
||||
CustomerCompanyDO dbCustomerCompany = randomPojo(CustomerCompanyDO.class);
|
||||
customerCompanyMapper.insert(dbCustomerCompany);// @Sql: 先插入出一条存在的数据
|
||||
// 准备参数
|
||||
CustomerCompanySaveReqVO updateReqVO = randomPojo(CustomerCompanySaveReqVO.class, o -> {
|
||||
o.setId(dbCustomerCompany.getId()); // 设置更新的 ID
|
||||
});
|
||||
|
||||
// 调用
|
||||
customerCompanyService.updateCustomerCompany(updateReqVO);
|
||||
// 校验是否更新正确
|
||||
CustomerCompanyDO customerCompany = customerCompanyMapper.selectById(updateReqVO.getId()); // 获取最新的
|
||||
assertPojoEquals(updateReqVO, customerCompany);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateCustomerCompany_notExists() {
|
||||
// 准备参数
|
||||
CustomerCompanySaveReqVO updateReqVO = randomPojo(CustomerCompanySaveReqVO.class);
|
||||
|
||||
// 调用, 并断言异常
|
||||
assertServiceException(() -> customerCompanyService.updateCustomerCompany(updateReqVO), CUSTOMER_COMPANY_NOT_EXISTS);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteCustomerCompany_success() {
|
||||
// mock 数据
|
||||
CustomerCompanyDO dbCustomerCompany = randomPojo(CustomerCompanyDO.class);
|
||||
customerCompanyMapper.insert(dbCustomerCompany);// @Sql: 先插入出一条存在的数据
|
||||
// 准备参数
|
||||
Long id = dbCustomerCompany.getId();
|
||||
|
||||
// 调用
|
||||
customerCompanyService.deleteCustomerCompany(id);
|
||||
// 校验数据不存在了
|
||||
assertNull(customerCompanyMapper.selectById(id));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDeleteCustomerCompany_notExists() {
|
||||
// 准备参数
|
||||
Long id = randomLongId();
|
||||
|
||||
// 调用, 并断言异常
|
||||
assertServiceException(() -> customerCompanyService.deleteCustomerCompany(id), CUSTOMER_COMPANY_NOT_EXISTS);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
|
||||
public void testGetCustomerCompanyPage() {
|
||||
// mock 数据
|
||||
CustomerCompanyDO dbCustomerCompany = randomPojo(CustomerCompanyDO.class, o -> { // 等会查询到
|
||||
o.setContacts(null);
|
||||
o.setCreateTime(null);
|
||||
o.setName(null);
|
||||
o.setAddress(null);
|
||||
o.setPhone(null);
|
||||
});
|
||||
customerCompanyMapper.insert(dbCustomerCompany);
|
||||
// 测试 contacts 不匹配
|
||||
customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setContacts(null)));
|
||||
// 测试 createTime 不匹配
|
||||
customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setCreateTime(null)));
|
||||
// 测试 name 不匹配
|
||||
customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setName(null)));
|
||||
// 测试 address 不匹配
|
||||
customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setAddress(null)));
|
||||
// 测试 phone 不匹配
|
||||
customerCompanyMapper.insert(cloneIgnoreId(dbCustomerCompany, o -> o.setPhone(null)));
|
||||
// 准备参数
|
||||
CustomerCompanyPageReqVO reqVO = new CustomerCompanyPageReqVO();
|
||||
reqVO.setContacts(null);
|
||||
reqVO.setCreateTime(null);
|
||||
reqVO.setName(null);
|
||||
reqVO.setAddress(null);
|
||||
reqVO.setPhone(null);
|
||||
|
||||
// 调用
|
||||
PageResult<CustomerCompanyDO> pageResult = customerCompanyService.getCustomerCompanyPage(reqVO);
|
||||
// 断言
|
||||
assertEquals(1, pageResult.getTotal());
|
||||
assertEquals(1, pageResult.getList().size());
|
||||
assertPojoEquals(dbCustomerCompany, pageResult.getList().get(0));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
<configuration>
|
||||
<!-- 引用 Spring Boot 的 logback 基础配置 -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
|
||||
</configuration>
|
@@ -0,0 +1,3 @@
|
||||
-- 将该删表 SQL 语句,添加到 yudao-module-cms-biz 模块的 test/resources/sql/clean.sql 文件里
|
||||
DELETE
|
||||
FROM "cms_contract";
|
@@ -0,0 +1,39 @@
|
||||
-- 将该建表 SQL 语句,添加到 yudao-module-cms-biz 模块的 test/resources/sql/create_tables.sql 文件里
|
||||
CREATE TABLE IF NOT EXISTS "cms_contract"
|
||||
(
|
||||
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
||||
"project_id" bigint NOT NULL,
|
||||
"name" varchar NOT NULL,
|
||||
"type" varchar NOT NULL,
|
||||
"progress" varchar NOT NULL,
|
||||
"expected_time" varchar NOT NULL,
|
||||
"printing_time" varchar NOT NULL,
|
||||
"signing_time" varchar,
|
||||
"archive_time" varchar,
|
||||
"status" varchar NOT NULL,
|
||||
"count_type" varchar,
|
||||
"remark" varchar,
|
||||
"contract_file_url" varchar,
|
||||
"construction_cost" varchar,
|
||||
"source" varchar,
|
||||
"discount" varchar,
|
||||
"consortium" bit,
|
||||
"consortium_company" varchar,
|
||||
"ext_proportion" varchar,
|
||||
"approved_amount" varchar NOT NULL,
|
||||
"review_file_url" varchar,
|
||||
"creator" varchar DEFAULT '',
|
||||
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updater" varchar DEFAULT '',
|
||||
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
"deleted" bit NOT NULL DEFAULT FALSE,
|
||||
"tenant_id" bigint NOT NULL,
|
||||
"amount" varchar,
|
||||
"pre_amount" varchar,
|
||||
"design_amount" varchar,
|
||||
"survey_fees" varchar,
|
||||
"measurement_fee" varchar,
|
||||
"other_fee" varchar,
|
||||
PRIMARY KEY ("id")
|
||||
) COMMENT '合同';
|
||||
|
@@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.pms.api.budegt;
|
||||
|
||||
import cn.iocoder.yudao.module.pms.api.budegt.dto.BudegtDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.api.budegt.dto.BudegtResDTO;
|
||||
|
||||
public interface BudgetApi {
|
||||
/**
|
||||
* 获得应收款的部分信息
|
||||
*/
|
||||
BudegtResDTO getBudegt(Long id);
|
||||
|
||||
/**
|
||||
* 获得应收款的detail信息
|
||||
*/
|
||||
BudegtDetailRespDTO getBudegtDetail(Long id);
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.pms.api.budegt.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class BudegtDetailRespDTO {
|
||||
/**
|
||||
* 合同管理
|
||||
*/
|
||||
private Long contractId;
|
||||
/**
|
||||
* 预算文件url
|
||||
*/
|
||||
private String budgetFileUrl;
|
||||
/**
|
||||
* 预算外包成本
|
||||
*/
|
||||
private BigDecimal outsourcingCosts;
|
||||
/**
|
||||
* 人力成本
|
||||
*/
|
||||
private BigDecimal laborCosts;
|
||||
/**
|
||||
* 累计人力成本
|
||||
*/
|
||||
private BigDecimal accumulatedLaborCosts;
|
||||
/**
|
||||
* 生产成本
|
||||
*/
|
||||
private BigDecimal productCosts;
|
||||
/**
|
||||
* 累计生产成本
|
||||
*/
|
||||
private BigDecimal accumulatedProductCosts;
|
||||
/**
|
||||
* 财务成本
|
||||
*/
|
||||
private BigDecimal financialCosts;
|
||||
/**
|
||||
* 累计财务成本
|
||||
*/
|
||||
private BigDecimal accumulatedFinancialCosts;
|
||||
/**
|
||||
* 回款情况
|
||||
*/
|
||||
private String collectionSituation;
|
||||
}
|
@@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.pms.api.budegt.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class BudegtResDTO {
|
||||
|
||||
/**
|
||||
* 合同管理
|
||||
*/
|
||||
private Long contractId;
|
||||
/**
|
||||
* 预算文件url
|
||||
*/
|
||||
private String budgetFileUrl;
|
||||
/**
|
||||
* 预算外包成本
|
||||
*/
|
||||
private BigDecimal outsourcingCosts;
|
||||
/**
|
||||
* 人力成本
|
||||
*/
|
||||
private BigDecimal laborCosts;
|
||||
/**
|
||||
* 累计人力成本
|
||||
*/
|
||||
private BigDecimal accumulatedLaborCosts;
|
||||
/**
|
||||
* 生产成本
|
||||
*/
|
||||
private BigDecimal productCosts;
|
||||
/**
|
||||
* 累计生产成本
|
||||
*/
|
||||
private BigDecimal accumulatedProductCosts;
|
||||
/**
|
||||
* 财务成本
|
||||
*/
|
||||
private BigDecimal financialCosts;
|
||||
/**
|
||||
* 累计财务成本
|
||||
*/
|
||||
private BigDecimal accumulatedFinancialCosts;
|
||||
/**
|
||||
* 回款情况
|
||||
*/
|
||||
private String collectionSituation;
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.pms.api.project;
|
||||
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO;
|
||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||
|
||||
public interface ProjectApi {
|
||||
/**
|
||||
* 获得项目部分信息
|
||||
*/
|
||||
ProjectRespDTO getProject(Long projectId);
|
||||
|
||||
/**
|
||||
* 获得项目detail信息
|
||||
*/
|
||||
ProjectDetailRespDTO getProjectDetailById(Long projectId);
|
||||
|
||||
/**
|
||||
* 判断项目是否存在
|
||||
* @param projectId
|
||||
*/
|
||||
void validProjectExist(Long projectId);
|
||||
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.pms.api.project.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProjectDetailRespDTO {
|
||||
|
||||
/**
|
||||
* 跟踪部门
|
||||
*/
|
||||
private String trackingDepName;
|
||||
/**
|
||||
* 项目经理
|
||||
*/
|
||||
private String projectManagerName;
|
||||
|
||||
/**
|
||||
* 客户公司
|
||||
*/
|
||||
private String customerCompanyName;
|
||||
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.pms.api.project.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 项目基本信息 dto
|
||||
*/
|
||||
@Data
|
||||
public class ProjectRespDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 项目编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 出图公司
|
||||
*/
|
||||
private String drawingCompany;
|
||||
|
||||
/**
|
||||
* 跟踪部门id
|
||||
*/
|
||||
private Long trackingDepId;
|
||||
|
||||
/**
|
||||
* 客户公司id
|
||||
*/
|
||||
private Long customerCompanyId;
|
||||
|
||||
/**
|
||||
* 项目经理id
|
||||
*/
|
||||
private Long projectManagerId;
|
||||
|
||||
/**
|
||||
* 预计合同金额
|
||||
*/
|
||||
private BigDecimal contractAmount;
|
||||
|
||||
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user