Compare commits
551 Commits
8e6ae90690
...
0.8.X
| Author | SHA1 | Date | |
|---|---|---|---|
| 451c7afcfd | |||
|
|
49bb8e116f | ||
|
|
d0a85c6d65 | ||
|
|
212b79be56 | ||
|
|
d630920c06 | ||
|
|
41e640c8d1 | ||
| 35d739d183 | |||
| dc2baadcae | |||
| 1258456a81 | |||
| a95bdb5d57 | |||
| 547b045dd4 | |||
| 9ce8807ed6 | |||
| c87418e4ba | |||
| 7cf9f4eca4 | |||
|
|
6e8028c1a0 | ||
|
|
1be7612eb5 | ||
|
|
6e28ba0342 | ||
| 682b939cb9 | |||
| 3acb6d7f54 | |||
|
|
51b27cf536 | ||
|
|
cc42108d4f | ||
| dde1ade8b9 | |||
| ae928692d3 | |||
| 87dd154114 | |||
| 3e36d41176 | |||
|
|
1a3de775c8 | ||
|
|
eadac22094 | ||
|
|
d1af1c28a6 | ||
|
|
91bd71f2f7 | ||
|
|
eef375cc2a | ||
| f0a74c1e1c | |||
| af7b73d29c | |||
|
|
72a9371f5f | ||
|
|
c0e06b6fad | ||
|
|
4278c4eb26 | ||
|
|
a4e889cfaa | ||
| a56a0008b9 | |||
| 50a62bc201 | |||
|
|
bbf2831cc6 | ||
|
|
e4d0422c40 | ||
| 822e635dc2 | |||
| 9b3c39f28f | |||
|
|
93816d5406 | ||
|
|
5a2fe5c519 | ||
| abfd5e2ee6 | |||
| 52be3be1f2 | |||
|
|
16533ae664 | ||
|
|
f617bb884d | ||
| 70251cd9d1 | |||
| ad6eef9543 | |||
|
|
6a79bbf0fe | ||
|
|
f55bb42557 | ||
| bcdecc5b01 | |||
| 038e8544a0 | |||
|
|
b49209bc1a | ||
|
|
93bb094566 | ||
|
|
e42eac9115 | ||
|
|
b5e71223e7 | ||
|
|
b1bf87b611 | ||
|
|
72bc19fab2 | ||
| 19040479dd | |||
| 8839693ccd | |||
| e6eec3c459 | |||
|
|
a21e0059ef | ||
|
|
223c0361ab | ||
| ab8dfb86b2 | |||
| b0ac38c050 | |||
| f164fa5b12 | |||
| 55ae4ad332 | |||
|
|
f343552729 | ||
|
|
ed69b65e96 | ||
| cf4e5b78fc | |||
| 9ef387114d | |||
| 660e8049cd | |||
| 7d65f76923 | |||
| 3ffc96b501 | |||
| 9849e6bfe3 | |||
| e8c1c646a8 | |||
| 2fde9ec993 | |||
| ce09ac9da3 | |||
| 2ab7647bf2 | |||
| a3016a0f70 | |||
| aab6f9e4f1 | |||
|
|
0f054c189d | ||
| ec40ab90ba | |||
| d42c4c5a94 | |||
| eecb7fcae6 | |||
| 5e5c0bae24 | |||
| 85751acc46 | |||
|
|
c922856a08 | ||
|
|
d5d77c53b6 | ||
|
|
32455daf42 | ||
| 827555aa43 | |||
| dde554c081 | |||
| 69f97e1bac | |||
| ca0de0fcd6 | |||
| 157f34fc6e | |||
| 383c180962 | |||
| 09466ad4a7 | |||
|
|
bce8152aff | ||
| 5029d09f09 | |||
| fa30ac37e9 | |||
| 882c329e03 | |||
| de623e5f34 | |||
| 3f02e108e9 | |||
| 56fe7f9e55 | |||
| 053f3ea01e | |||
| 734a83df10 | |||
| 4bea8bdb17 | |||
| 2f01c712e1 | |||
| a0b283a21e | |||
| 6fd30eae7c | |||
| 388d5a10c4 | |||
| 338d205cc6 | |||
| b8d3af67e7 | |||
| ad46667847 | |||
| d03cd926bc | |||
| 00f5abc0db | |||
| a671e1ee5f | |||
| 89e7a9d56a | |||
| b3da00e2e7 | |||
| 6fce4105ab | |||
| 7236e02813 | |||
| d05dd9448a | |||
| d7bf12d880 | |||
| c04f40ad5c | |||
| 5f1aec65c5 | |||
| 8fa94d4918 | |||
| b7d77405b8 | |||
| 1d8274000b | |||
|
|
2812c6b3b1 | ||
| 5d29e92bde | |||
| 10490610d1 | |||
| 6f9db961b4 | |||
| 9bed76e3dc | |||
| cddc3309ad | |||
| 9233d09edc | |||
| 20d598b099 | |||
| 2ff75fdc77 | |||
| 178df9de43 | |||
| c445a01cd9 | |||
| ad25227400 | |||
| aa0f645fc8 | |||
| 62f6362d61 | |||
| ad1fa08561 | |||
| 59956764b0 | |||
| 40de24f3b0 | |||
| 0c8bde49bc | |||
| d9733d057a | |||
| 3b1fc19b2d | |||
|
|
3fcb03ebc3 | ||
| 7aea184a81 | |||
| ad650b9a57 | |||
|
|
450fca0c45 | ||
| c997a4a1a0 | |||
| fe3d55c02b | |||
| 497d9e78fb | |||
| f4c870aa23 | |||
| 64d52f1ecf | |||
| 524f8f3333 | |||
| 81dec034b3 | |||
| 89773b273b | |||
| 8c7483dced | |||
| b93f953327 | |||
| 15b3d65771 | |||
| 719d012c38 | |||
| 29eab97af4 | |||
| 08dec15614 | |||
| d4b5bc7041 | |||
| dbcc28fb80 | |||
| 4a9d811592 | |||
| 70ade4632e | |||
| bc7b9d2454 | |||
| 272b29e54a | |||
| afd4165007 | |||
| ee376f922f | |||
| da01bfaa48 | |||
| 9484b64de7 | |||
| 6af45432b6 | |||
| bc46976b74 | |||
| 6a4775a1e4 | |||
| 356d7e9496 | |||
| 19cfcf0d71 | |||
| 487175e59c | |||
| 78410b13b7 | |||
| 8c7cce90ba | |||
| 59dad19296 | |||
| dbea29eb23 | |||
| fabad206c7 | |||
| 726799ae94 | |||
| 9b0e3f4238 | |||
| 8d2cde4aad | |||
| 2802972df2 | |||
| e326d8df0b | |||
| f70b446282 | |||
| 321d03b192 | |||
| 3d5c0a7281 | |||
| c1f4417d3c | |||
| 88d2d864b2 | |||
| fa333ff557 | |||
| 5a3759b502 | |||
| 601d8c751f | |||
| 09d2fb2dfc | |||
| 3658728acd | |||
| b94b7823e5 | |||
| 097d45b420 | |||
| 66d2b33db5 | |||
| c29f074eae | |||
| b246a2fac7 | |||
| aefee3debb | |||
| bb568bf1d8 | |||
| 5f523158c1 | |||
| 6ebae7fb60 | |||
| 7e028da213 | |||
| 8fa1f0a20b | |||
| 39eaab139e | |||
| 174cd29280 | |||
| dc47a91d0f | |||
| 97c9a3741a | |||
| 40c2f83589 | |||
| 230b18eee6 | |||
| 238e0d2963 | |||
| 395700b8d6 | |||
| c20965406f | |||
| b3dbdaef58 | |||
| ce3998db74 | |||
| d627a72aea | |||
| 16ba2dfa18 | |||
| 289555fd44 | |||
| 1c0b0da99e | |||
| 7e9caf9bb7 | |||
| 86200d189d | |||
| 3277610ff7 | |||
| 143853a87d | |||
| 47931b75ae | |||
| e084e56841 | |||
| a9b4d5ddd6 | |||
| e994afb97f | |||
| 24030dd93f | |||
| a4f8ecb48b | |||
| fa84bae4f2 | |||
| 13f83a56b6 | |||
| c7b899735f | |||
| fc537a1aa6 | |||
| 8d2d22de50 | |||
| 7eda414846 | |||
| 74f7866986 | |||
| 499d9c5611 | |||
| 6cf855b004 | |||
| 9fd96c3cf5 | |||
| 6265292cbb | |||
| 2490f487fd | |||
| 25b4dfe006 | |||
| faaa5b1b75 | |||
| 1f16c984a8 | |||
| 41557c606b | |||
| a8435a3716 | |||
| 01128d293e | |||
| 2d008f64ea | |||
| 29d99a4f8d | |||
| 416202360b | |||
| fd6c568d19 | |||
| 7efa20dd94 | |||
| b5a269a37a | |||
| 6436d56ab8 | |||
| eda206a4d5 | |||
| 15703216c3 | |||
| 3e640b4a4d | |||
| b5708ea8f0 | |||
| 1167bc117b | |||
| 5f142050a9 | |||
| 26c834780c | |||
| 0fe9bce02a | |||
| 2e79a5beb0 | |||
| 119b9105c7 | |||
| 4aba91abd9 | |||
| 7ec3f49c73 | |||
| 1a0a904903 | |||
| de5a82d0a7 | |||
| a07ced4b25 | |||
| b939052a88 | |||
| c33b27d174 | |||
| 691c8289dd | |||
| ca094574f5 | |||
| f068daba0b | |||
| 0c05455ae3 | |||
| 274671f309 | |||
| b4fba79838 | |||
| 6910278ba7 | |||
| 491eed3dad | |||
| 66838b6c69 | |||
| c8c2523fe7 | |||
| d0afe5eaaf | |||
| 7374b810c1 | |||
| 041e5aef0e | |||
| 6120e87966 | |||
| 5828dbd133 | |||
| ee49fbdcc0 | |||
| 7f1a89eb61 | |||
| 759bbbed63 | |||
| 5b0cb314e4 | |||
| 2fc4bf4043 | |||
| 2fb5a64124 | |||
| 379aa9d44b | |||
| b4a9a48ae6 | |||
| 41716b3430 | |||
| 585017873c | |||
| 605f7b85a1 | |||
| 192a27afbc | |||
| 768b18c22a | |||
| 3719416cbf | |||
| 791be3e1a5 | |||
| 7b7f4b902e | |||
| c547456108 | |||
| 931fc74ed7 | |||
| e7f1e584eb | |||
| b43b44d044 | |||
| d053dd0319 | |||
| 3b1ce45043 | |||
| 5473fbf28f | |||
| 2874f1727a | |||
| a3a4986cb8 | |||
| f525770094 | |||
| 25beef5517 | |||
| e6b1e31bd1 | |||
| 8c3a3eec28 | |||
| 1510f43aee | |||
| cb8fce435c | |||
| 7bb68483e6 | |||
| 696280bd47 | |||
| bdf01feacb | |||
| 120320c800 | |||
| 3db1651efd | |||
| 9d679954fa | |||
| a2844ec54a | |||
| 91ddc8602a | |||
| 22fd3c4a58 | |||
| ceab5d4be3 | |||
| bf8b69d193 | |||
| 7feaf8021b | |||
| 6328b4ac7a | |||
| 183e6d08d8 | |||
| a037c56122 | |||
| 857daa24af | |||
| 0968dcaded | |||
| cced2ff4aa | |||
| f197462b11 | |||
| 9559e5810e | |||
| 92ad229104 | |||
| ee1cb31321 | |||
| f0de25a3a2 | |||
| 0d40774194 | |||
| 948e62daae | |||
| 48d12fe056 | |||
| 6edc6e1100 | |||
| 12ea9b0b83 | |||
| c149216ebd | |||
| 325a93fd84 | |||
| f0656b57d4 | |||
| 9c7d2dca65 | |||
| 36b1e3da82 | |||
| c83eb79d25 | |||
| e0cf4b46b6 | |||
| 00972112d2 | |||
| 2559dc27cb | |||
| 7a0d7e1b12 | |||
| 1cd2cf2b9a | |||
| 98116fa042 | |||
| d3c6790603 | |||
| c1e3fa5141 | |||
| f319308196 | |||
| 185745b7da | |||
| 7440706e2e | |||
| 0adb29139e | |||
| 2148a068f8 | |||
| e1bb9e5431 | |||
| 8b2039f06a | |||
| 9761faa2d2 | |||
| d5f00a4b0b | |||
| b9fb4b4611 | |||
| 7d76ef0c52 | |||
| ea71a6dd93 | |||
| b9b6ae7e79 | |||
| 20a75aec4b | |||
| 3ad7bf40b5 | |||
| 196e628665 | |||
| 7c61c42eb5 | |||
| 1223b634b7 | |||
| 87913ba0a0 | |||
| eab45a8706 | |||
| a9a7a0889e | |||
| cd2e4016a6 | |||
| 87d72b2a0d | |||
| 4342215c00 | |||
| 7bf7d24f29 | |||
| 4da8d8d297 | |||
| c4eab467ee | |||
| fd50118161 | |||
| cc63aa80b2 | |||
| c95ea7db61 | |||
| f50c240bbe | |||
| 66278e635b | |||
| 74d0ba57e2 | |||
| e00d1357b0 | |||
| b9f87c6cc4 | |||
| 7c9c99bf45 | |||
| fdb13b7261 | |||
| 74a3803290 | |||
| 76497eece7 | |||
| d231d3619a | |||
| 20966157c5 | |||
| 59e58e5206 | |||
| 59ceeed4a4 | |||
| fac59f4346 | |||
| f6a74e58ea | |||
| 857a3948d6 | |||
| 47b3fb24b7 | |||
| 97e0df7ae1 | |||
| 7c87670896 | |||
| cd3cc85c0a | |||
| d70bb77755 | |||
| b00db10a37 | |||
| dbeb99d9e5 | |||
| 1a2fc9852d | |||
| 7aaa59cee1 | |||
| cbebd5b6d6 | |||
| 24a9784035 | |||
| de7ec604dd | |||
| 696f6d9ee0 | |||
| 050dd1a965 | |||
| 724c1dd16f | |||
| 0e85153b3d | |||
| af728f8ea6 | |||
| 7e07b6f970 | |||
| 8a0f5e65bb | |||
| 1947a5c2d5 | |||
| d8498728ee | |||
| 53e948b3e0 | |||
| 3ebc0cb86a | |||
| 8059b0a0bb | |||
| 1792196dc7 | |||
| d8051abf8e | |||
| 5e0cb69bb8 | |||
| 37a69b563b | |||
| 66f0b3fdd7 | |||
| 5e0dc848bb | |||
| a5323aea76 | |||
| cac747d158 | |||
| 705d929d6e | |||
| 29c21fd64f | |||
| 5236500f04 | |||
| 600867f386 | |||
| 8183bae824 | |||
| 37d6830947 | |||
| c71dfe3ff2 | |||
| ff139759d4 | |||
| 5176c80344 | |||
| 31f7a9c0cb | |||
| 9d208770d8 | |||
| 31d8d1ee16 | |||
| b4fbb8dfc8 | |||
| 40ebca2573 | |||
| ec08a360a0 | |||
| 977ea2b021 | |||
| e507887a27 | |||
| 12a887e074 | |||
| 577de8eb64 | |||
| 03add7c96b | |||
| 42e5b6dd2b | |||
| 88149561c5 | |||
| 51bb7593c7 | |||
| c34fc1e477 | |||
| 9bd6077599 | |||
| 6fe1f668d3 | |||
| 53b991242c | |||
| 91017f7c84 | |||
| 7b80ef035a | |||
| e54efab7c8 | |||
| 715c1b9728 | |||
| 8723924002 | |||
| cbaa47b34e | |||
| fe24426f59 | |||
| ef04d73e0c | |||
| b7d47a5d9d | |||
| 021c1c908a | |||
| cd3b25fa30 | |||
| 3106b2c530 | |||
| f4e6b24c92 | |||
| d6620e2449 | |||
| b59bb1789e | |||
| 4295a28f33 | |||
| 8572a60044 | |||
| 29328d70e9 | |||
| 12545f7c8b | |||
| 6ec4275088 | |||
| 14dbd633b5 | |||
| 8d68d2bdee | |||
| 6b8eac4139 | |||
| 13780c635b | |||
| a425a9052a | |||
| f64da15bc3 | |||
| b134539e53 | |||
| effc1f6f2e | |||
| ca285f78c6 | |||
| 0cfffcc60d | |||
| 37b2987279 | |||
| 59bdcf96dc | |||
| 8f602d80a9 | |||
| 7bddfad80f | |||
| 8b1d7ed280 | |||
| 285775c733 | |||
| 7e6bc1e8b4 | |||
| bf3967d7b5 | |||
| a0cd885fc7 | |||
| 481188f654 | |||
| c8fe545950 | |||
| 94840b2153 | |||
| c5ce33f71a | |||
| 43f4692a72 | |||
| 9af5284ff3 | |||
| 62da44382a | |||
| 6a5220ad78 | |||
| 3b7ae10499 | |||
| 6044413384 | |||
| 91d1236c37 | |||
| 020863d1ef | |||
| 6832209e98 | |||
| 3a0f729669 | |||
| aad568f320 | |||
| d6099a781f | |||
| e23098b766 | |||
| 37ea2b7d78 | |||
| c707a0356f | |||
| 484f63f9cc | |||
| 1f32171800 | |||
| 5a16a9d2b1 | |||
| 6147ad2252 | |||
| 5e9bf6069e | |||
| 3cc37ae3d3 | |||
| 5b4ea8f486 | |||
| b8ed505971 | |||
| 6f488c74fc | |||
| 1b65444ab3 | |||
| 125e07eed4 | |||
| 82a54e3200 | |||
| 327ae685c1 | |||
| df643a8e4e | |||
| 8684bc4a63 | |||
| c53befe9d6 | |||
| 5f9876343c | |||
| 1f4dcea63a |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -63,3 +63,5 @@ nbdist/
|
||||
*.local.*
|
||||
*.py
|
||||
*.pyc
|
||||
*.json
|
||||
*.toml
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
alwaysApply: true
|
||||
scene: git_message
|
||||
---
|
||||
|
||||
使用中文编写提交信息, 提交信息格式为:
|
||||
```
|
||||
<type>(<scope>): <subject>
|
||||
```
|
||||
20
docs/deleted-menu-backup.sql
Normal file
20
docs/deleted-menu-backup.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
-- 删除「采购需求」「采购看板」菜单前的备份 生成于脚本 库:klp-oa
|
||||
-- 回滚:执行下面的 INSERT 即可恢复菜单与角色授权
|
||||
|
||||
INSERT INTO sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query_param,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,update_time,remark) VALUES (1990706561827045378,'采购需求',1954721010120728578,0,'requirement','erp/requirement/index',NULL,1,0,'C','0','0',NULL,'nested','admin','2025-11-18 17:00:05','admin','2026-02-01 22:39:54','');
|
||||
INSERT INTO sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query_param,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,update_time,remark) VALUES (1990706888819179521,'采购看板',1954721010120728578,6,'dashboard','erp/dashboard/index',NULL,1,0,'C','0','0',NULL,'dashboard','admin','2025-11-18 17:01:23','admin','2026-05-08 19:06:02','');
|
||||
INSERT INTO sys_role_menu (role_id,menu_id) VALUES (1993591990145687554,1990706561827045378);
|
||||
INSERT INTO sys_role_menu (role_id,menu_id) VALUES (1993591990145687554,1990706888819179521);
|
||||
|
||||
-- 第二批删除:供应商库/采购订单/收货记录/退货管理/采购汇总
|
||||
INSERT INTO sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query_param,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,update_time,remark) VALUES (1955113252714999810,'供应商库',1954721010120728578,1,'supplier','erp/supplier/index',NULL,1,0,'C','0','0',NULL,'people','admin','2025-08-12 11:44:58','admin','2026-02-01 22:40:28','');
|
||||
INSERT INTO sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query_param,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,update_time,remark) VALUES (1990705902968995841,'采购订单',1954721010120728578,1,'order','erp/order/index',NULL,1,0,'C','0','0',NULL,'edit','admin','2025-11-18 16:57:27','admin','2025-11-18 17:03:49','');
|
||||
INSERT INTO sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query_param,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,update_time,remark) VALUES (1990706263360372737,'收货记录',1954721010120728578,1,'receipt','erp/receipt/index',NULL,1,0,'C','0','1',NULL,'log','admin','2025-11-18 16:58:53','admin','2026-05-08 19:06:09','');
|
||||
INSERT INTO sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query_param,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,update_time,remark) VALUES (1990706419627556866,'采购汇总',1954721010120728578,13,'report','erp/report/index',NULL,1,0,'C','0','1',NULL,'druid','admin','2025-11-18 16:59:31','admin','2026-05-08 19:05:51','');
|
||||
INSERT INTO sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query_param,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,update_time,remark) VALUES (1990706698213228545,'退货管理',1954721010120728578,5,'return','erp/return/index',NULL,1,0,'C','0','1',NULL,'guide','admin','2025-11-18 17:00:37','admin','2026-05-08 19:06:06','');
|
||||
INSERT INTO sys_role_menu (role_id,menu_id) VALUES (1993591990145687554,1955113252714999810);
|
||||
INSERT INTO sys_role_menu (role_id,menu_id) VALUES (1993591990145687554,1990705902968995841);
|
||||
INSERT INTO sys_role_menu (role_id,menu_id) VALUES (1993591990145687554,1990706263360372737);
|
||||
INSERT INTO sys_role_menu (role_id,menu_id) VALUES (1993591990145687554,1990706419627556866);
|
||||
INSERT INTO sys_role_menu (role_id,menu_id) VALUES (1993591990145687554,1990706698213228545);
|
||||
qin
|
||||
7
docs/klp_purchase_requisition_alter_1.sql
Normal file
7
docs/klp_purchase_requisition_alter_1.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
-- ========================================
|
||||
-- 电子请购单 — 增量变更 1:增加审批意见字段
|
||||
-- ========================================
|
||||
|
||||
ALTER TABLE `erp_purchase_requisition`
|
||||
ADD COLUMN `first_approval_opinion` VARCHAR(500) DEFAULT NULL COMMENT '一审审批意见' AFTER `remark`,
|
||||
ADD COLUMN `second_approval_opinion` VARCHAR(500) DEFAULT NULL COMMENT '二审审批意见' AFTER `first_approval_opinion`;
|
||||
83
docs/klp_purchase_requisition_ddl.sql
Normal file
83
docs/klp_purchase_requisition_ddl.sql
Normal file
@@ -0,0 +1,83 @@
|
||||
-- ========================================
|
||||
-- 电子请购单 — 数据库建表脚本
|
||||
-- 表结构:主表 + 明细表,全部文本字段,不关联任何现有表
|
||||
-- 对应文档:docs/科仑普请购采购单(1).docx
|
||||
-- ========================================
|
||||
|
||||
-- ----------------------------
|
||||
-- 主表:请购及采购单
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `erp_purchase_requisition`;
|
||||
CREATE TABLE `erp_purchase_requisition` (
|
||||
`req_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
|
||||
-- 头部(请购人填写)
|
||||
`req_dept` VARCHAR(100) DEFAULT NULL COMMENT '请购部门',
|
||||
`item_name` VARCHAR(200) DEFAULT NULL COMMENT '品名',
|
||||
`specification` VARCHAR(200) DEFAULT NULL COMMENT '规格',
|
||||
`unit` VARCHAR(20) DEFAULT NULL COMMENT '单位',
|
||||
`quantity` VARCHAR(50) DEFAULT NULL COMMENT '请购量',
|
||||
|
||||
-- 类别与日期
|
||||
`category` VARCHAR(50) DEFAULT NULL COMMENT '类别',
|
||||
`required_date` VARCHAR(50) DEFAULT NULL COMMENT '需求日期',
|
||||
|
||||
-- 说明
|
||||
`purpose_desc` VARCHAR(500) DEFAULT NULL COMMENT '用途说明',
|
||||
`use_dept` VARCHAR(100) DEFAULT NULL COMMENT '使用部门',
|
||||
|
||||
-- 采购处理(采购单位填写)
|
||||
`inspection_condition` VARCHAR(200) DEFAULT NULL COMMENT '品检条件',
|
||||
`trial_days` VARCHAR(50) DEFAULT NULL COMMENT '试用天数',
|
||||
`prev_purchase_record` VARCHAR(500) DEFAULT NULL COMMENT '前期采购记录',
|
||||
`purchase_proposal` VARCHAR(500) DEFAULT NULL COMMENT '采购拟办',
|
||||
`payment_terms` VARCHAR(200) DEFAULT NULL COMMENT '付款条件',
|
||||
`total_amount` VARCHAR(200) DEFAULT NULL COMMENT '采购金额',
|
||||
|
||||
-- 审批签名(8级)
|
||||
`sign_purchase_chairman` VARCHAR(64) DEFAULT NULL COMMENT '董事长(采购单位)',
|
||||
`sign_purchase_manager` VARCHAR(64) DEFAULT NULL COMMENT '部长/厂长(采购单位)',
|
||||
`sign_purchase_director` VARCHAR(64) DEFAULT NULL COMMENT '主任(采购单位)',
|
||||
`sign_purchase_handler` VARCHAR(64) DEFAULT NULL COMMENT '经办(采购单位)',
|
||||
`sign_request_gm` VARCHAR(64) DEFAULT NULL COMMENT '生产总经理(请购单位)',
|
||||
`sign_request_factory_mgr` VARCHAR(64) DEFAULT NULL COMMENT '厂长(请购单位)',
|
||||
`sign_request_director` VARCHAR(64) DEFAULT NULL COMMENT '主任(请购单位)',
|
||||
`sign_request_handler` VARCHAR(64) DEFAULT NULL COMMENT '经办(请购单位)',
|
||||
|
||||
-- 底部
|
||||
`unload_location` VARCHAR(50) DEFAULT NULL COMMENT '指定卸货位',
|
||||
`unload_other` VARCHAR(200) DEFAULT NULL COMMENT '卸货其他位置',
|
||||
|
||||
-- 状态与控制
|
||||
`form_status` VARCHAR(20) NOT NULL DEFAULT '0' COMMENT '状态:0=请购草稿 1=请购审批中 2=请购已通过 3=采购处理中 4=已完成 5=已驳回',
|
||||
`del_flag` VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '删除标志 0=存在 2=删除',
|
||||
`create_by` VARCHAR(64) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` DATETIME DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` VARCHAR(64) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` DATETIME DEFAULT NULL COMMENT '更新时间',
|
||||
`remark` VARCHAR(500) DEFAULT NULL COMMENT '备注',
|
||||
|
||||
PRIMARY KEY (`req_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='请购及采购单(科仑普)';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 明细表:请购及采购单明细(8行)
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `erp_purchase_requisition_item`;
|
||||
CREATE TABLE `erp_purchase_requisition_item` (
|
||||
`item_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '明细ID',
|
||||
`req_id` BIGINT NOT NULL COMMENT '关联请购单ID → erp_purchase_requisition.req_id',
|
||||
`seq` VARCHAR(10) NOT NULL COMMENT '项次',
|
||||
`item_name` VARCHAR(200) DEFAULT NULL COMMENT '品名',
|
||||
`specification` VARCHAR(200) DEFAULT NULL COMMENT '规格',
|
||||
`unit` VARCHAR(20) DEFAULT NULL COMMENT '单位',
|
||||
`quantity` VARCHAR(50) DEFAULT NULL COMMENT '请购量',
|
||||
`del_flag` VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '删除标志',
|
||||
`create_by` VARCHAR(64) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` DATETIME DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` VARCHAR(64) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` DATETIME DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`item_id`),
|
||||
KEY `idx_req_id` (`req_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='请购及采购单明细';
|
||||
208
docs/purchase-plan-ddl.sql
Normal file
208
docs/purchase-plan-ddl.sql
Normal file
@@ -0,0 +1,208 @@
|
||||
-- 采购计划 (erp_purchase_plan) 相关 DDL
|
||||
-- 在主库 jdbc:mysql://140.143.206.120:13306/klp-oa-test 上执行
|
||||
|
||||
-- 1. 采购计划头
|
||||
CREATE TABLE IF NOT EXISTS `erp_purchase_plan` (
|
||||
`plan_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '计划ID',
|
||||
`plan_no` VARCHAR(64) NOT NULL COMMENT '采购计划号',
|
||||
`plan_status` CHAR(1) NOT NULL DEFAULT '0' COMMENT '计划状态: 0-进行中 1-已完成归档',
|
||||
`audit_status` CHAR(1) NOT NULL DEFAULT '0' COMMENT '审核状态: 0-待审核 1-通过 2-驳回',
|
||||
`audit_opinion` VARCHAR(512) DEFAULT NULL COMMENT '申请/审核意见',
|
||||
`auditor` VARCHAR(64) DEFAULT NULL COMMENT '审核人',
|
||||
`audit_time` DATETIME DEFAULT NULL COMMENT '审核时间',
|
||||
`supplier` VARCHAR(128) DEFAULT NULL COMMENT '供货商',
|
||||
`purchase_date` DATE DEFAULT NULL COMMENT '采购日期',
|
||||
`plan_weight` DECIMAL(14,3) NOT NULL DEFAULT 0 COMMENT '计划总重量(T)',
|
||||
`arrived_weight` DECIMAL(14,3) NOT NULL DEFAULT 0 COMMENT '已到货重量(T)',
|
||||
`del_flag` CHAR(1) NOT NULL DEFAULT '0' COMMENT '删除标志: 0-存在 2-删除',
|
||||
`create_by` VARCHAR(64) DEFAULT NULL,
|
||||
`create_time` DATETIME DEFAULT NULL,
|
||||
`update_by` VARCHAR(64) DEFAULT NULL,
|
||||
`update_time` DATETIME DEFAULT NULL,
|
||||
`remark` VARCHAR(512) DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (`plan_id`),
|
||||
UNIQUE KEY `uk_plan_no` (`plan_no`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='采购计划头';
|
||||
|
||||
-- 2. 采购计划明细(多规格行,字段对齐 crm_order_item)
|
||||
CREATE TABLE IF NOT EXISTS `erp_purchase_plan_item` (
|
||||
`item_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '明细ID',
|
||||
`plan_id` BIGINT NOT NULL COMMENT '关联计划ID',
|
||||
`product_type` VARCHAR(64) DEFAULT NULL COMMENT '产品(如热轧卷板)',
|
||||
`material` VARCHAR(64) DEFAULT NULL COMMENT '材质',
|
||||
`grade` VARCHAR(64) DEFAULT NULL COMMENT '牌号',
|
||||
`coil_no` VARCHAR(64) DEFAULT NULL COMMENT '卷号',
|
||||
`width` VARCHAR(64) DEFAULT NULL COMMENT '宽度(mm,可为区间文本,对齐 crm_order_item)',
|
||||
`thickness` VARCHAR(64) DEFAULT NULL COMMENT '厚度(mm,可为区间文本)',
|
||||
`width_tolerance` VARCHAR(64) DEFAULT '0' COMMENT '宽度公差(自由文本)',
|
||||
`thickness_tolerance` VARCHAR(64) DEFAULT '0' COMMENT '厚度公差(自由文本)',
|
||||
`weight` DECIMAL(14,3) DEFAULT NULL COMMENT '重量(T)',
|
||||
`quantity` INT DEFAULT NULL COMMENT '数量(件/卷数,来自合同 product_num)',
|
||||
`arrived_weight` DECIMAL(14,3) NOT NULL DEFAULT 0 COMMENT '已到货重量(T),由到货Excel按牌号+规格累加',
|
||||
`item_status` CHAR(1) NOT NULL DEFAULT '0' COMMENT '到货状态: 0-未到货 1-部分到货 2-已到货',
|
||||
`supplier` VARCHAR(128) DEFAULT NULL COMMENT '供货商',
|
||||
`del_flag` CHAR(1) NOT NULL DEFAULT '0' COMMENT '删除标志',
|
||||
`create_by` VARCHAR(64) DEFAULT NULL,
|
||||
`create_time` DATETIME DEFAULT NULL,
|
||||
`update_by` VARCHAR(64) DEFAULT NULL,
|
||||
`update_time` DATETIME DEFAULT NULL,
|
||||
`remark` VARCHAR(512) DEFAULT NULL,
|
||||
PRIMARY KEY (`item_id`),
|
||||
KEY `idx_plan_id` (`plan_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='采购计划明细';
|
||||
|
||||
-- 3. 计划↔销售合同(crm_order) 中间表(多对多,挂合同头)
|
||||
CREATE TABLE IF NOT EXISTS `erp_purchase_plan_contract_rel` (
|
||||
`rel_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '关系ID',
|
||||
`plan_id` BIGINT NOT NULL COMMENT '采购计划ID',
|
||||
`order_id` BIGINT NOT NULL COMMENT '销售合同ID(crm_order.order_id)',
|
||||
`del_flag` CHAR(1) NOT NULL DEFAULT '0' COMMENT '删除标志',
|
||||
`create_by` VARCHAR(64) DEFAULT NULL,
|
||||
`create_time` DATETIME DEFAULT NULL,
|
||||
`update_by` VARCHAR(64) DEFAULT NULL,
|
||||
`update_time` DATETIME DEFAULT NULL,
|
||||
`remark` VARCHAR(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`rel_id`),
|
||||
KEY `idx_plan_id` (`plan_id`),
|
||||
KEY `idx_order_id` (`order_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='采购计划-销售合同关联表';
|
||||
|
||||
-- 4. 到货明细(对应上传的到货 Excel,一行一卷,独立于 WMS)
|
||||
CREATE TABLE IF NOT EXISTS `erp_purchase_plan_delivery` (
|
||||
`delivery_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '到货明细ID',
|
||||
`plan_id` BIGINT NOT NULL COMMENT '关联计划ID',
|
||||
`arrival_date` DATE DEFAULT NULL COMMENT '日期',
|
||||
`grade` VARCHAR(64) DEFAULT NULL COMMENT '牌号',
|
||||
`spec` VARCHAR(64) DEFAULT NULL COMMENT '规格(厚×宽)',
|
||||
`coil_no` VARCHAR(64) DEFAULT NULL COMMENT '卷号',
|
||||
`coil_weight` DECIMAL(14,3) DEFAULT NULL COMMENT '单卷重量(T)',
|
||||
`truck_no` VARCHAR(64) DEFAULT NULL COMMENT '车号',
|
||||
`truck_weight` DECIMAL(14,3) DEFAULT NULL COMMENT '整车数量(T)',
|
||||
`piece_count` INT DEFAULT NULL COMMENT '件数',
|
||||
`sales_code` VARCHAR(64) DEFAULT NULL COMMENT '销售代码',
|
||||
`arrival_station` VARCHAR(64) DEFAULT NULL COMMENT '钢厂到站',
|
||||
`del_flag` CHAR(1) NOT NULL DEFAULT '0' COMMENT '删除标志',
|
||||
`create_by` VARCHAR(64) DEFAULT NULL,
|
||||
`create_time` DATETIME DEFAULT NULL,
|
||||
`update_by` VARCHAR(64) DEFAULT NULL,
|
||||
`update_time` DATETIME DEFAULT NULL,
|
||||
`remark` VARCHAR(512) DEFAULT NULL,
|
||||
PRIMARY KEY (`delivery_id`),
|
||||
KEY `idx_plan_id` (`plan_id`),
|
||||
KEY `idx_coil_no` (`coil_no`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='采购计划到货明细';
|
||||
|
||||
-- 5. 到货上传批次(每上传一份到货表格记一条,便于随时回看每一次上传)
|
||||
CREATE TABLE IF NOT EXISTS `erp_purchase_plan_delivery_batch` (
|
||||
`batch_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '批次ID',
|
||||
`plan_id` BIGINT NOT NULL COMMENT '关联计划ID',
|
||||
`file_name` VARCHAR(255) DEFAULT NULL COMMENT '文件名',
|
||||
`row_count` INT DEFAULT 0 COMMENT '本次到货行数',
|
||||
`matched_count` INT DEFAULT 0 COMMENT '本次匹配上明细卷号的卷数',
|
||||
`arrived_percent` DECIMAL(6,2) DEFAULT 0 COMMENT '上传后到货百分比快照',
|
||||
`del_flag` CHAR(1) NOT NULL DEFAULT '0' COMMENT '删除标志',
|
||||
`create_by` VARCHAR(64) DEFAULT NULL,
|
||||
`create_time` DATETIME DEFAULT NULL,
|
||||
`update_by` VARCHAR(64) DEFAULT NULL,
|
||||
`update_time` DATETIME DEFAULT NULL,
|
||||
`remark` VARCHAR(512) DEFAULT NULL,
|
||||
PRIMARY KEY (`batch_id`),
|
||||
KEY `idx_plan_id` (`plan_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='采购计划到货上传批次';
|
||||
|
||||
-- 6. 供应商往来流水台账
|
||||
CREATE TABLE IF NOT EXISTS `erp_supplier_transaction` (
|
||||
`txn_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '往来流水ID',
|
||||
`supplier_id` BIGINT NOT NULL COMMENT '关联供应商ID',
|
||||
`txn_date` DATE DEFAULT NULL COMMENT '发生日期',
|
||||
`txn_type` CHAR(1) NOT NULL DEFAULT '1' COMMENT '类型: 1-采购应付 2-付款 3-退货 4-其他',
|
||||
`amount` DECIMAL(16,2) NOT NULL DEFAULT 0 COMMENT '金额',
|
||||
`doc_no` VARCHAR(64) DEFAULT NULL COMMENT '单据号',
|
||||
`del_flag` CHAR(1) NOT NULL DEFAULT '0' COMMENT '删除标志',
|
||||
`create_by` VARCHAR(64) DEFAULT NULL,
|
||||
`create_time` DATETIME DEFAULT NULL,
|
||||
`update_by` VARCHAR(64) DEFAULT NULL,
|
||||
`update_time` DATETIME DEFAULT NULL,
|
||||
`remark` VARCHAR(512) DEFAULT NULL,
|
||||
PRIMARY KEY (`txn_id`),
|
||||
KEY `idx_supplier_id` (`supplier_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='供应商往来流水台账';
|
||||
|
||||
-- ====== 既有表增列(幂等:列不存在才加) ======
|
||||
SET @c := (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'erp_purchase_plan_delivery' AND COLUMN_NAME = 'batch_id');
|
||||
SET @s := IF(@c = 0, 'ALTER TABLE erp_purchase_plan_delivery ADD COLUMN batch_id BIGINT NULL COMMENT ''关联上传批次ID'' AFTER plan_id', 'SELECT 1');
|
||||
PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
-- 到货行是否 WMS 钢卷表已确认到货(supplier_coil_no 存在且 data_type<>10)
|
||||
SET @c := (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'erp_purchase_plan_delivery' AND COLUMN_NAME = 'arrived');
|
||||
SET @s := IF(@c = 0, 'ALTER TABLE erp_purchase_plan_delivery ADD COLUMN arrived TINYINT NOT NULL DEFAULT 0 COMMENT ''是否WMS确认到货:1是0否'' AFTER batch_id', 'SELECT 1');
|
||||
PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
-- 计划要求总数量(卷/件) = Σ明细数量
|
||||
SET @c := (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'erp_purchase_plan' AND COLUMN_NAME = 'plan_qty');
|
||||
SET @s := IF(@c = 0, 'ALTER TABLE erp_purchase_plan ADD COLUMN plan_qty INT NOT NULL DEFAULT 0 COMMENT ''计划要求总数量(卷/件)'' AFTER arrived_weight', 'SELECT 1');
|
||||
PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
-- 已到货卷数 = WMS确认到货的上传卷数
|
||||
SET @c := (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'erp_purchase_plan' AND COLUMN_NAME = 'arrived_count');
|
||||
SET @s := IF(@c = 0, 'ALTER TABLE erp_purchase_plan ADD COLUMN arrived_count INT NOT NULL DEFAULT 0 COMMENT ''已到货卷数'' AFTER plan_qty', 'SELECT 1');
|
||||
PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
-- 2026-06-29 大改:采购计划→采购合同;要求改为 规格+总重量+厂商;到货区分已到/在途
|
||||
SET @c := (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'erp_purchase_plan_item' AND COLUMN_NAME = 'spec');
|
||||
SET @s := IF(@c = 0, 'ALTER TABLE erp_purchase_plan_item ADD COLUMN spec VARCHAR(128) DEFAULT NULL COMMENT ''规格'' AFTER plan_id', 'SELECT 1');
|
||||
PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
SET @c := (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'erp_purchase_plan_item' AND COLUMN_NAME = 'manufacturer');
|
||||
SET @s := IF(@c = 0, 'ALTER TABLE erp_purchase_plan_item ADD COLUMN manufacturer VARCHAR(128) DEFAULT NULL COMMENT ''厂商(手填,历史记忆)'' AFTER spec', 'SELECT 1');
|
||||
PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
SET @c := (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'erp_purchase_plan_delivery' AND COLUMN_NAME = 'in_transit');
|
||||
SET @s := IF(@c = 0, 'ALTER TABLE erp_purchase_plan_delivery ADD COLUMN in_transit TINYINT NOT NULL DEFAULT 0 COMMENT ''是否在途:1是0否(钢卷表存在且data_type=10)'' AFTER arrived', 'SELECT 1');
|
||||
PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
SET @c := (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'erp_purchase_plan' AND COLUMN_NAME = 'in_transit_count');
|
||||
SET @s := IF(@c = 0, 'ALTER TABLE erp_purchase_plan ADD COLUMN in_transit_count INT NOT NULL DEFAULT 0 COMMENT ''在途卷数'' AFTER arrived_count', 'SELECT 1');
|
||||
PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
SET @c := (SELECT COUNT(*) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'erp_purchase_plan' AND COLUMN_NAME = 'in_transit_weight');
|
||||
SET @s := IF(@c = 0, 'ALTER TABLE erp_purchase_plan ADD COLUMN in_transit_weight DECIMAL(14,3) NOT NULL DEFAULT 0 COMMENT ''在途重量(T)'' AFTER in_transit_count', 'SELECT 1');
|
||||
PREPARE stmt FROM @s; EXECUTE stmt; DEALLOCATE PREPARE stmt;
|
||||
|
||||
|
||||
-- ============ 菜单 ============
|
||||
-- 采购目录挂在「生产辅助」(path=helper) 下;父 id 按 path 动态解析,兼容不同环境的不同 menu_id。
|
||||
-- 整段可重复执行(叶子菜单用 REPLACE,目录用 存在判断 + 归位 UPDATE)。
|
||||
|
||||
-- 1) 解析「生产辅助」目录 id
|
||||
SET @helper_id = (SELECT menu_id FROM (SELECT menu_id FROM sys_menu WHERE path = 'helper' AND parent_id = 0 LIMIT 1) t);
|
||||
|
||||
-- 2) 确保「采购」目录存在(不存在则在「生产辅助」下创建;用派生表规避同表 INSERT...SELECT 限制)
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2100000000000000000, '采购', @helper_id, 50, 'purchase', '', '', 1, 0, 'M', '0', '0', '', 'shopping', 'admin', sysdate(), '采购目录'
|
||||
FROM dual
|
||||
WHERE NOT EXISTS (SELECT 1 FROM (SELECT menu_id FROM sys_menu WHERE path = 'purchase' AND menu_type = 'M') x);
|
||||
|
||||
-- 3) 无论新建还是已存在,确保「采购」目录归位到「生产辅助」下,并设为显示(visible=0,否则其下所有菜单都不会出现在侧边栏)
|
||||
UPDATE sys_menu SET parent_id = @helper_id, visible = '0', status = '0' WHERE path = 'purchase' AND menu_type = 'M';
|
||||
|
||||
-- 4) 解析「采购」目录 id(供下方叶子菜单使用)
|
||||
SET @purchase_id = (SELECT menu_id FROM (SELECT menu_id FROM sys_menu WHERE path = 'purchase' AND menu_type = 'M' LIMIT 1) t);
|
||||
|
||||
-- 5) 采购计划 + 按钮(REPLACE 可重复执行)
|
||||
REPLACE INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark) VALUES
|
||||
(2100000000000000001, '采购合同', @purchase_id, 2, 'purchasePlan', 'erp/purchasePlan/index', '', 1, 0, 'C', '0', '0', 'erp:purchasePlan:list', 'form', 'admin', sysdate(), '采购合同菜单'),
|
||||
(2100000000000000002, '采购合同查询', 2100000000000000001, 1, '', '', '', 1, 0, 'F', '0', '0', 'erp:purchasePlan:query', '#', 'admin', sysdate(), ''),
|
||||
(2100000000000000003, '采购合同新增', 2100000000000000001, 2, '', '', '', 1, 0, 'F', '0', '0', 'erp:purchasePlan:add', '#', 'admin', sysdate(), ''),
|
||||
(2100000000000000004, '采购合同修改', 2100000000000000001, 3, '', '', '', 1, 0, 'F', '0', '0', 'erp:purchasePlan:edit', '#', 'admin', sysdate(), ''),
|
||||
(2100000000000000005, '采购合同删除', 2100000000000000001, 4, '', '', '', 1, 0, 'F', '0', '0', 'erp:purchasePlan:remove', '#', 'admin', sysdate(), ''),
|
||||
(2100000000000000006, '到货导入', 2100000000000000001, 5, '', '', '', 1, 0, 'F', '0', '0', 'erp:purchasePlan:import', '#', 'admin', sysdate(), '');
|
||||
|
||||
-- 6) 采购审核 + 按钮(REPLACE 可重复执行)
|
||||
REPLACE INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark) VALUES
|
||||
(2100000000000000010, '采购审核', @purchase_id, 3, 'purchaseAudit', 'erp/purchaseAudit/index', '', 1, 0, 'C', '0', '0', 'erp:purchasePlan:auditList', 'validCode', 'admin', sysdate(), '采购审核菜单'),
|
||||
(2100000000000000011, '审核操作', 2100000000000000010, 1, '', '', '', 1, 0, 'F', '0', '0', 'erp:purchasePlan:audit', '#', 'admin', sysdate(), '');
|
||||
|
||||
-- 7) 到货记录(审核通过的计划上传到货表格、按卷号比对、到货百分比)
|
||||
REPLACE INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark) VALUES
|
||||
(2100000000000000020, '到货记录', @purchase_id, 4, 'purchaseDelivery', 'erp/purchaseDelivery/index', '', 1, 0, 'C', '0', '0', 'erp:purchasePlan:list', 'truck', 'admin', sysdate(), '到货记录与卷号比对');
|
||||
4645
docs/rolling_mill_project_management(1).html
Normal file
4645
docs/rolling_mill_project_management(1).html
Normal file
File diff suppressed because it is too large
Load Diff
25
docs/sql_align_databases.sql
Normal file
25
docs/sql_align_databases.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
-- =============================================================
|
||||
-- 线上线下库对齐修复脚本
|
||||
-- 用于 klp-oa(线上)和 klp-oa-test(线下)
|
||||
-- =============================================================
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
-- ==================== 第一部分:补字典(两边都执行) ====================
|
||||
|
||||
-- 1.1 regrade_quality_type 字典类型
|
||||
INSERT IGNORE INTO sys_dict_type (dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES ('改判后质量状态', 'regrade_quality_type', '0', 'admin', NOW(), 'admin', NOW(), '');
|
||||
|
||||
-- 1.2 regrade_quality_type 字典数据
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (1, '协议销售', 'protocol_sale', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW()),
|
||||
(2, '转分剪', 'to_slitting', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW()),
|
||||
(3, '降级', 'downgrade', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW()),
|
||||
(4, '返修', 'rework', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW()),
|
||||
(5, '报废', 'scrap', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
|
||||
-- 1.3 quality_review_status 补充缺失数据
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (2, '待审批', '2', 'quality_review_status', '', 'warning', 'Y', '0', 'admin', NOW()),
|
||||
(3, '已通过', '3', 'quality_review_status', '', 'success', 'Y', '0', 'admin', NOW()),
|
||||
(4, '已驳回', '4', 'quality_review_status', '', 'danger', 'Y', '0', 'admin', NOW());
|
||||
51
docs/sql_align_databases_v2.sql
Normal file
51
docs/sql_align_databases_v2.sql
Normal file
@@ -0,0 +1,51 @@
|
||||
-- =============================================================
|
||||
-- 线上线下库对齐修复(修复版v2)
|
||||
-- 适配 dict_code / dict_id 非自增的表结构
|
||||
-- =============================================================
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
-- ==================== 1. 补字典类型 ====================
|
||||
SET @max_dict_id = (SELECT COALESCE(MAX(dict_id), 0) FROM sys_dict_type);
|
||||
|
||||
INSERT IGNORE INTO sys_dict_type (dict_id, dict_name, dict_type, status, create_by, create_time)
|
||||
VALUES (@max_dict_id + 1, '改判后质量状态', 'regrade_quality_type', '0', 'admin', NOW());
|
||||
|
||||
-- ==================== 2. 补字典数据 ====================
|
||||
SET @max_code = (SELECT COALESCE(MAX(dict_code), 0) FROM sys_dict_data);
|
||||
SET @code = @max_code + 1;
|
||||
|
||||
-- quality_review_status 缺失的3条
|
||||
INSERT IGNORE INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (@code, 2, '待审批', '2', 'quality_review_status', '', 'warning', 'Y', '0', 'admin', NOW());
|
||||
SET @code = @code + 1;
|
||||
|
||||
INSERT IGNORE INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (@code, 3, '已通过', '3', 'quality_review_status', '', 'success', 'Y', '0', 'admin', NOW());
|
||||
SET @code = @code + 1;
|
||||
|
||||
INSERT IGNORE INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (@code, 4, '已驳回', '4', 'quality_review_status', '', 'danger', 'Y', '0', 'admin', NOW());
|
||||
SET @code = @code + 1;
|
||||
|
||||
-- regrade_quality_type 5条
|
||||
INSERT IGNORE INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (@code, 1, '协议销售', 'protocol_sale', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
SET @code = @code + 1;
|
||||
|
||||
INSERT IGNORE INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (@code, 2, '转分剪', 'to_slitting', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
SET @code = @code + 1;
|
||||
|
||||
INSERT IGNORE INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (@code, 3, '降级', 'downgrade', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
SET @code = @code + 1;
|
||||
|
||||
INSERT IGNORE INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (@code, 4, '返修', 'rework', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
SET @code = @code + 1;
|
||||
|
||||
INSERT IGNORE INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (@code, 5, '报废', 'scrap', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
|
||||
-- ==================== 3. 验证 ====================
|
||||
SELECT 'Dict fix OK' AS result;
|
||||
69
docs/sql_align_dev.sql
Normal file
69
docs/sql_align_dev.sql
Normal file
@@ -0,0 +1,69 @@
|
||||
-- =============================================================
|
||||
-- 线下库 klp-oa-test 菜单对齐修复
|
||||
-- 将质量评审菜单从"质量管理"下移到"评审流程"目录下
|
||||
-- 并补充次品钢卷、O级卷菜单
|
||||
-- =============================================================
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
-- ==================== 1. 清理旧的质量评审菜单 ====================
|
||||
DELETE FROM sys_role_menu WHERE menu_id IN (2100000000000000036,2100000000000000037,2100000000000000038,2100000000000000039,2100000000000000040,2100000000000000041,2100000000000000042,2100000000000000043);
|
||||
DELETE FROM sys_menu WHERE menu_id IN (2100000000000000036,2100000000000000037,2100000000000000038,2100000000000000039,2100000000000000040,2100000000000000041,2100000000000000042,2100000000000000043);
|
||||
|
||||
-- 计算可用菜单ID
|
||||
SET @max_id = (SELECT COALESCE(MAX(menu_id), 0) FROM sys_menu);
|
||||
|
||||
-- ==================== 2. 创建"评审流程"目录(挂在质量管理下) ====================
|
||||
SET @parent_quality = 2068954238598967297; -- 质量管理
|
||||
SET @id_review_dir = @max_id + 1;
|
||||
INSERT IGNORE INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, is_frame, is_cache, menu_type, visible, status, icon, create_by, create_time, update_by, update_time)
|
||||
VALUES (@id_review_dir, '评审流程', @parent_quality, 5, 'review', 1, 0, 'M', '0', '0', 'guide', 'admin', NOW(), 'admin', NOW());
|
||||
|
||||
-- ==================== 3. 在评审流程下创建子菜单 ====================
|
||||
SET @parent = @id_review_dir;
|
||||
SET @id = @max_id + 2;
|
||||
|
||||
-- 次品钢卷 (order=4)
|
||||
INSERT IGNORE INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, icon, create_by, create_time)
|
||||
VALUES (@id, '次品钢卷', @parent, 4, 'rubbish', 'wms/coil/views/scrap', 1, 0, 'C', '0', '0', 'checkbox', 'admin', NOW());
|
||||
SET @id = @id + 1;
|
||||
|
||||
-- O级卷 (order=5)
|
||||
INSERT IGNORE INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, icon, create_by, create_time)
|
||||
VALUES (@id, 'O级卷', @parent, 5, 'jishu', 'wms/coil/views/jishu', 1, 0, 'C', '0', '0', 'checkbox', 'admin', NOW());
|
||||
SET @id = @id + 1;
|
||||
|
||||
-- 质量评审 (order=6)
|
||||
SET @id_review_menu = @id;
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
|
||||
VALUES (@id_review_menu, '质量评审', @parent, 6, 'qualityReview', 'mes/qc/qualityReview/index', 1, 0, 'C', '0', '0', 'qc:qualityReview:list', 'guide', 'admin', NOW());
|
||||
SET @id = @id + 1;
|
||||
|
||||
-- 质量评审待审批 (order=7, 隐藏)
|
||||
SET @id_review_todo = @id;
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
|
||||
VALUES (@id_review_todo, '质量评审待审批', @parent, 7, 'qualityReviewTodo', 'mes/qc/qualityReview/todo', 1, 0, 'C', '1', '0', 'qc:qualityReview:approve', 'checkbox', 'admin', NOW());
|
||||
SET @id = @id + 1;
|
||||
|
||||
-- ==================== 4. 按钮权限(挂在质量评审菜单下) ====================
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, menu_type, visible, status, perms, create_by, create_time)
|
||||
VALUES (@id, '质量评审新增', @id_review_menu, 1, 'F', '0', '0', 'qc:qualityReview:add', 'admin', NOW()); SET @id = @id + 1;
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, menu_type, visible, status, perms, create_by, create_time)
|
||||
VALUES (@id, '质量评审修改', @id_review_menu, 2, 'F', '0', '0', 'qc:qualityReview:edit', 'admin', NOW()); SET @id = @id + 1;
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, menu_type, visible, status, perms, create_by, create_time)
|
||||
VALUES (@id, '质量评审删除', @id_review_menu, 3, 'F', '0', '0', 'qc:qualityReview:delete', 'admin', NOW()); SET @id = @id + 1;
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, menu_type, visible, status, perms, create_by, create_time)
|
||||
VALUES (@id, '质量评审提交送审', @id_review_menu, 4, 'F', '0', '0', 'qc:qualityReview:submit', 'admin', NOW()); SET @id = @id + 1;
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, menu_type, visible, status, perms, create_by, create_time)
|
||||
VALUES (@id, '质量评审审批', @id_review_menu, 5, 'F', '0', '0', 'qc:qualityReview:approve', 'admin', NOW()); SET @id = @id + 1;
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, menu_type, visible, status, perms, create_by, create_time)
|
||||
VALUES (@id, '质量评审执行改判', @id_review_menu, 6, 'F', '0', '0', 'qc:qualityReview:execute', 'admin', NOW());
|
||||
|
||||
-- ==================== 5. 授权admin角色 ====================
|
||||
INSERT IGNORE INTO sys_role_menu (role_id, menu_id) VALUES
|
||||
(1, @parent_quality), (1, @id_review_dir),
|
||||
(1, @id_review_menu), (1, @id_review_todo);
|
||||
-- 按钮权限
|
||||
INSERT IGNORE INTO sys_role_menu (role_id, menu_id) SELECT 1, menu_id FROM sys_menu WHERE parent_id = @id_review_menu AND menu_type = 'F';
|
||||
|
||||
-- ==================== 6. 验证 ====================
|
||||
SELECT 'Dev align OK' AS result;
|
||||
38
docs/sql_fix_online.sql
Normal file
38
docs/sql_fix_online.sql
Normal file
@@ -0,0 +1,38 @@
|
||||
-- =============================================================
|
||||
-- 线上 klp-oa 库修复脚本
|
||||
-- 1. 删除乱码父菜单
|
||||
-- 2. 补充缺失字典
|
||||
-- =============================================================
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
-- ========== 1. 清理乱码父菜单 ==========
|
||||
DELETE FROM sys_role_menu WHERE menu_id = 2100000000000000035;
|
||||
DELETE FROM sys_menu WHERE menu_id = 2100000000000000035;
|
||||
|
||||
-- ========== 2. 补充缺失字典类型 ==========
|
||||
INSERT IGNORE INTO sys_dict_type (dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES ('改判后质量状态', 'regrade_quality_type', '0', 'admin', NOW(), 'admin', NOW(), '');
|
||||
|
||||
-- ========== 3. 补充缺失字典数据 ==========
|
||||
-- quality_review_status 缺的3条
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (2, '待审批', '2', 'quality_review_status', '', 'warning', 'Y', '0', 'admin', NOW());
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (3, '已通过', '3', 'quality_review_status', '', 'success', 'Y', '0', 'admin', NOW());
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (4, '已驳回', '4', 'quality_review_status', '', 'danger', 'Y', '0', 'admin', NOW());
|
||||
|
||||
-- regrade_quality_type 全部5条
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (1, '协议销售', 'protocol_sale', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (2, '转分剪', 'to_slitting', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (3, '降级', 'downgrade', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (4, '返修', 'rework', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
|
||||
VALUES (5, '报废', 'scrap', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
|
||||
-- ========== 4. 验证 ==========
|
||||
SELECT 'OK' as result FROM sys_dict_type WHERE dict_type = 'regrade_quality_type' LIMIT 1;
|
||||
153
docs/sql_quality_review_install.sql
Normal file
153
docs/sql_quality_review_install.sql
Normal file
@@ -0,0 +1,153 @@
|
||||
-- =============================================================
|
||||
-- 质量评审流程 - 安装脚本
|
||||
-- 用法: mysql -h 140.143.206.120 -P 13306 -u klp -p 数据库名 --default-character-set=utf8mb4 < 本文件
|
||||
-- =============================================================
|
||||
SET NAMES utf8mb4;
|
||||
|
||||
-- ========== 1. 彻底清理所有质量评审相关数据 ==========
|
||||
-- 删除角色-菜单关联
|
||||
DELETE FROM sys_role_menu WHERE menu_id IN (SELECT menu_id FROM sys_menu WHERE perms LIKE '%qualityReview%');
|
||||
DELETE FROM sys_role_menu WHERE menu_id IN (SELECT menu_id FROM sys_menu WHERE menu_name = '质量评审' OR menu_name = '质量评审待审批');
|
||||
-- 删除菜单本身
|
||||
DELETE FROM sys_menu WHERE perms LIKE '%qualityReview%';
|
||||
DELETE FROM sys_menu WHERE menu_name = '质量评审';
|
||||
DELETE FROM sys_menu WHERE menu_name = '质量评审待审批';
|
||||
-- 删除字典
|
||||
DELETE FROM sys_dict_data WHERE dict_type = 'quality_review_status';
|
||||
DELETE FROM sys_dict_data WHERE dict_type = 'regrade_quality_type';
|
||||
DELETE FROM sys_dict_type WHERE dict_type = 'quality_review_status';
|
||||
DELETE FROM sys_dict_type WHERE dict_type = 'regrade_quality_type';
|
||||
-- 删表
|
||||
DROP TABLE IF EXISTS qc_quality_review_log;
|
||||
DROP TABLE IF EXISTS qc_quality_review_coil;
|
||||
DROP TABLE IF EXISTS qc_quality_review;
|
||||
|
||||
-- ========== 2. 建表 ==========
|
||||
CREATE TABLE IF NOT EXISTS `qc_quality_review` (
|
||||
`review_id` bigint NOT NULL AUTO_INCREMENT COMMENT '评审单主键',
|
||||
`review_no` varchar(50) NOT NULL COMMENT '评审单编号',
|
||||
`product_name` varchar(100) DEFAULT NULL COMMENT '产品名称',
|
||||
`transmit_dept` varchar(50) DEFAULT NULL COMMENT '传递部门',
|
||||
`transmit_user` varchar(50) DEFAULT NULL COMMENT '传递人',
|
||||
`transmit_date` date DEFAULT NULL COMMENT '传递日期',
|
||||
`prod_date_range` varchar(50) DEFAULT NULL COMMENT '生产日期范围',
|
||||
`flow_status` tinyint(1) DEFAULT '1' COMMENT '流程状态: 1=待提交 2=待审批 3=已通过 4=已驳回',
|
||||
`dept_opinion` text COMMENT '品质部评审意见',
|
||||
`dept_sign` varchar(50) DEFAULT NULL COMMENT '品质部签字人',
|
||||
`dept_sign_date` date DEFAULT NULL COMMENT '品质部签字日期',
|
||||
`leader_opinion` text COMMENT '领导审批意见',
|
||||
`leader_sign` varchar(50) DEFAULT NULL COMMENT '领导签字人',
|
||||
`leader_sign_date` date DEFAULT NULL COMMENT '领导签字日期',
|
||||
`reject_reason` varchar(500) DEFAULT NULL COMMENT '驳回原因',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
`del_flag` tinyint(1) DEFAULT '0' COMMENT '删除标志',
|
||||
`create_by` varchar(50) DEFAULT NULL,
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`update_by` varchar(50) DEFAULT NULL,
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`review_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='质量评审单';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `qc_quality_review_coil` (
|
||||
`detail_id` bigint NOT NULL AUTO_INCREMENT COMMENT '明细主键',
|
||||
`review_id` bigint NOT NULL COMMENT '关联评审单ID',
|
||||
`group_seq` int DEFAULT NULL COMMENT '序号',
|
||||
`group_remark` varchar(200) DEFAULT NULL COMMENT '组备注',
|
||||
`coil_id` bigint DEFAULT NULL COMMENT '钢卷ID',
|
||||
`current_coil_no` varchar(50) DEFAULT NULL COMMENT '产品卷号',
|
||||
`supplier_coil_no` varchar(50) DEFAULT NULL COMMENT '原料卷号',
|
||||
`spec` varchar(50) DEFAULT NULL COMMENT '规格',
|
||||
`net_weight` decimal(10,3) DEFAULT NULL COMMENT '卷重(t)',
|
||||
`defect_desc` text COMMENT '缺陷描述',
|
||||
`before_quality` varchar(20) DEFAULT NULL COMMENT '改判前质量等级',
|
||||
`regrade_quality` varchar(50) DEFAULT NULL COMMENT '改判后质量状态',
|
||||
`execute_status` tinyint(1) DEFAULT '0' COMMENT '执行状态: 0=待执行 1=已执行',
|
||||
`execute_time` datetime DEFAULT NULL COMMENT '执行时间',
|
||||
`remark` varchar(500) DEFAULT NULL,
|
||||
`del_flag` tinyint(1) DEFAULT '0',
|
||||
`create_by` varchar(50) DEFAULT NULL,
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`update_by` varchar(50) DEFAULT NULL,
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`detail_id`),
|
||||
KEY `idx_review_id` (`review_id`),
|
||||
KEY `idx_coil_id` (`coil_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='质量评审钢卷明细';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `qc_quality_review_log` (
|
||||
`log_id` bigint NOT NULL AUTO_INCREMENT COMMENT '日志主键',
|
||||
`review_id` bigint NOT NULL COMMENT '关联评审单ID',
|
||||
`action` varchar(20) NOT NULL COMMENT '动作: submit/approve/reject',
|
||||
`operator` varchar(50) DEFAULT NULL COMMENT '操作人',
|
||||
`opinion` text COMMENT '审批意见',
|
||||
`operate_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '操作时间',
|
||||
`create_by` varchar(50) DEFAULT NULL,
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`log_id`),
|
||||
KEY `idx_review_id` (`review_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='质量评审审批日志';
|
||||
|
||||
-- ========== 3. 字典 ==========
|
||||
INSERT IGNORE INTO sys_dict_type (dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES ('Quality Review Status', 'quality_review_status', '0', 'admin', NOW(), 'admin', NOW(), '');
|
||||
INSERT IGNORE INTO sys_dict_type (dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES ('Regrade Quality Type', 'regrade_quality_type', '0', 'admin', NOW(), 'admin', NOW(), '');
|
||||
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) VALUES (1, '待提交', '1', 'quality_review_status', '', 'info', 'Y', '0', 'admin', NOW());
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) VALUES (2, '待审批', '2', 'quality_review_status', '', 'warning', 'Y', '0', 'admin', NOW());
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) VALUES (3, '已通过', '3', 'quality_review_status', '', 'success', 'Y', '0', 'admin', NOW());
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) VALUES (4, '已驳回', '4', 'quality_review_status', '', 'danger', 'Y', '0', 'admin', NOW());
|
||||
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) VALUES (1, '协议销售', 'protocol_sale', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) VALUES (2, '转分剪', 'to_slitting', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) VALUES (3, '降级', 'downgrade', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) VALUES (4, '返修', 'rework', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time) VALUES (5, '报废', 'scrap', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());
|
||||
|
||||
-- ========== 4. 创建菜单 ==========
|
||||
-- 父菜单: 质量模块 (path=quality, menu_id=2068954238598967297)
|
||||
SET @parent_id = 2068954238598967297;
|
||||
SET @max_order = (SELECT COALESCE(MAX(order_num), 0) FROM sys_menu WHERE parent_id = @parent_id);
|
||||
SET @max_id = (SELECT COALESCE(MAX(menu_id), 0) FROM sys_menu);
|
||||
|
||||
SET @id1 = @max_id + 1;
|
||||
SET @id2 = @max_id + 2;
|
||||
SET @id3 = @max_id + 3;
|
||||
SET @id4 = @max_id + 4;
|
||||
SET @id5 = @max_id + 5;
|
||||
SET @id6 = @max_id + 6;
|
||||
SET @id7 = @max_id + 7;
|
||||
SET @id8 = @max_id + 8;
|
||||
|
||||
-- 质量评审菜单 (type=C 菜单)
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
|
||||
VALUES (@id1, '质量评审', @parent_id, @max_order + 1, 'qualityReview', 'mes/qc/qualityReview/index', 1, 0, 'C', '0', '0', 'qc:qualityReview:list', 'guide', 'admin', NOW());
|
||||
|
||||
-- 质量评审待审批 (type=C 隐藏)
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time)
|
||||
VALUES (@id2, '质量评审待审批', @parent_id, @max_order + 2, 'qualityReviewTodo', 'mes/qc/qualityReview/todo', 1, 0, 'C', '1', '0', 'qc:qualityReview:approve', 'checkbox', 'admin', NOW());
|
||||
|
||||
-- 按钮权限 (type=F)
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, menu_type, visible, status, perms, create_by, create_time)
|
||||
VALUES (@id3, '质量评审新增', @id1, 1, 'F', '0', '0', 'qc:qualityReview:add', 'admin', NOW());
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, menu_type, visible, status, perms, create_by, create_time)
|
||||
VALUES (@id4, '质量评审修改', @id1, 2, 'F', '0', '0', 'qc:qualityReview:edit', 'admin', NOW());
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, menu_type, visible, status, perms, create_by, create_time)
|
||||
VALUES (@id5, '质量评审删除', @id1, 3, 'F', '0', '0', 'qc:qualityReview:delete', 'admin', NOW());
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, menu_type, visible, status, perms, create_by, create_time)
|
||||
VALUES (@id6, '质量评审提交送审', @id1, 4, 'F', '0', '0', 'qc:qualityReview:submit', 'admin', NOW());
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, menu_type, visible, status, perms, create_by, create_time)
|
||||
VALUES (@id7, '质量评审审批', @id1, 5, 'F', '0', '0', 'qc:qualityReview:approve', 'admin', NOW());
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, menu_type, visible, status, perms, create_by, create_time)
|
||||
VALUES (@id8, '质量评审执行改判', @id1, 6, 'F', '0', '0', 'qc:qualityReview:execute', 'admin', NOW());
|
||||
|
||||
-- ========== 5. 授权 admin 角色 ==========
|
||||
INSERT IGNORE INTO sys_role_menu (role_id, menu_id) VALUES
|
||||
(1, @parent_id), (1, @id1), (1, @id2),
|
||||
(1, @id3), (1, @id4), (1, @id5),
|
||||
(1, @id6), (1, @id7), (1, @id8);
|
||||
|
||||
-- ========== 6. 验证 ==========
|
||||
SELECT CONCAT('Tables: ', COUNT(*)) AS result FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME LIKE 'qc_quality_review%';
|
||||
SELECT CONCAT('Dict: ', dict_type) AS result FROM sys_dict_type WHERE dict_type = 'quality_review_status';
|
||||
SELECT CONCAT('Menu: ', menu_name, ' -> parent_id=', parent_id) AS result FROM sys_menu WHERE perms = 'qc:qualityReview:list';
|
||||
@@ -129,6 +129,28 @@
|
||||
<artifactId>klp-cost</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.klp</groupId>
|
||||
<artifactId>klp-flow</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 产品和工艺模块-->
|
||||
<dependency>
|
||||
<groupId>com.klp</groupId>
|
||||
<artifactId>klp-pt</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 工艺模型配置模块-->
|
||||
<dependency>
|
||||
<groupId>com.klp</groupId>
|
||||
<artifactId>klp-pltcm</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 性能管理模块-->
|
||||
<dependency>
|
||||
<groupId>com.klp</groupId>
|
||||
<artifactId>klp-perf</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -361,6 +361,15 @@ public class SqlServerApiClient {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public ExecuteSqlResponse queryExcoilByHotCoilId(String hotCoilId) {
|
||||
return executeSql(
|
||||
"oracle",
|
||||
"select * from JXPLTCM.PLTCM_PDO_EXCOIL where HOT_COILID = :hotCoilId",
|
||||
singletonParam("hotCoilId", hotCoilId)
|
||||
);
|
||||
}
|
||||
|
||||
public ExecuteSqlResponse queryPlanListByHotCoilIdLike(String hotCoilId, int page, int pageSize) {
|
||||
int endRow = page * pageSize;
|
||||
int startRow = endRow - pageSize;
|
||||
@@ -504,7 +513,7 @@ public class SqlServerApiClient {
|
||||
params.put("endRow", endRow);
|
||||
StringBuilder where = new StringBuilder();
|
||||
if (coilId != null && !coilId.trim().isEmpty()) {
|
||||
where.append(" AND UPPER(EXCOILID) LIKE '%' || UPPER(:coilId) || '%'");
|
||||
where.append(" AND (UPPER(EXCOILID) LIKE '%' || UPPER(:coilId) || '%' OR UPPER(HOT_COILID) LIKE '%' || UPPER(:coilId) || '%')");
|
||||
params.put("coilId", coilId.trim());
|
||||
}
|
||||
if (startDate != null && !startDate.trim().isEmpty()) {
|
||||
@@ -524,7 +533,7 @@ public class SqlServerApiClient {
|
||||
Map<String, Object> params = new java.util.HashMap<>();
|
||||
StringBuilder where = new StringBuilder();
|
||||
if (coilId != null && !coilId.trim().isEmpty()) {
|
||||
where.append(" AND UPPER(EXCOILID) LIKE '%' || UPPER(:coilId) || '%'");
|
||||
where.append(" AND (UPPER(EXCOILID) LIKE '%' || UPPER(:coilId) || '%' OR UPPER(HOT_COILID) LIKE '%' || UPPER(:coilId) || '%')");
|
||||
params.put("coilId", coilId.trim());
|
||||
}
|
||||
if (startDate != null && !startDate.trim().isEmpty()) {
|
||||
|
||||
@@ -122,7 +122,10 @@ public class SqlServerApiBusinessService {
|
||||
* 计划详情:按热卷号查询。
|
||||
*/
|
||||
public PlanDetailView getPlanByHotCoilId(String hotCoilId) {
|
||||
return PlanDetailView.fromExecuteSqlResponse(hotCoilId, client.queryPlanByHotCoilId(hotCoilId));
|
||||
SqlServerApiClient.ExecuteSqlResponse planResponse = client.queryPlanByHotCoilId(hotCoilId);
|
||||
SqlServerApiClient.ExecuteSqlResponse excoilResponse = null;
|
||||
excoilResponse = client.queryExcoilByHotCoilId(hotCoilId);
|
||||
return PlanDetailView.fromExecuteSqlResponse(hotCoilId, planResponse, excoilResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -249,6 +252,49 @@ public class SqlServerApiBusinessService {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试用:统计 V_VBDA_GAUGE 中各 THICK 列的非空/非零数量,
|
||||
* 用于排查"末架出口厚度恒为 0"问题——确认实际数据落在哪一列。
|
||||
*/
|
||||
public Map<String, Object> getGaugeStats(String matId) {
|
||||
List<Map<String, Object>> rows = asRowList(client.queryGaugeByMatId(matId));
|
||||
String[] cols = {"THICK0", "THICK1", "THICK4", "THICK5",
|
||||
"THICK0REF", "THICK1REF", "THICK4REF", "THICK5REF"};
|
||||
Map<String, Object> stats = new LinkedHashMap<>();
|
||||
for (String col : cols) {
|
||||
long nonNull = 0, nonZero = 0;
|
||||
Double min = null, max = null;
|
||||
for (Map<String, Object> r : rows) {
|
||||
Object raw = r.get(col);
|
||||
if (raw == null) raw = r.get(col.toLowerCase());
|
||||
if (raw == null) continue;
|
||||
nonNull++;
|
||||
Number n = asNumber(raw);
|
||||
if (n == null) continue;
|
||||
double d = n.doubleValue();
|
||||
if (d != 0.0) nonZero++;
|
||||
if (min == null || d < min) min = d;
|
||||
if (max == null || d > max) max = d;
|
||||
}
|
||||
Map<String, Object> info = new LinkedHashMap<>();
|
||||
info.put("nonNullCount", nonNull);
|
||||
info.put("nonZeroCount", nonZero);
|
||||
info.put("min", min);
|
||||
info.put("max", max);
|
||||
stats.put(col, info);
|
||||
}
|
||||
Map<String, Object> result = new LinkedHashMap<>();
|
||||
result.put("matId", matId);
|
||||
result.put("totalRows", rows.size());
|
||||
result.put("columnStats", stats);
|
||||
List<Map<String, Object>> samples = new ArrayList<>();
|
||||
if (!rows.isEmpty()) samples.add(rows.get(0));
|
||||
if (rows.size() > 1) samples.add(rows.get(rows.size() / 2));
|
||||
if (rows.size() > 2) samples.add(rows.get(rows.size() - 1));
|
||||
result.put("sampleRows", samples);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 轧辊数据:返回全部在辊/备辊数据。
|
||||
*/
|
||||
@@ -378,11 +424,13 @@ public class SqlServerApiBusinessService {
|
||||
private final String coilId;
|
||||
private final List<Map<String, Object>> rows;
|
||||
private final Map<String, Object> firstRow;
|
||||
private final List<Map<String, Object>> excoilRows;
|
||||
|
||||
public PlanDetailView(String coilId, List<Map<String, Object>> rows, Map<String, Object> firstRow) {
|
||||
public PlanDetailView(String coilId, List<Map<String, Object>> rows, Map<String, Object> firstRow, List<Map<String, Object>> excoilRows) {
|
||||
this.coilId = coilId;
|
||||
this.rows = rows;
|
||||
this.firstRow = firstRow;
|
||||
this.excoilRows = excoilRows;
|
||||
}
|
||||
|
||||
public String getCoilId() {
|
||||
@@ -397,10 +445,21 @@ public class SqlServerApiBusinessService {
|
||||
return firstRow;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getExcoilRows() {
|
||||
return excoilRows;
|
||||
}
|
||||
|
||||
public static PlanDetailView fromExecuteSqlResponse(String coilId, SqlServerApiClient.ExecuteSqlResponse response) {
|
||||
List<Map<String, Object>> rows = asRowList(response);
|
||||
Map<String, Object> firstRow = rows.isEmpty() ? Collections.<String, Object>emptyMap() : rows.get(0);
|
||||
return new PlanDetailView(coilId, rows, firstRow);
|
||||
return new PlanDetailView(coilId, rows, firstRow, Collections.<Map<String, Object>>emptyList());
|
||||
}
|
||||
|
||||
public static PlanDetailView fromExecuteSqlResponse(String coilId, SqlServerApiClient.ExecuteSqlResponse response, SqlServerApiClient.ExecuteSqlResponse excoilResponse) {
|
||||
List<Map<String, Object>> rows = asRowList(response);
|
||||
Map<String, Object> firstRow = rows.isEmpty() ? Collections.<String, Object>emptyMap() : rows.get(0);
|
||||
List<Map<String, Object>> excoilRows = asRowList(excoilResponse);
|
||||
return new PlanDetailView(coilId, rows, firstRow, excoilRows);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,15 @@ public class SqlServerApiController {
|
||||
return R.ok(businessService.getRealtimeData(matId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试用:V_VBDA_GAUGE 各 THICK 列非空/非零统计 + 样本行。
|
||||
* 用于定位"末架出口厚度恒为 0"问题。
|
||||
*/
|
||||
@GetMapping("/test/gauge-stats/{matId}")
|
||||
public R<Map<String, Object>> testGaugeStats(@PathVariable String matId) {
|
||||
return R.ok(businessService.getGaugeStats(matId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 轧辊数据:type / status 均可选,不传则返回全量。
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.klp.web.controller.monitor;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.system.domain.bo.OperPerformanceQuery;
|
||||
import com.klp.system.domain.vo.OperMenuGroupVO;
|
||||
import com.klp.system.domain.vo.OperModuleStatVO;
|
||||
import com.klp.system.domain.vo.OperPersonVO;
|
||||
import com.klp.system.domain.vo.OperSummaryVO;
|
||||
import com.klp.system.service.ISysOperLogService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 绩效汇总
|
||||
*
|
||||
* @author Reasonix
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/monitor/performance")
|
||||
public class OperPerformanceController extends BaseController {
|
||||
|
||||
private final ISysOperLogService operLogService;
|
||||
|
||||
/**
|
||||
* 绩效概览统计
|
||||
*/
|
||||
@SaCheckPermission("monitor:performance:list")
|
||||
@GetMapping("/summary")
|
||||
public R<OperSummaryVO> summary(OperPerformanceQuery query) {
|
||||
return R.ok(operLogService.selectPerformanceSummary(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员绩效列表(含模块明细)
|
||||
*/
|
||||
@SaCheckPermission("monitor:performance:list")
|
||||
@GetMapping("/person")
|
||||
public R<List<OperPersonVO>> person(OperPerformanceQuery query) {
|
||||
return R.ok(operLogService.selectPersonPerformance(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 模块使用排行
|
||||
*/
|
||||
@SaCheckPermission("monitor:performance:list")
|
||||
@GetMapping("/module")
|
||||
public R<List<OperModuleStatVO>> module(OperPerformanceQuery query) {
|
||||
return R.ok(operLogService.selectModuleRanking(query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按菜单分组绩效统计(oper_page 匹配一级菜单 path)
|
||||
*/
|
||||
@SaCheckPermission("monitor:performance:list")
|
||||
@GetMapping("/menuGroup")
|
||||
public R<List<OperMenuGroupVO>> menuGroup(OperPerformanceQuery query) {
|
||||
return R.ok(operLogService.selectMenuGroupPerformance(query));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.klp.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.system.domain.vo.SysFileCommentVo;
|
||||
import com.klp.system.domain.bo.SysFileCommentBo;
|
||||
import com.klp.system.service.ISysFileCommentService;
|
||||
|
||||
/**
|
||||
* 文件评论
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-07-04
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/file/comment")
|
||||
public class SysFileCommentController extends BaseController {
|
||||
|
||||
private final ISysFileCommentService iSysFileCommentService;
|
||||
|
||||
/**
|
||||
* 查询文件评论列表
|
||||
*/
|
||||
@GetMapping("/list/{fileId}")
|
||||
public R<List<SysFileCommentVo>> list(@NotNull(message = "文件ID不能为空") @PathVariable Long fileId) {
|
||||
return R.ok(iSysFileCommentService.queryListByFileId(fileId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文件评论
|
||||
*/
|
||||
@Log(title = "文件评论", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysFileCommentBo bo) {
|
||||
return toAjax(iSysFileCommentService.insertByBo(bo));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.klp.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.system.domain.vo.SysFileVo;
|
||||
import com.klp.system.domain.bo.SysFileBo;
|
||||
import com.klp.system.service.ISysFileService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 文件主信息
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-30
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/file")
|
||||
public class SysFileController extends BaseController {
|
||||
|
||||
private final ISysFileService iSysFileService;
|
||||
|
||||
/**
|
||||
* 查询文件主信息列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysFileVo> list(SysFileBo bo, PageQuery pageQuery) {
|
||||
return iSysFileService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出文件主信息列表
|
||||
*/
|
||||
@Log(title = "文件主信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(SysFileBo bo, HttpServletResponse response) {
|
||||
List<SysFileVo> list = iSysFileService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "文件主信息", SysFileVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件主信息详细信息
|
||||
*
|
||||
* @param fileId 主键
|
||||
*/
|
||||
@GetMapping("/{fileId}")
|
||||
public R<SysFileVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long fileId) {
|
||||
return R.ok(iSysFileService.queryById(fileId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文件主信息
|
||||
*/
|
||||
@Log(title = "文件主信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Long> add(@Validated(AddGroup.class) @RequestBody SysFileBo bo) {
|
||||
iSysFileService.insertByBo(bo);
|
||||
return R.ok(bo.getFileId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文件主信息
|
||||
*/
|
||||
@Log(title = "文件主信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysFileBo bo) {
|
||||
return toAjax(iSysFileService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件主信息
|
||||
*
|
||||
* @param fileIds 主键串
|
||||
*/
|
||||
@Log(title = "文件主信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{fileIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] fileIds) {
|
||||
return toAjax(iSysFileService.deleteWithValidByIds(Arrays.asList(fileIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件浏览次数 +1
|
||||
*/
|
||||
@PutMapping("/incrementView/{fileId}")
|
||||
public R<Void> incrementView(@NotNull(message = "主键不能为空") @PathVariable Long fileId) {
|
||||
iSysFileService.incrementViewCount(fileId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询与我相关的文件(私有文件且当前用户在可见用户列表中)
|
||||
*/
|
||||
@GetMapping("/relatedToMe")
|
||||
public TableDataInfo<SysFileVo> relatedToMe(SysFileBo bo, PageQuery pageQuery) {
|
||||
return iSysFileService.queryPageListRelatedToMe(bo, pageQuery);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.klp.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.system.domain.vo.SysFileVisibleUserVo;
|
||||
import com.klp.system.domain.bo.SysFileVisibleUserBo;
|
||||
import com.klp.system.service.ISysFileVisibleUserService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 私有文件可见用户多对多关联
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-30
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/fileVisibleUser")
|
||||
public class SysFileVisibleUserController extends BaseController {
|
||||
|
||||
private final ISysFileVisibleUserService iSysFileVisibleUserService;
|
||||
|
||||
/**
|
||||
* 查询私有文件可见用户多对多关联列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysFileVisibleUserVo> list(SysFileVisibleUserBo bo, PageQuery pageQuery) {
|
||||
return iSysFileVisibleUserService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出私有文件可见用户多对多关联列表
|
||||
*/
|
||||
@Log(title = "私有文件可见用户多对多关联", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(SysFileVisibleUserBo bo, HttpServletResponse response) {
|
||||
List<SysFileVisibleUserVo> list = iSysFileVisibleUserService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "私有文件可见用户多对多关联", SysFileVisibleUserVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取私有文件可见用户多对多关联详细信息
|
||||
*
|
||||
* @param visibleId 主键
|
||||
*/
|
||||
@GetMapping("/{visibleId}")
|
||||
public R<SysFileVisibleUserVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long visibleId) {
|
||||
return R.ok(iSysFileVisibleUserService.queryById(visibleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增私有文件可见用户多对多关联
|
||||
*/
|
||||
@Log(title = "私有文件可见用户多对多关联", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysFileVisibleUserBo bo) {
|
||||
return toAjax(iSysFileVisibleUserService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改私有文件可见用户多对多关联
|
||||
*/
|
||||
@Log(title = "私有文件可见用户多对多关联", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysFileVisibleUserBo bo) {
|
||||
return toAjax(iSysFileVisibleUserService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除私有文件可见用户多对多关联
|
||||
*
|
||||
* @param visibleIds 主键串
|
||||
*/
|
||||
@Log(title = "私有文件可见用户多对多关联", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{visibleIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] visibleIds) {
|
||||
return toAjax(iSysFileVisibleUserService.deleteWithValidByIds(Arrays.asList(visibleIds), true));
|
||||
}
|
||||
}
|
||||
@@ -84,6 +84,8 @@ public class SysMenuController extends BaseController {
|
||||
public R<Void> add(@Validated @RequestBody SysMenu menu) {
|
||||
if (!menuService.checkMenuNameUnique(menu)) {
|
||||
return R.fail("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||
} else if (StringUtils.isNotBlank(menu.getMenuKey()) && !menuService.checkMenuKeyUnique(menu)) {
|
||||
return R.fail("新增菜单'" + menu.getMenuName() + "'失败,菜单唯一标识'" + menu.getMenuKey() + "'已存在");
|
||||
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) {
|
||||
return R.fail("新增菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||
}
|
||||
@@ -99,6 +101,8 @@ public class SysMenuController extends BaseController {
|
||||
public R<Void> edit(@Validated @RequestBody SysMenu menu) {
|
||||
if (!menuService.checkMenuNameUnique(menu)) {
|
||||
return R.fail("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||
} else if (StringUtils.isNotBlank(menu.getMenuKey()) && !menuService.checkMenuKeyUnique(menu)) {
|
||||
return R.fail("修改菜单'" + menu.getMenuName() + "'失败,菜单唯一标识'" + menu.getMenuKey() + "'已存在");
|
||||
} else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) {
|
||||
return R.fail("修改菜单'" + menu.getMenuName() + "'失败,地址必须以http(s)://开头");
|
||||
} else if (menu.getMenuId().equals(menu.getParentId())) {
|
||||
@@ -124,4 +128,29 @@ public class SysMenuController extends BaseController {
|
||||
}
|
||||
return toAjax(menuService.deleteMenuById(menuId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 menuKey 获取菜单信息(供流程图等外部固定引用跳转)
|
||||
*
|
||||
* @param menuKey 菜单唯一标识
|
||||
*/
|
||||
@GetMapping("/getByKey")
|
||||
public R<SysMenu> getByKey(@RequestParam String menuKey) {
|
||||
SysMenu menu = menuService.selectMenuByMenuKey(menuKey);
|
||||
if (menu == null) {
|
||||
return R.fail("菜单唯一标识 '" + menuKey + "' 不存在");
|
||||
}
|
||||
return R.ok(menu);
|
||||
}
|
||||
|
||||
/**
|
||||
* 为现有菜单自动生成 menu_key(仅处理 menu_key 为空且类型为 C/M 的菜单)
|
||||
*/
|
||||
@SaCheckPermission("system:menu:edit")
|
||||
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/generateMenuKeys")
|
||||
public R<Void> generateMenuKeys() {
|
||||
int count = menuService.generateMenuKeys();
|
||||
return R.ok("成功为 " + count + " 个菜单生成 menu_key");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,24 @@ public class SysUserController extends BaseController {
|
||||
return userService.selectPageUserList(user, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色标识查询用户列表(用于选择审批人等场景)
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/selectUserByRole/{roleKey}")
|
||||
public R<List<SysUser>> selectUserByRoleKey(@PathVariable String roleKey) {
|
||||
return R.ok(userService.selectUserByRoleKey(roleKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询请购审批人列表(角色标识 glc)
|
||||
*/
|
||||
@SaCheckLogin
|
||||
@GetMapping("/approverUsers/list")
|
||||
public R<List<SysUser>> approverUsers() {
|
||||
return R.ok(userService.selectUserByRoleKey("glc"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户列表
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
-- ------------------------------------------------------------
|
||||
-- 质量评审流程 - 异常产品评审审批单
|
||||
-- V15__qc_quality_review.sql
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
-- 1. 字典类型
|
||||
INSERT INTO `sys_dict_type` VALUES (NULL, '质量评审状态', 'quality_review_status', '0', 'admin', NOW(), '', NULL, '质量评审单流程状态');
|
||||
INSERT INTO `sys_dict_type` VALUES (NULL, '改判后质量状态', 'regrade_quality_type', '0', 'admin', NOW(), '', NULL, '领导审批时指定的改判结果');
|
||||
|
||||
-- 2. 字典数据 - 质量评审状态
|
||||
INSERT INTO `sys_dict_data` VALUES (NULL, 1, '待提交', '1', 'quality_review_status', '', 'info', 'Y', '0', 'admin', NOW(), '', NULL, '');
|
||||
INSERT INTO `sys_dict_data` VALUES (NULL, 2, '待审批', '2', 'quality_review_status', '', 'warning', 'Y', '0', 'admin', NOW(), '', NULL, '');
|
||||
INSERT INTO `sys_dict_data` VALUES (NULL, 3, '已通过', '3', 'quality_review_status', '', 'success', 'Y', '0', 'admin', NOW(), '', NULL, '');
|
||||
INSERT INTO `sys_dict_data` VALUES (NULL, 4, '已驳回', '4', 'quality_review_status', '', 'danger', 'Y', '0', 'admin', NOW(), '', NULL, '');
|
||||
|
||||
-- 3. 字典数据 - 改判后质量状态
|
||||
INSERT INTO `sys_dict_data` VALUES (NULL, 1, '协议销售', 'protocol_sale', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW(), '', NULL, '');
|
||||
INSERT INTO `sys_dict_data` VALUES (NULL, 2, '转分剪', 'to_slitting', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW(), '', NULL, '');
|
||||
INSERT INTO `sys_dict_data` VALUES (NULL, 3, '降级', 'downgrade', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW(), '', NULL, '');
|
||||
INSERT INTO `sys_dict_data` VALUES (NULL, 4, '返修', 'rework', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW(), '', NULL, '');
|
||||
INSERT INTO `sys_dict_data` VALUES (NULL, 5, '报废', 'scrap', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW(), '', NULL, '');
|
||||
|
||||
-- 4. 质量评审主表
|
||||
CREATE TABLE `qc_quality_review` (
|
||||
`review_id` bigint NOT NULL AUTO_INCREMENT COMMENT '评审单主键',
|
||||
`review_no` varchar(50) NOT NULL COMMENT '评审单编号(QR-2026-XXXX)',
|
||||
`product_name` varchar(100) DEFAULT NULL COMMENT '产品名称',
|
||||
`transmit_dept` varchar(50) DEFAULT '品质部' COMMENT '传递部门',
|
||||
`transmit_user` varchar(50) DEFAULT NULL COMMENT '传递人',
|
||||
`transmit_date` date DEFAULT NULL COMMENT '传递日期',
|
||||
`prod_date_range` varchar(50) DEFAULT NULL COMMENT '生产日期范围',
|
||||
|
||||
-- 流程状态
|
||||
`flow_status` tinyint(1) DEFAULT '1' COMMENT '流程状态:1=待提交 2=待审批 3=已通过 4=已驳回',
|
||||
|
||||
-- 品质部评审
|
||||
`dept_opinion` text COMMENT '品质部评审意见',
|
||||
`dept_sign` varchar(50) DEFAULT NULL COMMENT '品质部签字人',
|
||||
`dept_sign_date` date DEFAULT NULL COMMENT '品质部签字日期',
|
||||
|
||||
-- 领导审批
|
||||
`leader_opinion` text COMMENT '领导审批意见',
|
||||
`leader_sign` varchar(50) DEFAULT NULL COMMENT '领导签字人',
|
||||
`leader_sign_date` date DEFAULT NULL COMMENT '领导签字日期',
|
||||
`reject_reason` varchar(500) DEFAULT NULL COMMENT '驳回原因',
|
||||
|
||||
-- 公共基础字段
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
`del_flag` tinyint(1) DEFAULT '0' COMMENT '删除标志(0=正常,1=已删除)',
|
||||
`create_by` varchar(50) DEFAULT '' COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_by` varchar(50) DEFAULT '' COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
PRIMARY KEY (`review_id`) USING BTREE,
|
||||
UNIQUE KEY `uk_review_no` (`review_no`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='质量评审单';
|
||||
|
||||
-- 5. 质量评审钢卷明细表
|
||||
CREATE TABLE `qc_quality_review_coil` (
|
||||
`detail_id` bigint NOT NULL AUTO_INCREMENT COMMENT '明细主键',
|
||||
`review_id` bigint NOT NULL COMMENT '关联评审单ID',
|
||||
|
||||
-- 钢卷分组信息
|
||||
`group_seq` int DEFAULT NULL COMMENT '序号(1,2,3...)',
|
||||
`group_remark` varchar(200) DEFAULT NULL COMMENT '组备注(如"含3个钢卷")',
|
||||
|
||||
-- 钢卷信息
|
||||
`coil_id` bigint DEFAULT NULL COMMENT '钢卷ID(关联wms_material_coil)',
|
||||
`current_coil_no` varchar(50) DEFAULT NULL COMMENT '产品卷号',
|
||||
`supplier_coil_no` varchar(50) DEFAULT NULL COMMENT '原料卷号',
|
||||
`spec` varchar(50) DEFAULT NULL COMMENT '规格(如1.35×1250)',
|
||||
`net_weight` decimal(10,3) DEFAULT NULL COMMENT '卷重(t)',
|
||||
|
||||
-- 缺陷与改判
|
||||
`defect_desc` text COMMENT '缺陷描述',
|
||||
`before_quality` varchar(20) DEFAULT NULL COMMENT '改判前质量等级(系统自动带出)',
|
||||
`regrade_quality` varchar(50) DEFAULT NULL COMMENT '改判后质量状态(字典:regrade_quality_type)',
|
||||
`execute_status` tinyint(1) DEFAULT '0' COMMENT '执行状态:0=待执行 1=已执行',
|
||||
`execute_time` datetime DEFAULT NULL COMMENT '执行时间',
|
||||
|
||||
-- 公共基础字段
|
||||
`remark` varchar(500) DEFAULT NULL,
|
||||
`del_flag` tinyint(1) DEFAULT '0',
|
||||
`create_by` varchar(50) DEFAULT '',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
`update_by` varchar(50) DEFAULT '',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`detail_id`) USING BTREE,
|
||||
KEY `idx_review_id` (`review_id`) USING BTREE,
|
||||
KEY `idx_coil_id` (`coil_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='质量评审钢卷明细';
|
||||
|
||||
-- 6. 质量评审审批日志表
|
||||
CREATE TABLE `qc_quality_review_log` (
|
||||
`log_id` bigint NOT NULL AUTO_INCREMENT COMMENT '日志主键',
|
||||
`review_id` bigint NOT NULL COMMENT '关联评审单ID',
|
||||
`action` varchar(20) NOT NULL COMMENT '动作:submit=提交 approve=通过 reject=驳回',
|
||||
`operator` varchar(50) DEFAULT NULL COMMENT '操作人',
|
||||
`opinion` text COMMENT '审批意见',
|
||||
`operate_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '操作时间',
|
||||
`create_by` varchar(50) DEFAULT '',
|
||||
`create_time` datetime DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`log_id`) USING BTREE,
|
||||
KEY `idx_review_id` (`review_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='质量评审审批日志';
|
||||
@@ -0,0 +1,10 @@
|
||||
-- ------------------------------------------------------------
|
||||
-- 质量评审 — 钢卷明细增加逻辑库区字段
|
||||
-- V16__qc_quality_review_warehouse.sql
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
ALTER TABLE `qc_quality_review_coil`
|
||||
ADD COLUMN `before_warehouse_id` bigint DEFAULT NULL COMMENT '改判前逻辑库区ID' AFTER `before_quality`,
|
||||
ADD COLUMN `before_warehouse_name` varchar(100) DEFAULT NULL COMMENT '改判前逻辑库区名称' AFTER `before_warehouse_id`,
|
||||
ADD COLUMN `target_warehouse_id` bigint DEFAULT NULL COMMENT '改判后目标库区ID' AFTER `regrade_quality`,
|
||||
ADD COLUMN `target_warehouse_name` varchar(100) DEFAULT NULL COMMENT '改判后目标库区名称' AFTER `target_warehouse_id`;
|
||||
@@ -36,6 +36,9 @@ CREATE TABLE IF NOT EXISTS wms_furnace_plan_coil (
|
||||
plan_coil_id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
plan_id BIGINT NOT NULL COMMENT '计划ID',
|
||||
coil_id BIGINT NOT NULL COMMENT '钢卷ID',
|
||||
logic_warehouse_id BIGINT NULL COMMENT '逻辑库区去向(钢卷退火后目标逻辑库区)',
|
||||
furnace_level TINYINT(1) NULL COMMENT '炉火层级(1=一层,2=二层,3=三层)',
|
||||
contract_id BIGINT NULL COMMENT '合同ID',
|
||||
del_flag TINYINT DEFAULT 0 COMMENT '删除标记(0正常 1删除)',
|
||||
create_by VARCHAR(64) NULL,
|
||||
update_by VARCHAR(64) NULL,
|
||||
|
||||
@@ -76,6 +76,16 @@ public class ApsPlanDetailController extends BaseController {
|
||||
return toAjax(iApsPlanDetailService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增排产单明细
|
||||
*/
|
||||
@Log(title = "排产单明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/batch")
|
||||
public R<Void> batchAdd(@Validated(AddGroup.class) @RequestBody List<ApsPlanDetailBo> boList) {
|
||||
return toAjax(iApsPlanDetailService.insertBatchByBo(boList));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排产单明细
|
||||
*/
|
||||
|
||||
@@ -226,5 +226,9 @@ public class ApsPlanDetailBo extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 排产日期(字符串格式,例如 '2025-12-29')
|
||||
*/
|
||||
private String detailDate;
|
||||
|
||||
}
|
||||
|
||||
@@ -52,6 +52,11 @@ public class ApsPlanSheetBo extends BaseEntity {
|
||||
*/
|
||||
private String planType;
|
||||
|
||||
/**
|
||||
* 排产文件
|
||||
*/
|
||||
private String apsUrl;
|
||||
|
||||
/**
|
||||
* 排产人
|
||||
*/
|
||||
|
||||
@@ -184,6 +184,10 @@ public class ApsPlanDetail extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 排产日期(字符串格式,例如 '2025-12-29')
|
||||
*/
|
||||
private String detailDate;
|
||||
/**
|
||||
* 删除标记(0正常 1删除)
|
||||
*/
|
||||
|
||||
@@ -49,6 +49,10 @@ public class ApsPlanSheet extends BaseEntity {
|
||||
* 排产类型
|
||||
*/
|
||||
private String planType;
|
||||
/**
|
||||
* 排产文件
|
||||
*/
|
||||
private String apsUrl;
|
||||
/**
|
||||
* 排产人
|
||||
*/
|
||||
|
||||
@@ -261,6 +261,12 @@ public class ApsPlanDetailVo {
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 排产日期(字符串格式,例如 '2025-12-29')
|
||||
*/
|
||||
@ExcelProperty(value = "排产日期")
|
||||
private String detailDate;
|
||||
|
||||
/**
|
||||
* 技术附件
|
||||
*/
|
||||
|
||||
@@ -60,6 +60,12 @@ public class ApsPlanSheetVo {
|
||||
@ExcelProperty(value = "排产类型")
|
||||
private String planType;
|
||||
|
||||
/**
|
||||
* 排产文件
|
||||
*/
|
||||
@ExcelProperty(value = "排产文件")
|
||||
private String apsUrl;
|
||||
|
||||
/**
|
||||
* 排产人
|
||||
*/
|
||||
|
||||
@@ -43,6 +43,11 @@ public interface IApsPlanDetailService {
|
||||
*/
|
||||
Boolean insertByBo(ApsPlanDetailBo bo);
|
||||
|
||||
/**
|
||||
* 批量新增排产单明细
|
||||
*/
|
||||
Boolean insertBatchByBo(List<ApsPlanDetailBo> boList);
|
||||
|
||||
/**
|
||||
* 修改排产单明细
|
||||
*/
|
||||
|
||||
@@ -101,6 +101,7 @@ public class ApsPlanDetailServiceImpl implements IApsPlanDetailService {
|
||||
qw.eq(StringUtils.isNotBlank(bo.getSampleReq()), "d.sample_req", bo.getSampleReq());
|
||||
qw.eq(bo.getStartTime() != null, "d.start_time", bo.getStartTime());
|
||||
qw.eq(bo.getEndTime() != null, "d.end_time", bo.getEndTime());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getDetailDate()), "d.detail_date", bo.getDetailDate());
|
||||
//根据创建时间倒叙
|
||||
qw.orderByDesc("d.create_time");
|
||||
return qw;
|
||||
@@ -168,6 +169,7 @@ public class ApsPlanDetailServiceImpl implements IApsPlanDetailService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSampleReq()), ApsPlanDetail::getSampleReq, bo.getSampleReq());
|
||||
lqw.eq(bo.getStartTime() != null, ApsPlanDetail::getStartTime, bo.getStartTime());
|
||||
lqw.eq(bo.getEndTime() != null, ApsPlanDetail::getEndTime, bo.getEndTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDetailDate()), ApsPlanDetail::getDetailDate, bo.getDetailDate());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@@ -185,6 +187,16 @@ public class ApsPlanDetailServiceImpl implements IApsPlanDetailService {
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增排产单明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertBatchByBo(List<ApsPlanDetailBo> boList) {
|
||||
List<ApsPlanDetail> list = BeanUtil.copyToList(boList, ApsPlanDetail.class);
|
||||
list.forEach(this::validEntityBeforeSave);
|
||||
return baseMapper.insertBatch(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改排产单明细
|
||||
*/
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="detailDate" column="detail_date"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<result property="lineName" column="line_name"/>
|
||||
<result property="planCode" column="plan_code"/>
|
||||
<result property="planType" column="plan_type"/>
|
||||
<result property="apsUrl" column="aps_url"/>
|
||||
<result property="scheduler" column="scheduler"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
@@ -27,6 +28,7 @@
|
||||
s.line_name AS lineName,
|
||||
s.plan_code AS planCode,
|
||||
s.plan_type AS planType,
|
||||
s.aps_url AS apsUrl,
|
||||
s.scheduler AS scheduler,
|
||||
s.remark AS masterRemark,
|
||||
d.remark AS detailRemark,
|
||||
|
||||
@@ -35,6 +35,12 @@ public class SysMenu extends TreeEntity<SysMenu> {
|
||||
@Size(min = 0, max = 50, message = "菜单名称长度不能超过{max}个字符")
|
||||
private String menuName;
|
||||
|
||||
/**
|
||||
* 菜单唯一标识(外部固定引用,不受目录变动影响)
|
||||
*/
|
||||
@Size(min = 0, max = 64, message = "菜单唯一标识长度不能超过{max}个字符")
|
||||
private String menuKey;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@@ -96,6 +102,11 @@ public class SysMenu extends TreeEntity<SysMenu> {
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 样式
|
||||
*/
|
||||
private String style;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
||||
@@ -96,6 +96,11 @@ public class OperLogEvent implements Serializable {
|
||||
*/
|
||||
private String errorMsg;
|
||||
|
||||
/**
|
||||
* 页面路由
|
||||
*/
|
||||
private String operPage;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
|
||||
@@ -26,9 +26,15 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Excel相关处理
|
||||
@@ -149,6 +155,33 @@ public class ExcelUtil {
|
||||
builder.doWrite(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel(仅导出指定列)
|
||||
*
|
||||
* @param list 导出数据集合
|
||||
* @param sheetName 工作表的名称
|
||||
* @param clazz 实体类
|
||||
* @param includeColumnFieldNames 需要导出的字段名集合(Java字段名,非Excel列名)
|
||||
* @param response 响应体
|
||||
*/
|
||||
public static <T> void exportExcel(List<T> list, String sheetName, Class<T> clazz,
|
||||
Set<String> includeColumnFieldNames,
|
||||
HttpServletResponse response) {
|
||||
try {
|
||||
resetResponse(sheetName, response);
|
||||
ServletOutputStream os = response.getOutputStream();
|
||||
EasyExcel.write(os, clazz)
|
||||
.autoCloseStream(false)
|
||||
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||
.registerConverter(new ExcelBigNumberConvert())
|
||||
.includeColumnFieldNames(includeColumnFieldNames)
|
||||
.sheet(sheetName)
|
||||
.doWrite(list);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("导出Excel异常");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 单表多数据模板导出 模板格式为 {.属性}
|
||||
*
|
||||
@@ -325,4 +358,67 @@ public class ExcelUtil {
|
||||
return IdUtil.fastSimpleUUID() + "_" + filename + ".xlsx";
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel(按指定顺序的列导出,使用动态表头)
|
||||
*
|
||||
* @param list 导出数据集合
|
||||
* @param sheetName 工作表的名称
|
||||
* @param orderedFields 按导出顺序排列的Java字段名列表
|
||||
* @param fieldLabelMap Java字段名 -> Excel列头中文名 映射
|
||||
* @param response 响应体
|
||||
*/
|
||||
public static <T> void exportExcelOrdered(List<T> list, String sheetName,
|
||||
List<String> orderedFields,
|
||||
Map<String, String> fieldLabelMap,
|
||||
HttpServletResponse response) {
|
||||
if (orderedFields == null || orderedFields.isEmpty()) {
|
||||
throw new IllegalArgumentException("导出列不能为空");
|
||||
}
|
||||
// 构建动态表头
|
||||
List<List<String>> heads = orderedFields.stream()
|
||||
.map(f -> Collections.singletonList(fieldLabelMap.getOrDefault(f, f)))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 构建数据行
|
||||
List<List<Object>> data = new ArrayList<>(list.size());
|
||||
if (!list.isEmpty()) {
|
||||
Map<String, Field> fieldCache = new HashMap<>();
|
||||
Class<?> clazz = list.get(0).getClass();
|
||||
for (T vo : list) {
|
||||
List<Object> row = new ArrayList<>(orderedFields.size());
|
||||
for (String fieldName : orderedFields) {
|
||||
Field field = fieldCache.computeIfAbsent(fieldName, k -> {
|
||||
try {
|
||||
Field f = clazz.getDeclaredField(k);
|
||||
f.setAccessible(true);
|
||||
return f;
|
||||
} catch (NoSuchFieldException e) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
try {
|
||||
row.add(field != null ? field.get(vo) : null);
|
||||
} catch (IllegalAccessException e) {
|
||||
row.add(null);
|
||||
}
|
||||
}
|
||||
data.add(row);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
resetResponse(sheetName, response);
|
||||
ServletOutputStream os = response.getOutputStream();
|
||||
EasyExcel.write(os)
|
||||
.head(heads)
|
||||
.autoCloseStream(false)
|
||||
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
|
||||
.registerConverter(new ExcelBigNumberConvert())
|
||||
.sheet(sheetName)
|
||||
.doWrite(data);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("导出Excel异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.klp.cost.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.cost.domain.vo.CostProdMetricResultVo;
|
||||
import com.klp.cost.domain.bo.CostProdMetricResultBo;
|
||||
import com.klp.cost.service.ICostProdMetricResultService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 生产指标计算结果
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-17
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/cost/prodMetricResult")
|
||||
public class CostProdMetricResultController extends BaseController {
|
||||
|
||||
private final ICostProdMetricResultService iCostProdMetricResultService;
|
||||
|
||||
/**
|
||||
* 查询生产指标计算结果列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<CostProdMetricResultVo> list(CostProdMetricResultBo bo, PageQuery pageQuery) {
|
||||
return iCostProdMetricResultService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产指标计算结果列表
|
||||
*/
|
||||
@Log(title = "生产指标计算结果", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(CostProdMetricResultBo bo, HttpServletResponse response) {
|
||||
List<CostProdMetricResultVo> list = iCostProdMetricResultService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "生产指标计算结果", CostProdMetricResultVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产指标计算结果详细信息
|
||||
*
|
||||
* @param resultId 主键
|
||||
*/
|
||||
@GetMapping("/{resultId}")
|
||||
public R<CostProdMetricResultVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long resultId) {
|
||||
return R.ok(iCostProdMetricResultService.queryById(resultId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产指标计算结果
|
||||
*/
|
||||
@Log(title = "生产指标计算结果", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody CostProdMetricResultBo bo) {
|
||||
return toAjax(iCostProdMetricResultService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量保存生产指标计算结果(先删除再插入)
|
||||
*/
|
||||
@Log(title = "生产指标计算结果", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/batch")
|
||||
public R<Void> batchSave(@RequestBody CostProdMetricResultBo bo) {
|
||||
return toAjax(iCostProdMetricResultService.batchSaveWithDelete(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产指标计算结果
|
||||
*/
|
||||
@Log(title = "生产指标计算结果", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody CostProdMetricResultBo bo) {
|
||||
return toAjax(iCostProdMetricResultService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产指标计算结果
|
||||
*
|
||||
* @param resultIds 主键串
|
||||
*/
|
||||
@Log(title = "生产指标计算结果", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{resultIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] resultIds) {
|
||||
return toAjax(iCostProdMetricResultService.deleteWithValidByIds(Arrays.asList(resultIds), true));
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,10 @@ public class CostItem extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 查询条件(JSON格式)
|
||||
*/
|
||||
private String queryCondition;
|
||||
/**
|
||||
* 删除标识 0=正常 2=删除
|
||||
*/
|
||||
|
||||
@@ -42,13 +42,21 @@ public class CostProdMetric extends BaseEntity {
|
||||
*/
|
||||
private String metricFormula;
|
||||
/**
|
||||
* 指标计算结果值
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal metricValue;
|
||||
/**
|
||||
* 是否使用单价 0=否 1=是
|
||||
*/
|
||||
private Integer usePrice;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private String tags;
|
||||
/**
|
||||
* 删除标识 0=正常 2=删除
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.klp.cost.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 生产指标计算结果对象 cost_prod_metric_result
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("cost_prod_metric_result")
|
||||
public class CostProdMetricResult extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "result_id")
|
||||
private Long resultId;
|
||||
/**
|
||||
* 报表ID(关联生产日报)
|
||||
*/
|
||||
private Long reportId;
|
||||
/**
|
||||
* 指标ID(关联cost_prod_metric)
|
||||
*/
|
||||
private Long metricId;
|
||||
/**
|
||||
* 计算日期
|
||||
*/
|
||||
private Date metricDate;
|
||||
/**
|
||||
* 班组
|
||||
*/
|
||||
private String teamGroup;
|
||||
/**
|
||||
* 计算值
|
||||
*/
|
||||
private BigDecimal calcValue;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private String tags;
|
||||
/**
|
||||
* 删除标识 0=正常 2=删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
|
||||
}
|
||||
@@ -47,5 +47,10 @@ public class CostItemBo extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 查询条件(JSON格式)
|
||||
*/
|
||||
private String queryCondition;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -44,6 +44,20 @@ public class CostProdDetailBo extends BaseEntity {
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date detailDate;
|
||||
|
||||
/**
|
||||
* 日期起
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date detailDateStart;
|
||||
|
||||
/**
|
||||
* 日期止
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date detailDateEnd;
|
||||
|
||||
/**
|
||||
* 成本项目ID
|
||||
*/
|
||||
|
||||
@@ -44,14 +44,23 @@ public class CostProdMetricBo extends BaseEntity {
|
||||
private String metricFormula;
|
||||
|
||||
/**
|
||||
* 指标计算结果值
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal metricValue;
|
||||
|
||||
/**
|
||||
* 是否使用单价 0=否 1=是
|
||||
*/
|
||||
private Integer usePrice;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private String tags;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.klp.cost.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 生产指标计算结果业务对象 cost_prod_metric_result
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-17
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CostProdMetricResultBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long resultId;
|
||||
|
||||
/**
|
||||
* 报表ID(关联生产日报)
|
||||
*/
|
||||
private Long reportId;
|
||||
|
||||
/**
|
||||
* 指标ID(关联cost_prod_metric)
|
||||
*/
|
||||
private Long metricId;
|
||||
|
||||
/**
|
||||
* 计算日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date metricDate;
|
||||
|
||||
/**
|
||||
* 计算日期起
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date metricDateStart;
|
||||
|
||||
/**
|
||||
* 计算日期止
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date metricDateEnd;
|
||||
|
||||
/**
|
||||
* 班组
|
||||
*/
|
||||
private String teamGroup;
|
||||
|
||||
/**
|
||||
* 计算值
|
||||
*/
|
||||
private BigDecimal calcValue;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private String tags;
|
||||
|
||||
/**
|
||||
* 要删除的主键ID集合
|
||||
*/
|
||||
private List<Long> resultIds;
|
||||
|
||||
/**
|
||||
* 要批量插入的数据集合
|
||||
*/
|
||||
private List<CostProdMetricResultBo> prodMetricResultList;
|
||||
|
||||
}
|
||||
@@ -55,5 +55,11 @@ public class CostItemVo {
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 查询条件(JSON格式)
|
||||
*/
|
||||
@ExcelProperty(value = "查询条件(JSON格式)")
|
||||
private String queryCondition;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.klp.cost.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 生产指标计算结果视图对象 cost_prod_metric_result
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-17
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CostProdMetricResultVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long resultId;
|
||||
|
||||
/**
|
||||
* 报表ID(关联生产日报)
|
||||
*/
|
||||
@ExcelProperty(value = "报表ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "关=联生产日报")
|
||||
private Long reportId;
|
||||
|
||||
/**
|
||||
* 指标ID(关联cost_prod_metric)
|
||||
*/
|
||||
@ExcelProperty(value = "指标ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "关=联cost_prod_metric")
|
||||
private Long metricId;
|
||||
|
||||
/**
|
||||
* 计算日期
|
||||
*/
|
||||
@ExcelProperty(value = "计算日期")
|
||||
private Date metricDate;
|
||||
|
||||
/**
|
||||
* 班组
|
||||
*/
|
||||
@ExcelProperty(value = "班组")
|
||||
private String teamGroup;
|
||||
|
||||
/**
|
||||
* 计算值
|
||||
*/
|
||||
@ExcelProperty(value = "计算值")
|
||||
private BigDecimal calcValue;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
@ExcelProperty(value = "标签")
|
||||
private String tags;
|
||||
|
||||
|
||||
}
|
||||
@@ -52,16 +52,27 @@ public class CostProdMetricVo {
|
||||
private String metricFormula;
|
||||
|
||||
/**
|
||||
* 指标计算结果值
|
||||
* 单价
|
||||
*/
|
||||
@ExcelProperty(value = "指标计算结果值")
|
||||
@ExcelProperty(value = "单价")
|
||||
private BigDecimal metricValue;
|
||||
|
||||
/**
|
||||
* 是否使用单价 0=否 1=是
|
||||
*/
|
||||
@ExcelProperty(value = "是否使用单价")
|
||||
private Integer usePrice;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
@ExcelProperty(value = "标签")
|
||||
private String tags;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.klp.cost.mapper;
|
||||
|
||||
import com.klp.cost.domain.CostProdMetricResult;
|
||||
import com.klp.cost.domain.vo.CostProdMetricResultVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 生产指标计算结果Mapper接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-17
|
||||
*/
|
||||
public interface CostProdMetricResultMapper extends BaseMapperPlus<CostProdMetricResultMapper, CostProdMetricResult, CostProdMetricResultVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.klp.cost.service;
|
||||
|
||||
import com.klp.cost.domain.CostProdMetricResult;
|
||||
import com.klp.cost.domain.vo.CostProdMetricResultVo;
|
||||
import com.klp.cost.domain.bo.CostProdMetricResultBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产指标计算结果Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-17
|
||||
*/
|
||||
public interface ICostProdMetricResultService {
|
||||
|
||||
/**
|
||||
* 查询生产指标计算结果
|
||||
*/
|
||||
CostProdMetricResultVo queryById(Long resultId);
|
||||
|
||||
/**
|
||||
* 查询生产指标计算结果列表
|
||||
*/
|
||||
TableDataInfo<CostProdMetricResultVo> queryPageList(CostProdMetricResultBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询生产指标计算结果列表
|
||||
*/
|
||||
List<CostProdMetricResultVo> queryList(CostProdMetricResultBo bo);
|
||||
|
||||
/**
|
||||
* 新增生产指标计算结果
|
||||
*/
|
||||
Boolean insertByBo(CostProdMetricResultBo bo);
|
||||
|
||||
/**
|
||||
* 修改生产指标计算结果
|
||||
*/
|
||||
Boolean updateByBo(CostProdMetricResultBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除生产指标计算结果信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 批量保存生产指标计算结果(先删除再插入)
|
||||
*/
|
||||
Boolean batchSaveWithDelete(CostProdMetricResultBo bo);
|
||||
}
|
||||
@@ -65,6 +65,7 @@ public class CostItemServiceImpl implements ICostItemService {
|
||||
lqw.like(StringUtils.isNotBlank(bo.getItemName()), CostItem::getItemName, bo.getItemName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCategory()), CostItem::getCategory, bo.getCategory());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUnit()), CostItem::getUnit, bo.getUnit());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getQueryCondition()), CostItem::getQueryCondition, bo.getQueryCondition());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,8 @@ public class CostProdDetailServiceImpl implements ICostProdDetailService {
|
||||
lqw.eq(bo.getReportId() != null, CostProdDetail::getReportId, bo.getReportId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getShift()), CostProdDetail::getShift, bo.getShift());
|
||||
lqw.eq(bo.getDetailDate() != null, CostProdDetail::getDetailDate, bo.getDetailDate());
|
||||
lqw.between(bo.getDetailDateStart() != null && bo.getDetailDateEnd() != null,
|
||||
CostProdDetail::getDetailDate, bo.getDetailDateStart(), bo.getDetailDateEnd());
|
||||
lqw.eq(bo.getItemId() != null, CostProdDetail::getItemId, bo.getItemId());
|
||||
lqw.eq(bo.getQuantity() != null, CostProdDetail::getQuantity, bo.getQuantity());
|
||||
lqw.eq(bo.getUnitPrice() != null, CostProdDetail::getUnitPrice, bo.getUnitPrice());
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.klp.cost.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.klp.cost.domain.bo.CostProdMetricResultBo;
|
||||
import com.klp.cost.domain.vo.CostProdMetricResultVo;
|
||||
import com.klp.cost.domain.CostProdMetricResult;
|
||||
import com.klp.cost.mapper.CostProdMetricResultMapper;
|
||||
import com.klp.cost.service.ICostProdMetricResultService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 生产指标计算结果Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-17
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class CostProdMetricResultServiceImpl implements ICostProdMetricResultService {
|
||||
|
||||
private final CostProdMetricResultMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询生产指标计算结果
|
||||
*/
|
||||
@Override
|
||||
public CostProdMetricResultVo queryById(Long resultId){
|
||||
return baseMapper.selectVoById(resultId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产指标计算结果列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<CostProdMetricResultVo> queryPageList(CostProdMetricResultBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<CostProdMetricResult> lqw = buildQueryWrapper(bo);
|
||||
Page<CostProdMetricResultVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产指标计算结果列表
|
||||
*/
|
||||
@Override
|
||||
public List<CostProdMetricResultVo> queryList(CostProdMetricResultBo bo) {
|
||||
LambdaQueryWrapper<CostProdMetricResult> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<CostProdMetricResult> buildQueryWrapper(CostProdMetricResultBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<CostProdMetricResult> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getReportId() != null, CostProdMetricResult::getReportId, bo.getReportId());
|
||||
lqw.eq(bo.getMetricId() != null, CostProdMetricResult::getMetricId, bo.getMetricId());
|
||||
lqw.eq(bo.getMetricDate() != null, CostProdMetricResult::getMetricDate, bo.getMetricDate());
|
||||
lqw.between(bo.getMetricDateStart() != null && bo.getMetricDateEnd() != null,
|
||||
CostProdMetricResult::getMetricDate, bo.getMetricDateStart(), bo.getMetricDateEnd());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTeamGroup()), CostProdMetricResult::getTeamGroup, bo.getTeamGroup());
|
||||
lqw.eq(bo.getCalcValue() != null, CostProdMetricResult::getCalcValue, bo.getCalcValue());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTags()), CostProdMetricResult::getTags, bo.getTags());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产指标计算结果
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(CostProdMetricResultBo bo) {
|
||||
CostProdMetricResult add = BeanUtil.toBean(bo, CostProdMetricResult.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setResultId(add.getResultId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产指标计算结果
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CostProdMetricResultBo bo) {
|
||||
CostProdMetricResult update = BeanUtil.toBean(bo, CostProdMetricResult.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(CostProdMetricResult entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产指标计算结果
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量保存(先删除再插入)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchSaveWithDelete(CostProdMetricResultBo bo) {
|
||||
if (CollUtil.isNotEmpty(bo.getProdMetricResultList())) {
|
||||
if (CollUtil.isNotEmpty(bo.getResultIds())) {
|
||||
baseMapper.deleteBatchIds(bo.getResultIds());
|
||||
}
|
||||
List<CostProdMetricResult> list = bo.getProdMetricResultList().stream()
|
||||
.map(item -> BeanUtil.toBean(item, CostProdMetricResult.class))
|
||||
.collect(Collectors.toList());
|
||||
return baseMapper.insertBatch(list);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,8 @@ public class CostProdMetricServiceImpl implements ICostProdMetricService {
|
||||
lqw.like(StringUtils.isNotBlank(bo.getMetricName()), CostProdMetric::getMetricName, bo.getMetricName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMetricFormula()), CostProdMetric::getMetricFormula, bo.getMetricFormula());
|
||||
lqw.eq(bo.getMetricValue() != null, CostProdMetric::getMetricValue, bo.getMetricValue());
|
||||
lqw.eq(bo.getUsePrice() != null, CostProdMetric::getUsePrice, bo.getUsePrice());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getTags()), CostProdMetric::getTags, bo.getTags());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,10 @@ public class CostProdReportServiceImpl implements ICostProdReportService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLineType()), CostProdReport::getLineType, bo.getLineType());
|
||||
lqw.eq(bo.getInputWeight() != null, CostProdReport::getInputWeight, bo.getInputWeight());
|
||||
lqw.eq(bo.getOutputWeight() != null, CostProdReport::getOutputWeight, bo.getOutputWeight());
|
||||
lqw.apply(bo.getReportDate() != null, "DATE_FORMAT(report_date, '%Y-%m') = {0}", bo.getReportDate());
|
||||
if (bo.getReportDate() != null) {
|
||||
String monthStr = new java.text.SimpleDateFormat("yyyy-MM").format(bo.getReportDate());
|
||||
lqw.apply("DATE_FORMAT(report_date, '%Y-%m') = {0}", monthStr);
|
||||
}
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="category" column="category"/>
|
||||
<result property="unit" column="unit"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="queryCondition" column="query_condition"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
|
||||
@@ -11,7 +11,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="metricName" column="metric_name"/>
|
||||
<result property="metricFormula" column="metric_formula"/>
|
||||
<result property="metricValue" column="metric_value"/>
|
||||
<result property="usePrice" column="use_price"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="tags" column="tags"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<?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="com.klp.cost.mapper.CostProdMetricResultMapper">
|
||||
|
||||
<resultMap type="com.klp.cost.domain.CostProdMetricResult" id="CostProdMetricResultResult">
|
||||
<result property="resultId" column="result_id"/>
|
||||
<result property="reportId" column="report_id"/>
|
||||
<result property="metricId" column="metric_id"/>
|
||||
<result property="metricDate" column="metric_date"/>
|
||||
<result property="teamGroup" column="team_group"/>
|
||||
<result property="calcValue" column="calc_value"/>
|
||||
<result property="tags" column="tags"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.klp.crm.controller;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.aps.domain.bo.ApsPlanDetailBo;
|
||||
import com.klp.aps.domain.bo.ApsPlanSheetBo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -23,6 +26,7 @@ import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.crm.domain.vo.CrmOrderVo;
|
||||
import com.klp.crm.domain.vo.CrmOrderExportVo;
|
||||
import com.klp.crm.domain.bo.CrmOrderBo;
|
||||
import com.klp.crm.service.ICrmOrderService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
@@ -65,6 +69,35 @@ public class CrmOrderController extends BaseController {
|
||||
ExcelUtil.exportExcel(list, "正式订单主", CrmOrderVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出正式订单主列表(业务精简字段,用于合同编辑详情页导出)
|
||||
*/
|
||||
@Log(title = "正式订单主", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportDetail")
|
||||
public void exportDetail(@RequestBody CrmOrderBo bo, HttpServletResponse response) {
|
||||
List<CrmOrderVo> list = iCrmOrderService.queryList(bo);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
List<CrmOrderExportVo> exportList = list.stream().map(vo -> {
|
||||
CrmOrderExportVo export = new CrmOrderExportVo();
|
||||
BeanUtil.copyProperties(vo, export);
|
||||
// 日期格式化
|
||||
export.setSignTime(vo.getSignTime() != null ? sdf.format(vo.getSignTime()) : null);
|
||||
export.setDeliveryDate(vo.getDeliveryDate() != null ? sdf.format(vo.getDeliveryDate()) : null);
|
||||
// 状态转文本
|
||||
if (vo.getStatus() != null) {
|
||||
switch (vo.getStatus().intValue()) {
|
||||
case 0: export.setStatus("草稿"); break;
|
||||
case 1: export.setStatus("已生效"); break;
|
||||
case 2: export.setStatus("已作废"); break;
|
||||
case 3: export.setStatus("已完成"); break;
|
||||
default: export.setStatus(String.valueOf(vo.getStatus())); break;
|
||||
}
|
||||
}
|
||||
return export;
|
||||
}).collect(Collectors.toList());
|
||||
ExcelUtil.exportExcel(exportList, "合同编辑详情", CrmOrderExportVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取正式订单主详细信息
|
||||
*
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.klp.crm.controller;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -18,6 +22,7 @@ import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.crm.domain.vo.CrmOrderItemVo;
|
||||
import com.klp.crm.domain.vo.CrmOrderItemExportVo;
|
||||
import com.klp.crm.domain.vo.CrmContractOrderFinanceVo;
|
||||
import com.klp.crm.domain.bo.CrmOrderItemBo;
|
||||
import com.klp.crm.service.ICrmOrderItemService;
|
||||
@@ -56,6 +61,30 @@ public class CrmOrderItemController extends BaseController {
|
||||
ExcelUtil.exportExcel(list, "正式订单明细", CrmOrderItemVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出正式订单明细列表(业务精简字段,用于订单明细列表页导出)
|
||||
*/
|
||||
@Log(title = "正式订单明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/exportDetail")
|
||||
public void exportDetail(@RequestBody CrmOrderItemBo bo, HttpServletResponse response) {
|
||||
List<CrmOrderItemVo> list = iCrmOrderItemService.queryList(bo);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
List<CrmOrderItemExportVo> exportList = list.stream().map(vo -> {
|
||||
CrmOrderItemExportVo export = new CrmOrderItemExportVo();
|
||||
BeanUtil.copyProperties(vo, export);
|
||||
// 日期格式化
|
||||
export.setSignTime(vo.getSignTime() != null ? sdf.format(vo.getSignTime()) : null);
|
||||
// 展平 orderInfo 中的 salesman、orderCode、contractName
|
||||
if (vo.getOrderInfo() != null) {
|
||||
export.setSalesman(vo.getOrderInfo().getSalesman());
|
||||
export.setOrderCode(vo.getOrderInfo().getOrderCode());
|
||||
export.setContractName(vo.getOrderInfo().getContractName());
|
||||
}
|
||||
return export;
|
||||
}).collect(Collectors.toList());
|
||||
ExcelUtil.exportExcel(exportList, "订单明细列表", CrmOrderItemExportVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取正式订单明细详细信息
|
||||
*
|
||||
@@ -105,11 +134,12 @@ public class CrmOrderItemController extends BaseController {
|
||||
@PathVariable Long contractId) {
|
||||
return R.ok(iCrmOrderItemService.queryFinanceAndObjectionByContractId(contractId));
|
||||
}
|
||||
// 根据订单id查询发货单据中的配卷。
|
||||
// 根据订单id查询发货单据中的配卷(分页)。
|
||||
@GetMapping("/coils/order/{orderId}")
|
||||
public R<List<WmsMaterialCoilVo>> getCoilsByOrderId(@NotNull(message = "订单ID不能为空")
|
||||
@PathVariable Long orderId) {
|
||||
return R.ok(iCrmOrderItemService.queryCoilsByOrderId(orderId));
|
||||
public TableDataInfo<WmsMaterialCoilVo> getCoilsByOrderId(@NotNull(message = "订单ID不能为空")
|
||||
@PathVariable Long orderId,
|
||||
PageQuery pageQuery) {
|
||||
return iCrmOrderItemService.queryCoilsByOrderId(orderId, pageQuery);
|
||||
}
|
||||
|
||||
// 根据合同id查询发货单据中的配卷。
|
||||
@@ -132,4 +162,39 @@ public class CrmOrderItemController extends BaseController {
|
||||
@PathVariable String customerId) {
|
||||
return R.ok(iCrmOrderItemService.queryCoilsByCustomerId(customerId));
|
||||
}
|
||||
|
||||
// 根据销售员查询生产成果(钢卷列表),分页
|
||||
@GetMapping("/coils/bySalesman")
|
||||
public TableDataInfo<WmsMaterialCoilVo> getCoilsBySalesman(@RequestParam String salesman,
|
||||
PageQuery pageQuery) {
|
||||
return iCrmOrderItemService.queryCoilsBySalesman(salesman, pageQuery);
|
||||
}
|
||||
|
||||
// 根据合同ID查询生产成果(钢卷列表),分页
|
||||
@GetMapping("/coils/byContract/{contractId}")
|
||||
public TableDataInfo<WmsMaterialCoilVo> getCoilsByContractIdPaginated(@NotNull(message = "合同ID不能为空")
|
||||
@PathVariable Long contractId,
|
||||
PageQuery pageQuery) {
|
||||
return iCrmOrderItemService.queryCoilsByContractIdPaginated(contractId, pageQuery);
|
||||
}
|
||||
|
||||
// 根据订单ID统计配卷汇总
|
||||
@GetMapping("/coils/order/{orderId}/statistics")
|
||||
public R<java.util.Map<String, java.math.BigDecimal>> getCoilsByOrderIdStatistics(@NotNull(message = "订单ID不能为空")
|
||||
@PathVariable Long orderId) {
|
||||
return R.ok(iCrmOrderItemService.queryCoilsByOrderIdStatistics(orderId));
|
||||
}
|
||||
|
||||
// 根据销售员统计生产成果汇总
|
||||
@GetMapping("/coils/bySalesman/statistics")
|
||||
public R<java.util.Map<String, java.math.BigDecimal>> getCoilsBySalesmanStatistics(@RequestParam String salesman) {
|
||||
return R.ok(iCrmOrderItemService.queryCoilsBySalesmanStatistics(salesman));
|
||||
}
|
||||
|
||||
// 根据合同ID统计生产成果汇总
|
||||
@GetMapping("/coils/byContract/{contractId}/statistics")
|
||||
public R<java.util.Map<String, java.math.BigDecimal>> getCoilsByContractIdStatistics(@NotNull(message = "合同ID不能为空")
|
||||
@PathVariable Long contractId) {
|
||||
return R.ok(iCrmOrderItemService.queryCoilsByContractIdStatistics(contractId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,6 +85,15 @@ public class CrmSalesReportController extends BaseController {
|
||||
return R.ok(stats);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询省份统计数据
|
||||
*/
|
||||
@GetMapping("/provinceStats")
|
||||
public R<List<CrmSalesReportVo.ProvinceStat>> getProvinceStats(CrmSalesReportBo bo) {
|
||||
List<CrmSalesReportVo.ProvinceStat> stats = iCrmSalesReportService.queryProvinceStats(bo);
|
||||
return R.ok(stats);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出销售报表订单明细
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.klp.crm.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 合同编辑详情导出视图对象
|
||||
* 仅包含页面表格展示的业务字段(19列)
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-07-06
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CrmOrderExportVo {
|
||||
|
||||
@ExcelProperty(value = "合同号")
|
||||
private String contractCode;
|
||||
|
||||
@ExcelProperty(value = "供方")
|
||||
private String supplier;
|
||||
|
||||
@ExcelProperty(value = "需方")
|
||||
private String customer;
|
||||
|
||||
@ExcelProperty(value = "业务员")
|
||||
private String salesman;
|
||||
|
||||
@ExcelProperty(value = "签订日期")
|
||||
private String signTime;
|
||||
|
||||
@ExcelProperty(value = "交货日期")
|
||||
private String deliveryDate;
|
||||
|
||||
@ExcelProperty(value = "签订地点")
|
||||
private String signLocation;
|
||||
|
||||
@ExcelProperty(value = "供方地址")
|
||||
private String supplierAddress;
|
||||
|
||||
@ExcelProperty(value = "供方电话")
|
||||
private String supplierPhone;
|
||||
|
||||
@ExcelProperty(value = "供方开户行")
|
||||
private String supplierBank;
|
||||
|
||||
@ExcelProperty(value = "供方账号")
|
||||
private String supplierAccount;
|
||||
|
||||
@ExcelProperty(value = "需方地址")
|
||||
private String customerAddress;
|
||||
|
||||
@ExcelProperty(value = "需方电话")
|
||||
private String customerPhone;
|
||||
|
||||
@ExcelProperty(value = "需方开户行")
|
||||
private String customerBank;
|
||||
|
||||
@ExcelProperty(value = "需方账号")
|
||||
private String customerAccount;
|
||||
|
||||
@ExcelProperty(value = "订单金额")
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
@ExcelProperty(value = "已收款")
|
||||
private BigDecimal receivedAmount;
|
||||
|
||||
@ExcelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.klp.crm.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 订单明细列表导出视图对象
|
||||
* 仅包含页面表格展示的业务字段(32列)
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-07-06
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CrmOrderItemExportVo {
|
||||
|
||||
// ========== 合同信息(联表) ==========
|
||||
|
||||
@ExcelProperty(value = "合同号")
|
||||
private String contractCode;
|
||||
|
||||
@ExcelProperty(value = "合同名称")
|
||||
private String contractName;
|
||||
|
||||
@ExcelProperty(value = "需方")
|
||||
private String customer;
|
||||
|
||||
@ExcelProperty(value = "供方")
|
||||
private String supplier;
|
||||
|
||||
@ExcelProperty(value = "业务员")
|
||||
private String salesman;
|
||||
|
||||
@ExcelProperty(value = "签订时间")
|
||||
private String signTime;
|
||||
|
||||
@ExcelProperty(value = "订单编号")
|
||||
private String orderCode;
|
||||
|
||||
// ========== 明细标识 ==========
|
||||
|
||||
@ExcelProperty(value = "明细ID")
|
||||
private Long itemId;
|
||||
|
||||
@ExcelProperty(value = "订单ID")
|
||||
private Long orderId;
|
||||
|
||||
// ========== 产品规格 ==========
|
||||
|
||||
@ExcelProperty(value = "产品类型")
|
||||
private String productType;
|
||||
|
||||
@ExcelProperty(value = "原料规格")
|
||||
private String rawMaterialSpec;
|
||||
|
||||
@ExcelProperty(value = "成品规格")
|
||||
private String finishedProductSpec;
|
||||
|
||||
@ExcelProperty(value = "数量")
|
||||
private Long productNum;
|
||||
|
||||
@ExcelProperty(value = "材质")
|
||||
private String material;
|
||||
|
||||
@ExcelProperty(value = "等级")
|
||||
private String grade;
|
||||
|
||||
@ExcelProperty(value = "宽度")
|
||||
private String width;
|
||||
|
||||
@ExcelProperty(value = "厚度")
|
||||
private String thickness;
|
||||
|
||||
@ExcelProperty(value = "宽度公差")
|
||||
private String widthTolerance;
|
||||
|
||||
@ExcelProperty(value = "厚度公差")
|
||||
private String thicknessTolerance;
|
||||
|
||||
@ExcelProperty(value = "重量")
|
||||
private BigDecimal weight;
|
||||
|
||||
// ========== 价格 ==========
|
||||
|
||||
@ExcelProperty(value = "合同定价")
|
||||
private BigDecimal contractPrice;
|
||||
|
||||
@ExcelProperty(value = "明细金额")
|
||||
private BigDecimal itemAmount;
|
||||
|
||||
// ========== 加工要求 ==========
|
||||
|
||||
@ExcelProperty(value = "表面处理")
|
||||
private String surfaceTreatment;
|
||||
|
||||
@ExcelProperty(value = "包装要求")
|
||||
private String packagingReq;
|
||||
|
||||
@ExcelProperty(value = "切边要求")
|
||||
private String edgeCuttingReq;
|
||||
|
||||
@ExcelProperty(value = "表面质量")
|
||||
private String surfaceQuality;
|
||||
|
||||
// ========== 其他 ==========
|
||||
|
||||
@ExcelProperty(value = "特殊要求")
|
||||
private String specialRequire;
|
||||
|
||||
@ExcelProperty(value = "用途")
|
||||
private String purpose;
|
||||
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@ExcelProperty(value = "定制人")
|
||||
private String customizer;
|
||||
|
||||
@ExcelProperty(value = "发货人")
|
||||
private String shipper;
|
||||
|
||||
@ExcelProperty(value = "排产批次")
|
||||
private String productionBatch;
|
||||
}
|
||||
@@ -234,6 +234,12 @@ public class CrmOrderItemVo {
|
||||
@ExcelProperty(value = "交货日期")
|
||||
private Date deliveryDate;
|
||||
|
||||
/**
|
||||
* 销售员(联表查询直接映射)
|
||||
*/
|
||||
@ExcelProperty(value = "销售员")
|
||||
private String salesman;
|
||||
|
||||
/**
|
||||
* 订单信息
|
||||
*/
|
||||
|
||||
@@ -290,4 +290,35 @@ public class CrmSalesReportVo {
|
||||
@ExcelProperty(value = "销售金额")
|
||||
private BigDecimal salesAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 省份统计内部类
|
||||
*/
|
||||
@Data
|
||||
public static class ProvinceStat {
|
||||
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
@ExcelProperty(value = "省份")
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 客户数量
|
||||
*/
|
||||
@ExcelProperty(value = "客户数量")
|
||||
private Integer customerCount;
|
||||
|
||||
/**
|
||||
* 订单数量
|
||||
*/
|
||||
@ExcelProperty(value = "订单数量")
|
||||
private Integer orderCount;
|
||||
|
||||
/**
|
||||
* 销售金额
|
||||
*/
|
||||
@ExcelProperty(value = "销售金额")
|
||||
private BigDecimal salesAmount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,4 +12,9 @@ import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
*/
|
||||
public interface CrmCustomerMapper extends BaseMapperPlus<CrmCustomerMapper, CrmCustomer, CrmCustomerVo> {
|
||||
|
||||
/**
|
||||
* 查询当前最大的customer_code,用于自动生成新编码
|
||||
*/
|
||||
String selectMaxCustomerCode();
|
||||
|
||||
}
|
||||
|
||||
@@ -54,4 +54,12 @@ public interface CrmSalesReportMapper {
|
||||
* @return 行业统计列表
|
||||
*/
|
||||
List<CrmSalesReportVo.IndustryStat> selectIndustryStats(@Param("bo") CrmSalesReportBo bo);
|
||||
|
||||
/**
|
||||
* 查询省份统计数据
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 省份统计列表
|
||||
*/
|
||||
List<CrmSalesReportVo.ProvinceStat> selectProvinceStats(@Param("bo") CrmSalesReportBo bo);
|
||||
}
|
||||
@@ -57,9 +57,9 @@ public interface ICrmOrderItemService {
|
||||
CrmContractOrderFinanceVo queryFinanceAndObjectionByContractId(Long contractId);
|
||||
|
||||
/**
|
||||
* 根据订单ID查询发货单配卷
|
||||
* 根据订单ID查询发货单配卷(分页)
|
||||
*/
|
||||
List<WmsMaterialCoilVo> queryCoilsByOrderId(Long orderId);
|
||||
TableDataInfo<WmsMaterialCoilVo> queryCoilsByOrderId(Long orderId, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 根据合同ID查询发货单配卷
|
||||
@@ -75,4 +75,29 @@ public interface ICrmOrderItemService {
|
||||
* 根据客户ID查询发货单配卷
|
||||
*/
|
||||
List<WmsMaterialCoilVo> queryCoilsByCustomerId(String customerId);
|
||||
|
||||
/**
|
||||
* 根据销售员查询生产成果(钢卷列表)分页
|
||||
*/
|
||||
TableDataInfo<WmsMaterialCoilVo> queryCoilsBySalesman(String salesman, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 根据合同ID查询生产成果(钢卷列表)分页
|
||||
*/
|
||||
TableDataInfo<WmsMaterialCoilVo> queryCoilsByContractIdPaginated(Long contractId, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 根据订单ID统计配卷汇总数据(数量、毛重、净重)
|
||||
*/
|
||||
java.util.Map<String, java.math.BigDecimal> queryCoilsByOrderIdStatistics(Long orderId);
|
||||
|
||||
/**
|
||||
* 根据销售员统计生产成果汇总数据(数量、毛重、净重)
|
||||
*/
|
||||
java.util.Map<String, java.math.BigDecimal> queryCoilsBySalesmanStatistics(String salesman);
|
||||
|
||||
/**
|
||||
* 根据合同ID统计生产成果汇总数据(数量、毛重、净重)
|
||||
*/
|
||||
java.util.Map<String, java.math.BigDecimal> queryCoilsByContractIdStatistics(Long contractId);
|
||||
}
|
||||
|
||||
@@ -72,4 +72,12 @@ public interface ICrmSalesReportService {
|
||||
* @return 行业统计列表
|
||||
*/
|
||||
List<CrmSalesReportVo.IndustryStat> queryIndustryStats(CrmSalesReportBo bo);
|
||||
|
||||
/**
|
||||
* 查询省份统计数据
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 省份统计列表
|
||||
*/
|
||||
List<CrmSalesReportVo.ProvinceStat> queryProvinceStats(CrmSalesReportBo bo);
|
||||
}
|
||||
@@ -91,6 +91,25 @@ public class CrmCustomerServiceImpl implements ICrmCustomerService {
|
||||
@Override
|
||||
public Boolean insertByBo(CrmCustomerBo bo) {
|
||||
CrmCustomer add = BeanUtil.toBean(bo, CrmCustomer.class);
|
||||
// 自动生成customer_code:查询最大编码并加1
|
||||
if (StringUtils.isBlank(add.getCustomerCode())) {
|
||||
String maxCode = baseMapper.selectMaxCustomerCode();
|
||||
if (StringUtils.isBlank(maxCode)) {
|
||||
add.setCustomerCode("00001");
|
||||
} else {
|
||||
// 提取末尾数字后缀并递增,支持纯数字("00001")和带前缀("KH00001")两种格式
|
||||
java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("^(.*?)(\\d+)$");
|
||||
java.util.regex.Matcher matcher = pattern.matcher(maxCode);
|
||||
if (matcher.matches()) {
|
||||
String prefix = matcher.group(1);
|
||||
String numStr = matcher.group(2);
|
||||
long num = Long.parseLong(numStr) + 1;
|
||||
add.setCustomerCode(prefix + String.format("%0" + numStr.length() + "d", num));
|
||||
} else {
|
||||
add.setCustomerCode(maxCode + "1");
|
||||
}
|
||||
}
|
||||
}
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
|
||||
@@ -35,6 +35,8 @@ import com.klp.crm.service.ICrmOrderItemService;
|
||||
import com.klp.mapper.WmsReceivableMapper;
|
||||
import com.klp.mapper.WmsDeliveryWaybillMapper;
|
||||
import com.klp.mapper.WmsDeliveryWaybillDetailMapper;
|
||||
import com.klp.mapper.WmsCoilContractRelMapper;
|
||||
import com.klp.domain.WmsCoilContractRel;
|
||||
import com.klp.service.IWmsMaterialCoilService;
|
||||
|
||||
import java.util.*;
|
||||
@@ -57,6 +59,7 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
private final WmsReceivableMapper wmsReceivableMapper;
|
||||
private final WmsDeliveryWaybillMapper wmsDeliveryWaybillMapper;
|
||||
private final WmsDeliveryWaybillDetailMapper wmsDeliveryWaybillDetailMapper;
|
||||
private final WmsCoilContractRelMapper coilContractRelMapper;
|
||||
private final IWmsMaterialCoilService iWmsMaterialCoilService;
|
||||
|
||||
/**
|
||||
@@ -165,7 +168,11 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
Map<Long, CrmOrderVo> orderMap = orderList.stream()
|
||||
.collect(Collectors.toMap(CrmOrderVo::getOrderId, o -> o, (a, b) -> a));
|
||||
for (CrmOrderItemVo item : records) {
|
||||
item.setOrderInfo(orderMap.get(item.getOrderId()));
|
||||
CrmOrderVo order = orderMap.get(item.getOrderId());
|
||||
item.setOrderInfo(order);
|
||||
if (order != null) {
|
||||
item.setSalesman(order.getSalesman());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,30 +263,18 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
public CrmContractOrderFinanceVo queryFinanceAndObjectionByContractId(Long contractId) {
|
||||
CrmContractOrderFinanceVo result = new CrmContractOrderFinanceVo();
|
||||
|
||||
LambdaQueryWrapper<CrmOrder> orderWrapper = new LambdaQueryWrapper<>();
|
||||
orderWrapper.eq(CrmOrder::getContractId, contractId);
|
||||
List<CrmOrder> orders = crmOrderMapper.selectList(orderWrapper);
|
||||
|
||||
if (orders == null || orders.isEmpty()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
List<Long> orderIds = orders.stream()
|
||||
.map(CrmOrder::getOrderId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<CrmSalesObjection> objectionWrapper = new LambdaQueryWrapper<>();
|
||||
objectionWrapper.in(CrmSalesObjection::getOrderId, orderIds);
|
||||
objectionWrapper.in(CrmSalesObjection::getOrderId, contractId);
|
||||
List<CrmSalesObjectionVo> objectionList = crmSalesObjectionMapper.selectVoList(objectionWrapper);
|
||||
result.setObjectionList(objectionList);
|
||||
|
||||
LambdaQueryWrapper<com.klp.domain.WmsReceivable> receivableWrapper = new LambdaQueryWrapper<>();
|
||||
receivableWrapper.in(WmsReceivable::getOrderId, orderIds);
|
||||
receivableWrapper.in(WmsReceivable::getOrderId, contractId);
|
||||
List<WmsReceivableVo> receivableList = wmsReceivableMapper.selectVoList(receivableWrapper);
|
||||
result.setReceivableList(receivableList);
|
||||
|
||||
LambdaQueryWrapper<WmsDeliveryWaybill> waybillWrapper = new LambdaQueryWrapper<>();
|
||||
waybillWrapper.in(WmsDeliveryWaybill::getOrderId, orderIds);
|
||||
waybillWrapper.in(WmsDeliveryWaybill::getOrderId, contractId);
|
||||
List<WmsDeliveryWaybillVo> wmsDeliveryWaybills = wmsDeliveryWaybillMapper.selectVoList(waybillWrapper);
|
||||
result.setWmsDeliveryWaybills(wmsDeliveryWaybills);
|
||||
|
||||
@@ -287,16 +282,19 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsMaterialCoilVo> queryCoilsByOrderId(Long orderId) {
|
||||
// ==================== 线圈ID解析辅助方法 ====================
|
||||
|
||||
/**
|
||||
* 根据订单ID解析关联的线圈ID串(通过发货单→发货单明细)
|
||||
* @return 逗号分隔的coilId字符串,无数据返回null
|
||||
*/
|
||||
private String resolveCoilIdsByOrderId(Long orderId) {
|
||||
LambdaQueryWrapper<WmsDeliveryWaybill> waybillWrapper = new LambdaQueryWrapper<>();
|
||||
waybillWrapper.eq(WmsDeliveryWaybill::getOrderId, orderId);
|
||||
List<WmsDeliveryWaybill> waybills = wmsDeliveryWaybillMapper.selectList(waybillWrapper);
|
||||
|
||||
if (waybills == null || waybills.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
return null;
|
||||
}
|
||||
|
||||
List<Long> waybillIds = waybills.stream()
|
||||
.map(WmsDeliveryWaybill::getWaybillId)
|
||||
.collect(Collectors.toList());
|
||||
@@ -304,43 +302,145 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
LambdaQueryWrapper<WmsDeliveryWaybillDetail> detailWrapper = new LambdaQueryWrapper<>();
|
||||
detailWrapper.in(WmsDeliveryWaybillDetail::getWaybillId, waybillIds);
|
||||
List<WmsDeliveryWaybillDetail> details = wmsDeliveryWaybillDetailMapper.selectList(detailWrapper);
|
||||
|
||||
if (details == null || details.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
return null;
|
||||
}
|
||||
|
||||
String coilIds = details.stream()
|
||||
return details.stream()
|
||||
.map(WmsDeliveryWaybillDetail::getCoilId)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(","));
|
||||
|
||||
WmsMaterialCoilBo coilBo = new WmsMaterialCoilBo();
|
||||
coilBo.setCoilIds(coilIds);
|
||||
return iWmsMaterialCoilService.queryList(coilBo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsMaterialCoilVo> queryCoilsByContractId(Long contractId) {
|
||||
/**
|
||||
* 根据销售员解析关联的线圈ID串(通过crm_order→wms_coil_contract_rel)
|
||||
* @return 逗号分隔的coilId字符串,无数据返回null
|
||||
*/
|
||||
private String resolveCoilIdsBySalesman(String salesman) {
|
||||
LambdaQueryWrapper<CrmOrder> orderWrapper = new LambdaQueryWrapper<>();
|
||||
orderWrapper.eq(CrmOrder::getContractId, contractId);
|
||||
orderWrapper.eq(CrmOrder::getSalesman, salesman);
|
||||
orderWrapper.eq(CrmOrder::getDelFlag, 0);
|
||||
List<CrmOrder> orders = crmOrderMapper.selectList(orderWrapper);
|
||||
|
||||
if (orders == null || orders.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
return null;
|
||||
}
|
||||
|
||||
List<Long> orderIds = orders.stream()
|
||||
.map(CrmOrder::getOrderId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<WmsDeliveryWaybill> waybillWrapper = new LambdaQueryWrapper<>();
|
||||
waybillWrapper.in(WmsDeliveryWaybill::getOrderId, orderIds);
|
||||
List<WmsDeliveryWaybill> waybills = wmsDeliveryWaybillMapper.selectList(waybillWrapper);
|
||||
LambdaQueryWrapper<WmsCoilContractRel> relWrapper = new LambdaQueryWrapper<>();
|
||||
relWrapper.in(WmsCoilContractRel::getContractId, orderIds);
|
||||
relWrapper.eq(WmsCoilContractRel::getDelFlag, 0);
|
||||
List<WmsCoilContractRel> rels = coilContractRelMapper.selectList(relWrapper);
|
||||
if (rels == null || rels.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return rels.stream()
|
||||
.map(WmsCoilContractRel::getCoilId)
|
||||
.distinct()
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(","));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据合同ID解析关联的线圈ID串(通过crm_order→wms_coil_contract_rel)
|
||||
* @return 逗号分隔的coilId字符串,无数据返回null
|
||||
*/
|
||||
private String resolveCoilIdsByContractId(Long contractId) {
|
||||
LambdaQueryWrapper<WmsCoilContractRel> relWrapper = new LambdaQueryWrapper<>();
|
||||
relWrapper.eq(WmsCoilContractRel::getContractId, contractId);
|
||||
relWrapper.eq(WmsCoilContractRel::getDelFlag, 0);
|
||||
List<WmsCoilContractRel> rels = coilContractRelMapper.selectList(relWrapper);
|
||||
if (rels == null || rels.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return rels.stream()
|
||||
.map(WmsCoilContractRel::getCoilId)
|
||||
.distinct()
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(","));
|
||||
}
|
||||
|
||||
// ==================== 分页列表查询 ====================
|
||||
|
||||
@Override
|
||||
public TableDataInfo<WmsMaterialCoilVo> queryCoilsByOrderId(Long orderId, PageQuery pageQuery) {
|
||||
String coilIds = resolveCoilIdsByOrderId(orderId);
|
||||
if (coilIds == null) {
|
||||
return new TableDataInfo<>();
|
||||
}
|
||||
WmsMaterialCoilBo coilBo = new WmsMaterialCoilBo();
|
||||
coilBo.setCoilIds(coilIds);
|
||||
return iWmsMaterialCoilService.queryPageList(coilBo, pageQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<WmsMaterialCoilVo> queryCoilsBySalesman(String salesman, PageQuery pageQuery) {
|
||||
String coilIds = resolveCoilIdsBySalesman(salesman);
|
||||
if (coilIds == null) {
|
||||
return new TableDataInfo<>();
|
||||
}
|
||||
WmsMaterialCoilBo coilBo = new WmsMaterialCoilBo();
|
||||
coilBo.setCoilIds(coilIds);
|
||||
return iWmsMaterialCoilService.queryPageList(coilBo, pageQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<WmsMaterialCoilVo> queryCoilsByContractIdPaginated(Long contractId, PageQuery pageQuery) {
|
||||
String coilIds = resolveCoilIdsByContractId(contractId);
|
||||
if (coilIds == null) {
|
||||
return new TableDataInfo<>();
|
||||
}
|
||||
WmsMaterialCoilBo coilBo = new WmsMaterialCoilBo();
|
||||
coilBo.setCoilIds(coilIds);
|
||||
return iWmsMaterialCoilService.queryPageList(coilBo, pageQuery);
|
||||
}
|
||||
|
||||
// ==================== 统计汇总查询 ====================
|
||||
|
||||
@Override
|
||||
public Map<String, java.math.BigDecimal> queryCoilsByOrderIdStatistics(Long orderId) {
|
||||
String coilIds = resolveCoilIdsByOrderId(orderId);
|
||||
if (coilIds == null) {
|
||||
return emptyStatistics();
|
||||
}
|
||||
WmsMaterialCoilBo coilBo = new WmsMaterialCoilBo();
|
||||
coilBo.setCoilIds(coilIds);
|
||||
return iWmsMaterialCoilService.getStatistics(coilBo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, java.math.BigDecimal> queryCoilsBySalesmanStatistics(String salesman) {
|
||||
String coilIds = resolveCoilIdsBySalesman(salesman);
|
||||
if (coilIds == null) {
|
||||
return emptyStatistics();
|
||||
}
|
||||
WmsMaterialCoilBo coilBo = new WmsMaterialCoilBo();
|
||||
coilBo.setCoilIds(coilIds);
|
||||
return iWmsMaterialCoilService.getStatistics(coilBo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, java.math.BigDecimal> queryCoilsByContractIdStatistics(Long contractId) {
|
||||
String coilIds = resolveCoilIdsByContractId(contractId);
|
||||
if (coilIds == null) {
|
||||
return emptyStatistics();
|
||||
}
|
||||
WmsMaterialCoilBo coilBo = new WmsMaterialCoilBo();
|
||||
coilBo.setCoilIds(coilIds);
|
||||
return iWmsMaterialCoilService.getStatistics(coilBo);
|
||||
}
|
||||
|
||||
// ==================== 已有方法(非分页) ====================
|
||||
|
||||
@Override
|
||||
public List<WmsMaterialCoilVo> queryCoilsByContractId(Long contractId) {
|
||||
|
||||
LambdaQueryWrapper<WmsDeliveryWaybill> waybillWrapper = new LambdaQueryWrapper<>();
|
||||
waybillWrapper.eq(WmsDeliveryWaybill::getOrderId, contractId);
|
||||
List<WmsDeliveryWaybill> waybills = wmsDeliveryWaybillMapper.selectList(waybillWrapper);
|
||||
if (waybills == null || waybills.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<Long> waybillIds = waybills.stream()
|
||||
.map(WmsDeliveryWaybill::getWaybillId)
|
||||
.collect(Collectors.toList());
|
||||
@@ -348,11 +448,9 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
LambdaQueryWrapper<WmsDeliveryWaybillDetail> detailWrapper = new LambdaQueryWrapper<>();
|
||||
detailWrapper.in(WmsDeliveryWaybillDetail::getWaybillId, waybillIds);
|
||||
List<WmsDeliveryWaybillDetail> details = wmsDeliveryWaybillDetailMapper.selectList(detailWrapper);
|
||||
|
||||
if (details == null || details.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
String coilIds = details.stream()
|
||||
.map(WmsDeliveryWaybillDetail::getCoilId)
|
||||
.map(String::valueOf)
|
||||
@@ -370,11 +468,9 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
LambdaQueryWrapper<CrmOrder> orderWrapper = new LambdaQueryWrapper<>();
|
||||
orderWrapper.eq(CrmOrder::getCustomerId, customerId);
|
||||
List<CrmOrder> orders = crmOrderMapper.selectList(orderWrapper);
|
||||
|
||||
if (orders == null || orders.isEmpty()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
List<Long> orderIds = orders.stream()
|
||||
.map(CrmOrder::getOrderId)
|
||||
.collect(Collectors.toList());
|
||||
@@ -402,11 +498,9 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
LambdaQueryWrapper<CrmOrder> orderWrapper = new LambdaQueryWrapper<>();
|
||||
orderWrapper.eq(CrmOrder::getCustomerId, customerId);
|
||||
List<CrmOrder> orders = crmOrderMapper.selectList(orderWrapper);
|
||||
|
||||
if (orders == null || orders.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<Long> orderIds = orders.stream()
|
||||
.map(CrmOrder::getOrderId)
|
||||
.collect(Collectors.toList());
|
||||
@@ -414,11 +508,9 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
LambdaQueryWrapper<WmsDeliveryWaybill> waybillWrapper = new LambdaQueryWrapper<>();
|
||||
waybillWrapper.in(WmsDeliveryWaybill::getOrderId, orderIds);
|
||||
List<WmsDeliveryWaybill> waybills = wmsDeliveryWaybillMapper.selectList(waybillWrapper);
|
||||
|
||||
if (waybills == null || waybills.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<Long> waybillIds = waybills.stream()
|
||||
.map(WmsDeliveryWaybill::getWaybillId)
|
||||
.collect(Collectors.toList());
|
||||
@@ -426,11 +518,9 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
LambdaQueryWrapper<WmsDeliveryWaybillDetail> detailWrapper = new LambdaQueryWrapper<>();
|
||||
detailWrapper.in(WmsDeliveryWaybillDetail::getWaybillId, waybillIds);
|
||||
List<WmsDeliveryWaybillDetail> details = wmsDeliveryWaybillDetailMapper.selectList(detailWrapper);
|
||||
|
||||
if (details == null || details.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
String coilIds = details.stream()
|
||||
.map(WmsDeliveryWaybillDetail::getCoilId)
|
||||
.map(String::valueOf)
|
||||
@@ -440,4 +530,12 @@ public class CrmOrderItemServiceImpl implements ICrmOrderItemService {
|
||||
coilBo.setCoilIds(coilIds);
|
||||
return iWmsMaterialCoilService.queryList(coilBo);
|
||||
}
|
||||
|
||||
private Map<String, java.math.BigDecimal> emptyStatistics() {
|
||||
Map<String, java.math.BigDecimal> empty = new HashMap<>();
|
||||
empty.put("total_count", java.math.BigDecimal.ZERO);
|
||||
empty.put("total_gross_weight", java.math.BigDecimal.ZERO);
|
||||
empty.put("total_net_weight", java.math.BigDecimal.ZERO);
|
||||
return empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +107,12 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
extracted(records);
|
||||
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
private void extracted(List<CrmOrderVo> records) {
|
||||
Set<String> userNames = records.stream()
|
||||
.flatMap(v -> java.util.stream.Stream.of(v.getCreateBy(), v.getUpdateBy()))
|
||||
.filter(StringUtils::isNotBlank)
|
||||
@@ -178,8 +184,6 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
private QueryWrapper<CrmOrder> buildQueryWrapperPlus(CrmOrderBo bo) {
|
||||
@@ -250,11 +254,9 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
qw.eq("co.del_flag", 0);
|
||||
//排序规则:
|
||||
// 1. 置顶优先 (is_top=1 排在前面)
|
||||
// 2. 状态为1(已生效)的排在前面
|
||||
// 3. 创建时间倒序
|
||||
// 2. 合同号倒序(KLPY+年月日+序号,降序最新在前)
|
||||
qw.orderByDesc("co.is_top")
|
||||
.orderByDesc("CASE WHEN co.status = 1 THEN 1 ELSE 0 END")
|
||||
.orderByDesc("co.create_time");
|
||||
.orderByDesc("co.contract_code");
|
||||
return qw;
|
||||
}
|
||||
|
||||
@@ -264,7 +266,9 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
@Override
|
||||
public List<CrmOrderVo> queryList(CrmOrderBo bo) {
|
||||
QueryWrapper<CrmOrder> lqw = buildQueryWrapperPlus(bo);
|
||||
return baseMapper.selectVoPagePlus(lqw);
|
||||
List<CrmOrderVo> crmOrderVos = baseMapper.selectVoPagePlus(lqw);
|
||||
extracted(crmOrderVos);
|
||||
return crmOrderVos;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -287,9 +291,37 @@ public class CrmOrderServiceImpl implements ICrmOrderService {
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(CrmOrderBo bo) {
|
||||
// 查询旧订单获取原销售员和原合同编号,用于判断是否需要同步钢卷
|
||||
CrmOrder oldOrder = null;
|
||||
String oldSalesman = null;
|
||||
String oldContractCode = null;
|
||||
if (bo.getOrderId() != null) {
|
||||
oldOrder = baseMapper.selectById(bo.getOrderId());
|
||||
if (oldOrder != null) {
|
||||
oldSalesman = oldOrder.getSalesman();
|
||||
oldContractCode = oldOrder.getContractCode();
|
||||
}
|
||||
}
|
||||
|
||||
CrmOrder update = BeanUtil.toBean(bo, CrmOrder.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
boolean result = baseMapper.updateById(update) > 0;
|
||||
|
||||
// 如果销售员或合同编号变更,同步更新所有关联钢卷
|
||||
if (result && oldOrder != null) {
|
||||
String newSalesman = update.getSalesman();
|
||||
String newContractCode = update.getContractCode();
|
||||
boolean salesmanChanged = !Objects.equals(oldSalesman, newSalesman);
|
||||
boolean contractCodeChanged = !Objects.equals(oldContractCode, newContractCode);
|
||||
if (salesmanChanged || contractCodeChanged) {
|
||||
coilContractRelMapper.updateCoilSaleNameByOrderId(
|
||||
bo.getOrderId(),
|
||||
StringUtils.isNotBlank(newSalesman) ? newSalesman : oldSalesman,
|
||||
StringUtils.isNotBlank(newContractCode) ? newContractCode : oldContractCode);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -136,4 +136,12 @@ public class CrmSalesReportServiceImpl implements ICrmSalesReportService {
|
||||
public List<CrmSalesReportVo.IndustryStat> queryIndustryStats(CrmSalesReportBo bo) {
|
||||
return baseMapper.selectIndustryStats(bo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询省份统计数据
|
||||
*/
|
||||
@Override
|
||||
public List<CrmSalesReportVo.ProvinceStat> queryProvinceStats(CrmSalesReportBo bo) {
|
||||
return baseMapper.selectProvinceStats(bo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,5 +23,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectMaxCustomerCode" resultType="String">
|
||||
SELECT customer_code FROM crm_customer WHERE del_flag = 0 ORDER BY LENGTH(customer_code) DESC, customer_code DESC LIMIT 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
<result property="customer" column="customer"/>
|
||||
<result property="signTime" column="sign_time"/>
|
||||
<result property="deliveryDate" column="delivery_date"/>
|
||||
<result property="salesman" column="salesman"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 根据订单ID列表查询订单明细 -->
|
||||
@@ -155,7 +156,8 @@
|
||||
o.supplier,
|
||||
o.customer,
|
||||
o.sign_time,
|
||||
o.delivery_date
|
||||
o.delivery_date,
|
||||
o.salesman
|
||||
FROM crm_order_item i
|
||||
LEFT JOIN crm_order o ON i.order_id = o.order_id AND o.del_flag = 0
|
||||
<where>
|
||||
|
||||
@@ -268,4 +268,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
ORDER BY salesAmount DESC
|
||||
</select>
|
||||
|
||||
<!-- 查询省份统计数据 -->
|
||||
<select id="selectProvinceStats" resultType="com.klp.crm.domain.vo.CrmSalesReportVo$ProvinceStat">
|
||||
SELECT
|
||||
COALESCE(c.province, '其他') as province,
|
||||
COUNT(DISTINCT c.customer_id) as customerCount,
|
||||
COUNT(o.order_id) as orderCount,
|
||||
COALESCE(SUM(o.order_amount), 0) as salesAmount
|
||||
FROM crm_order o
|
||||
LEFT JOIN crm_customer c ON o.customer_id = c.customer_id
|
||||
<include refid="selectCondition"/>
|
||||
GROUP BY c.province
|
||||
ORDER BY salesAmount DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -31,4 +31,7 @@ public class CoilTotalMergedExportVo implements Serializable {
|
||||
|
||||
@ExcelProperty("总成本")
|
||||
private Double totalCost;
|
||||
|
||||
@ExcelProperty("钢卷ID")
|
||||
private Long coilId;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
package com.klp.erp.controller;
|
||||
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.erp.domain.bo.ErpPurchasePlanAuditBo;
|
||||
import com.klp.erp.domain.bo.ErpPurchasePlanBo;
|
||||
import com.klp.erp.domain.vo.ErpContractOptionVo;
|
||||
import com.klp.erp.domain.vo.ErpPurchasePlanDeliveryVo;
|
||||
import com.klp.erp.domain.vo.ErpPurchasePlanItemVo;
|
||||
import com.klp.erp.domain.vo.ErpPurchasePlanVo;
|
||||
import com.klp.erp.service.IErpPurchasePlanService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 采购计划
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-22
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/erp/purchasePlan")
|
||||
public class ErpPurchasePlanController extends BaseController {
|
||||
|
||||
private final IErpPurchasePlanService iErpPurchasePlanService;
|
||||
|
||||
/** 查询采购计划列表 */
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ErpPurchasePlanVo> list(ErpPurchasePlanBo bo, PageQuery pageQuery) {
|
||||
return iErpPurchasePlanService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/** 总体到货进度统计(已完成 N / 共 M) */
|
||||
@GetMapping("/statistics")
|
||||
public R<Map<String, Object>> statistics(ErpPurchasePlanBo bo) {
|
||||
return R.ok(iErpPurchasePlanService.statistics(bo));
|
||||
}
|
||||
|
||||
/** 导出采购计划列表 */
|
||||
@Log(title = "采购计划", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ErpPurchasePlanBo bo, HttpServletResponse response) {
|
||||
List<ErpPurchasePlanVo> list = iErpPurchasePlanService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "采购计划", ErpPurchasePlanVo.class, response);
|
||||
}
|
||||
|
||||
/** 获取采购计划详细信息 */
|
||||
@GetMapping("/{planId}")
|
||||
public R<ErpPurchasePlanVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long planId) {
|
||||
return R.ok(iErpPurchasePlanService.queryById(planId));
|
||||
}
|
||||
|
||||
/** 按销售合同取明细(选合同自动带出明细:1/2/3合同 -> 1/2/3/4明细) */
|
||||
@GetMapping("/itemsByOrders")
|
||||
public R<List<ErpPurchasePlanItemVo>> itemsByOrders(@RequestParam("orderIds") List<Long> orderIds) {
|
||||
return R.ok(iErpPurchasePlanService.queryItemsByOrders(orderIds));
|
||||
}
|
||||
|
||||
/** 合同列表(左侧):crm_order + 每个合同已有的采购计划数 */
|
||||
@GetMapping("/contracts")
|
||||
public TableDataInfo<ErpContractOptionVo> contracts(@RequestParam(value = "keyword", required = false) String keyword,
|
||||
PageQuery pageQuery) {
|
||||
return iErpPurchasePlanService.queryContractPage(keyword, pageQuery);
|
||||
}
|
||||
|
||||
/** 某合同下的所有采购计划 */
|
||||
@GetMapping("/byContract/{orderId}")
|
||||
public R<List<ErpPurchasePlanVo>> byContract(@PathVariable Long orderId) {
|
||||
return R.ok(iErpPurchasePlanService.queryPlansByContract(orderId));
|
||||
}
|
||||
|
||||
/** 新增采购计划 */
|
||||
@Log(title = "采购计划", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ErpPurchasePlanBo bo) {
|
||||
return toAjax(iErpPurchasePlanService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/** 修改采购计划 */
|
||||
@Log(title = "采购计划", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ErpPurchasePlanBo bo) {
|
||||
return toAjax(iErpPurchasePlanService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/** 审核(通过/驳回 + 申请意见) */
|
||||
@Log(title = "采购计划", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/audit")
|
||||
public R<Void> audit(@Validated @RequestBody ErpPurchasePlanAuditBo bo) {
|
||||
return toAjax(iErpPurchasePlanService.audit(bo, getUsername()));
|
||||
}
|
||||
|
||||
/** 送审 / 重新送审 */
|
||||
@Log(title = "采购计划", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/submit/{planId}")
|
||||
public R<Void> submit(@NotNull(message = "主键不能为空") @PathVariable Long planId) {
|
||||
return toAjax(iErpPurchasePlanService.submitForAudit(planId));
|
||||
}
|
||||
|
||||
/** 删除采购计划 */
|
||||
@Log(title = "采购计划", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] planIds) {
|
||||
return toAjax(iErpPurchasePlanService.deleteWithValidByIds(Arrays.asList(planIds), true));
|
||||
}
|
||||
|
||||
/** 导入到货 Excel */
|
||||
@Log(title = "采购计划-到货", businessType = BusinessType.IMPORT)
|
||||
@PostMapping(value = "/{planId}/importDelivery", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public R<Map<String, Object>> importDelivery(@PathVariable Long planId,
|
||||
@RequestPart("file") MultipartFile file) throws Exception {
|
||||
Map<String, Object> result = iErpPurchasePlanService.importDelivery(planId, file.getInputStream(), file.getOriginalFilename(), getUsername());
|
||||
return R.ok(String.valueOf(result.get("message")), result);
|
||||
}
|
||||
|
||||
/** 查询某计划的到货明细 */
|
||||
@GetMapping("/{planId}/delivery")
|
||||
public R<List<ErpPurchasePlanDeliveryVo>> deliveryList(@PathVariable Long planId) {
|
||||
return R.ok(iErpPurchasePlanService.queryDeliveryList(planId));
|
||||
}
|
||||
|
||||
/** 刷新到货:拿已上传卷号去 WMS 钢卷表实时复核,签收入库的自动翻为已到货(无需重传) */
|
||||
@PutMapping("/{planId}/refreshArrival")
|
||||
public R<Void> refreshArrival(@PathVariable Long planId) {
|
||||
iErpPurchasePlanService.refreshProgress(planId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/** 厂商历史记忆(手填自动补全) */
|
||||
@GetMapping("/manufacturers")
|
||||
public R<List<String>> manufacturers(@RequestParam(value = "keyword", required = false) String keyword) {
|
||||
return R.ok(iErpPurchasePlanService.queryManufacturers(keyword));
|
||||
}
|
||||
|
||||
/** 到货记录页左侧:审核通过的合同分页 */
|
||||
@GetMapping("/deliveryPlans")
|
||||
public TableDataInfo<ErpPurchasePlanVo> deliveryPlans(@RequestParam(value = "keyword", required = false) String keyword,
|
||||
PageQuery pageQuery) {
|
||||
return iErpPurchasePlanService.queryDeliveryPlanPage(keyword, pageQuery);
|
||||
}
|
||||
|
||||
/** 删除到货明细 */
|
||||
@Log(title = "采购计划-到货", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/delivery/{deliveryId}")
|
||||
public R<Void> deleteDelivery(@PathVariable Long deliveryId) {
|
||||
return toAjax(iErpPurchasePlanService.deleteDelivery(deliveryId));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.klp.erp.controller;
|
||||
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.klp.erp.domain.bo.ErpPurchaseRequisitionBo;
|
||||
import com.klp.erp.domain.vo.ErpPurchaseRequisitionVo;
|
||||
import com.klp.erp.service.IErpPurchaseRequisitionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 请购及采购单
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-29
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/erp/purchaseRequisition")
|
||||
public class ErpPurchaseRequisitionController extends BaseController {
|
||||
|
||||
private final IErpPurchaseRequisitionService iErpPurchaseRequisitionService;
|
||||
|
||||
/** 查询请购单列表 */
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ErpPurchaseRequisitionVo> list(ErpPurchaseRequisitionBo bo, PageQuery pageQuery) {
|
||||
return iErpPurchaseRequisitionService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/** 导出请购单列表 */
|
||||
@Log(title = "请购及采购单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ErpPurchaseRequisitionBo bo, HttpServletResponse response) {
|
||||
List<ErpPurchaseRequisitionVo> list = iErpPurchaseRequisitionService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "请购及采购单", ErpPurchaseRequisitionVo.class, response);
|
||||
}
|
||||
|
||||
/** 获取请购单详细信息(含明细) */
|
||||
@GetMapping("/{reqId}")
|
||||
public R<ErpPurchaseRequisitionVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long reqId) {
|
||||
return R.ok(iErpPurchaseRequisitionService.queryById(reqId));
|
||||
}
|
||||
|
||||
/** 新增请购单 */
|
||||
@Log(title = "请购及采购单", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ErpPurchaseRequisitionBo bo) {
|
||||
return toAjax(iErpPurchaseRequisitionService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/** 修改请购单 */
|
||||
@Log(title = "请购及采购单", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ErpPurchaseRequisitionBo bo) {
|
||||
return toAjax(iErpPurchaseRequisitionService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/** 删除请购单 */
|
||||
@Log(title = "请购及采购单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{reqIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] reqIds) {
|
||||
return toAjax(iErpPurchaseRequisitionService.deleteWithValidByIds(Arrays.asList(reqIds), true));
|
||||
}
|
||||
|
||||
/** 提交审批(草稿 → 审批中) */
|
||||
@Log(title = "请购及采购单", businessType = BusinessType.UPDATE)
|
||||
@SaCheckPermission("erp:purchaseRequisition:approve")
|
||||
@PutMapping("/{reqId}/submit")
|
||||
public R<Void> submitApproval(@NotNull(message = "主键不能为空") @PathVariable Long reqId,
|
||||
@NotNull(message = "审批人不能为空") @RequestParam Long firstApproverId,
|
||||
@NotEmpty(message = "审批人姓名不能为空") @RequestParam String firstApproverName) {
|
||||
return toAjax(iErpPurchaseRequisitionService.submitApproval(reqId, firstApproverId, firstApproverName));
|
||||
}
|
||||
|
||||
/** 审批通过(审批中 → 已通过) */
|
||||
@Log(title = "请购及采购单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{reqId}/approve")
|
||||
public R<Void> approve(@NotNull(message = "主键不能为空") @PathVariable Long reqId,
|
||||
@RequestParam(required = false) String approvalOpinion) {
|
||||
return toAjax(iErpPurchaseRequisitionService.approve(reqId, approvalOpinion));
|
||||
}
|
||||
|
||||
/** 驳回(审批中 → 已驳回) */
|
||||
@Log(title = "请购及采购单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{reqId}/reject")
|
||||
public R<Void> reject(@NotNull(message = "主键不能为空") @PathVariable Long reqId,
|
||||
@RequestParam(required = false) String approvalOpinion) {
|
||||
return toAjax(iErpPurchaseRequisitionService.reject(reqId, approvalOpinion));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.klp.erp.controller;
|
||||
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.erp.domain.bo.ErpSupplierTransactionBo;
|
||||
import com.klp.erp.domain.vo.ErpSupplierTransactionVo;
|
||||
import com.klp.erp.service.IErpSupplierTransactionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 供应商往来流水
|
||||
*
|
||||
* @author klp
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/erp/supplierTxn")
|
||||
public class ErpSupplierTransactionController extends BaseController {
|
||||
|
||||
private final IErpSupplierTransactionService txnService;
|
||||
|
||||
/** 某供应商的往来流水(含逐笔余额) */
|
||||
@GetMapping("/list")
|
||||
public R<List<ErpSupplierTransactionVo>> list(@RequestParam("supplierId") Long supplierId) {
|
||||
return R.ok(txnService.queryBySupplier(supplierId));
|
||||
}
|
||||
|
||||
/** 某供应商的往来汇总 */
|
||||
@GetMapping("/summary")
|
||||
public R<Map<String, Object>> summary(@RequestParam("supplierId") Long supplierId) {
|
||||
return R.ok(txnService.summary(supplierId));
|
||||
}
|
||||
|
||||
@Log(title = "供应商往来", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit
|
||||
@PostMapping
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ErpSupplierTransactionBo bo) {
|
||||
return toAjax(txnService.insertByBo(bo));
|
||||
}
|
||||
|
||||
@Log(title = "供应商往来", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ErpSupplierTransactionBo bo) {
|
||||
return toAjax(txnService.updateByBo(bo));
|
||||
}
|
||||
|
||||
@Log(title = "供应商往来", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{txnIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] txnIds) {
|
||||
return toAjax(txnService.deleteByIds(Arrays.asList(txnIds)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.klp.erp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 采购计划头对象 erp_purchase_plan
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("erp_purchase_plan")
|
||||
public class ErpPurchasePlan extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 计划ID */
|
||||
@TableId(value = "plan_id")
|
||||
private Long planId;
|
||||
|
||||
/** 采购计划号 */
|
||||
private String planNo;
|
||||
|
||||
/** 计划状态: 0-进行中 1-已完成归档 */
|
||||
private String planStatus;
|
||||
|
||||
/** 审核状态: 0-待审核 1-通过 2-驳回 */
|
||||
private String auditStatus;
|
||||
|
||||
/** 申请/审核意见 */
|
||||
private String auditOpinion;
|
||||
|
||||
/** 审核人 */
|
||||
private String auditor;
|
||||
|
||||
/** 审核时间 */
|
||||
private Date auditTime;
|
||||
|
||||
/** 供货商 */
|
||||
private String supplier;
|
||||
|
||||
/** 采购日期 */
|
||||
private Date purchaseDate;
|
||||
|
||||
/** 计划总重量(T) */
|
||||
private BigDecimal planWeight;
|
||||
|
||||
/** 已到货重量(T) = Σ到货卷(WMS已确认)单卷重量 */
|
||||
private BigDecimal arrivedWeight;
|
||||
|
||||
/** 要求项数 = 明细行数 */
|
||||
private Integer planQty;
|
||||
|
||||
/** 已到货卷数 = WMS确认到货的上传卷数 */
|
||||
private Integer arrivedCount;
|
||||
|
||||
/** 在途卷数 = 钢卷表存在但 data_type=10 的上传卷数 */
|
||||
private Integer inTransitCount;
|
||||
|
||||
/** 在途重量(T) */
|
||||
private BigDecimal inTransitWeight;
|
||||
|
||||
/** 删除标志 */
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.klp.erp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 采购计划审核日志(每次审核留痕)
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-25
|
||||
*/
|
||||
@Data
|
||||
@TableName("erp_purchase_plan_audit_log")
|
||||
public class ErpPurchasePlanAuditLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "log_id")
|
||||
private Long logId;
|
||||
|
||||
private Long planId;
|
||||
|
||||
/** 审核结果: 1-通过 2-驳回 */
|
||||
private String auditStatus;
|
||||
|
||||
/** 审核/驳回意见 */
|
||||
private String auditOpinion;
|
||||
|
||||
private String auditor;
|
||||
|
||||
private Date auditTime;
|
||||
|
||||
private Date createTime;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.klp.erp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 采购计划-销售合同关联对象 erp_purchase_plan_contract_rel
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("erp_purchase_plan_contract_rel")
|
||||
public class ErpPurchasePlanContractRel extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 关系ID */
|
||||
@TableId(value = "rel_id")
|
||||
private Long relId;
|
||||
|
||||
/** 采购计划ID */
|
||||
private Long planId;
|
||||
|
||||
/** 销售合同ID(crm_order.order_id) */
|
||||
private Long orderId;
|
||||
|
||||
/** 删除标志 */
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.klp.erp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 采购计划到货明细对象 erp_purchase_plan_delivery
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("erp_purchase_plan_delivery")
|
||||
public class ErpPurchasePlanDelivery extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 到货明细ID */
|
||||
@TableId(value = "delivery_id")
|
||||
private Long deliveryId;
|
||||
|
||||
/** 关联计划ID */
|
||||
private Long planId;
|
||||
|
||||
/** 关联上传批次ID */
|
||||
private Long batchId;
|
||||
|
||||
/** 是否WMS已确认到货: 1-是 0-否(卷号在钢卷表存在且 data_type<>10) */
|
||||
private Integer arrived;
|
||||
|
||||
/** 是否在途: 1-是(卷号在钢卷表存在但 data_type=10) 0-否 */
|
||||
private Integer inTransit;
|
||||
|
||||
/** 日期 */
|
||||
private Date arrivalDate;
|
||||
|
||||
/** 牌号 */
|
||||
private String grade;
|
||||
|
||||
/** 规格(厚×宽) */
|
||||
private String spec;
|
||||
|
||||
/** 卷号 */
|
||||
private String coilNo;
|
||||
|
||||
/** 单卷重量(T) */
|
||||
private BigDecimal coilWeight;
|
||||
|
||||
/** 车号 */
|
||||
private String truckNo;
|
||||
|
||||
/** 整车数量(T) */
|
||||
private BigDecimal truckWeight;
|
||||
|
||||
/** 件数 */
|
||||
private Integer pieceCount;
|
||||
|
||||
/** 销售代码 */
|
||||
private String salesCode;
|
||||
|
||||
/** 钢厂到站 */
|
||||
private String arrivalStation;
|
||||
|
||||
/** 删除标志 */
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.klp.erp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 到货上传批次对象 erp_purchase_plan_delivery_batch
|
||||
* 每上传一份到货 Excel 记一条批次,便于随时回看每一次上传。
|
||||
*
|
||||
* @author klp
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("erp_purchase_plan_delivery_batch")
|
||||
public class ErpPurchasePlanDeliveryBatch extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 批次ID */
|
||||
@TableId(value = "batch_id")
|
||||
private Long batchId;
|
||||
|
||||
/** 关联计划ID */
|
||||
private Long planId;
|
||||
|
||||
/** 文件名 */
|
||||
private String fileName;
|
||||
|
||||
/** 本次导入到货行数 */
|
||||
private Integer rowCount;
|
||||
|
||||
/** 本次与明细卷号匹配上的卷数 */
|
||||
private Integer matchedCount;
|
||||
|
||||
/** 上传后计划到货百分比快照(0-100) */
|
||||
private BigDecimal arrivedPercent;
|
||||
|
||||
/** 删除标志 */
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.klp.erp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 采购计划明细对象 erp_purchase_plan_item
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("erp_purchase_plan_item")
|
||||
public class ErpPurchasePlanItem extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 明细ID */
|
||||
@TableId(value = "item_id")
|
||||
private Long itemId;
|
||||
|
||||
/** 关联计划ID */
|
||||
private Long planId;
|
||||
|
||||
/** 规格 */
|
||||
private String spec;
|
||||
|
||||
/** 厂商(手填,带历史记忆) */
|
||||
private String manufacturer;
|
||||
|
||||
/** 产品(如热轧卷板) */
|
||||
private String productType;
|
||||
|
||||
/** 材质 */
|
||||
private String material;
|
||||
|
||||
/** 牌号 */
|
||||
private String grade;
|
||||
|
||||
/** 卷号 */
|
||||
private String coilNo;
|
||||
|
||||
/** 宽度(mm,可为区间文本) */
|
||||
private String width;
|
||||
|
||||
/** 厚度(mm,可为区间文本) */
|
||||
private String thickness;
|
||||
|
||||
/** 宽度公差 */
|
||||
private String widthTolerance;
|
||||
|
||||
/** 厚度公差 */
|
||||
private String thicknessTolerance;
|
||||
|
||||
/** 重量(T) */
|
||||
private BigDecimal weight;
|
||||
|
||||
/** 数量(件/卷数) */
|
||||
private Integer quantity;
|
||||
|
||||
/** 已到货重量(T),由到货Excel按牌号+规格累加 */
|
||||
private BigDecimal arrivedWeight;
|
||||
|
||||
/** 到货状态: 0-未到货 1-部分到货 2-已到货 */
|
||||
private String itemStatus;
|
||||
|
||||
/** 供货商 */
|
||||
private String supplier;
|
||||
|
||||
/** 删除标志 */
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.klp.erp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 请购及采购单对象 erp_purchase_requisition
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("erp_purchase_requisition")
|
||||
public class ErpPurchaseRequisition extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(value = "req_id")
|
||||
private Long reqId;
|
||||
|
||||
/** 请购部门 */
|
||||
private String reqDept;
|
||||
|
||||
/** 品名 */
|
||||
private String itemName;
|
||||
|
||||
/** 规格 */
|
||||
private String specification;
|
||||
|
||||
/** 单位 */
|
||||
private String unit;
|
||||
|
||||
/** 请购量 */
|
||||
private String quantity;
|
||||
|
||||
/** 类别 */
|
||||
private String category;
|
||||
|
||||
/** 需求日期 */
|
||||
private String requiredDate;
|
||||
|
||||
/** 用途说明 */
|
||||
private String purposeDesc;
|
||||
|
||||
/** 使用部门 */
|
||||
private String useDept;
|
||||
|
||||
/** 品检条件 */
|
||||
private String inspectionCondition;
|
||||
|
||||
/** 试用天数 */
|
||||
private String trialDays;
|
||||
|
||||
/** 前期采购记录 */
|
||||
private String prevPurchaseRecord;
|
||||
|
||||
/** 采购拟办 */
|
||||
private String purchaseProposal;
|
||||
|
||||
/** 付款条件 */
|
||||
private String paymentTerms;
|
||||
|
||||
/** 采购金额 */
|
||||
private String totalAmount;
|
||||
|
||||
/** 董事长(采购单位) */
|
||||
private String signPurchaseChairman;
|
||||
|
||||
/** 部长/厂长(采购单位) */
|
||||
private String signPurchaseManager;
|
||||
|
||||
/** 主任(采购单位) */
|
||||
private String signPurchaseDirector;
|
||||
|
||||
/** 经办(采购单位) */
|
||||
private String signPurchaseHandler;
|
||||
|
||||
/** 生产总经理(请购单位) */
|
||||
private String signRequestGm;
|
||||
|
||||
/** 厂长(请购单位) */
|
||||
private String signRequestFactoryMgr;
|
||||
|
||||
/** 主任(请购单位) */
|
||||
private String signRequestDirector;
|
||||
|
||||
/** 经办(请购单位) */
|
||||
private String signRequestHandler;
|
||||
|
||||
/** 指定卸货位 */
|
||||
private String unloadLocation;
|
||||
|
||||
/** 卸货其他位置 */
|
||||
private String unloadOther;
|
||||
|
||||
/** 状态 */
|
||||
private String formStatus;
|
||||
|
||||
/** 删除标志 */
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/** 一审审批意见 */
|
||||
private String firstApprovalOpinion;
|
||||
|
||||
/** 二审审批意见 */
|
||||
private String secondApprovalOpinion;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.klp.erp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 请购及采购单明细对象 erp_purchase_requisition_item
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("erp_purchase_requisition_item")
|
||||
public class ErpPurchaseRequisitionItem extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 明细ID */
|
||||
@TableId(value = "item_id")
|
||||
private Long itemId;
|
||||
|
||||
/** 关联请购单ID */
|
||||
private Long reqId;
|
||||
|
||||
/** 项次 */
|
||||
private String seq;
|
||||
|
||||
/** 品名 */
|
||||
private String itemName;
|
||||
|
||||
/** 规格 */
|
||||
private String specification;
|
||||
|
||||
/** 单位 */
|
||||
private String unit;
|
||||
|
||||
/** 请购量 */
|
||||
private String quantity;
|
||||
|
||||
/** 删除标志 */
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.klp.erp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 供应商往来流水对象 erp_supplier_transaction
|
||||
*
|
||||
* @author klp
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("erp_supplier_transaction")
|
||||
public class ErpSupplierTransaction extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 往来流水ID */
|
||||
@TableId(value = "txn_id")
|
||||
private Long txnId;
|
||||
|
||||
/** 关联供应商ID */
|
||||
private Long supplierId;
|
||||
|
||||
/** 发生日期 */
|
||||
private Date txnDate;
|
||||
|
||||
/** 类型: 1-采购应付 2-付款 3-退货 4-其他 */
|
||||
private String txnType;
|
||||
|
||||
/** 金额 */
|
||||
private BigDecimal amount;
|
||||
|
||||
/** 单据号 */
|
||||
private String docNo;
|
||||
|
||||
/** 删除标志 */
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.klp.erp.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 采购计划审核业务对象
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
public class ErpPurchasePlanAuditBo {
|
||||
|
||||
/** 计划ID */
|
||||
@NotNull(message = "计划ID不能为空")
|
||||
private Long planId;
|
||||
|
||||
/** 审核结果: 1-通过 2-驳回 */
|
||||
@NotNull(message = "审核结果不能为空")
|
||||
private String auditStatus;
|
||||
|
||||
/** 申请/审核意见 */
|
||||
private String auditOpinion;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.klp.erp.domain.bo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 采购计划头业务对象 erp_purchase_plan
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ErpPurchasePlanBo extends BaseEntity {
|
||||
|
||||
/** 计划ID */
|
||||
@NotNull(message = "计划ID不能为空", groups = {EditGroup.class})
|
||||
private Long planId;
|
||||
|
||||
/** 采购计划号(为空时自动生成) */
|
||||
private String planNo;
|
||||
|
||||
/** 综合搜索关键字:计划号 / 供货商 / 合同号 */
|
||||
private String keyword;
|
||||
|
||||
/** 计划状态: 0-进行中 1-已完成归档 */
|
||||
private String planStatus;
|
||||
|
||||
/** 审核状态: 0-待审核 1-通过 2-驳回 */
|
||||
private String auditStatus;
|
||||
|
||||
/** 供货商 */
|
||||
private String supplier;
|
||||
|
||||
/** 采购日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date purchaseDate;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 明细行 */
|
||||
private List<ErpPurchasePlanItemBo> items;
|
||||
|
||||
/** 关联的销售合同ID列表(crm_order.order_id) */
|
||||
private List<Long> orderIds;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.klp.erp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 采购计划明细业务对象 erp_purchase_plan_item
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ErpPurchasePlanItemBo extends BaseEntity {
|
||||
|
||||
/** 明细ID */
|
||||
private Long itemId;
|
||||
|
||||
/** 关联计划ID */
|
||||
private Long planId;
|
||||
|
||||
/** 规格 */
|
||||
private String spec;
|
||||
|
||||
/** 厂商(手填,带历史记忆) */
|
||||
private String manufacturer;
|
||||
|
||||
/** 产品(如热轧卷板) */
|
||||
private String productType;
|
||||
|
||||
/** 材质 */
|
||||
private String material;
|
||||
|
||||
/** 牌号 */
|
||||
private String grade;
|
||||
|
||||
/** 卷号 */
|
||||
private String coilNo;
|
||||
|
||||
/** 宽度(mm,可为区间文本) */
|
||||
private String width;
|
||||
|
||||
/** 厚度(mm,可为区间文本) */
|
||||
private String thickness;
|
||||
|
||||
/** 宽度公差 */
|
||||
private String widthTolerance;
|
||||
|
||||
/** 厚度公差 */
|
||||
private String thicknessTolerance;
|
||||
|
||||
/** 重量(T) */
|
||||
private BigDecimal weight;
|
||||
|
||||
/** 数量(件/卷数) */
|
||||
private Integer quantity;
|
||||
|
||||
/** 供货商 */
|
||||
private String supplier;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.klp.erp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 请购及采购单业务对象 erp_purchase_requisition
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ErpPurchaseRequisitionBo extends BaseEntity {
|
||||
|
||||
/** 主键 */
|
||||
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
||||
private Long reqId;
|
||||
|
||||
/** 请购部门 */
|
||||
private String reqDept;
|
||||
|
||||
/** 品名 */
|
||||
private String itemName;
|
||||
|
||||
/** 规格 */
|
||||
private String specification;
|
||||
|
||||
/** 单位 */
|
||||
private String unit;
|
||||
|
||||
/** 请购量 */
|
||||
private String quantity;
|
||||
|
||||
/** 类别 */
|
||||
private String category;
|
||||
|
||||
/** 需求日期 */
|
||||
private String requiredDate;
|
||||
|
||||
/** 用途说明 */
|
||||
private String purposeDesc;
|
||||
|
||||
/** 使用部门 */
|
||||
private String useDept;
|
||||
|
||||
/** 品检条件 */
|
||||
private String inspectionCondition;
|
||||
|
||||
/** 试用天数 */
|
||||
private String trialDays;
|
||||
|
||||
/** 前期采购记录 */
|
||||
private String prevPurchaseRecord;
|
||||
|
||||
/** 采购拟办 */
|
||||
private String purchaseProposal;
|
||||
|
||||
/** 付款条件 */
|
||||
private String paymentTerms;
|
||||
|
||||
/** 采购金额 */
|
||||
private String totalAmount;
|
||||
|
||||
/** 董事长(采购单位) */
|
||||
private String signPurchaseChairman;
|
||||
|
||||
/** 部长/厂长(采购单位) */
|
||||
private String signPurchaseManager;
|
||||
|
||||
/** 主任(采购单位) */
|
||||
private String signPurchaseDirector;
|
||||
|
||||
/** 经办(采购单位) */
|
||||
private String signPurchaseHandler;
|
||||
|
||||
/** 生产总经理(请购单位) */
|
||||
private String signRequestGm;
|
||||
|
||||
/** 厂长(请购单位) */
|
||||
private String signRequestFactoryMgr;
|
||||
|
||||
/** 主任(请购单位) */
|
||||
private String signRequestDirector;
|
||||
|
||||
/** 经办(请购单位) */
|
||||
private String signRequestHandler;
|
||||
|
||||
/** 指定卸货位 */
|
||||
private String unloadLocation;
|
||||
|
||||
/** 卸货其他位置 */
|
||||
private String unloadOther;
|
||||
|
||||
/** 状态 */
|
||||
private String formStatus;
|
||||
|
||||
/** 一审审批意见 */
|
||||
private String firstApprovalOpinion;
|
||||
|
||||
/** 二审审批意见 */
|
||||
private String secondApprovalOpinion;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 明细行 */
|
||||
private List<ErpPurchaseRequisitionItemBo> items;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.klp.erp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 请购及采购单明细业务对象 erp_purchase_requisition_item
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ErpPurchaseRequisitionItemBo extends BaseEntity {
|
||||
|
||||
/** 明细ID */
|
||||
private Long itemId;
|
||||
|
||||
/** 关联请购单ID */
|
||||
private Long reqId;
|
||||
|
||||
/** 项次 */
|
||||
private String seq;
|
||||
|
||||
/** 品名 */
|
||||
private String itemName;
|
||||
|
||||
/** 规格 */
|
||||
private String specification;
|
||||
|
||||
/** 单位 */
|
||||
private String unit;
|
||||
|
||||
/** 请购量 */
|
||||
private String quantity;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.klp.erp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 供应商往来流水业务对象
|
||||
*
|
||||
* @author klp
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ErpSupplierTransactionBo extends BaseEntity {
|
||||
|
||||
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
||||
private Long txnId;
|
||||
|
||||
@NotNull(message = "供应商不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private Long supplierId;
|
||||
|
||||
private Date txnDate;
|
||||
|
||||
@NotNull(message = "类型不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String txnType;
|
||||
|
||||
@NotNull(message = "金额不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private BigDecimal amount;
|
||||
|
||||
private String docNo;
|
||||
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.klp.erp.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 采购计划左侧「合同列表」视图对象:crm_order + 该合同已有的采购计划数。
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-25
|
||||
*/
|
||||
@Data
|
||||
public class ErpContractOptionVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 销售合同ID(crm_order.order_id) */
|
||||
private Long orderId;
|
||||
|
||||
/** 订单编号 */
|
||||
private String orderCode;
|
||||
|
||||
/** 合同号 */
|
||||
private String contractCode;
|
||||
|
||||
/** 合同名称 */
|
||||
private String contractName;
|
||||
|
||||
/** 需方(客户) */
|
||||
private String customer;
|
||||
|
||||
/** 供方 */
|
||||
private String supplier;
|
||||
|
||||
/** 订单总金额 */
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
/** 销售员 */
|
||||
private String salesman;
|
||||
|
||||
/** 该合同已挂接的采购计划数 */
|
||||
private Integer planCount;
|
||||
|
||||
// ====== 以下为 crm_order 全量补充字段 ======
|
||||
|
||||
/** 订单类型:pre-预订单,formal-正式订单 */
|
||||
private Long orderType;
|
||||
|
||||
/** 交货日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date deliveryDate;
|
||||
|
||||
/** 订单状态 */
|
||||
private Long orderStatus;
|
||||
|
||||
/** 财务状态 */
|
||||
private Long financeStatus;
|
||||
|
||||
/** 未结款数额 */
|
||||
private BigDecimal unpaidAmount;
|
||||
|
||||
/** 签订时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date signTime;
|
||||
|
||||
/** 签订地点 */
|
||||
private String signLocation;
|
||||
|
||||
/** 产品内容 */
|
||||
private String productContent;
|
||||
|
||||
/** 合同内容 */
|
||||
private String contractContent;
|
||||
|
||||
/** 供方地址 */
|
||||
private String supplierAddress;
|
||||
|
||||
/** 供方电话 */
|
||||
private String supplierPhone;
|
||||
|
||||
/** 供方开户行 */
|
||||
private String supplierBank;
|
||||
|
||||
/** 供方账号 */
|
||||
private String supplierAccount;
|
||||
|
||||
/** 供方税号 */
|
||||
private String supplierTaxNo;
|
||||
|
||||
/** 需方地址 */
|
||||
private String customerAddress;
|
||||
|
||||
/** 需方电话 */
|
||||
private String customerPhone;
|
||||
|
||||
/** 需方开户行 */
|
||||
private String customerBank;
|
||||
|
||||
/** 需方账号 */
|
||||
private String customerAccount;
|
||||
|
||||
/** 需方税号 */
|
||||
private String customerTaxNo;
|
||||
|
||||
/** 技术附件 */
|
||||
private String techAnnex;
|
||||
|
||||
/** 商务附件 */
|
||||
private String businessAnnex;
|
||||
|
||||
/** 排产函 */
|
||||
private String productionSchedule;
|
||||
|
||||
/** 算单价备注 */
|
||||
private String unitPriceRemark;
|
||||
|
||||
/** 应付定金(万元) */
|
||||
private BigDecimal depositPayable;
|
||||
|
||||
/** 已付定金(万元) */
|
||||
private BigDecimal depositPaid;
|
||||
|
||||
/** 定金比例(%) */
|
||||
private BigDecimal depositRatio;
|
||||
|
||||
/** 合同状态 0=草稿 1=生效 2=作废 3=已完成 */
|
||||
private Long status;
|
||||
|
||||
/** 关联合同ID */
|
||||
private Long contractId;
|
||||
|
||||
/** 附件 */
|
||||
private String annexFiles;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 是否置顶 */
|
||||
private Integer isTop;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.klp.erp.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 采购计划审核日志视图对象
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-06-25
|
||||
*/
|
||||
@Data
|
||||
public class ErpPurchasePlanAuditLogVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long logId;
|
||||
|
||||
private Long planId;
|
||||
|
||||
/** 审核结果: 1-通过 2-驳回 */
|
||||
private String auditStatus;
|
||||
|
||||
private String auditOpinion;
|
||||
|
||||
private String auditor;
|
||||
|
||||
private Date auditTime;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.klp.erp.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 到货上传批次视图对象
|
||||
*
|
||||
* @author klp
|
||||
*/
|
||||
@Data
|
||||
public class ErpPurchasePlanDeliveryBatchVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long batchId;
|
||||
|
||||
private Long planId;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private Integer rowCount;
|
||||
|
||||
private Integer matchedCount;
|
||||
|
||||
private BigDecimal arrivedPercent;
|
||||
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
private String remark;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user