From cfbf7533b8cfc395a110390da23cf6bb641daff9 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 08 一月 2025 16:05:17 +0800
Subject: [PATCH] Merge branch '2.0.1' of http://139.186.142.91:10010/r/productDev/funingyunwei into 2.0.1
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwProblemServiceImpl.java | 212 ++
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwMaterialMapper.java | 13
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwOutinboundController.java | 94 +
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwWarehouseMapper.java | 13
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwProblemMapper.java | 12
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStocktakingService.java | 104 +
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwWarehouseService.java | 98 +
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwOutinboundMapper.java | 13
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStocktakingServiceImpl.java | 357 ++++
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStocktakingRecordService.java | 100 +
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwOutinboundRecordService.java | 97 +
server/db/business.yw_outinbound_record.permissions.sql | 6
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwProblem.java | 114 +
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStocktakingRecordServiceImpl.java | 205 ++
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwMaterialController.java | 102 +
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwMaterialService.java | 101 +
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwMaterialServiceImpl.java | 237 +++
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwWarehouseController.java | 100 +
server/db/business.yw_stocktaking_record.permissions.sql | 6
server/db/business.yw_outinbound.permissions.sql | 6
server/visits/admin_timer/src/main/java/com/doumee/api/YwTimerController.java | 30
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStockServiceImpl.java | 129 +
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwWarehouseServiceImpl.java | 239 +++
server/system_service/src/main/java/com/doumee/core/utils/Constants.java | 91 +
server/db/business.yw_problem.permissions.sql | 6
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwWarehouse.java | 85 +
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStocktakingRecord.java | 139 +
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwProblemController.java | 93 +
server/db/business.yw_material.permissions.sql | 6
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwOutinboundRecordServiceImpl.java | 140 +
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStocktakingRecordController.java | 103 +
server/system_service/src/main/java/com/doumee/dao/system/model/Multifile.java | 4
server/db/business.yw_stock.permissions.sql | 6
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStocktakingRecordMapper.java | 13
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwOutinboundRecord.java | 138 +
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStocktakingController.java | 123 +
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwOutinboundRecordMapper.java | 13
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwMaterial.java | 123 +
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStock.java | 97 +
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStocktaking.java | 181 ++
server/db/business.yw_stocktaking.permissions.sql | 6
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwProblemService.java | 97 +
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwOutinboundServiceImpl.java | 391 +++++
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Category.java | 2
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwOutinbound.java | 111 +
server/db/business.yw_warehouse.permissions.sql | 6
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStockMapper.java | 13
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStocktakingMapper.java | 13
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwOutinboundService.java | 99 +
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStockService.java | 97 +
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStockController.java | 92 +
51 files changed, 4,668 insertions(+), 8 deletions(-)
diff --git a/server/db/business.yw_material.permissions.sql b/server/db/business.yw_material.permissions.sql
new file mode 100644
index 0000000..df5ce32
--- /dev/null
+++ b/server/db/business.yw_material.permissions.sql
@@ -0,0 +1,6 @@
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywmaterial:create', '鏂板缓杩愮淮璧勪骇淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywmaterial:delete', '鍒犻櫎杩愮淮璧勪骇淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywmaterial:update', '淇敼杩愮淮璧勪骇淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywmaterial:query', '鏌ヨ杩愮淮璧勪骇淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywmaterial:exportExcel', '瀵煎嚭杩愮淮璧勪骇淇℃伅琛�(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+
diff --git a/server/db/business.yw_outinbound.permissions.sql b/server/db/business.yw_outinbound.permissions.sql
new file mode 100644
index 0000000..09b45fa
--- /dev/null
+++ b/server/db/business.yw_outinbound.permissions.sql
@@ -0,0 +1,6 @@
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywoutinbound:create', '鏂板缓杩愮淮鍑哄叆搴撲俊鎭〃', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywoutinbound:delete', '鍒犻櫎杩愮淮鍑哄叆搴撲俊鎭〃', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywoutinbound:update', '淇敼杩愮淮鍑哄叆搴撲俊鎭〃', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywoutinbound:query', '鏌ヨ杩愮淮鍑哄叆搴撲俊鎭〃', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywoutinbound:exportExcel', '瀵煎嚭杩愮淮鍑哄叆搴撲俊鎭〃(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+
diff --git a/server/db/business.yw_outinbound_record.permissions.sql b/server/db/business.yw_outinbound_record.permissions.sql
new file mode 100644
index 0000000..e26032d
--- /dev/null
+++ b/server/db/business.yw_outinbound_record.permissions.sql
@@ -0,0 +1,6 @@
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywoutinboundrecord:create', '鏂板缓杩愮淮鍑哄叆搴撲俊鎭槑缁嗚〃', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywoutinboundrecord:delete', '鍒犻櫎杩愮淮鍑哄叆搴撲俊鎭槑缁嗚〃', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywoutinboundrecord:update', '淇敼杩愮淮鍑哄叆搴撲俊鎭槑缁嗚〃', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywoutinboundrecord:query', '鏌ヨ杩愮淮鍑哄叆搴撲俊鎭槑缁嗚〃', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywoutinboundrecord:exportExcel', '瀵煎嚭杩愮淮鍑哄叆搴撲俊鎭槑缁嗚〃(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+
diff --git a/server/db/business.yw_problem.permissions.sql b/server/db/business.yw_problem.permissions.sql
new file mode 100644
index 0000000..07c996d
--- /dev/null
+++ b/server/db/business.yw_problem.permissions.sql
@@ -0,0 +1,6 @@
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywproblem:create', '鏂板缓杩愮淮闂涓婃姤淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywproblem:delete', '鍒犻櫎杩愮淮闂涓婃姤淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywproblem:update', '淇敼杩愮淮闂涓婃姤淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywproblem:query', '鏌ヨ杩愮淮闂涓婃姤淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywproblem:exportExcel', '瀵煎嚭杩愮淮闂涓婃姤淇℃伅琛�(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+
diff --git a/server/db/business.yw_stock.permissions.sql b/server/db/business.yw_stock.permissions.sql
new file mode 100644
index 0000000..2a2dbd3
--- /dev/null
+++ b/server/db/business.yw_stock.permissions.sql
@@ -0,0 +1,6 @@
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstock:create', '鏂板缓杩愮淮搴撳瓨淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstock:delete', '鍒犻櫎杩愮淮搴撳瓨淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstock:update', '淇敼杩愮淮搴撳瓨淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstock:query', '鏌ヨ杩愮淮搴撳瓨淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstock:exportExcel', '瀵煎嚭杩愮淮搴撳瓨淇℃伅琛�(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+
diff --git a/server/db/business.yw_stocktaking.permissions.sql b/server/db/business.yw_stocktaking.permissions.sql
new file mode 100644
index 0000000..ee2d847
--- /dev/null
+++ b/server/db/business.yw_stocktaking.permissions.sql
@@ -0,0 +1,6 @@
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstocktaking:create', '鏂板缓杩愮淮鐩樼偣淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstocktaking:delete', '鍒犻櫎杩愮淮鐩樼偣淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstocktaking:update', '淇敼杩愮淮鐩樼偣淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstocktaking:query', '鏌ヨ杩愮淮鐩樼偣淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstocktaking:exportExcel', '瀵煎嚭杩愮淮鐩樼偣淇℃伅琛�(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+
diff --git a/server/db/business.yw_stocktaking_record.permissions.sql b/server/db/business.yw_stocktaking_record.permissions.sql
new file mode 100644
index 0000000..7013420
--- /dev/null
+++ b/server/db/business.yw_stocktaking_record.permissions.sql
@@ -0,0 +1,6 @@
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstocktakingrecord:create', '鏂板缓杩愮淮鐩樼偣鏄庣粏璁板綍琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstocktakingrecord:delete', '鍒犻櫎杩愮淮鐩樼偣鏄庣粏璁板綍琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstocktakingrecord:update', '淇敼杩愮淮鐩樼偣鏄庣粏璁板綍琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstocktakingrecord:query', '鏌ヨ杩愮淮鐩樼偣鏄庣粏璁板綍琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywstocktakingrecord:exportExcel', '瀵煎嚭杩愮淮鐩樼偣鏄庣粏璁板綍琛�(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+
diff --git a/server/db/business.yw_warehouse.permissions.sql b/server/db/business.yw_warehouse.permissions.sql
new file mode 100644
index 0000000..a874d0b
--- /dev/null
+++ b/server/db/business.yw_warehouse.permissions.sql
@@ -0,0 +1,6 @@
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywwarehouse:create', '鏂板缓杩愮淮浠撳簱淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywwarehouse:delete', '鍒犻櫎杩愮淮浠撳簱淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywwarehouse:update', '淇敼杩愮淮浠撳簱淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywwarehouse:query', '鏌ヨ杩愮淮浠撳簱淇℃伅琛�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:ywwarehouse:exportExcel', '瀵煎嚭杩愮淮浠撳簱淇℃伅琛�(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
+
diff --git a/server/system_service/src/main/java/com/doumee/core/utils/Constants.java b/server/system_service/src/main/java/com/doumee/core/utils/Constants.java
index 50b0d9d..f5ac3a4 100644
--- a/server/system_service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/system_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -52,6 +52,7 @@
public static final String YW_DEVICE ="YW_DEVICE" ;
public static final String YW_PATROL ="YW_PATROL" ;
public static final String YW_CONTRACT_BILL ="YW_CONTRACT_BILL" ;
+ public static final String YW_MATERIAL ="YW_MATERIAL" ;
public static final String RESERVATION_TOTAL_NUM ="RESERVATION_TOTAL_NUM" ;
public static final String SIGN_IN_PLACE_LAT ="SIGN_IN_PLACE_LAT" ;
@@ -514,6 +515,9 @@
public static final long EXPIRE_TIME = 7200;
public static final String INTERNAL_TOKEN ="INTERNAL_TOKEN";
+ public static final String COM_OUTBOUND_OUT_KEY = "obout_";
+ public static final String COM_OUTBOUND_IN_KEY = "obin_";
+ public static final String COM_OUTBOUND_TAKING_KEY = "obtaking_";
public static final String GOODSORDER_KEY = "ordercode_";
public static final String ACTIVITY_SIGN_KEY = "actcode_";
@@ -640,6 +644,91 @@
int otherDeal = 5;//浠栦汉宸插鐞�
int otherUnPass = 6;//浠栦汉鎷掔粷
}
+
+
+
+ //绫诲瀷 0閲囪喘鍏ュ簱 1棰嗙敤閫�鍥� 2搴撳瓨璋冩暣鍏ュ簱 3鍏朵粬鍏ュ簱 4鐩樼泩鍏ュ簱 5棰嗙敤鍑哄簱 6浠撳簱鍑哄簱 7璋冩暣鍑哄簱 8閲囪喘鍑哄簱 9鍏朵粬鍑哄簱 10鐩樹簭鍑哄簱
+ public enum ywOutInType{
+ BUY_IN(0, 0),
+ USE_RETURN_IN(1, 0),
+ STOCK_IN(2, 0),
+ OTHER_IN(3, 0),
+ TAKING_IN(4, 0),
+ USE_OUT(5, 1),
+ HOUSE_OUT(6, 1),
+ STOCK_OUT(7, 1),
+ OTHER_UN_PASS_OUT(8, 1),
+ BUY_OUT(9, 1),
+ TAKING_OUT(10, 1)
+ ;
+ // 鎴愬憳鍙橀噺
+ private int key;
+ private int inOut;
+
+ // 鏋勯�犳柟娉�
+ ywOutInType(int key, int inOut) {
+ this.inOut = inOut;
+ this.key = key;
+ }
+
+ // 鏅�氭柟娉�
+ public static Integer getInOutValue(int index) {
+ for (ywOutInType c : ywOutInType.values()) {
+ if (c.getKey() == index) {
+ return c.getInOut();
+ }
+ }
+ return null;
+ }
+
+
+ // 鏅�氭柟娉�
+ public static ywOutInType getYwOutInType(int index) {
+ for (ywOutInType c : ywOutInType.values()) {
+ if (c.getKey() == index) {
+ return c;
+ }
+ }
+ return null;
+ }
+
+
+ /**
+ * 鏍规嵁鍑哄叆搴撶被鍨嬭幏鍙栨墍鏈夌殑鍏蜂綋绫诲瀷
+ * @param inOutType
+ * @return
+ */
+ public static List<Integer> getAllTypeKey(int inOutType) {
+ List<Integer> list = new ArrayList<>();
+ for (ywOutInType c : ywOutInType.values()) {
+ if (c.getInOut() == inOutType) {
+ list.add(c.getKey());
+ }
+ }
+ return list;
+ }
+
+ // get set 鏂规硶
+ public int getInOut() {
+ return inOut;
+ }
+
+ public void setInOut(int inOut) {
+ this.inOut = inOut;
+ }
+
+ public int getKey() {
+ return key;
+ }
+
+ public void setKey(int key) {
+ this.key = key;
+ }
+
+
+ }
+
+
/**
* 鑾峰彇杞︾墝绫诲瀷淇℃伅
@@ -1297,6 +1386,8 @@
YW_CONTRACT_FILE(9, "鍚堝悓闄勪欢 ", "鍚堝悓闄勪欢 "),
FN_CONTRACT_REVENUE_FILE(10, "鏀舵敮娴佹按闄勪欢 ", "鍚堝悓璐﹀崟闄勪欢 "),
FN_PATROL_TASK_RECORD_FILE(11, "宸℃浠诲姟鐐瑰鐞嗛檮浠� ", "宸℃浠诲姟鐐瑰鐞嗛檮浠� "),
+ MATERIAL_FILE(12, "璧勪骇闄勪欢 ", "璧勪骇闄勪欢 "),
+ PROBLEM_FILE(13, "闂闄勪欢 ", "闂闄勪欢 "),
;
// 鎴愬憳鍙橀噺
diff --git a/server/system_service/src/main/java/com/doumee/dao/system/model/Multifile.java b/server/system_service/src/main/java/com/doumee/dao/system/model/Multifile.java
index b0a6fb3..6ed4ba1 100644
--- a/server/system_service/src/main/java/com/doumee/dao/system/model/Multifile.java
+++ b/server/system_service/src/main/java/com/doumee/dao/system/model/Multifile.java
@@ -63,8 +63,8 @@
@ExcelColumn(name="绫诲瀷0鍥剧墖 1瑙嗛 2鍏朵粬")
private Integer type;
- @ApiModelProperty(value = "鍏宠仈瀵硅薄绫诲瀷 0闅愭偅鐜板満鎯呭喌 1闅愭偅澶勭悊鍓嶆儏鍐� 2闅愭偅澶勭悊鍚庢儏鍐� 3闅愭偅閫�鍥炶鏄� 4浼氳瀹ゆ枃浠� 5闃滃畞璁惧鍥剧墖 6闃滃畞璁惧杩愮淮鍥剧墖", example = "1")
- @ExcelColumn(name="鍏宠仈瀵硅薄绫诲瀷 0闅愭偅鐜板満鎯呭喌 1闅愭偅澶勭悊鍓嶆儏鍐� 2闅愭偅澶勭悊鍚庢儏鍐� 3闅愭偅閫�鍥炶鏄� 4浼氳瀹ゆ枃浠� 5闃滃畞璁惧鍥剧墖 6闃滃畞璁惧杩愮淮鍥剧墖")
+ @ApiModelProperty(value = "鍏宠仈瀵硅薄绫诲瀷 0闅愭偅鐜板満鎯呭喌 1闅愭偅澶勭悊鍓嶆儏鍐� 2闅愭偅澶勭悊鍚庢儏鍐� 3闅愭偅閫�鍥炶鏄� 4浼氳瀹ゆ枃浠� 5闃滃畞璁惧鍥剧墖 6闃滃畞璁惧杩愮淮鍥剧墖 7璧勪骇闄勪欢", example = "1")
+ @ExcelColumn(name="鍏宠仈瀵硅薄绫诲瀷 0闅愭偅鐜板満鎯呭喌 1闅愭偅澶勭悊鍓嶆儏鍐� 2闅愭偅澶勭悊鍚庢儏鍐� 3闅愭偅閫�鍥炶鏄� 4浼氳瀹ゆ枃浠� 5闃滃畞璁惧鍥剧墖 6闃滃畞璁惧杩愮淮鍥剧墖 7璧勪骇闄勪欢")
private Integer objType;
@ApiModelProperty(value = "鏂囦欢鍦板潃")
diff --git a/server/visits/admin_timer/src/main/java/com/doumee/api/YwTimerController.java b/server/visits/admin_timer/src/main/java/com/doumee/api/YwTimerController.java
index 5bf7386..eda709f 100644
--- a/server/visits/admin_timer/src/main/java/com/doumee/api/YwTimerController.java
+++ b/server/visits/admin_timer/src/main/java/com/doumee/api/YwTimerController.java
@@ -3,17 +3,19 @@
import com.alibaba.fastjson.JSONObject;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.model.ApiResponse;
+import com.doumee.core.utils.Constants;
import com.doumee.core.utils.HttpsUtil;
+import com.doumee.core.utils.redis.RedisUtil;
import com.doumee.core.wx.WXConstant;
import com.doumee.dao.business.model.YwContract;
-import com.doumee.service.business.PlatformJobService;
-import com.doumee.service.business.YwContractBillService;
-import com.doumee.service.business.YwContractService;
-import com.doumee.service.business.YwPatrolSchemeService;
+import com.doumee.dao.business.model.YwOutinbound;
+import com.doumee.service.business.*;
+import com.doumee.service.business.impl.YwOutinboundServiceImpl;
import com.doumee.service.system.SystemDictDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -43,6 +45,12 @@
@Autowired
private YwPatrolSchemeService ywPatrolSchemeService;
+ @Autowired
+ private YwOutinboundService ywOutinboundService;
+
+ @Autowired
+ private RedisTemplate<String, Object> redisTemplate;
+
@ApiOperation("瀹氭椂澶勭悊鍚堝悓璐﹀崟缂栫爜")
@GetMapping("/ywDealContractBillCodeTimer")
@@ -67,7 +75,6 @@
}
-
@ApiOperation("瀹氭椂鐢熸垚浠婃棩宸℃浠诲姟浠诲姟")
@GetMapping("/ywPatrolSchemeTaskTimer")
public ApiResponse ywPatrolSchemeTaskTimer() {
@@ -76,4 +83,17 @@
}
+ @ApiOperation("瀹氭椂鏇存柊redis鏁版嵁")
+ @GetMapping("/ywUpdRedisDataTimer")
+ public ApiResponse ywUpdRedisDataTimer() {
+ //鍔犲叆redis缂撳瓨锛屽叆搴撳崟鎬绘暟閲�
+ RedisUtil.addObject(redisTemplate, Constants.RedisKeys.COM_OUTBOUND_IN_KEY,0);
+ //鍔犲叆redis缂撳瓨锛屽嚭搴撳崟鎬绘暟閲�
+ RedisUtil.addObject(redisTemplate,Constants.RedisKeys.COM_OUTBOUND_OUT_KEY,0);
+ //鍔犲叆redis缂撳瓨锛岀洏鐐瑰崟鎬绘暟閲�
+ RedisUtil.addObject(redisTemplate,Constants.RedisKeys.COM_OUTBOUND_TAKING_KEY,0);
+ return ApiResponse.success("瀹氭椂鏇存柊redis鏁版嵁");
+ }
+
+
}
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwMaterialController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwMaterialController.java
new file mode 100644
index 0000000..e9d3cf6
--- /dev/null
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwMaterialController.java
@@ -0,0 +1,102 @@
+package com.doumee.cloud.admin;
+
+import com.doumee.api.BaseController;
+import com.doumee.config.annotation.CloudRequiredPermission;
+import com.doumee.core.annotation.excel.ExcelExporter;
+import com.doumee.core.annotation.pr.PreventRepeat;
+import com.doumee.core.model.ApiResponse;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.model.PageData;
+import com.doumee.core.utils.Constants;
+import com.doumee.dao.business.model.YwMaterial;
+import com.doumee.service.business.YwMaterialService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Api(tags = "杩愮淮璧勪骇淇℃伅琛�")
+@RestController
+@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/ywMaterial")
+public class YwMaterialController extends BaseController {
+
+ @Autowired
+ private YwMaterialService ywMaterialService;
+
+ @PreventRepeat
+ @ApiOperation("鏂板缓")
+ @PostMapping("/create")
+ @CloudRequiredPermission("business:ywmaterial:create")
+ public ApiResponse create(@RequestBody YwMaterial ywMaterial,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywMaterial.setLoginUserInfo(this.getLoginUser(token));
+ return ApiResponse.success(ywMaterialService.create(ywMaterial));
+ }
+
+ @ApiOperation("鏍规嵁ID鍒犻櫎")
+ @GetMapping("/delete/{id}")
+ @CloudRequiredPermission("business:ywmaterial:delete")
+ public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywMaterialService.deleteById(id);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鎵归噺鍒犻櫎")
+ @GetMapping("/delete/batch")
+ @CloudRequiredPermission("business:ywmaterial:delete")
+ public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ String [] idArray = ids.split(",");
+ List<Integer> idList = new ArrayList<>();
+ for (String id : idArray) {
+ idList.add(Integer.valueOf(id));
+ }
+ ywMaterialService.deleteByIdInBatch(idList);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鏍规嵁ID淇敼")
+ @PostMapping("/updateById")
+ @CloudRequiredPermission("business:ywmaterial:update")
+ public ApiResponse updateById(@RequestBody YwMaterial ywMaterial,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywMaterialService.updateById(ywMaterial);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鏍规嵁ID淇敼鐘舵��")
+ @PostMapping("/updateStatus")
+ @CloudRequiredPermission("business:ywmaterial:update")
+ public ApiResponse updateStatus(@RequestBody YwMaterial ywMaterial,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywMaterialService.updateStatus(ywMaterial);
+ return ApiResponse.success(null);
+ }
+
+
+ @ApiOperation("鍒嗛〉鏌ヨ")
+ @PostMapping("/page")
+ @CloudRequiredPermission("business:ywmaterial:query")
+ public ApiResponse<PageData<YwMaterial>> findPage (@RequestBody PageWrap<YwMaterial> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ return ApiResponse.success(ywMaterialService.findPage(pageWrap));
+ }
+
+ @ApiOperation("瀵煎嚭Excel")
+ @PostMapping("/exportExcel")
+ @CloudRequiredPermission("business:ywmaterial:exportExcel")
+ public void exportExcel (@RequestBody PageWrap<YwMaterial> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ExcelExporter.build(YwMaterial.class).export(ywMaterialService.findPage(pageWrap).getRecords(), "杩愮淮璧勪骇淇℃伅琛�", response);
+ }
+
+ @ApiOperation("鏍规嵁ID鏌ヨ")
+ @GetMapping("/{id}")
+ @CloudRequiredPermission("business:ywmaterial:query")
+ public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ return ApiResponse.success(ywMaterialService.getDetail(id));
+ }
+}
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwOutinboundController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwOutinboundController.java
new file mode 100644
index 0000000..07544f7
--- /dev/null
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwOutinboundController.java
@@ -0,0 +1,94 @@
+package com.doumee.cloud.admin;
+
+import com.doumee.api.BaseController;
+import com.doumee.config.annotation.CloudRequiredPermission;
+import com.doumee.core.annotation.excel.ExcelExporter;
+import com.doumee.core.annotation.pr.PreventRepeat;
+import com.doumee.core.model.ApiResponse;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.model.PageData;
+import com.doumee.core.utils.Constants;
+import com.doumee.dao.business.model.YwOutinbound;
+import com.doumee.service.business.YwOutinboundService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Api(tags = "杩愮淮鍑哄叆搴撲俊鎭〃")
+@RestController
+@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/ywOutinbound")
+public class YwOutinboundController extends BaseController {
+
+ @Autowired
+ private YwOutinboundService ywOutinboundService;
+
+ @PreventRepeat
+ @ApiOperation("鏂板缓")
+ @PostMapping("/create")
+ @CloudRequiredPermission("business:ywoutinbound:create")
+ public ApiResponse create(@RequestBody YwOutinbound ywOutinbound,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywOutinbound.setLoginUserInfo(this.getLoginUser(token));
+ return ApiResponse.success(ywOutinboundService.create(ywOutinbound));
+ }
+
+ @ApiOperation("鏍规嵁ID鍒犻櫎")
+ @GetMapping("/delete/{id}")
+ @CloudRequiredPermission("business:ywoutinbound:delete")
+ public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywOutinboundService.deleteById(id);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鎵归噺鍒犻櫎")
+ @GetMapping("/delete/batch")
+ @CloudRequiredPermission("business:ywoutinbound:delete")
+ public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ String [] idArray = ids.split(",");
+ List<Integer> idList = new ArrayList<>();
+ for (String id : idArray) {
+ idList.add(Integer.valueOf(id));
+ }
+ ywOutinboundService.deleteByIdInBatch(idList);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鏍规嵁ID淇敼")
+ @PostMapping("/updateById")
+ @CloudRequiredPermission("business:ywoutinbound:update")
+ public ApiResponse updateById(@RequestBody YwOutinbound ywOutinbound,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywOutinbound.setLoginUserInfo(this.getLoginUser(token));
+ ywOutinboundService.updateById(ywOutinbound);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鍒嗛〉鏌ヨ")
+ @PostMapping("/page")
+ @CloudRequiredPermission("business:ywoutinbound:query")
+ public ApiResponse<PageData<YwOutinbound>> findPage (@RequestBody PageWrap<YwOutinbound> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ return ApiResponse.success(ywOutinboundService.findPage(pageWrap));
+ }
+
+ @ApiOperation("瀵煎嚭Excel")
+ @PostMapping("/exportExcel")
+ @CloudRequiredPermission("business:ywoutinbound:exportExcel")
+ public void exportExcel (@RequestBody PageWrap<YwOutinbound> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ExcelExporter.build(YwOutinbound.class).export(ywOutinboundService.findPage(pageWrap).getRecords(), "杩愮淮鍑哄叆搴撲俊鎭〃", response);
+ }
+
+ @ApiOperation("鏍规嵁ID鏌ヨ")
+ @GetMapping("/{id}")
+ @CloudRequiredPermission("business:ywoutinbound:query")
+ public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ return ApiResponse.success(ywOutinboundService.getDetail(id));
+ }
+}
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwProblemController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwProblemController.java
new file mode 100644
index 0000000..310349f
--- /dev/null
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwProblemController.java
@@ -0,0 +1,93 @@
+package com.doumee.cloud.admin;
+
+import com.doumee.api.BaseController;
+import com.doumee.config.annotation.CloudRequiredPermission;
+import com.doumee.config.annotation.LoginNoRequired;
+import com.doumee.core.annotation.excel.ExcelExporter;
+import com.doumee.core.annotation.pr.PreventRepeat;
+import com.doumee.core.model.ApiResponse;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.model.PageData;
+import com.doumee.core.utils.Constants;
+import com.doumee.dao.business.model.YwProblem;
+import com.doumee.service.business.YwProblemService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Api(tags = "杩愮淮闂涓婃姤淇℃伅琛�")
+@RestController
+@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/ywProblem")
+public class YwProblemController extends BaseController {
+
+ @Autowired
+ private YwProblemService ywProblemService;
+
+ @LoginNoRequired
+ @PreventRepeat
+ @ApiOperation("闂鎻愭姤")
+ @PostMapping("/create")
+ public ApiResponse create(@RequestBody YwProblem ywProblem) {
+ return ApiResponse.success(ywProblemService.create(ywProblem));
+ }
+
+ @ApiOperation("鏍规嵁ID鍒犻櫎")
+ @GetMapping("/delete/{id}")
+ @CloudRequiredPermission("business:ywproblem:delete")
+ public ApiResponse deleteById(@PathVariable Integer id) {
+ ywProblemService.deleteById(id);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鎵归噺鍒犻櫎")
+ @GetMapping("/delete/batch")
+ @CloudRequiredPermission("business:ywproblem:delete")
+ public ApiResponse deleteByIdInBatch(@RequestParam String ids) {
+ String [] idArray = ids.split(",");
+ List<Integer> idList = new ArrayList<>();
+ for (String id : idArray) {
+ idList.add(Integer.valueOf(id));
+ }
+ ywProblemService.deleteByIdInBatch(idList);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鏍规嵁ID淇敼")
+ @PostMapping("/updateById")
+ @CloudRequiredPermission("business:ywproblem:update")
+ public ApiResponse updateById(@RequestBody YwProblem ywProblem) {
+ ywProblemService.updateById(ywProblem);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鍒嗛〉鏌ヨ")
+ @PostMapping("/page")
+ @CloudRequiredPermission("business:ywproblem:query")
+ public ApiResponse<PageData<YwProblem>> findPage (@RequestBody PageWrap<YwProblem> pageWrap) {
+ return ApiResponse.success(ywProblemService.findPage(pageWrap));
+ }
+
+ @ApiOperation("瀵煎嚭Excel")
+ @PostMapping("/exportExcel")
+ @CloudRequiredPermission("business:ywproblem:exportExcel")
+ public void exportExcel (@RequestBody PageWrap<YwProblem> pageWrap, HttpServletResponse response) {
+ ExcelExporter.build(YwProblem.class).export(ywProblemService.findPage(pageWrap).getRecords(), "杩愮淮闂涓婃姤淇℃伅琛�", response);
+ }
+
+ @ApiOperation("鏍规嵁ID鏌ヨ")
+ @GetMapping("/{id}")
+ @CloudRequiredPermission("business:ywproblem:query")
+ public ApiResponse findById(@PathVariable Integer id) {
+ return ApiResponse.success(ywProblemService.findById(id));
+ }
+}
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStockController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStockController.java
new file mode 100644
index 0000000..badb715
--- /dev/null
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStockController.java
@@ -0,0 +1,92 @@
+package com.doumee.cloud.admin;
+
+import com.doumee.api.BaseController;
+import com.doumee.config.annotation.CloudRequiredPermission;
+import com.doumee.core.annotation.excel.ExcelExporter;
+import com.doumee.core.annotation.pr.PreventRepeat;
+import com.doumee.core.model.ApiResponse;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.model.PageData;
+import com.doumee.core.utils.Constants;
+import com.doumee.dao.business.model.YwStock;
+import com.doumee.service.business.YwStockService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Api(tags = "杩愮淮搴撳瓨淇℃伅琛�")
+@RestController
+@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/ywStock")
+public class YwStockController extends BaseController {
+
+ @Autowired
+ private YwStockService ywStockService;
+
+ @PreventRepeat
+ @ApiOperation("鏂板缓")
+ @PostMapping("/create")
+ @CloudRequiredPermission("business:ywstock:create")
+ public ApiResponse create(@RequestBody YwStock ywStock) {
+ return ApiResponse.success(ywStockService.create(ywStock));
+ }
+
+ @ApiOperation("鏍规嵁ID鍒犻櫎")
+ @GetMapping("/delete/{id}")
+ @CloudRequiredPermission("business:ywstock:delete")
+ public ApiResponse deleteById(@PathVariable Integer id) {
+ ywStockService.deleteById(id);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鎵归噺鍒犻櫎")
+ @GetMapping("/delete/batch")
+ @CloudRequiredPermission("business:ywstock:delete")
+ public ApiResponse deleteByIdInBatch(@RequestParam String ids) {
+ String [] idArray = ids.split(",");
+ List<Integer> idList = new ArrayList<>();
+ for (String id : idArray) {
+ idList.add(Integer.valueOf(id));
+ }
+ ywStockService.deleteByIdInBatch(idList);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鏍规嵁ID淇敼")
+ @PostMapping("/updateById")
+ @CloudRequiredPermission("business:ywstock:update")
+ public ApiResponse updateById(@RequestBody YwStock ywStock) {
+ ywStockService.updateById(ywStock);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鍒嗛〉鏌ヨ")
+ @PostMapping("/page")
+ @CloudRequiredPermission("business:ywstock:query")
+ public ApiResponse<PageData<YwStock>> findPage (@RequestBody PageWrap<YwStock> pageWrap) {
+ return ApiResponse.success(ywStockService.findPage(pageWrap));
+ }
+
+ @ApiOperation("瀵煎嚭Excel")
+ @PostMapping("/exportExcel")
+ @CloudRequiredPermission("business:ywstock:exportExcel")
+ public void exportExcel (@RequestBody PageWrap<YwStock> pageWrap, HttpServletResponse response) {
+ ExcelExporter.build(YwStock.class).export(ywStockService.findPage(pageWrap).getRecords(), "杩愮淮搴撳瓨淇℃伅琛�", response);
+ }
+
+ @ApiOperation("鏍规嵁ID鏌ヨ")
+ @GetMapping("/{id}")
+ @CloudRequiredPermission("business:ywstock:query")
+ public ApiResponse findById(@PathVariable Integer id) {
+ return ApiResponse.success(ywStockService.findById(id));
+ }
+}
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStocktakingController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStocktakingController.java
new file mode 100644
index 0000000..97e1230
--- /dev/null
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStocktakingController.java
@@ -0,0 +1,123 @@
+package com.doumee.cloud.admin;
+
+import com.doumee.api.BaseController;
+import com.doumee.config.annotation.CloudRequiredPermission;
+import com.doumee.core.annotation.excel.ExcelExporter;
+import com.doumee.core.annotation.pr.PreventRepeat;
+import com.doumee.core.model.ApiResponse;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.model.PageData;
+import com.doumee.core.utils.Constants;
+import com.doumee.dao.business.model.YwStocktaking;
+import com.doumee.service.business.YwStocktakingService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Api(tags = "杩愮淮鐩樼偣淇℃伅琛�")
+@RestController
+@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/ywStocktaking")
+public class YwStocktakingController extends BaseController {
+
+ @Autowired
+ private YwStocktakingService ywStocktakingService;
+
+ @PreventRepeat
+ @ApiOperation("鏂板缓")
+ @PostMapping("/create")
+ @CloudRequiredPermission("business:ywstocktaking:create")
+ public ApiResponse create(@RequestBody YwStocktaking ywStocktaking,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywStocktaking.setLoginUserInfo(this.getLoginUser(token));
+ return ApiResponse.success(ywStocktakingService.create(ywStocktaking));
+ }
+
+ @ApiOperation("鏍规嵁ID鍒犻櫎")
+ @GetMapping("/delete/{id}")
+ @CloudRequiredPermission("business:ywstocktaking:delete")
+ public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywStocktakingService.deleteById(id,getLoginUser(token));
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鎵归噺鍒犻櫎")
+ @GetMapping("/delete/batch")
+ @CloudRequiredPermission("business:ywstocktaking:delete")
+ public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ String [] idArray = ids.split(",");
+ List<Integer> idList = new ArrayList<>();
+ for (String id : idArray) {
+ idList.add(Integer.valueOf(id));
+ }
+ ywStocktakingService.deleteByIdInBatch(idList);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鏍规嵁ID淇敼")
+ @PostMapping("/updateById")
+ @CloudRequiredPermission("business:ywstocktaking:update")
+ public ApiResponse updateById(@RequestBody YwStocktaking ywStocktaking,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywStocktakingService.updateById(ywStocktaking);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鍒嗛〉鏌ヨ")
+ @PostMapping("/page")
+ @CloudRequiredPermission("business:ywstocktaking:query")
+ public ApiResponse<PageData<YwStocktaking>> findPage (@RequestBody PageWrap<YwStocktaking> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ return ApiResponse.success(ywStocktakingService.findPage(pageWrap));
+ }
+
+ @ApiOperation("瀵煎嚭Excel")
+ @PostMapping("/exportExcel")
+ @CloudRequiredPermission("business:ywstocktaking:exportExcel")
+ public void exportExcel (@RequestBody PageWrap<YwStocktaking> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ExcelExporter.build(YwStocktaking.class).export(ywStocktakingService.findPage(pageWrap).getRecords(), "杩愮淮鐩樼偣淇℃伅琛�", response);
+ }
+
+ @ApiOperation("鏍规嵁ID鏌ヨ")
+ @GetMapping("/{id}")
+ @CloudRequiredPermission("business:ywstocktaking:query")
+ public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ return ApiResponse.success(ywStocktakingService.getDetail(id));
+ }
+
+
+
+ @ApiOperation("鍙栨秷鐩樼偣鍗�")
+ @GetMapping("/cancelById")
+ @CloudRequiredPermission("business:ywstocktaking:delete")
+ public ApiResponse cancelById(@RequestParam Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywStocktakingService.cancelById(id,getLoginUser(token));
+ return ApiResponse.success(null);
+ }
+
+
+ @ApiOperation("寮�濮嬬洏鐐瑰崟")
+ @GetMapping("/beginById")
+ @CloudRequiredPermission("business:ywstocktaking:delete")
+ public ApiResponse beginById(@RequestParam Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywStocktakingService.beginById(id,getLoginUser(token));
+ return ApiResponse.success(null);
+ }
+
+
+ @ApiOperation("瀹屾垚鐩樼偣鍗�")
+ @GetMapping("/finishById")
+ @CloudRequiredPermission("business:ywstocktaking:delete")
+ public ApiResponse finishById(@RequestParam Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywStocktakingService.finishById(id,getLoginUser(token));
+ return ApiResponse.success(null);
+ }
+
+
+}
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStocktakingRecordController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStocktakingRecordController.java
new file mode 100644
index 0000000..71a6469
--- /dev/null
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStocktakingRecordController.java
@@ -0,0 +1,103 @@
+package com.doumee.cloud.admin;
+
+import com.doumee.api.BaseController;
+import com.doumee.config.annotation.CloudRequiredPermission;
+import com.doumee.core.annotation.excel.ExcelExporter;
+import com.doumee.core.annotation.pr.PreventRepeat;
+import com.doumee.core.model.ApiResponse;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.model.PageData;
+import com.doumee.core.utils.Constants;
+import com.doumee.dao.business.model.YwStocktakingRecord;
+import com.doumee.service.business.YwStocktakingRecordService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Api(tags = "杩愮淮鐩樼偣鏄庣粏璁板綍琛�")
+@RestController
+@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/ywStocktakingRecord")
+public class YwStocktakingRecordController extends BaseController {
+
+ @Autowired
+ private YwStocktakingRecordService ywStocktakingRecordService;
+
+ @PreventRepeat
+ @ApiOperation("鏂板缓")
+ @PostMapping("/create")
+ @CloudRequiredPermission("business:ywstocktakingrecord:create")
+ public ApiResponse create(@RequestBody YwStocktakingRecord ywStocktakingRecord,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ return ApiResponse.success(ywStocktakingRecordService.create(ywStocktakingRecord));
+ }
+
+ @ApiOperation("鏍规嵁ID鍒犻櫎")
+ @GetMapping("/delete/{id}")
+ @CloudRequiredPermission("business:ywstocktakingrecord:delete")
+ public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywStocktakingRecordService.deleteById(id);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鎵归噺鍒犻櫎")
+ @GetMapping("/delete/batch")
+ @CloudRequiredPermission("business:ywstocktakingrecord:delete")
+ public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ String [] idArray = ids.split(",");
+ List<Integer> idList = new ArrayList<>();
+ for (String id : idArray) {
+ idList.add(Integer.valueOf(id));
+ }
+ ywStocktakingRecordService.deleteByIdInBatch(idList);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鏍规嵁ID淇敼")
+ @PostMapping("/updateById")
+ @CloudRequiredPermission("business:ywstocktakingrecord:update")
+ public ApiResponse updateById(@RequestBody YwStocktakingRecord ywStocktakingRecord,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywStocktakingRecordService.updateById(ywStocktakingRecord);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鍒嗛〉鏌ヨ")
+ @PostMapping("/page")
+ @CloudRequiredPermission("business:ywstocktakingrecord:query")
+ public ApiResponse<PageData<YwStocktakingRecord>> findPage (@RequestBody PageWrap<YwStocktakingRecord> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ return ApiResponse.success(ywStocktakingRecordService.findPage(pageWrap));
+ }
+
+ @ApiOperation("瀵煎嚭Excel")
+ @PostMapping("/exportExcel")
+ @CloudRequiredPermission("business:ywstocktakingrecord:exportExcel")
+ public void exportExcel (@RequestBody PageWrap<YwStocktakingRecord> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ExcelExporter.build(YwStocktakingRecord.class).export(ywStocktakingRecordService.findPage(pageWrap).getRecords(), "杩愮淮鐩樼偣鏄庣粏璁板綍琛�", response);
+ }
+
+ @ApiOperation("鏍规嵁ID鏌ヨ")
+ @GetMapping("/{id}")
+ @CloudRequiredPermission("business:ywstocktakingrecord:query")
+ public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ return ApiResponse.success(ywStocktakingRecordService.getDetail(id));
+ }
+
+
+ @ApiOperation("鐩樼偣鎻愪氦")
+ @PostMapping("/takingData")
+ @CloudRequiredPermission("business:ywstocktakingrecord:update")
+ public ApiResponse takingData(@RequestBody YwStocktakingRecord ywStocktakingRecord,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywStocktakingRecord.setLoginUserInfo(getLoginUser(token));
+ ywStocktakingRecordService.takingData(ywStocktakingRecord);
+ return ApiResponse.success(null);
+ }
+
+}
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwWarehouseController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwWarehouseController.java
new file mode 100644
index 0000000..b4d0c7e
--- /dev/null
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwWarehouseController.java
@@ -0,0 +1,100 @@
+package com.doumee.cloud.admin;
+
+import com.doumee.api.BaseController;
+import com.doumee.config.annotation.CloudRequiredPermission;
+import com.doumee.core.annotation.excel.ExcelExporter;
+import com.doumee.core.annotation.pr.PreventRepeat;
+import com.doumee.core.model.ApiResponse;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.model.PageData;
+import com.doumee.core.utils.Constants;
+import com.doumee.dao.business.model.YwWarehouse;
+import com.doumee.service.business.YwWarehouseService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import javax.servlet.http.HttpServletResponse;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Api(tags = "杩愮淮浠撳簱淇℃伅琛�")
+@RestController
+@RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/ywWarehouse")
+public class YwWarehouseController extends BaseController {
+
+ @Autowired
+ private YwWarehouseService ywWarehouseService;
+
+ @PreventRepeat
+ @ApiOperation("鏂板缓")
+ @PostMapping("/create")
+ @CloudRequiredPermission("business:ywwarehouse:create")
+ public ApiResponse create(@RequestBody YwWarehouse ywWarehouse,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywWarehouse.setLoginUserInfo(this.getLoginUser(token));
+ return ApiResponse.success(ywWarehouseService.create(ywWarehouse));
+ }
+
+ @ApiOperation("鏍规嵁ID鍒犻櫎")
+ @GetMapping("/delete/{id}")
+ @CloudRequiredPermission("business:ywwarehouse:delete")
+ public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywWarehouseService.deleteById(id,this.getLoginUser(token));
+ return ApiResponse.success(null);
+ }
+//
+// @ApiOperation("鎵归噺鍒犻櫎")
+// @GetMapping("/delete/batch")
+// @CloudRequiredPermission("business:ywwarehouse:delete")
+// public ApiResponse deleteByIdInBatch(@RequestParam String ids,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+// String [] idArray = ids.split(",");
+// List<Integer> idList = new ArrayList<>();
+// for (String id : idArray) {
+// idList.add(Integer.valueOf(id));
+// }
+// ywWarehouseService.deleteByIdInBatch(idList);
+// return ApiResponse.success(null);
+// }
+
+ @ApiOperation("鏍规嵁ID淇敼")
+ @PostMapping("/updateById")
+ @CloudRequiredPermission("business:ywwarehouse:update")
+ public ApiResponse updateById(@RequestBody YwWarehouse ywWarehouse,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ywWarehouseService.updateById(ywWarehouse);
+ return ApiResponse.success(null);
+ }
+
+ @ApiOperation("鍒嗛〉鏌ヨ")
+ @PostMapping("/page")
+ @CloudRequiredPermission("business:ywwarehouse:query")
+ public ApiResponse<PageData<YwWarehouse>> findPage (@RequestBody PageWrap<YwWarehouse> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ return ApiResponse.success(ywWarehouseService.findPage(pageWrap));
+ }
+
+ @ApiOperation("鍒楄〃鏌ヨ")
+ @PostMapping("/list")
+ @CloudRequiredPermission("business:ywwarehouse:query")
+ public ApiResponse<List<YwWarehouse>> findList (@RequestBody YwWarehouse model,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ return ApiResponse.success(ywWarehouseService.findList(model));
+ }
+
+ @ApiOperation("瀵煎嚭Excel")
+ @PostMapping("/exportExcel")
+ @CloudRequiredPermission("business:ywwarehouse:exportExcel")
+ public void exportExcel (@RequestBody PageWrap<YwWarehouse> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ ExcelExporter.build(YwWarehouse.class).export(ywWarehouseService.findPage(pageWrap).getRecords(), "杩愮淮浠撳簱淇℃伅琛�", response);
+ }
+
+ @ApiOperation("鏍规嵁ID鏌ヨ")
+ @GetMapping("/{id}")
+ @CloudRequiredPermission("business:ywwarehouse:query")
+ public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) {
+ return ApiResponse.success(ywWarehouseService.findById(id));
+ }
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwMaterialMapper.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwMaterialMapper.java
new file mode 100644
index 0000000..7a30466
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwMaterialMapper.java
@@ -0,0 +1,13 @@
+package com.doumee.dao.business;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.doumee.dao.business.model.YwMaterial;
+import com.github.yulichang.base.MPJBaseMapper;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+public interface YwMaterialMapper extends MPJBaseMapper<YwMaterial> {
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwOutinboundMapper.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwOutinboundMapper.java
new file mode 100644
index 0000000..7274448
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwOutinboundMapper.java
@@ -0,0 +1,13 @@
+package com.doumee.dao.business;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.doumee.dao.business.model.YwOutinbound;
+import com.github.yulichang.base.MPJBaseMapper;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+public interface YwOutinboundMapper extends MPJBaseMapper<YwOutinbound> {
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwOutinboundRecordMapper.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwOutinboundRecordMapper.java
new file mode 100644
index 0000000..800d513
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwOutinboundRecordMapper.java
@@ -0,0 +1,13 @@
+package com.doumee.dao.business;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.doumee.dao.business.model.YwOutinboundRecord;
+import com.github.yulichang.base.MPJBaseMapper;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 14:28
+ */
+public interface YwOutinboundRecordMapper extends MPJBaseMapper<YwOutinboundRecord> {
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwProblemMapper.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwProblemMapper.java
new file mode 100644
index 0000000..92b447a
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwProblemMapper.java
@@ -0,0 +1,12 @@
+package com.doumee.dao.business;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.doumee.dao.business.model.YwProblem;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+public interface YwProblemMapper extends BaseMapper<YwProblem> {
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStockMapper.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStockMapper.java
new file mode 100644
index 0000000..9c80527
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStockMapper.java
@@ -0,0 +1,13 @@
+package com.doumee.dao.business;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.doumee.dao.business.model.YwStock;
+import com.github.yulichang.base.MPJBaseMapper;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+public interface YwStockMapper extends MPJBaseMapper<YwStock> {
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStocktakingMapper.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStocktakingMapper.java
new file mode 100644
index 0000000..1786dea
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStocktakingMapper.java
@@ -0,0 +1,13 @@
+package com.doumee.dao.business;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.doumee.dao.business.model.YwStocktaking;
+import com.github.yulichang.base.MPJBaseMapper;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+public interface YwStocktakingMapper extends MPJBaseMapper<YwStocktaking> {
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStocktakingRecordMapper.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStocktakingRecordMapper.java
new file mode 100644
index 0000000..c360f7f
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStocktakingRecordMapper.java
@@ -0,0 +1,13 @@
+package com.doumee.dao.business;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.doumee.dao.business.model.YwStocktakingRecord;
+import com.github.yulichang.base.MPJBaseMapper;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+public interface YwStocktakingRecordMapper extends MPJBaseMapper<YwStocktakingRecord> {
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwWarehouseMapper.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwWarehouseMapper.java
new file mode 100644
index 0000000..e009c33
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwWarehouseMapper.java
@@ -0,0 +1,13 @@
+package com.doumee.dao.business;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.doumee.dao.business.model.YwWarehouse;
+import com.github.yulichang.base.MPJBaseMapper;
+
+/**
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+public interface YwWarehouseMapper extends MPJBaseMapper<YwWarehouse> {
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Category.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Category.java
index 4f5d50b..c71f12c 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Category.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Category.java
@@ -68,7 +68,7 @@
//@ExcelColumn(name="鍥炬爣")
private String imgurl;
- @ApiModelProperty(value = "绫诲瀷 0鍏徃绫诲瀷 1杞﹁締绫诲瀷 2杩愮淮-瀹㈡埛琛屼笟鍒嗙被 3杩愮淮-宸ュ崟鍒嗙被 4杩愮淮-宸℃鍖哄煙 5杩愮淮-璁惧鍒嗙被 6=瀹㈡埛琛屼笟" )
+ @ApiModelProperty(value = "绫诲瀷 0鍏徃绫诲瀷 1杞﹁締绫诲瀷 2杩愮淮-瀹㈡埛琛屼笟鍒嗙被 3杩愮淮-宸ュ崟鍒嗙被 4杩愮淮-宸℃鍖哄煙 5杩愮淮-璁惧鍒嗙被 6=瀹㈡埛琛屼笟 7=璧勪骇鍒嗙被" )
//@ExcelColumn(name="绫诲瀷 0鍏徃绫诲瀷 1杞﹁締绫诲瀷")
private Integer type;
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwMaterial.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwMaterial.java
new file mode 100644
index 0000000..5f23ec8
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwMaterial.java
@@ -0,0 +1,123 @@
+package com.doumee.dao.business.model;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.doumee.core.annotation.excel.ExcelColumn;
+import com.doumee.core.model.LoginUserModel;
+import com.doumee.dao.system.model.Multifile;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.Date;
+import java.math.BigDecimal;
+
+/**
+ * 杩愮淮璧勪骇淇℃伅琛�
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Data
+@ApiModel("杩愮淮璧勪骇淇℃伅琛�")
+@TableName("`yw_material`")
+public class YwMaterial extends LoginUserModel {
+
+ @TableId(type = IdType.AUTO)
+ @ApiModelProperty(value = "涓婚敭", example = "1")
+ @ExcelColumn(name="涓婚敭")
+ private Integer id;
+
+ @ApiModelProperty(value = "鍒涘缓浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鍒涘缓浜虹紪鐮�")
+ private Integer creator;
+
+ @ApiModelProperty(value = "鍒涘缓鏃堕棿")
+ @ExcelColumn(name="鍒涘缓鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date createDate;
+
+ @ApiModelProperty(value = "鏇存柊浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鏇存柊浜虹紪鐮�")
+ private Integer editor;
+
+ @ApiModelProperty(value = "鏇存柊鏃堕棿")
+ @ExcelColumn(name="鏇存柊鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date editDate;
+
+ @ApiModelProperty(value = "鏄惁鍒犻櫎0鍚� 1鏄�", example = "1")
+ @ExcelColumn(name="鏄惁鍒犻櫎0鍚� 1鏄�")
+ private Integer isdeleted;
+
+ @ApiModelProperty(value = "澶囨敞")
+ @ExcelColumn(name="澶囨敞")
+ private String remark;
+
+ @ApiModelProperty(value = "鍚嶇О")
+ @ExcelColumn(name="鍚嶇О")
+ private String name;
+
+ @ApiModelProperty(value = "鐘舵�� 0鍚敤 1绂佺敤", example = "1")
+ @ExcelColumn(name="鐘舵�� 0鍚敤 1绂佺敤")
+ private Integer status;
+
+ @ApiModelProperty(value = "缂栧彿")
+ @ExcelColumn(name="缂栧彿")
+ private String code;
+
+ @ApiModelProperty(value = "鎵�灞炰竴绾у垎绫荤紪鐮侊紙鍏宠仈category)", example = "1")
+ @ExcelColumn(name="鎵�灞炰竴绾у垎绫荤紪鐮侊紙鍏宠仈category)")
+ private Integer parentCateId;
+
+ @ApiModelProperty(value = "鎵�灞炰簩绾у垎绫荤紪鐮�(鍏宠仈category锛�", example = "1")
+ @ExcelColumn(name="鎵�灞炰簩绾у垎绫荤紪鐮�(鍏宠仈category锛�")
+ private Integer cateId;
+
+ @ApiModelProperty(value = "鏉$爜")
+ @ExcelColumn(name="鏉$爜")
+ private String qrcode;
+
+ @ApiModelProperty(value = "鎺掑簭鐮�", example = "1")
+ @ExcelColumn(name="鎺掑簭鐮�")
+ private Integer sortnum;
+
+ @ApiModelProperty(value = "鍝佺墝")
+ @ExcelColumn(name="鍝佺墝")
+ private String brand;
+
+ @ApiModelProperty(value = "瑙勬牸鍨嬪彿")
+ @ExcelColumn(name="瑙勬牸鍨嬪彿")
+ private String attr;
+
+ @ApiModelProperty(value = "瀹夊叏搴撳瓨锛堜笅闄愶級", example = "1")
+ @ExcelColumn(name="瀹夊叏搴撳瓨锛堜笅闄愶級")
+ private BigDecimal minStock;
+
+ @ApiModelProperty(value = "瀹夊叏搴撳瓨锛堜笂闄愶級", example = "1")
+ @ExcelColumn(name="瀹夊叏搴撳瓨锛堜笂闄愶級")
+ private BigDecimal maxStock;
+
+ @ApiModelProperty(value = "鍗曚綅")
+ @ExcelColumn(name="鍗曚綅")
+ private String unitName;
+
+ @ApiModelProperty(value = "鎵�灞炴埧婧愮紪鐮�(鍏宠仈yw_room)", example = "1")
+ @ExcelColumn(name="鎵�灞炴埧婧愮紪鐮�(鍏宠仈yw_room)")
+ private Integer roomId;
+
+ @ApiModelProperty(value = "鏄惁鑷姩缂栫爜锛�0=鍚︼紱1=鏄紱", example = "1")
+ @ExcelColumn(name="鏄惁鑷姩缂栫爜锛�0=鍚︼紱1=鏄紱")
+ private Integer autoCode;
+
+ @ApiModelProperty(value = "闄勪欢淇℃伅", example = "1")
+ @TableField(exist = false)
+ private Multifile multifile;
+
+ @ApiModelProperty(value = "鎵�灞為」鐩富閿�", example = "1")
+ @TableField(exist = false)
+ private Integer projectId;
+
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwOutinbound.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwOutinbound.java
new file mode 100644
index 0000000..e84edc2
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwOutinbound.java
@@ -0,0 +1,111 @@
+package com.doumee.dao.business.model;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.doumee.core.annotation.excel.ExcelColumn;
+import com.doumee.core.model.LoginUserModel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.Date;
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * 杩愮淮鍑哄叆搴撲俊鎭〃
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Data
+@ApiModel("杩愮淮鍑哄叆搴撲俊鎭〃")
+@TableName("`yw_outinbound`")
+public class YwOutinbound extends LoginUserModel {
+
+ @TableId(type = IdType.AUTO)
+ @ApiModelProperty(value = "涓婚敭", example = "1")
+ @ExcelColumn(name="涓婚敭")
+ private Integer id;
+
+ @ApiModelProperty(value = "鍒涘缓浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鍒涘缓浜虹紪鐮�")
+ private Integer creator;
+
+ @ApiModelProperty(value = "鍒涘缓鏃堕棿")
+ @ExcelColumn(name="鍒涘缓鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date createDate;
+
+ @ApiModelProperty(value = "鏇存柊浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鏇存柊浜虹紪鐮�")
+ private Integer editor;
+
+ @ApiModelProperty(value = "鏇存柊鏃堕棿")
+ @ExcelColumn(name="鏇存柊鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date editDate;
+
+ @ApiModelProperty(value = "鏄惁鍒犻櫎0鍚� 1鏄�", example = "1")
+ @ExcelColumn(name="鏄惁鍒犻櫎0鍚� 1鏄�")
+ private Integer isdeleted;
+
+ @ApiModelProperty(value = "澶囨敞")
+ @ExcelColumn(name="澶囨敞")
+ private String remark;
+
+ @ApiModelProperty(value = "浠撳簱缂栫爜(鍏宠仈yw_warehouse)")
+ @ExcelColumn(name="浠撳簱缂栫爜(鍏宠仈yw_warehouse)")
+ private Integer warehouseId;
+
+ @ApiModelProperty(value = "鐗╄祫缂栫爜锛堝叧鑱攜w_material)", example = "1")
+ @ExcelColumn(name="鐗╄祫缂栫爜锛堝叧鑱攜w_material)")
+ private Integer materialId;
+
+ @ApiModelProperty(value = "鏁伴噺", example = "1")
+ @ExcelColumn(name="鏁伴噺")
+ private BigDecimal stock;
+
+ @ApiModelProperty(value = "绫诲瀷 0閲囪喘鍏ュ簱 1棰嗙敤閫�鍥� 2璋冩暣鍏ュ簱 3鍏朵粬鍏ュ簱 4鐩樼泩鍏ュ簱 5棰嗙敤鍑哄簱 6浠撳簱鍑哄簱 7璋冩暣鍑哄簱 8閲囪喘鍑哄簱 9鍏朵粬鍑哄簱 10鐩樹簭鍑哄簱", example = "1")
+ @ExcelColumn(name="绫诲瀷 0閲囪喘鍏ュ簱 1棰嗙敤閫�鍥� 2璋冩暣鍏ュ簱 3鍏朵粬鍏ュ簱 4鐩樼泩鍏ュ簱 5棰嗙敤鍑哄簱 6浠撳簱鍑哄簱 7璋冩暣鍑哄簱 8閲囪喘鍑哄簱 9鍏朵粬鍑哄簱 10鐩樹簭鍑哄簱")
+ private Integer type;
+
+ @ApiModelProperty(value = "鏉ユ簮 0鎵嬪姩褰曞叆 1绯荤粺鐢熸垚", example = "1")
+ @ExcelColumn(name="鏉ユ簮 0鎵嬪姩褰曞叆 1绯荤粺鐢熸垚")
+ private Integer origin;
+
+ @ApiModelProperty(value = "璇存槑")
+ @ExcelColumn(name="璇存槑")
+ private String content;
+
+ @ApiModelProperty(value = "鍑哄叆搴撴棩鏈�")
+ @ExcelColumn(name="鍑哄叆搴撴棩鏈�")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date doneDate;
+
+ @ApiModelProperty(value = "鐘舵�� 0姝e父", example = "1")
+ @ExcelColumn(name="鐘舵�� 0姝e父")
+ private Integer status;
+
+ @ApiModelProperty(value = "鍗曟嵁缂栧彿")
+ @ExcelColumn(name="鍗曟嵁缂栧彿")
+ private String code;
+
+ @ApiModelProperty(value = "鍑哄叆搴撴暟鎹槑缁�", example = "1")
+ @TableField(exist = false)
+ private List<YwOutinboundRecord> recordList;
+
+
+ @ApiModelProperty(value = "鎿嶄綔绫诲瀷锛�1=鍑哄簱锛�0=鍏ュ簱锛堝垎椤靛垪琛ㄦ煡璇娇鐢級", example = "1")
+ @TableField(exist = false)
+ private Integer inOut;
+
+ @ApiModelProperty(value = "浠撳簱鍚嶇О", example = "1")
+ @TableField(exist = false)
+ private String warehouseName;
+
+ @ApiModelProperty(value = "鎿嶄綔浜哄悕绉�", example = "1")
+ @TableField(exist = false)
+ private String createUserName;
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwOutinboundRecord.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwOutinboundRecord.java
new file mode 100644
index 0000000..b201cb7
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwOutinboundRecord.java
@@ -0,0 +1,138 @@
+package com.doumee.dao.business.model;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.doumee.core.annotation.excel.ExcelColumn;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.Date;
+import java.math.BigDecimal;
+
+/**
+ * 杩愮淮鍑哄叆搴撲俊鎭槑缁嗚〃
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 14:28
+ */
+@Data
+@ApiModel("杩愮淮鍑哄叆搴撲俊鎭槑缁嗚〃")
+@TableName("`yw_outinbound_record`")
+public class YwOutinboundRecord {
+
+ @TableId(type = IdType.AUTO)
+ @ApiModelProperty(value = "涓婚敭", example = "1")
+ @ExcelColumn(name="涓婚敭")
+ private Integer id;
+
+ @ApiModelProperty(value = "鍒涘缓浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鍒涘缓浜虹紪鐮�")
+ private Integer creator;
+
+ @ApiModelProperty(value = "鍒涘缓鏃堕棿")
+ @ExcelColumn(name="鍒涘缓鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date createDate;
+
+ @ApiModelProperty(value = "鏇存柊浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鏇存柊浜虹紪鐮�")
+ private Integer editor;
+
+ @ApiModelProperty(value = "鏇存柊鏃堕棿")
+ @ExcelColumn(name="鏇存柊鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date editDate;
+
+ @ApiModelProperty(value = "鏄惁鍒犻櫎0鍚� 1鏄�", example = "1")
+ @ExcelColumn(name="鏄惁鍒犻櫎0鍚� 1鏄�")
+ private Integer isdeleted;
+
+ @ApiModelProperty(value = "澶囨敞")
+ @ExcelColumn(name="澶囨敞")
+ private String remark;
+
+ @ApiModelProperty(value = "鍑哄叆搴撹褰曚富閿�", example = "1")
+ @ExcelColumn(name="鍑哄叆搴撹褰曚富閿�")
+ private Integer outInBoundId;
+
+ @ApiModelProperty(value = "鐗╄祫缂栫爜锛堝叧鑱攜w_material)", example = "1")
+ @ExcelColumn(name="鐗╄祫缂栫爜锛堝叧鑱攜w_material)")
+ private Integer materialId;
+
+ @ApiModelProperty(value = "鏁伴噺", example = "1")
+ @ExcelColumn(name="鏁伴噺")
+ private BigDecimal stock;
+
+ @ApiModelProperty(value = "璧勪骇缂栫爜")
+ @TableField(exist = false)
+ private String materialCode;
+
+ @ApiModelProperty(value = "璧勪骇鍚嶇О")
+ @TableField(exist = false)
+ private String materialName;
+
+ @ApiModelProperty(value = "璧勪骇鏉″舰鐮�")
+ @TableField(exist = false)
+ private String materialQrcode;
+
+ @ApiModelProperty(value = "璧勪骇鍝佺墝")
+ @TableField(exist = false)
+ private String materialBrand;
+
+ @ApiModelProperty(value = "璧勪骇鍗曚綅")
+ @TableField(exist = false)
+ private String materialUnitName;
+
+ @ApiModelProperty(value = "鎿嶄綔绫诲瀷锛�1=鍑哄簱锛�0=鍏ュ簱锛堝垎椤靛垪琛ㄦ煡璇娇鐢級", example = "1")
+ @TableField(exist = false)
+ private Integer inOut;
+
+ @ApiModelProperty(value = "浠撳簱涓婚敭")
+ @TableField(exist = false)
+ private Integer warehouseId;
+
+ @ApiModelProperty(value = "浠撳簱鍚嶇О")
+ @TableField(exist = false)
+ private String warehouseName;
+
+ @ApiModelProperty(value = "鍗曟嵁鏃ユ湡")
+ @TableField(exist = false)
+ private Date doneDate;
+
+ @ApiModelProperty(value = "涓�绾у垎绫诲悕绉�")
+ @TableField(exist = false)
+ private String categoryParentName;
+
+ @ApiModelProperty(value = "浜岀骇鍒嗙被鍚嶇О")
+ @TableField(exist = false)
+ private String categoryName;
+
+ @ApiModelProperty(value = "鎿嶄綔浜哄悕绉�", example = "1")
+ @TableField(exist = false)
+ private String createUserName;
+
+ @ApiModelProperty(value = "鍗曟嵁缂栧彿", example = "1")
+ @TableField(exist = false)
+ private String code;
+
+
+ @ApiModelProperty(value = "鍗曟嵁鏃ユ湡 寮�濮� yyyy-MM-dd", example = "1")
+ @TableField(exist = false)
+ private String doneDateStart;
+
+ @ApiModelProperty(value = "鍗曟嵁鏃ユ湡 缁撴潫 yyyy-MM-dd", example = "1")
+ @TableField(exist = false)
+ private String doneDateEnd;
+
+
+ @ApiModelProperty(value = "鍒涘缓鏃ユ湡 寮�濮� yyyy-MM-dd", example = "1")
+ @TableField(exist = false)
+ private String createDateStart;
+
+ @ApiModelProperty(value = "鍒涘缓鏃ユ湡 缁撴潫 yyyy-MM-dd", example = "1")
+ @TableField(exist = false)
+ private String createDateEnd;
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwProblem.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwProblem.java
new file mode 100644
index 0000000..d6ab8c4
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwProblem.java
@@ -0,0 +1,114 @@
+package com.doumee.dao.business.model;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.doumee.core.annotation.excel.ExcelColumn;
+import com.doumee.dao.system.model.Multifile;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 杩愮淮闂涓婃姤淇℃伅琛�
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Data
+@ApiModel("杩愮淮闂涓婃姤淇℃伅琛�")
+@TableName("`yw_problem`")
+public class YwProblem {
+
+ @TableId(type = IdType.AUTO)
+ @ApiModelProperty(value = "涓婚敭", example = "1")
+ @ExcelColumn(name="涓婚敭")
+ private Integer id;
+
+ @ApiModelProperty(value = "鍒涘缓浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鍒涘缓浜虹紪鐮�")
+ private Integer creator;
+
+ @ApiModelProperty(value = "鍒涘缓鏃堕棿")
+ @ExcelColumn(name="鍒涘缓鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date createDate;
+
+ @ApiModelProperty(value = "鏇存柊浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鏇存柊浜虹紪鐮�")
+ private Integer editor;
+
+ @ApiModelProperty(value = "鏇存柊鏃堕棿")
+ @ExcelColumn(name="鏇存柊鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date editDate;
+
+ @ApiModelProperty(value = "鏄惁鍒犻櫎0鍚� 1鏄�", example = "1")
+ @ExcelColumn(name="鏄惁鍒犻櫎0鍚� 1鏄�")
+ private Integer isdeleted;
+
+ @ApiModelProperty(value = "浣嶇疆")
+ @ExcelColumn(name="浣嶇疆")
+ private String position;
+
+ @ApiModelProperty(value = "澶囨敞")
+ @ExcelColumn(name="澶囨敞")
+ private String remark;
+
+ @ApiModelProperty(value = "鐘舵�� 0鍚敤 1绂佺敤", example = "1")
+ @ExcelColumn(name="鐘舵�� 0鍚敤 1绂佺敤")
+ private Integer status;
+
+ @ApiModelProperty(value = "鎯呭喌璇存槑")
+ @ExcelColumn(name="鎯呭喌璇存槑")
+ private String content;
+
+ @ApiModelProperty(value = "涓婃姤浜哄鍚�")
+ @ExcelColumn(name="涓婃姤浜哄鍚�")
+ private String name;
+
+ @ApiModelProperty(value = "鑱旂郴鐢佃瘽")
+ @ExcelColumn(name="鑱旂郴鐢佃瘽")
+ private String phone;
+
+ @ApiModelProperty(value = "鎻愭姤鏃堕棿")
+ @ExcelColumn(name="鎻愭姤鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date submitDate;
+
+ @ApiModelProperty(value = "缂栧彿")
+ @ExcelColumn(name="缂栧彿")
+ private String code;
+
+ @ApiModelProperty(value = "澶勭悊鐘舵�� 0寰呭鐞� 1宸茶浆宸ュ崟 2宸插叧闂�", example = "1")
+ @ExcelColumn(name="澶勭悊鐘舵�� 0寰呭鐞� 1宸茶浆宸ュ崟 2宸插叧闂�")
+ private Integer dealStatus;
+
+ @ApiModelProperty(value = "澶勭悊浜虹紪鐮�(鍏宠仈system_user)", example = "1")
+ @ExcelColumn(name="澶勭悊浜虹紪鐮�(鍏宠仈system_user)")
+ private Integer dealUserId;
+
+ @ApiModelProperty(value = "澶勭悊鏃堕棿")
+ @ExcelColumn(name="澶勭悊鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date dealDate;
+
+ @ApiModelProperty(value = "澶勭悊澶囨敞")
+ @ExcelColumn(name="澶勭悊澶囨敞")
+ private String dealInfo;
+
+ @ApiModelProperty(value = "澶勭悊鏂瑰紡 0杞伐鍗� 1鍏抽棴", example = "1")
+ @ExcelColumn(name="澶勭悊鏂瑰紡 0杞伐鍗� 1鍏抽棴")
+ private Integer dealType;
+
+ @ApiModelProperty(value = "鍏宠仈宸ュ崟缂栫爜锛堝叧鑱攜w_workorder)", example = "1")
+ @ExcelColumn(name="鍏宠仈宸ュ崟缂栫爜锛堝叧鑱攜w_workorder)")
+ private Integer workorderId;
+
+ @ApiModelProperty(value = "闄勪欢淇℃伅")
+ @TableField(exist = false)
+ private List<Multifile> fileList;
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStock.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStock.java
new file mode 100644
index 0000000..dc2ec33
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStock.java
@@ -0,0 +1,97 @@
+package com.doumee.dao.business.model;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.doumee.core.annotation.excel.ExcelColumn;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.Date;
+import java.math.BigDecimal;
+
+/**
+ * 杩愮淮搴撳瓨淇℃伅琛�
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Data
+@ApiModel("杩愮淮搴撳瓨淇℃伅琛�")
+@TableName("`yw_stock`")
+public class YwStock {
+
+ @TableId(type = IdType.AUTO)
+ @ApiModelProperty(value = "涓婚敭", example = "1")
+ @ExcelColumn(name="涓婚敭")
+ private Integer id;
+
+ @ApiModelProperty(value = "鍒涘缓浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鍒涘缓浜虹紪鐮�")
+ private Integer creator;
+
+ @ApiModelProperty(value = "鍒涘缓鏃堕棿")
+ @ExcelColumn(name="鍒涘缓鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date createDate;
+
+ @ApiModelProperty(value = "鏇存柊浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鏇存柊浜虹紪鐮�")
+ private Integer editor;
+
+ @ApiModelProperty(value = "鏇存柊鏃堕棿")
+ @ExcelColumn(name="鏇存柊鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date editDate;
+
+ @ApiModelProperty(value = "鏄惁鍒犻櫎0鍚� 1鏄�", example = "1")
+ @ExcelColumn(name="鏄惁鍒犻櫎0鍚� 1鏄�")
+ private Integer isdeleted;
+
+ @ApiModelProperty(value = "澶囨敞")
+ @ExcelColumn(name="澶囨敞")
+ private String remark;
+
+ @ApiModelProperty(value = "浠撳簱缂栫爜(鍏宠仈yw_warehouse)")
+ @ExcelColumn(name="浠撳簱缂栫爜(鍏宠仈yw_warehouse)")
+ private Integer warehouseId;
+
+ @ApiModelProperty(value = "鐗╄祫缂栫爜锛堝叧鑱攜w_material)", example = "1")
+ @ExcelColumn(name="鐗╄祫缂栫爜锛堝叧鑱攜w_material)")
+ private Integer materialId;
+
+ @ApiModelProperty(value = "鏁伴噺", example = "1")
+ @ExcelColumn(name="鏁伴噺")
+ private BigDecimal stock;
+
+
+ @ApiModelProperty(value = "璧勪骇缂栫爜")
+ @TableField(exist = false)
+ private String materialCode;
+
+ @ApiModelProperty(value = "璧勪骇鍚嶇О")
+ @TableField(exist = false)
+ private String materialName;
+
+ @ApiModelProperty(value = "璧勪骇鏉″舰鐮�")
+ @TableField(exist = false)
+ private String materialQrcode;
+
+ @ApiModelProperty(value = "璧勪骇鍝佺墝")
+ @TableField(exist = false)
+ private String materialBrand;
+
+ @ApiModelProperty(value = "璧勪骇鍗曚綅")
+ @TableField(exist = false)
+ private String materialUnitName;
+
+ @ApiModelProperty(value = "璧勪骇瑙勬牸鍨嬪彿")
+ @TableField(exist = false)
+ private String materialAttr;
+
+ @ApiModelProperty(value = "浠撳簱鍚嶇О")
+ @TableField(exist = false)
+ private String warehouseName;
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStocktaking.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStocktaking.java
new file mode 100644
index 0000000..3addc97
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStocktaking.java
@@ -0,0 +1,181 @@
+package com.doumee.dao.business.model;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.doumee.core.annotation.excel.ExcelColumn;
+import com.doumee.core.model.LoginUserModel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 杩愮淮鐩樼偣淇℃伅琛�
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Data
+@ApiModel("杩愮淮鐩樼偣淇℃伅琛�")
+@TableName("`yw_stocktaking`")
+public class YwStocktaking extends LoginUserModel {
+
+ @TableId(type = IdType.AUTO)
+ @ApiModelProperty(value = "涓婚敭", example = "1")
+ @ExcelColumn(name="涓婚敭")
+ private Integer id;
+
+ @ApiModelProperty(value = "鍒涘缓浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鍒涘缓浜虹紪鐮�")
+ private Integer creator;
+
+ @ApiModelProperty(value = "鍒涘缓鏃堕棿")
+ @ExcelColumn(name="鍒涘缓鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date createDate;
+
+ @ApiModelProperty(value = "鏇存柊浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鏇存柊浜虹紪鐮�")
+ private Integer editor;
+
+ @ApiModelProperty(value = "鏇存柊鏃堕棿")
+ @ExcelColumn(name="鏇存柊鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date editDate;
+
+ @ApiModelProperty(value = "鏄惁鍒犻櫎0鍚� 1鏄�", example = "1")
+ @ExcelColumn(name="鏄惁鍒犻櫎0鍚� 1鏄�")
+ private Integer isdeleted;
+
+ @ApiModelProperty(value = "浣嶇疆")
+ @ExcelColumn(name="浣嶇疆")
+ private String position;
+
+ @ApiModelProperty(value = "澶囨敞")
+ @ExcelColumn(name="澶囨敞")
+ private String remark;
+
+ @ApiModelProperty(value = "鐘舵�� 0鏈紑濮� 1杩涜涓� 2宸插畬鎴� 3宸插彇娑�", example = "1")
+ @ExcelColumn(name="鐘舵�� 0鏈紑濮� 1杩涜涓� 2宸插畬鎴� 3宸插彇娑�")
+ private Integer status;
+
+ @ApiModelProperty(value = "鐩樼偣鍛樼紪鐮�(鍏宠仈system_user)")
+ @ExcelColumn(name="鐩樼偣鍛樼紪鐮�(鍏宠仈system_user)")
+ private Integer userId;
+
+ @ApiModelProperty(value = "鍚嶇О")
+ @ExcelColumn(name="鍚嶇О")
+ private String name;
+
+ @ApiModelProperty(value = "鐩樼偣鏃堕棿")
+ @ExcelColumn(name="鐩樼偣鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date planDate;
+
+ @ApiModelProperty(value = "缂栧彿")
+ @ExcelColumn(name="缂栧彿")
+ private String code;
+
+ @ApiModelProperty(value = "浠撳簱缂栫爜(鍏宠仈yw_warehouse)")
+ @ExcelColumn(name="浠撳簱缂栫爜(鍏宠仈yw_warehouse)")
+ private Integer warehouseId;
+
+ @ApiModelProperty(value = "寮�濮嬪鐞嗕汉(鍏宠仈system_user)", example = "1")
+ @ExcelColumn(name="寮�濮嬪鐞嗕汉(鍏宠仈system_user)")
+ private Integer dealUserId;
+
+ @ApiModelProperty(value = "寮�濮嬫椂闂�")
+ @ExcelColumn(name="寮�濮嬫椂闂�")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date dealDate;
+
+ @ApiModelProperty(value = "寮�濮嬪娉�")
+ @ExcelColumn(name="寮�濮嬪娉�")
+ private String dealInfo;
+
+ @ApiModelProperty(value = "宸茬洏鐐圭墿璧勬暟閲�", example = "1")
+ @ExcelColumn(name="宸茬洏鐐圭墿璧勬暟閲�")
+ private Integer doneNum;
+
+ @ApiModelProperty(value = "鏈洏鐐圭墿璧勬暟閲�", example = "1")
+ @ExcelColumn(name="鏈洏鐐圭墿璧勬暟閲�")
+ private Integer waitNum;
+
+ @ApiModelProperty(value = "鎬荤墿璧勬暟閲�", example = "1")
+ @ExcelColumn(name="鎬荤墿璧勬暟閲�")
+ private Integer totalNum;
+
+ @ApiModelProperty(value = "鐩樼泩鐗╄祫鏁伴噺", example = "1")
+ @ExcelColumn(name="鐩樼泩鐗╄祫鏁伴噺")
+ private Integer profitNum;
+
+ @ApiModelProperty(value = "鐩樹簭鐗╄祫鏁伴噺", example = "1")
+ @ExcelColumn(name="鐩樹簭鐗╄祫鏁伴噺")
+ private Integer lossNum;
+
+ @ApiModelProperty(value = "璐﹀疄鐩哥鐗╄祫鏁伴噺", example = "1")
+ @ExcelColumn(name="璐﹀疄鐩哥鐗╄祫鏁伴噺")
+ private Integer equalNum;
+
+ @ApiModelProperty(value = "瀹屾垚澶勭悊浜�(鍏宠仈system_user)", example = "1")
+ @ExcelColumn(name="瀹屾垚澶勭悊浜�(鍏宠仈system_user)")
+ private Integer doneUserId;
+
+ @ApiModelProperty(value = "瀹屾垚鏃堕棿")
+ @ExcelColumn(name="瀹屾垚鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date doneDate;
+
+ @ApiModelProperty(value = "瀹屾垚澶囨敞")
+ @ExcelColumn(name="瀹屾垚澶囨敞")
+ private String doneInfo;
+
+ @ApiModelProperty(value = "鍙栨秷澶勭悊浜�(鍏宠仈system_user)", example = "1")
+ @ExcelColumn(name="鍙栨秷澶勭悊浜�(鍏宠仈system_user)")
+ private Integer cancelUserId;
+
+ @ApiModelProperty(value = "鍙栨秷鏃堕棿")
+ @ExcelColumn(name="鍙栨秷鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date cancelDate;
+
+ @ApiModelProperty(value = "鍙栨秷澶囨敞")
+ @ExcelColumn(name="鍙栨秷澶囨敞")
+ private String cancelInfo;
+
+ @ApiModelProperty(value = "浠撳簱鍚嶇О")
+ @TableField(exist = false)
+ private String warehouseName;
+
+ @ApiModelProperty(value = "鍒涘缓浜哄悕绉�")
+ @TableField(exist = false)
+ private String createName;
+
+ @ApiModelProperty(value = "鐩樼偣鍛樺悕绉�")
+ @TableField(exist = false)
+ private String userName;
+
+ @ApiModelProperty(value = "宸茬洏璁板綍鏁�")
+ @TableField(exist = false)
+ private Integer finishAmount;
+
+ @ApiModelProperty(value = "鏈洏璁板綍鏁�")
+ @TableField(exist = false)
+ private Integer unFinishAmount;
+
+ @ApiModelProperty(value = "鐩樼泩璁板綍鏁�")
+ @TableField(exist = false)
+ private Integer profitAmount;
+
+ @ApiModelProperty(value = "鐩樹簭璁板綍鏁�")
+ @TableField(exist = false)
+ private Integer lossAmount;
+
+ @ApiModelProperty(value = "鐩哥璁板綍鏁�")
+ @TableField(exist = false)
+ private Integer equalAmount;
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStocktakingRecord.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStocktakingRecord.java
new file mode 100644
index 0000000..6672876
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStocktakingRecord.java
@@ -0,0 +1,139 @@
+package com.doumee.dao.business.model;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.doumee.core.annotation.excel.ExcelColumn;
+import com.doumee.core.model.LoginUserModel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.Date;
+import java.math.BigDecimal;
+
+/**
+ * 杩愮淮鐩樼偣鏄庣粏璁板綍琛�
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Data
+@ApiModel("杩愮淮鐩樼偣鏄庣粏璁板綍琛�")
+@TableName("`yw_stocktaking_record`")
+public class YwStocktakingRecord extends LoginUserModel {
+
+ @TableId(type = IdType.AUTO)
+ @ApiModelProperty(value = "涓婚敭", example = "1")
+ @ExcelColumn(name="涓婚敭")
+ private Integer id;
+
+ @ApiModelProperty(value = "鍒涘缓浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鍒涘缓浜虹紪鐮�")
+ private Integer creator;
+
+ @ApiModelProperty(value = "鍒涘缓鏃堕棿")
+ @ExcelColumn(name="鍒涘缓鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date createDate;
+
+ @ApiModelProperty(value = "鏇存柊浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鏇存柊浜虹紪鐮�")
+ private Integer editor;
+
+ @ApiModelProperty(value = "鏇存柊鏃堕棿")
+ @ExcelColumn(name="鏇存柊鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date editDate;
+
+ @ApiModelProperty(value = "鏄惁鍒犻櫎0鍚� 1鏄�", example = "1")
+ @ExcelColumn(name="鏄惁鍒犻櫎0鍚� 1鏄�")
+ private Integer isdeleted;
+
+ @ApiModelProperty(value = "澶囨敞")
+ @ExcelColumn(name="澶囨敞")
+ private String remark;
+
+ @ApiModelProperty(value = "鐘舵�� 0鏈紑濮� 1宸茬洏鐐�", example = "1")
+ @ExcelColumn(name="鐘舵�� 0鏈紑濮� 1宸茬洏鐐�")
+ private Integer status;
+
+ @ApiModelProperty(value = "鐩樼偣鍛樼紪鐮�(鍏宠仈system_user)")
+ @ExcelColumn(name="鐩樼偣鍛樼紪鐮�(鍏宠仈system_user)")
+ private String userId;
+
+ @ApiModelProperty(value = "鐩樼偣鏃堕棿")
+ @ExcelColumn(name="鐩樼偣鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date planDate;
+
+ @ApiModelProperty(value = "缂栧彿")
+ @ExcelColumn(name="缂栧彿")
+ private String code;
+
+ @ApiModelProperty(value = "鐗╄祫缂栫爜锛堝叧鑱攜w_material)", example = "1")
+ @ExcelColumn(name="鐗╄祫缂栫爜锛堝叧鑱攜w_material)")
+ private Integer materialId;
+
+ @ApiModelProperty(value = "璐﹂潰鏁伴噺", example = "1")
+ @ExcelColumn(name="璐﹂潰鏁伴噺")
+ private BigDecimal stock;
+
+ @ApiModelProperty(value = "瀹為檯鐩樼偣搴撳瓨閲�", example = "1")
+ @ExcelColumn(name="瀹為檯鐩樼偣搴撳瓨閲�")
+ private BigDecimal actStock;
+
+ @ApiModelProperty(value = "鐩樼偣 0璐﹀疄鐩哥 1鐩樹簭 2鐩樼泩", example = "1")
+ @ExcelColumn(name="鐩樼偣 0璐﹀疄鐩哥 1鐩樹簭 2鐩樼泩")
+ private Integer type;
+
+ @ApiModelProperty(value = "鐩樼偣璁″垝缂栫爜(鍏宠仈yw_stocktaking)", example = "1")
+ @ExcelColumn(name="鐩樼偣璁″垝缂栫爜(鍏宠仈yw_stocktaking)")
+ private Integer stocktakingId;
+
+ @ApiModelProperty(value = "璧勪骇缂栫爜")
+ @TableField(exist = false)
+ private String materialCode;
+
+ @ApiModelProperty(value = "璧勪骇鍚嶇О")
+ @TableField(exist = false)
+ private String materialName;
+
+ @ApiModelProperty(value = "璧勪骇鏉″舰鐮�")
+ @TableField(exist = false)
+ private String materialQrcode;
+
+ @ApiModelProperty(value = "璧勪骇鍝佺墝")
+ @TableField(exist = false)
+ private String materialBrand;
+
+ @ApiModelProperty(value = "璧勪骇瑙勬牸鍨嬪彿")
+ @TableField(exist = false)
+ private String materialAttr;
+
+ @ApiModelProperty(value = "璧勪骇鍗曚綅")
+ @TableField(exist = false)
+ private String materialUnitName;
+
+ @ApiModelProperty(value = "浠撳簱鍚嶇О")
+ @TableField(exist = false)
+ private String warehouseName;
+
+ @ApiModelProperty(value = "鐩樼偣浜哄悕绉�")
+ @TableField(exist = false)
+ private String userName;
+
+ @ApiModelProperty(value = "鐩樼偣浜虹粍缁囧悕绉�")
+ @TableField(exist = false)
+ private String companyName;
+
+
+
+
+
+
+
+
+
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwWarehouse.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwWarehouse.java
new file mode 100644
index 0000000..812fbc3
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwWarehouse.java
@@ -0,0 +1,85 @@
+package com.doumee.dao.business.model;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.doumee.core.annotation.excel.ExcelColumn;
+import com.doumee.core.model.LoginUserModel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.Date;
+
+/**
+ * 杩愮淮浠撳簱淇℃伅琛�
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Data
+@ApiModel("杩愮淮浠撳簱淇℃伅琛�")
+@TableName("`yw_warehouse`")
+public class YwWarehouse extends LoginUserModel {
+
+ @TableId(type = IdType.AUTO)
+ @ApiModelProperty(value = "涓婚敭", example = "1")
+ @ExcelColumn(name="涓婚敭")
+ private Integer id;
+
+ @ApiModelProperty(value = "鍒涘缓浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鍒涘缓浜虹紪鐮�")
+ private Integer creator;
+
+ @ApiModelProperty(value = "鍒涘缓鏃堕棿")
+ @ExcelColumn(name="鍒涘缓鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date createDate;
+
+ @ApiModelProperty(value = "鏇存柊浜虹紪鐮�", example = "1")
+ @ExcelColumn(name="鏇存柊浜虹紪鐮�")
+ private Integer editor;
+
+ @ApiModelProperty(value = "鏇存柊鏃堕棿")
+ @ExcelColumn(name="鏇存柊鏃堕棿")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date editDate;
+
+ @ApiModelProperty(value = "鏄惁鍒犻櫎0鍚� 1鏄�", example = "1")
+ @ExcelColumn(name="鏄惁鍒犻櫎0鍚� 1鏄�")
+ private Integer isdeleted;
+
+ @ApiModelProperty(value = "澶囨敞")
+ @ExcelColumn(name="澶囨敞")
+ private String remark;
+
+ @ApiModelProperty(value = "鐘舵�� 0鍚敤 1绂佺敤", example = "1")
+ @ExcelColumn(name="鐘舵�� 0鍚敤 1绂佺敤")
+ private Integer status;
+
+ @ApiModelProperty(value = "鍚嶇О")
+ @ExcelColumn(name="鍚嶇О")
+ private String name;
+
+ @ApiModelProperty(value = "浣嶇疆")
+ @ExcelColumn(name="浣嶇疆")
+ private String position;
+
+ @ApiModelProperty(value = "缂栧彿")
+ @ExcelColumn(name="缂栧彿")
+ private String code;
+
+ @ApiModelProperty(value = "璐熻矗浜虹紪鐮�(鍏宠仈system_user)", example = "1")
+ @ExcelColumn(name="璐熻矗浜虹紪鐮�(鍏宠仈system_user)")
+ private Integer userId;
+
+ @ApiModelProperty(value = "鎺掑簭鐮�", example = "1")
+ @ExcelColumn(name="鎺掑簭鐮�")
+ private Integer sortnum;
+
+
+ @ApiModelProperty(value = "璐熻矗浜哄悕绉�", example = "1")
+ @TableField(exist = false)
+ private String userName;
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwMaterialService.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwMaterialService.java
new file mode 100644
index 0000000..6da3431
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwMaterialService.java
@@ -0,0 +1,101 @@
+package com.doumee.service.business;
+
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.dao.business.model.YwMaterial;
+import java.util.List;
+
+/**
+ * 杩愮淮璧勪骇淇℃伅琛⊿ervice瀹氫箟
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+public interface YwMaterialService {
+
+ /**
+ * 鍒涘缓
+ *
+ * @param ywMaterial 瀹炰綋瀵硅薄
+ * @return Integer
+ */
+ Integer create(YwMaterial ywMaterial);
+
+ /**
+ * 涓婚敭鍒犻櫎
+ *
+ * @param id 涓婚敭
+ */
+ void deleteById(Integer id);
+
+ /**
+ * 鍒犻櫎
+ *
+ * @param ywMaterial 瀹炰綋瀵硅薄
+ */
+ void delete(YwMaterial ywMaterial);
+
+ /**
+ * 鎵归噺涓婚敭鍒犻櫎
+ *
+ * @param ids 涓婚敭闆�
+ */
+ void deleteByIdInBatch(List<Integer> ids);
+
+ /**
+ * 涓婚敭鏇存柊
+ *
+ * @param ywMaterial 瀹炰綋瀵硅薄
+ */
+ void updateById(YwMaterial ywMaterial);
+
+ /**
+ * 鎵归噺涓婚敭鏇存柊
+ *
+ * @param ywMaterials 瀹炰綋闆�
+ */
+ void updateByIdInBatch(List<YwMaterial> ywMaterials);
+
+ void updateStatus(YwMaterial ywMaterials);
+
+ /**
+ * 涓婚敭鏌ヨ
+ *
+ * @param id 涓婚敭
+ * @return YwMaterial
+ */
+ YwMaterial findById(Integer id);
+
+ /**
+ * 鏉′欢鏌ヨ鍗曟潯璁板綍
+ *
+ * @param ywMaterial 瀹炰綋瀵硅薄
+ * @return YwMaterial
+ */
+ YwMaterial findOne(YwMaterial ywMaterial);
+
+ /**
+ * 鏉′欢鏌ヨ
+ *
+ * @param ywMaterial 瀹炰綋瀵硅薄
+ * @return List<YwMaterial>
+ */
+ List<YwMaterial> findList(YwMaterial ywMaterial);
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ *
+ * @param pageWrap 鍒嗛〉瀵硅薄
+ * @return PageData<YwMaterial>
+ */
+ PageData<YwMaterial> findPage(PageWrap<YwMaterial> pageWrap);
+
+ /**
+ * 鏉′欢缁熻
+ *
+ * @param ywMaterial 瀹炰綋瀵硅薄
+ * @return long
+ */
+ long count(YwMaterial ywMaterial);
+
+ YwMaterial getDetail(Integer id);
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwOutinboundRecordService.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwOutinboundRecordService.java
new file mode 100644
index 0000000..8ed0246
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwOutinboundRecordService.java
@@ -0,0 +1,97 @@
+package com.doumee.service.business;
+
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.dao.business.model.YwOutinboundRecord;
+import java.util.List;
+
+/**
+ * 杩愮淮鍑哄叆搴撲俊鎭槑缁嗚〃Service瀹氫箟
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 14:28
+ */
+public interface YwOutinboundRecordService {
+
+ /**
+ * 鍒涘缓
+ *
+ * @param ywOutinboundRecord 瀹炰綋瀵硅薄
+ * @return Integer
+ */
+ Integer create(YwOutinboundRecord ywOutinboundRecord);
+
+ /**
+ * 涓婚敭鍒犻櫎
+ *
+ * @param id 涓婚敭
+ */
+ void deleteById(Integer id);
+
+ /**
+ * 鍒犻櫎
+ *
+ * @param ywOutinboundRecord 瀹炰綋瀵硅薄
+ */
+ void delete(YwOutinboundRecord ywOutinboundRecord);
+
+ /**
+ * 鎵归噺涓婚敭鍒犻櫎
+ *
+ * @param ids 涓婚敭闆�
+ */
+ void deleteByIdInBatch(List<Integer> ids);
+
+ /**
+ * 涓婚敭鏇存柊
+ *
+ * @param ywOutinboundRecord 瀹炰綋瀵硅薄
+ */
+ void updateById(YwOutinboundRecord ywOutinboundRecord);
+
+ /**
+ * 鎵归噺涓婚敭鏇存柊
+ *
+ * @param ywOutinboundRecords 瀹炰綋闆�
+ */
+ void updateByIdInBatch(List<YwOutinboundRecord> ywOutinboundRecords);
+
+ /**
+ * 涓婚敭鏌ヨ
+ *
+ * @param id 涓婚敭
+ * @return YwOutinboundRecord
+ */
+ YwOutinboundRecord findById(Integer id);
+
+ /**
+ * 鏉′欢鏌ヨ鍗曟潯璁板綍
+ *
+ * @param ywOutinboundRecord 瀹炰綋瀵硅薄
+ * @return YwOutinboundRecord
+ */
+ YwOutinboundRecord findOne(YwOutinboundRecord ywOutinboundRecord);
+
+ /**
+ * 鏉′欢鏌ヨ
+ *
+ * @param ywOutinboundRecord 瀹炰綋瀵硅薄
+ * @return List<YwOutinboundRecord>
+ */
+ List<YwOutinboundRecord> findList(YwOutinboundRecord ywOutinboundRecord);
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ *
+ * @param pageWrap 鍒嗛〉瀵硅薄
+ * @return PageData<YwOutinboundRecord>
+ */
+ PageData<YwOutinboundRecord> findPage(PageWrap<YwOutinboundRecord> pageWrap);
+
+ /**
+ * 鏉′欢缁熻
+ *
+ * @param ywOutinboundRecord 瀹炰綋瀵硅薄
+ * @return long
+ */
+ long count(YwOutinboundRecord ywOutinboundRecord);
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwOutinboundService.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwOutinboundService.java
new file mode 100644
index 0000000..379ff7b
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwOutinboundService.java
@@ -0,0 +1,99 @@
+package com.doumee.service.business;
+
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.dao.business.model.YwOutinbound;
+import java.util.List;
+
+/**
+ * 杩愮淮鍑哄叆搴撲俊鎭〃Service瀹氫箟
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+public interface YwOutinboundService {
+
+ /**
+ * 鍒涘缓
+ *
+ * @param ywOutinbound 瀹炰綋瀵硅薄
+ * @return Integer
+ */
+ Integer create(YwOutinbound ywOutinbound);
+
+ /**
+ * 涓婚敭鍒犻櫎
+ *
+ * @param id 涓婚敭
+ */
+ void deleteById(Integer id);
+
+ /**
+ * 鍒犻櫎
+ *
+ * @param ywOutinbound 瀹炰綋瀵硅薄
+ */
+ void delete(YwOutinbound ywOutinbound);
+
+ /**
+ * 鎵归噺涓婚敭鍒犻櫎
+ *
+ * @param ids 涓婚敭闆�
+ */
+ void deleteByIdInBatch(List<Integer> ids);
+
+ /**
+ * 涓婚敭鏇存柊
+ *
+ * @param ywOutinbound 瀹炰綋瀵硅薄
+ */
+ void updateById(YwOutinbound ywOutinbound);
+
+ /**
+ * 鎵归噺涓婚敭鏇存柊
+ *
+ * @param ywOutinbounds 瀹炰綋闆�
+ */
+ void updateByIdInBatch(List<YwOutinbound> ywOutinbounds);
+
+ /**
+ * 涓婚敭鏌ヨ
+ *
+ * @param id 涓婚敭
+ * @return YwOutinbound
+ */
+ YwOutinbound findById(Integer id);
+
+ /**
+ * 鏉′欢鏌ヨ鍗曟潯璁板綍
+ *
+ * @param ywOutinbound 瀹炰綋瀵硅薄
+ * @return YwOutinbound
+ */
+ YwOutinbound findOne(YwOutinbound ywOutinbound);
+
+ /**
+ * 鏉′欢鏌ヨ
+ *
+ * @param ywOutinbound 瀹炰綋瀵硅薄
+ * @return List<YwOutinbound>
+ */
+ List<YwOutinbound> findList(YwOutinbound ywOutinbound);
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ *
+ * @param pageWrap 鍒嗛〉瀵硅薄
+ * @return PageData<YwOutinbound>
+ */
+ PageData<YwOutinbound> findPage(PageWrap<YwOutinbound> pageWrap);
+
+ /**
+ * 鏉′欢缁熻
+ *
+ * @param ywOutinbound 瀹炰綋瀵硅薄
+ * @return long
+ */
+ long count(YwOutinbound ywOutinbound);
+
+ YwOutinbound getDetail(Integer id);
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwProblemService.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwProblemService.java
new file mode 100644
index 0000000..a0f41d4
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwProblemService.java
@@ -0,0 +1,97 @@
+package com.doumee.service.business;
+
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.dao.business.model.YwProblem;
+import java.util.List;
+
+/**
+ * 杩愮淮闂涓婃姤淇℃伅琛⊿ervice瀹氫箟
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+public interface YwProblemService {
+
+ /**
+ * 鍒涘缓
+ *
+ * @param ywProblem 瀹炰綋瀵硅薄
+ * @return Integer
+ */
+ Integer create(YwProblem ywProblem);
+
+ /**
+ * 涓婚敭鍒犻櫎
+ *
+ * @param id 涓婚敭
+ */
+ void deleteById(Integer id);
+
+ /**
+ * 鍒犻櫎
+ *
+ * @param ywProblem 瀹炰綋瀵硅薄
+ */
+ void delete(YwProblem ywProblem);
+
+ /**
+ * 鎵归噺涓婚敭鍒犻櫎
+ *
+ * @param ids 涓婚敭闆�
+ */
+ void deleteByIdInBatch(List<Integer> ids);
+
+ /**
+ * 涓婚敭鏇存柊
+ *
+ * @param ywProblem 瀹炰綋瀵硅薄
+ */
+ void updateById(YwProblem ywProblem);
+
+ /**
+ * 鎵归噺涓婚敭鏇存柊
+ *
+ * @param ywProblems 瀹炰綋闆�
+ */
+ void updateByIdInBatch(List<YwProblem> ywProblems);
+
+ /**
+ * 涓婚敭鏌ヨ
+ *
+ * @param id 涓婚敭
+ * @return YwProblem
+ */
+ YwProblem findById(Integer id);
+
+ /**
+ * 鏉′欢鏌ヨ鍗曟潯璁板綍
+ *
+ * @param ywProblem 瀹炰綋瀵硅薄
+ * @return YwProblem
+ */
+ YwProblem findOne(YwProblem ywProblem);
+
+ /**
+ * 鏉′欢鏌ヨ
+ *
+ * @param ywProblem 瀹炰綋瀵硅薄
+ * @return List<YwProblem>
+ */
+ List<YwProblem> findList(YwProblem ywProblem);
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ *
+ * @param pageWrap 鍒嗛〉瀵硅薄
+ * @return PageData<YwProblem>
+ */
+ PageData<YwProblem> findPage(PageWrap<YwProblem> pageWrap);
+
+ /**
+ * 鏉′欢缁熻
+ *
+ * @param ywProblem 瀹炰綋瀵硅薄
+ * @return long
+ */
+ long count(YwProblem ywProblem);
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStockService.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStockService.java
new file mode 100644
index 0000000..1b6d5a0
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStockService.java
@@ -0,0 +1,97 @@
+package com.doumee.service.business;
+
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.dao.business.model.YwStock;
+import java.util.List;
+
+/**
+ * 杩愮淮搴撳瓨淇℃伅琛⊿ervice瀹氫箟
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+public interface YwStockService {
+
+ /**
+ * 鍒涘缓
+ *
+ * @param ywStock 瀹炰綋瀵硅薄
+ * @return Integer
+ */
+ Integer create(YwStock ywStock);
+
+ /**
+ * 涓婚敭鍒犻櫎
+ *
+ * @param id 涓婚敭
+ */
+ void deleteById(Integer id);
+
+ /**
+ * 鍒犻櫎
+ *
+ * @param ywStock 瀹炰綋瀵硅薄
+ */
+ void delete(YwStock ywStock);
+
+ /**
+ * 鎵归噺涓婚敭鍒犻櫎
+ *
+ * @param ids 涓婚敭闆�
+ */
+ void deleteByIdInBatch(List<Integer> ids);
+
+ /**
+ * 涓婚敭鏇存柊
+ *
+ * @param ywStock 瀹炰綋瀵硅薄
+ */
+ void updateById(YwStock ywStock);
+
+ /**
+ * 鎵归噺涓婚敭鏇存柊
+ *
+ * @param ywStocks 瀹炰綋闆�
+ */
+ void updateByIdInBatch(List<YwStock> ywStocks);
+
+ /**
+ * 涓婚敭鏌ヨ
+ *
+ * @param id 涓婚敭
+ * @return YwStock
+ */
+ YwStock findById(Integer id);
+
+ /**
+ * 鏉′欢鏌ヨ鍗曟潯璁板綍
+ *
+ * @param ywStock 瀹炰綋瀵硅薄
+ * @return YwStock
+ */
+ YwStock findOne(YwStock ywStock);
+
+ /**
+ * 鏉′欢鏌ヨ
+ *
+ * @param ywStock 瀹炰綋瀵硅薄
+ * @return List<YwStock>
+ */
+ List<YwStock> findList(YwStock ywStock);
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ *
+ * @param pageWrap 鍒嗛〉瀵硅薄
+ * @return PageData<YwStock>
+ */
+ PageData<YwStock> findPage(PageWrap<YwStock> pageWrap);
+
+ /**
+ * 鏉′欢缁熻
+ *
+ * @param ywStock 瀹炰綋瀵硅薄
+ * @return long
+ */
+ long count(YwStock ywStock);
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStocktakingRecordService.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStocktakingRecordService.java
new file mode 100644
index 0000000..0c2f5db
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStocktakingRecordService.java
@@ -0,0 +1,100 @@
+package com.doumee.service.business;
+
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.dao.business.model.YwStocktakingRecord;
+import java.util.List;
+
+/**
+ * 杩愮淮鐩樼偣鏄庣粏璁板綍琛⊿ervice瀹氫箟
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+public interface YwStocktakingRecordService {
+
+ /**
+ * 鍒涘缓
+ *
+ * @param ywStocktakingRecord 瀹炰綋瀵硅薄
+ * @return Integer
+ */
+ Integer create(YwStocktakingRecord ywStocktakingRecord);
+
+ /**
+ * 涓婚敭鍒犻櫎
+ *
+ * @param id 涓婚敭
+ */
+ void deleteById(Integer id);
+
+ /**
+ * 鍒犻櫎
+ *
+ * @param ywStocktakingRecord 瀹炰綋瀵硅薄
+ */
+ void delete(YwStocktakingRecord ywStocktakingRecord);
+
+ /**
+ * 鎵归噺涓婚敭鍒犻櫎
+ *
+ * @param ids 涓婚敭闆�
+ */
+ void deleteByIdInBatch(List<Integer> ids);
+
+ /**
+ * 涓婚敭鏇存柊
+ *
+ * @param ywStocktakingRecord 瀹炰綋瀵硅薄
+ */
+ void updateById(YwStocktakingRecord ywStocktakingRecord);
+
+ /**
+ * 鎵归噺涓婚敭鏇存柊
+ *
+ * @param ywStocktakingRecords 瀹炰綋闆�
+ */
+ void updateByIdInBatch(List<YwStocktakingRecord> ywStocktakingRecords);
+
+ /**
+ * 涓婚敭鏌ヨ
+ *
+ * @param id 涓婚敭
+ * @return YwStocktakingRecord
+ */
+ YwStocktakingRecord findById(Integer id);
+
+ YwStocktakingRecord getDetail(Integer id);
+ /**
+ * 鏉′欢鏌ヨ鍗曟潯璁板綍
+ *
+ * @param ywStocktakingRecord 瀹炰綋瀵硅薄
+ * @return YwStocktakingRecord
+ */
+ YwStocktakingRecord findOne(YwStocktakingRecord ywStocktakingRecord);
+
+ /**
+ * 鏉′欢鏌ヨ
+ *
+ * @param ywStocktakingRecord 瀹炰綋瀵硅薄
+ * @return List<YwStocktakingRecord>
+ */
+ List<YwStocktakingRecord> findList(YwStocktakingRecord ywStocktakingRecord);
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ *
+ * @param pageWrap 鍒嗛〉瀵硅薄
+ * @return PageData<YwStocktakingRecord>
+ */
+ PageData<YwStocktakingRecord> findPage(PageWrap<YwStocktakingRecord> pageWrap);
+
+ /**
+ * 鏉′欢缁熻
+ *
+ * @param ywStocktakingRecord 瀹炰綋瀵硅薄
+ * @return long
+ */
+ long count(YwStocktakingRecord ywStocktakingRecord);
+
+ void takingData(YwStocktakingRecord ywStocktakingRecord);
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStocktakingService.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStocktakingService.java
new file mode 100644
index 0000000..0df5bf2
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStocktakingService.java
@@ -0,0 +1,104 @@
+package com.doumee.service.business;
+
+import com.doumee.core.model.LoginUserInfo;
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.dao.business.model.YwStocktaking;
+import java.util.List;
+
+/**
+ * 杩愮淮鐩樼偣淇℃伅琛⊿ervice瀹氫箟
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+public interface YwStocktakingService {
+
+ /**
+ * 鍒涘缓
+ *
+ * @param ywStocktaking 瀹炰綋瀵硅薄
+ * @return Integer
+ */
+ Integer create(YwStocktaking ywStocktaking);
+
+ /**
+ * 涓婚敭鍒犻櫎
+ *
+ * @param id 涓婚敭
+ */
+ void deleteById(Integer id, LoginUserInfo loginUserInfo);
+
+ void cancelById(Integer id, LoginUserInfo loginUserInfo);
+
+ void beginById(Integer id, LoginUserInfo loginUserInfo);
+
+ void finishById(Integer id, LoginUserInfo loginUserInfo);
+ /**
+ * 鍒犻櫎
+ *
+ * @param ywStocktaking 瀹炰綋瀵硅薄
+ */
+ void delete(YwStocktaking ywStocktaking);
+
+ /**
+ * 鎵归噺涓婚敭鍒犻櫎
+ *
+ * @param ids 涓婚敭闆�
+ */
+ void deleteByIdInBatch(List<Integer> ids);
+
+ /**
+ * 涓婚敭鏇存柊
+ *
+ * @param ywStocktaking 瀹炰綋瀵硅薄
+ */
+ void updateById(YwStocktaking ywStocktaking);
+
+ /**
+ * 鎵归噺涓婚敭鏇存柊
+ *
+ * @param ywStocktakings 瀹炰綋闆�
+ */
+ void updateByIdInBatch(List<YwStocktaking> ywStocktakings);
+
+ /**
+ * 涓婚敭鏌ヨ
+ *
+ * @param id 涓婚敭
+ * @return YwStocktaking
+ */
+ YwStocktaking findById(Integer id);
+
+ YwStocktaking getDetail(Integer id);
+ /**
+ * 鏉′欢鏌ヨ鍗曟潯璁板綍
+ *
+ * @param ywStocktaking 瀹炰綋瀵硅薄
+ * @return YwStocktaking
+ */
+ YwStocktaking findOne(YwStocktaking ywStocktaking);
+
+ /**
+ * 鏉′欢鏌ヨ
+ *
+ * @param ywStocktaking 瀹炰綋瀵硅薄
+ * @return List<YwStocktaking>
+ */
+ List<YwStocktaking> findList(YwStocktaking ywStocktaking);
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ *
+ * @param pageWrap 鍒嗛〉瀵硅薄
+ * @return PageData<YwStocktaking>
+ */
+ PageData<YwStocktaking> findPage(PageWrap<YwStocktaking> pageWrap);
+
+ /**
+ * 鏉′欢缁熻
+ *
+ * @param ywStocktaking 瀹炰綋瀵硅薄
+ * @return long
+ */
+ long count(YwStocktaking ywStocktaking);
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwWarehouseService.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwWarehouseService.java
new file mode 100644
index 0000000..08f453e
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwWarehouseService.java
@@ -0,0 +1,98 @@
+package com.doumee.service.business;
+
+import com.doumee.core.model.LoginUserInfo;
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.dao.business.model.YwWarehouse;
+import java.util.List;
+
+/**
+ * 杩愮淮浠撳簱淇℃伅琛⊿ervice瀹氫箟
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+public interface YwWarehouseService {
+
+ /**
+ * 鍒涘缓
+ *
+ * @param ywWarehouse 瀹炰綋瀵硅薄
+ * @return Integer
+ */
+ Integer create(YwWarehouse ywWarehouse);
+
+ /**
+ * 涓婚敭鍒犻櫎
+ *
+ * @param id 涓婚敭
+ */
+ void deleteById(Integer id, LoginUserInfo loginUserInfo);
+
+ /**
+ * 鍒犻櫎
+ *
+ * @param ywWarehouse 瀹炰綋瀵硅薄
+ */
+ void delete(YwWarehouse ywWarehouse);
+
+ /**
+ * 鎵归噺涓婚敭鍒犻櫎
+ *
+ * @param ids 涓婚敭闆�
+ */
+ void deleteByIdInBatch(List<Integer> ids);
+
+ /**
+ * 涓婚敭鏇存柊
+ *
+ * @param ywWarehouse 瀹炰綋瀵硅薄
+ */
+ void updateById(YwWarehouse ywWarehouse);
+
+ /**
+ * 鎵归噺涓婚敭鏇存柊
+ *
+ * @param ywWarehouses 瀹炰綋闆�
+ */
+ void updateByIdInBatch(List<YwWarehouse> ywWarehouses);
+
+ /**
+ * 涓婚敭鏌ヨ
+ *
+ * @param id 涓婚敭
+ * @return YwWarehouse
+ */
+ YwWarehouse findById(Integer id);
+
+ /**
+ * 鏉′欢鏌ヨ鍗曟潯璁板綍
+ *
+ * @param ywWarehouse 瀹炰綋瀵硅薄
+ * @return YwWarehouse
+ */
+ YwWarehouse findOne(YwWarehouse ywWarehouse);
+
+ /**
+ * 鏉′欢鏌ヨ
+ *
+ * @param ywWarehouse 瀹炰綋瀵硅薄
+ * @return List<YwWarehouse>
+ */
+ List<YwWarehouse> findList(YwWarehouse ywWarehouse);
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ *
+ * @param pageWrap 鍒嗛〉瀵硅薄
+ * @return PageData<YwWarehouse>
+ */
+ PageData<YwWarehouse> findPage(PageWrap<YwWarehouse> pageWrap);
+
+ /**
+ * 鏉′欢缁熻
+ *
+ * @param ywWarehouse 瀹炰綋瀵硅薄
+ * @return long
+ */
+ long count(YwWarehouse ywWarehouse);
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwMaterialServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwMaterialServiceImpl.java
new file mode 100644
index 0000000..90dde7f
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwMaterialServiceImpl.java
@@ -0,0 +1,237 @@
+package com.doumee.service.business.impl;
+
+import com.doumee.biz.system.SystemDictDataBiz;
+import com.doumee.core.constants.ResponseStatus;
+import com.doumee.core.exception.BusinessException;
+import com.doumee.core.model.LoginUserInfo;
+import com.doumee.core.model.LoginUserModel;
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Constants;
+import com.doumee.core.utils.Utils;
+import com.doumee.dao.business.YwMaterialMapper;
+import com.doumee.dao.business.YwOutinboundMapper;
+import com.doumee.dao.business.YwOutinboundRecordMapper;
+import com.doumee.dao.business.model.*;
+import com.doumee.dao.system.MultifileMapper;
+import com.doumee.dao.system.model.Multifile;
+import com.doumee.service.business.YwMaterialService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import org.apache.commons.lang.StringUtils;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 杩愮淮璧勪骇淇℃伅琛⊿ervice瀹炵幇
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Service
+public class YwMaterialServiceImpl implements YwMaterialService {
+
+ @Autowired
+ private YwMaterialMapper ywMaterialMapper;
+
+ @Autowired
+ private MultifileMapper multifileMapper;
+
+ @Autowired
+ private YwOutinboundRecordMapper ywOutinboundRecordMapper;
+
+ @Autowired
+ private SystemDictDataBiz systemDictDataBiz;
+
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public Integer create(YwMaterial ywMaterial) {
+ //TODO rk 鎵�灞為」鐩�/鎴块棿闇�姹傞棶棰�
+ if(Objects.isNull(ywMaterial)
+ || StringUtils.isBlank(ywMaterial.getName())
+ || StringUtils.isBlank(ywMaterial.getCode())
+ || StringUtils.isBlank(ywMaterial.getQrcode())
+ || Objects.isNull(ywMaterial.getCateId())
+ ){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ ywMaterial.setId(null);
+ if(StringUtils.isBlank(ywMaterial.getCode())){
+ //鑷姩鐢熸垚 TODO 瀛樺湪闂
+ Long countCode = ywMaterialMapper.selectCount(new QueryWrapper<YwMaterial>().lambda().eq(YwMaterial::getAutoCode, Constants.ONE));
+ String nextCode = StringUtils.leftPad(Long.toString(countCode + 1),4,"0");
+ ywMaterial.setCode("P"+nextCode);
+ ywMaterial.setAutoCode(Constants.ONE);
+ }else{
+ //楠岃瘉code鏄惁瀛樺湪
+ if(ywMaterialMapper.selectCount(new QueryWrapper<YwMaterial>().lambda().eq(YwMaterial::getCode, ywMaterial.getCode()))>0){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"褰撳墠缂栫爜宸插瓨鍦�");
+ };
+ ywMaterial.setAutoCode(Constants.ZERO);
+ }
+ LoginUserInfo loginUserInfo = ywMaterial.getLoginUserInfo();
+ ywMaterial.setCreator(loginUserInfo.getId());
+ ywMaterial.setCreateDate(new Date());
+ ywMaterial.setIsdeleted(Constants.ZERO);
+ ywMaterial.setStatus(Constants.ZERO);
+ ywMaterialMapper.insert(ywMaterial);
+
+ if(Objects.nonNull(ywMaterial.getMultifile())){
+ if(org.apache.commons.lang3.StringUtils.isBlank(ywMaterial.getMultifile().getFileurl())
+ || org.apache.commons.lang3.StringUtils.isBlank(ywMaterial.getMultifile().getName())){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"闄勪欢淇℃伅閿欒");
+ }
+ ywMaterial.getMultifile().setCreator(loginUserInfo.getId());
+ ywMaterial.getMultifile().setCreateDate(new Date());
+ ywMaterial.getMultifile().setIsdeleted(Constants.ZERO);
+ ywMaterial.getMultifile().setObjType(Constants.MultiFile.MATERIAL_FILE.getKey());
+ ywMaterial.getMultifile().setObjId(ywMaterial.getId());
+ multifileMapper.insert(ywMaterial.getMultifile());
+ }
+ return ywMaterial.getId();
+ }
+
+ @Override
+ public void deleteById(Integer id) {
+ if(ywOutinboundRecordMapper.selectCount(new QueryWrapper<YwOutinboundRecord>().lambda().eq(YwOutinboundRecord::getMaterialId,id))>Constants.ZERO){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"褰撳墠璧勪骇宸叉湁鍑哄叆搴撹褰曪紝涓嶅彲鍒犻櫎");
+ }
+ ywMaterialMapper.update(new UpdateWrapper<YwMaterial>().lambda().set(YwMaterial::getIsdeleted,Constants.ONE).eq(YwMaterial::getId,id));
+ }
+
+ @Override
+ public void delete(YwMaterial ywMaterial) {
+ UpdateWrapper<YwMaterial> deleteWrapper = new UpdateWrapper<>(ywMaterial);
+ ywMaterialMapper.delete(deleteWrapper);
+ }
+
+ @Override
+ public void deleteByIdInBatch(List<Integer> ids) {
+ if (CollectionUtils.isEmpty(ids)) {
+ return;
+ }
+ ywMaterialMapper.deleteBatchIds(ids);
+ }
+
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public void updateById(YwMaterial ywMaterial) {
+ //TODO rk 鎵�灞為」鐩�/鎴块棿闇�姹傞棶棰�
+ if(Objects.isNull(ywMaterial)
+ || StringUtils.isBlank(ywMaterial.getName())
+ || StringUtils.isBlank(ywMaterial.getCode())
+ || StringUtils.isBlank(ywMaterial.getQrcode())
+ || Objects.isNull(ywMaterial.getCateId())
+ || Objects.isNull(ywMaterial.getId())
+ ){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ ywMaterial.setCode(null);
+ LoginUserInfo loginUserInfo = ywMaterial.getLoginUserInfo();
+ ywMaterial.setEditor(loginUserInfo.getId());
+ ywMaterial.setEditDate(new Date());
+ ywMaterialMapper.updateById(ywMaterial);
+ multifileMapper.delete(new QueryWrapper<Multifile>().lambda().eq(Multifile::getObjType,Constants.MultiFile.MATERIAL_FILE.getKey()).eq(Multifile::getObjId,ywMaterial.getId()));
+ if(Objects.nonNull(ywMaterial.getMultifile())){
+ if(org.apache.commons.lang3.StringUtils.isBlank(ywMaterial.getMultifile().getFileurl())
+ || org.apache.commons.lang3.StringUtils.isBlank(ywMaterial.getMultifile().getName())){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"闄勪欢淇℃伅閿欒");
+ }
+ ywMaterial.getMultifile().setCreator(loginUserInfo.getId());
+ ywMaterial.getMultifile().setCreateDate(new Date());
+ ywMaterial.getMultifile().setIsdeleted(Constants.ZERO);
+ ywMaterial.getMultifile().setObjType(Constants.MultiFile.MATERIAL_FILE.getKey());
+ ywMaterial.getMultifile().setObjId(ywMaterial.getId());
+ multifileMapper.insert(ywMaterial.getMultifile());
+ }
+ }
+
+ @Override
+ public void updateByIdInBatch(List<YwMaterial> ywMaterials) {
+ if (CollectionUtils.isEmpty(ywMaterials)) {
+ return;
+ }
+ for (YwMaterial ywMaterial: ywMaterials) {
+ this.updateById(ywMaterial);
+ }
+ }
+
+ @Override
+ public void updateStatus(YwMaterial ywMaterials) {
+ if(Objects.isNull(ywMaterials)
+ || Objects.isNull(ywMaterials.getId())
+ || Objects.isNull(ywMaterials.getStatus())){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ ywMaterialMapper.update(new UpdateWrapper<YwMaterial>().lambda().eq(YwMaterial::getId,ywMaterials.getId()).set(YwMaterial::getStatus,ywMaterials.getStatus()));
+ }
+
+ @Override
+ public YwMaterial findById(Integer id) {
+ return ywMaterialMapper.selectById(id);
+ }
+
+ @Override
+ public YwMaterial getDetail(Integer id) {
+ YwMaterial ywMaterial = ywMaterialMapper.selectById(id);
+ if(Objects.isNull(ywMaterial)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY);
+ }
+ Multifile multifile = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda().eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.MATERIAL_FILE.getKey()));
+ if(Objects.nonNull(multifile)){
+ String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode()
+ +systemDictDataBiz.queryByCode(Constants.FTP,Constants.YW_CONTRACT_BILL).getCode();
+ multifile.setFileurlFull(path + multifile.getFileurl());
+ ywMaterial.setMultifile(multifile);
+ }
+ return ywMaterial;
+ }
+
+ @Override
+ public YwMaterial findOne(YwMaterial ywMaterial) {
+ QueryWrapper<YwMaterial> wrapper = new QueryWrapper<>(ywMaterial);
+ return ywMaterialMapper.selectOne(wrapper);
+ }
+
+ @Override
+ public List<YwMaterial> findList(YwMaterial ywMaterial) {
+ QueryWrapper<YwMaterial> wrapper = new QueryWrapper<>(ywMaterial);
+ return ywMaterialMapper.selectList(wrapper);
+ }
+
+ @Override
+ public PageData<YwMaterial> findPage(PageWrap<YwMaterial> pageWrap) {
+ IPage<YwMaterial> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
+ MPJLambdaWrapper<YwMaterial> queryWrapper = new MPJLambdaWrapper<>();
+ Utils.MP.blankToNull(pageWrap.getModel());
+ YwMaterial model = pageWrap.getModel();
+ queryWrapper.selectAll(YwMaterial.class)
+ .leftJoin(YwRoom.class,YwRoom::getId,YwMaterial::getRoomId)
+ .and(StringUtils.isNotBlank(model.getCode()),i->i.like(YwMaterial::getCode,model.getCode()).or().like(YwMaterial::getName,model.getCode()))
+ .like(StringUtils.isNotBlank(model.getAttr()),YwMaterial::getAttr,model.getAttr())
+ .eq(Objects.nonNull(model.getProjectId()),YwRoom::getProjectId,model.getProjectId())
+ .eq(Objects.nonNull(model.getRoomId()),YwMaterial::getRoomId,model.getRoomId())
+ .eq(YwMaterial::getIsdeleted,Constants.ZERO)
+ .orderByAsc(YwMaterial::getCode)
+ ;
+
+ IPage iPage = ywMaterialMapper.selectJoinPage(page,YwMaterial.class,queryWrapper);
+ return PageData.from(iPage);
+ }
+
+ @Override
+ public long count(YwMaterial ywMaterial) {
+ QueryWrapper<YwMaterial> wrapper = new QueryWrapper<>(ywMaterial);
+ return ywMaterialMapper.selectCount(wrapper);
+ }
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwOutinboundRecordServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwOutinboundRecordServiceImpl.java
new file mode 100644
index 0000000..b839bc7
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwOutinboundRecordServiceImpl.java
@@ -0,0 +1,140 @@
+package com.doumee.service.business.impl;
+
+import com.doumee.core.constants.ResponseStatus;
+import com.doumee.core.exception.BusinessException;
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Constants;
+import com.doumee.core.utils.Utils;
+import com.doumee.dao.business.YwOutinboundRecordMapper;
+import com.doumee.dao.business.model.*;
+import com.doumee.dao.system.model.SystemUser;
+import com.doumee.service.business.YwOutinboundRecordService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 杩愮淮鍑哄叆搴撲俊鎭槑缁嗚〃Service瀹炵幇
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 14:28
+ */
+@Service
+public class YwOutinboundRecordServiceImpl implements YwOutinboundRecordService {
+
+ @Autowired
+ private YwOutinboundRecordMapper ywOutinboundRecordMapper;
+
+ @Override
+ public Integer create(YwOutinboundRecord ywOutinboundRecord) {
+ ywOutinboundRecordMapper.insert(ywOutinboundRecord);
+ return ywOutinboundRecord.getId();
+ }
+
+ @Override
+ public void deleteById(Integer id) {
+ ywOutinboundRecordMapper.deleteById(id);
+ }
+
+ @Override
+ public void delete(YwOutinboundRecord ywOutinboundRecord) {
+ UpdateWrapper<YwOutinboundRecord> deleteWrapper = new UpdateWrapper<>(ywOutinboundRecord);
+ ywOutinboundRecordMapper.delete(deleteWrapper);
+ }
+
+ @Override
+ public void deleteByIdInBatch(List<Integer> ids) {
+ if (CollectionUtils.isEmpty(ids)) {
+ return;
+ }
+ ywOutinboundRecordMapper.deleteBatchIds(ids);
+ }
+
+ @Override
+ public void updateById(YwOutinboundRecord ywOutinboundRecord) {
+ ywOutinboundRecordMapper.updateById(ywOutinboundRecord);
+ }
+
+ @Override
+ public void updateByIdInBatch(List<YwOutinboundRecord> ywOutinboundRecords) {
+ if (CollectionUtils.isEmpty(ywOutinboundRecords)) {
+ return;
+ }
+ for (YwOutinboundRecord ywOutinboundRecord: ywOutinboundRecords) {
+ this.updateById(ywOutinboundRecord);
+ }
+ }
+
+ @Override
+ public YwOutinboundRecord findById(Integer id) {
+ return ywOutinboundRecordMapper.selectById(id);
+ }
+
+ @Override
+ public YwOutinboundRecord findOne(YwOutinboundRecord ywOutinboundRecord) {
+ QueryWrapper<YwOutinboundRecord> wrapper = new QueryWrapper<>(ywOutinboundRecord);
+ return ywOutinboundRecordMapper.selectOne(wrapper);
+ }
+
+ @Override
+ public List<YwOutinboundRecord> findList(YwOutinboundRecord ywOutinboundRecord) {
+ QueryWrapper<YwOutinboundRecord> wrapper = new QueryWrapper<>(ywOutinboundRecord);
+ return ywOutinboundRecordMapper.selectList(wrapper);
+ }
+
+ @Override
+ public PageData<YwOutinboundRecord> findPage(PageWrap<YwOutinboundRecord> pageWrap) {
+ IPage<YwOutinboundRecord> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
+ MPJLambdaWrapper<YwOutinboundRecord> queryWrapper = new MPJLambdaWrapper<YwOutinboundRecord>();
+ Utils.MP.blankToNull(pageWrap.getModel());
+ YwOutinboundRecord model = pageWrap.getModel();
+ if(Objects.isNull(model)||Objects.isNull(model.getInOut())){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ List<Integer> typeList = Constants.ywOutInType.getAllTypeKey(model.getInOut());
+ queryWrapper.selectAll(YwOutinboundRecord.class)
+ .selectAs(SystemUser::getRealname,YwOutinboundRecord::getCreateUserName)
+ .selectAs(YwOutinbound::getCode,YwOutinboundRecord::getCode)
+ .selectAs(YwWarehouse::getName,YwOutinboundRecord::getWarehouseName)
+ .selectAs(YwMaterial::getCode,YwOutinboundRecord::getMaterialCode)
+ .selectAs(YwMaterial::getName,YwOutinboundRecord::getMaterialName)
+ .selectAs(YwMaterial::getQrcode,YwOutinboundRecord::getMaterialQrcode)
+ .selectAs(YwMaterial::getBrand,YwOutinboundRecord::getMaterialBrand)
+ .selectAs(YwMaterial::getUnitName,YwOutinboundRecord::getMaterialUnitName)
+ .select(" c.name ",YwOutinboundRecord::getCategoryParentName)
+ .select(" c1.name ",YwOutinboundRecord::getCategoryName)
+ .leftJoin(YwOutinbound.class,YwOutinbound::getId,YwOutinboundRecord::getOutInBoundId)
+ .leftJoin(SystemUser.class,SystemUser::getId,YwOutinbound::getCreator)
+ .leftJoin(YwWarehouse.class,YwWarehouse::getId,YwOutinbound::getWarehouseId)
+ .leftJoin(YwMaterial.class,YwMaterial::getId,YwOutinboundRecord::getMaterialId)
+ .leftJoin("category c on t4.PARENT_CATE_ID = c.id")
+ .leftJoin("category c1 on t4.CATE_ID = c1.id")
+ .like(StringUtils.isNotBlank(model.getCode()),YwOutinbound::getCode,model.getCode())
+ .like(StringUtils.isNotBlank(model.getMaterialCode()),YwMaterial::getCode,model.getMaterialCode())
+ .eq(Objects.nonNull(model.getWarehouseId()),YwOutinbound::getWarehouseId,model.getWarehouseId())
+ .in(Objects.nonNull(model.getInOut()),YwOutinbound::getType,typeList)
+ .ge(StringUtils.isNotBlank(model.getDoneDateStart()),YwOutinbound::getDoneDate,model.getDoneDateStart()+" 00:00:00")
+ .le(StringUtils.isNotBlank(model.getDoneDateEnd()),YwOutinbound::getDoneDate,model.getDoneDateEnd()+" 23:59:59")
+ .ge(StringUtils.isNotBlank(model.getCreateDateStart()),YwOutinbound::getCreateDate,model.getCreateDateStart()+" 00:00:00")
+ .le(StringUtils.isNotBlank(model.getCreateDateEnd()),YwOutinbound::getCreateDate,model.getCreateDateEnd()+" 23:59:59")
+ .orderByDesc(YwOutinbound::getCreateDate)
+ ;
+ IPage iPage = ywOutinboundRecordMapper.selectJoinPage(page,YwOutinboundRecord.class,queryWrapper);
+ return PageData.from(iPage);
+ }
+
+ @Override
+ public long count(YwOutinboundRecord ywOutinboundRecord) {
+ QueryWrapper<YwOutinboundRecord> wrapper = new QueryWrapper<>(ywOutinboundRecord);
+ return ywOutinboundRecordMapper.selectCount(wrapper);
+ }
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwOutinboundServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwOutinboundServiceImpl.java
new file mode 100644
index 0000000..21d53b2
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwOutinboundServiceImpl.java
@@ -0,0 +1,391 @@
+package com.doumee.service.business.impl;
+
+import com.alibaba.druid.sql.visitor.functions.Concat;
+import com.doumee.core.constants.ResponseStatus;
+import com.doumee.core.exception.BusinessException;
+import com.doumee.core.model.LoginUserInfo;
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Constants;
+import com.doumee.core.utils.DateUtil;
+import com.doumee.core.utils.Utils;
+import com.doumee.core.utils.redis.RedisUtil;
+import com.doumee.dao.business.*;
+import com.doumee.dao.business.model.*;
+import com.doumee.dao.system.model.SystemUser;
+import com.doumee.service.business.YwOutinboundService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 杩愮淮鍑哄叆搴撲俊鎭〃Service瀹炵幇
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Service
+public class YwOutinboundServiceImpl implements YwOutinboundService {
+
+ @Autowired
+ private YwOutinboundMapper ywOutinboundMapper;
+
+ @Autowired
+ private YwMaterialMapper ywMaterialMapper;
+
+ @Autowired
+ private YwOutinboundRecordMapper ywOutinboundRecordMapper;
+
+ @Autowired
+ private YwStockMapper ywStockMapper;
+
+ @Autowired
+ private YwWarehouseMapper ywWarehouseMapper;
+
+ @Autowired
+ private YwStocktakingMapper ywStocktakingMapper;
+
+ @Autowired
+ private RedisTemplate<String, Object> redisTemplate;
+
+ @Override
+ @Transactional(rollbackFor = {Exception.class, BusinessException.class})
+ public Integer create(YwOutinbound ywOutinbound) {
+ List<YwOutinboundRecord> recordList = this.verifyData(ywOutinbound);
+ YwWarehouse ywWarehouse = ywWarehouseMapper.selectById(ywOutinbound.getWarehouseId());
+ if(Objects.isNull(ywWarehouse)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌浠撳簱淇℃伅");
+ }
+ LoginUserInfo loginUserInfo = ywOutinbound.getLoginUserInfo();
+ //鏍规嵁鎿嶄綔绫诲瀷杩涜鍒ゆ柇鏄叆搴�/鍑哄簱
+ Constants.ywOutInType ywOutInType = Constants.ywOutInType.getYwOutInType(ywOutinbound.getType());
+ if(Objects.isNull(ywOutInType)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈尮閰嶅埌鍑哄叆搴撶被鍨�");
+ }
+ //鐢熸垚鍑哄叆搴撳崟鎹紪鍙�
+ ywOutinbound.setCode(getNextInOutCode(ywOutInType.getInOut()));
+ ywOutinbound.setCreator(loginUserInfo.getId());
+ ywOutinbound.setCreateDate(new Date());
+ ywOutinbound.setOrigin(Constants.ZERO);
+ ywOutinboundMapper.insert(ywOutinbound);
+ for (YwOutinboundRecord ywOutinboundRecord:recordList) {
+ ywOutinboundRecord.setCreator(loginUserInfo.getId());
+ ywOutinboundRecord.setCreateDate(new Date());
+ ywOutinboundRecord.setIsdeleted(Constants.ZERO);
+ }
+ ywOutinboundRecordMapper.insert(recordList);
+ //鏇存柊搴撳瓨淇℃伅
+ this.dealStockData(ywOutinbound,recordList,ywOutInType.getInOut());
+ return ywOutinbound.getId();
+ }
+
+
+ public List<YwOutinboundRecord> verifyData(YwOutinbound ywOutinbound){
+ if(Objects.isNull(ywOutinbound)
+ || Objects.isNull(ywOutinbound.getType())
+ || (Objects.nonNull(ywOutinbound.getType()) && (!(ywOutinbound.getType() == Constants.ZERO || ywOutinbound.getType() == Constants.ONE)))
+ || Objects.isNull(ywOutinbound.getWarehouseId())
+ || Objects.isNull(ywOutinbound.getDoneDate())
+ || com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(ywOutinbound.getRecordList())
+ ){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ List<YwOutinboundRecord> recordList = ywOutinbound.getRecordList();
+ for (YwOutinboundRecord ywOutinboundRecord:recordList) {
+ if(Objects.isNull(ywOutinboundRecord)
+ ||Objects.isNull(ywOutinboundRecord.getMaterialId())
+ ||Objects.isNull(ywOutinboundRecord.getStock())
+ ||ywOutinboundRecord.getStock().compareTo(BigDecimal.ZERO)<=Constants.ZERO
+ ){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ }
+ //鍒ゆ柇褰撳墠鏄惁瀛樺湪杩涜涓殑鐩樼偣鍗�
+ if(ywStocktakingMapper.selectCount(new QueryWrapper<YwStocktaking>().lambda().eq(YwStocktaking::getIsdeleted,Constants.ZERO)
+ .eq(YwStocktaking::getWarehouseId,ywOutinbound.getWarehouseId())
+ .eq(YwStocktaking::getStatus,Constants.ONE))>Constants.ZERO){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀛樺湪杩涜涓殑鐩樼偣鍗曪紝鏃犳硶杩涜鍑哄叆搴撴搷浣�");
+ };
+ //鍒ゆ柇鏄惁瀛樺湪鐩稿悓鏁版嵁
+ Set<Integer> materialIds = new HashSet<Integer>(recordList.stream().map(i->i.getMaterialId()).collect(Collectors.toList()));
+ if(materialIds.size() != recordList.size()){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀛樺湪鐩稿悓璧勪骇淇℃伅锛岃妫�鏌ユ暟鎹紒");
+ }
+ if(ywMaterialMapper.selectCount(new QueryWrapper<YwMaterial>().lambda().in(YwMaterial::getId,materialIds))!=recordList.size()){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"璧勪骇淇℃伅瀛樺湪寮傚父锛岃妫�鏌ユ暟鎹紒");
+ }
+ return recordList;
+ }
+
+ public void dealStockData(YwOutinbound ywOutinbound,List<YwOutinboundRecord> recordList,Integer inOut){
+ for (YwOutinboundRecord ywOutinboundRecord:recordList) {
+ YwStock ywStock = ywStockMapper.selectOne(new QueryWrapper<YwStock>().lambda().eq(YwStock::getIsdeleted,Constants.ZERO).eq(YwStock::getWarehouseId,ywOutinbound.getWarehouseId()).eq(YwStock::getMaterialId,ywOutinboundRecord.getMaterialId()));
+ if(Constants.equalsInteger(inOut,Constants.ZERO)){
+ //鍏ュ簱
+ if(Objects.isNull(ywStock)){
+ ywStock.setStock(ywOutinboundRecord.getStock());
+ ywStock.setWarehouseId(ywOutinbound.getWarehouseId());
+ ywStock.setMaterialId(ywOutinboundRecord.getMaterialId());
+ ywStock.setCreateDate(new Date());
+ ywStock.setCreator(ywOutinbound.getCreator());
+ ywStockMapper.insert(ywStock);
+ }else{
+ ywStockMapper.update(new UpdateWrapper<YwStock>().lambda()
+ .set(YwStock::getStock," ( stock + " + ywStock.getStock() + " )")
+ .set(YwStock::getEditDate, DateUtil.getCurrDateTime())
+ .set(YwStock::getEditor, ywOutinbound.getCreator())
+ .eq(YwStock::getId,ywStock.getId())
+ );
+ }
+ }else{
+ YwMaterial ywMaterial = ywMaterialMapper.selectById(ywOutinboundRecord.getMaterialId());
+ //鍑哄簱
+ if(Objects.isNull(ywStock) || ywStock.getStock().compareTo(ywOutinboundRecord.getStock()) < Constants.ZERO){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), ywMaterial.getName() + "搴撳瓨涓嶈冻锛岃鍒锋柊閲嶈瘯");
+ }else if(ywStock.getStock().compareTo(ywOutinboundRecord.getStock()) == Constants.ZERO){
+ ywStockMapper.deleteById(ywStock.getId());
+ }else{
+ ywStockMapper.update(new UpdateWrapper<YwStock>().lambda()
+ .set(YwStock::getStock," ( stock - " + ywStock.getStock() + " )")
+ .set(YwStock::getEditDate, DateUtil.getCurrDateTime())
+ .set(YwStock::getEditor, ywOutinbound.getCreator())
+ .eq(YwStock::getId,ywStock.getId())
+ );
+ }
+ }
+ }
+ }
+
+ @Override
+ public void deleteById(Integer id) {
+ ywOutinboundMapper.deleteById(id);
+ }
+
+ @Override
+ public void delete(YwOutinbound ywOutinbound) {
+ UpdateWrapper<YwOutinbound> deleteWrapper = new UpdateWrapper<>(ywOutinbound);
+ ywOutinboundMapper.delete(deleteWrapper);
+ }
+
+ @Override
+ public void deleteByIdInBatch(List<Integer> ids) {
+ if (CollectionUtils.isEmpty(ids)) {
+ return;
+ }
+ ywOutinboundMapper.deleteBatchIds(ids);
+ }
+
+ @Override
+ public void updateById(YwOutinbound ywOutinbound) {
+ ywOutinboundMapper.updateById(ywOutinbound);
+ }
+
+ @Override
+ public void updateByIdInBatch(List<YwOutinbound> ywOutinbounds) {
+ if (CollectionUtils.isEmpty(ywOutinbounds)) {
+ return;
+ }
+ for (YwOutinbound ywOutinbound: ywOutinbounds) {
+ this.updateById(ywOutinbound);
+ }
+ }
+
+ @Override
+ public YwOutinbound findById(Integer id) {
+ return ywOutinboundMapper.selectById(id);
+ }
+
+ @Override
+ public YwOutinbound findOne(YwOutinbound ywOutinbound) {
+ QueryWrapper<YwOutinbound> wrapper = new QueryWrapper<>(ywOutinbound);
+ return ywOutinboundMapper.selectOne(wrapper);
+ }
+
+ @Override
+ public List<YwOutinbound> findList(YwOutinbound ywOutinbound) {
+ QueryWrapper<YwOutinbound> wrapper = new QueryWrapper<>(ywOutinbound);
+ return ywOutinboundMapper.selectList(wrapper);
+ }
+
+ @Override
+ public YwOutinbound getDetail(Integer id) {
+ MPJLambdaWrapper<YwOutinbound> queryWrapper = new MPJLambdaWrapper<YwOutinbound>();
+ queryWrapper.selectAll(YwOutinbound.class)
+ .selectAs(SystemUser::getRealname,YwOutinbound::getCreateUserName)
+ .selectAs(YwWarehouse::getName,YwOutinbound::getWarehouseName)
+ .leftJoin(SystemUser.class,SystemUser::getId,YwOutinbound::getCreator)
+ .leftJoin(YwWarehouse.class,YwWarehouse::getId,YwOutinbound::getWarehouseId)
+ .eq(YwOutinbound::getId,id)
+ .last(" limit 1");
+ YwOutinbound ywOutinbound = ywOutinboundMapper.selectJoinOne(YwOutinbound.class,queryWrapper);
+ List<Integer> idList = new ArrayList<>();
+ idList.add(id);
+ ywOutinbound.setRecordList(this.getRecordDetailData(idList));
+ return ywOutinbound;
+ }
+
+
+ @Override
+ public PageData<YwOutinbound> findPage(PageWrap<YwOutinbound> pageWrap) {
+ IPage<YwOutinbound> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
+ MPJLambdaWrapper<YwOutinbound> queryWrapper = new MPJLambdaWrapper<YwOutinbound>();
+ Utils.MP.blankToNull(pageWrap.getModel());
+ YwOutinbound model = pageWrap.getModel();
+ if(Objects.isNull(model)||Objects.isNull(model.getInOut())){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ List<Integer> typeList = Constants.ywOutInType.getAllTypeKey(model.getInOut());
+ queryWrapper.selectAll(YwOutinbound.class)
+ .selectAs(SystemUser::getRealname,YwOutinbound::getCreateUserName)
+ .selectAs(YwWarehouse::getName,YwOutinbound::getWarehouseName)
+ .leftJoin(SystemUser.class,SystemUser::getId,YwOutinbound::getCreator)
+ .leftJoin(YwWarehouse.class,YwWarehouse::getId,YwOutinbound::getWarehouseId)
+ .like(StringUtils.isNotBlank(model.getCode()),YwOutinbound::getCode,model.getCode())
+ .eq(Objects.nonNull(model.getType()),YwOutinbound::getType,model.getType())
+ .eq(Objects.nonNull(model.getWarehouseId()),YwOutinbound::getWarehouseId,model.getWarehouseId())
+ .in(Objects.nonNull(model.getInOut()),YwOutinbound::getType,typeList)
+ ;
+ for(PageWrap.SortData sortData: pageWrap.getSorts()) {
+ if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
+ queryWrapper.orderByDesc(sortData.getProperty());
+ } else {
+ queryWrapper.orderByAsc(sortData.getProperty());
+ }
+ }
+ IPage iPage = ywOutinboundMapper.selectJoinPage(page,YwOutinbound.class,queryWrapper);
+ if(Objects.nonNull(iPage.getRecords())){
+ iPage.setRecords(this.getDetailData(iPage.getRecords()));
+ }
+ return PageData.from(iPage);
+ }
+
+ public List<YwOutinbound> getDetailData(List<YwOutinbound> ywOutinboundList){
+ List<Integer> idList = ywOutinboundList.stream().map(i->i.getId()).collect(Collectors.toList());
+ if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(idList)){
+ List<YwOutinboundRecord> ywOutinboundRecordList = this.getRecordDetailData(idList);
+ if(CollectionUtils.isEmpty(ywOutinboundRecordList)){
+ return ywOutinboundList;
+ }
+ for (YwOutinbound ywOutinbound:ywOutinboundList) {
+ ywOutinbound.setRecordList(
+ ywOutinboundRecordList.stream().filter(i->Constants.equalsInteger(i.getOutInBoundId(),ywOutinbound.getId())).collect(Collectors.toList())
+ );
+ }
+ }
+ return ywOutinboundList;
+ }
+
+
+ public List<YwOutinboundRecord> getRecordDetailData(List<Integer> outinBoundIdList){
+ List<YwOutinboundRecord> ywOutinboundRecordList = ywOutinboundRecordMapper.selectJoinList(YwOutinboundRecord.class,
+ new MPJLambdaWrapper<YwOutinboundRecord>()
+ .selectAll(YwOutinboundRecord.class)
+ .selectAs(YwMaterial::getCode,YwOutinboundRecord::getMaterialCode)
+ .selectAs(YwMaterial::getName,YwOutinboundRecord::getMaterialName)
+ .selectAs(YwMaterial::getQrcode,YwOutinboundRecord::getMaterialQrcode)
+ .selectAs(YwMaterial::getBrand,YwOutinboundRecord::getMaterialBrand)
+ .selectAs(YwMaterial::getUnitName,YwOutinboundRecord::getMaterialUnitName)
+ .leftJoin(YwMaterial.class,YwMaterial::getId,YwOutinboundRecord::getMaterialId)
+ .eq(YwOutinboundRecord::getIsdeleted,Constants.ZERO)
+ .in(YwOutinboundRecord::getOutInBoundId,outinBoundIdList)
+ );
+ return ywOutinboundRecordList;
+ }
+
+
+// @Override
+// public PageData<YwOutinbound> findPage(PageWrap<YwOutinbound> pageWrap) {
+// IPage<YwOutinbound> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
+//
+// QueryWrapper<YwOutinbound> queryWrapper = new QueryWrapper<>();
+// Utils.MP.blankToNull(pageWrap.getModel());
+// if (pageWrap.getModel().getId() != null) {
+// queryWrapper.lambda().eq(YwOutinbound::getId, pageWrap.getModel().getId());
+// }
+// if (pageWrap.getModel().getCreator() != null) {
+// queryWrapper.lambda().eq(YwOutinbound::getCreator, pageWrap.getModel().getCreator());
+// }
+// if (pageWrap.getModel().getCreateDate() != null) {
+// queryWrapper.lambda().ge(YwOutinbound::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate()));
+// queryWrapper.lambda().le(YwOutinbound::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate()));
+// }
+// if (pageWrap.getModel().getEditor() != null) {
+// queryWrapper.lambda().eq(YwOutinbound::getEditor, pageWrap.getModel().getEditor());
+// }
+// if (pageWrap.getModel().getEditDate() != null) {
+// queryWrapper.lambda().ge(YwOutinbound::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate()));
+// queryWrapper.lambda().le(YwOutinbound::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate()));
+// }
+// if (pageWrap.getModel().getIsdeleted() != null) {
+// queryWrapper.lambda().eq(YwOutinbound::getIsdeleted, pageWrap.getModel().getIsdeleted());
+// }
+// if (pageWrap.getModel().getRemark() != null) {
+// queryWrapper.lambda().eq(YwOutinbound::getRemark, pageWrap.getModel().getRemark());
+// }
+// if (pageWrap.getModel().getWarehouseId() != null) {
+// queryWrapper.lambda().eq(YwOutinbound::getWarehouseId, pageWrap.getModel().getWarehouseId());
+// }
+// if (pageWrap.getModel().getMaterialId() != null) {
+// queryWrapper.lambda().eq(YwOutinbound::getMaterialId, pageWrap.getModel().getMaterialId());
+// }
+// if (pageWrap.getModel().getStock() != null) {
+// queryWrapper.lambda().eq(YwOutinbound::getStock, pageWrap.getModel().getStock());
+// }
+// if (pageWrap.getModel().getType() != null) {
+// queryWrapper.lambda().eq(YwOutinbound::getType, pageWrap.getModel().getType());
+// }
+// if (pageWrap.getModel().getOrigin() != null) {
+// queryWrapper.lambda().eq(YwOutinbound::getOrigin, pageWrap.getModel().getOrigin());
+// }
+// if (pageWrap.getModel().getContent() != null) {
+// queryWrapper.lambda().eq(YwOutinbound::getContent, pageWrap.getModel().getContent());
+// }
+// if (pageWrap.getModel().getDoneDate() != null) {
+// queryWrapper.lambda().ge(YwOutinbound::getDoneDate, Utils.Date.getStart(pageWrap.getModel().getDoneDate()));
+// queryWrapper.lambda().le(YwOutinbound::getDoneDate, Utils.Date.getEnd(pageWrap.getModel().getDoneDate()));
+// }
+// if (pageWrap.getModel().getStatus() != null) {
+// queryWrapper.lambda().eq(YwOutinbound::getStatus, pageWrap.getModel().getStatus());
+// }
+// for(PageWrap.SortData sortData: pageWrap.getSorts()) {
+// if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
+// queryWrapper.orderByDesc(sortData.getProperty());
+// } else {
+// queryWrapper.orderByAsc(sortData.getProperty());
+// }
+// }
+// return PageData.from(ywOutinboundMapper.selectPage(page, queryWrapper));
+// }
+
+ @Override
+ public long count(YwOutinbound ywOutinbound) {
+ QueryWrapper<YwOutinbound> wrapper = new QueryWrapper<>(ywOutinbound);
+ return ywOutinboundMapper.selectCount(wrapper);
+ }
+
+
+ public synchronized String getNextInOutCode(Integer inOut){
+ String prefix = Constants.equalsInteger(inOut,0)?"RK-":"CK-" + DateUtil.getDate(new Date(),"yyyyMMdd") +"-";
+ Integer countNum = RedisUtil.getObject(redisTemplate,
+ Constants.equalsInteger(inOut,0)?Constants.RedisKeys.COM_OUTBOUND_OUT_KEY:Constants.RedisKeys.COM_OUTBOUND_IN_KEY,
+ Integer.class);
+ countNum = Constants.formatIntegerNum(countNum)+1;
+ //鏇存柊缂撳瓨
+ RedisUtil.addObject(redisTemplate,Constants.equalsInteger(inOut,0)?Constants.RedisKeys.COM_OUTBOUND_OUT_KEY:Constants.RedisKeys.COM_OUTBOUND_IN_KEY,countNum);
+ String nextIndex =Integer.toString( countNum );
+ return prefix + StringUtils.leftPad(nextIndex,4,"0");
+ }
+
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwProblemServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwProblemServiceImpl.java
new file mode 100644
index 0000000..5ee8050
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwProblemServiceImpl.java
@@ -0,0 +1,212 @@
+package com.doumee.service.business.impl;
+
+import com.doumee.core.constants.ResponseStatus;
+import com.doumee.core.exception.BusinessException;
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Constants;
+import com.doumee.core.utils.Utils;
+import com.doumee.dao.business.YwProblemMapper;
+import com.doumee.dao.business.model.YwProblem;
+import com.doumee.dao.system.MultifileMapper;
+import com.doumee.dao.system.model.Multifile;
+import com.doumee.service.business.YwProblemService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 杩愮淮闂涓婃姤淇℃伅琛⊿ervice瀹炵幇
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Service
+public class YwProblemServiceImpl implements YwProblemService {
+
+ @Autowired
+ private YwProblemMapper ywProblemMapper;
+
+ @Autowired
+ private MultifileMapper multifileMapper;
+
+ @Override
+ public Integer create(YwProblem ywProblem) {
+ if(Objects.isNull(ywProblem)
+ || Objects.isNull(ywProblem.getSubmitDate())
+ || StringUtils.isBlank(ywProblem.getContent())
+ || StringUtils.isBlank(ywProblem.getPhone())
+ || StringUtils.isBlank(ywProblem.getName())
+ ){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ ywProblem.setCreateDate(new Date());
+ ywProblem.setIsdeleted(Constants.ZERO);
+ ywProblem.setStatus(Constants.ZERO);
+ ywProblem.setDealStatus(Constants.ZERO);
+ ywProblemMapper.insert(ywProblem);
+
+ List<Multifile> fileList = new ArrayList<>();
+ if(ywProblem.getFileList()!=null && ywProblem.getFileList().size()>0){
+ for (int i = 0; i < ywProblem.getFileList().size(); i++) {
+ Multifile multifile = ywProblem.getFileList().get(i);
+ if(StringUtils.isBlank(multifile.getFileurl())){
+ continue;
+ }
+ multifile.setCreateDate(ywProblem.getCreateDate());
+ multifile.setIsdeleted(Constants.ZERO);
+ multifile.setObjId(ywProblem.getId());
+ multifile.setObjType(Constants.MultiFile.PROBLEM_FILE.getKey());
+ multifile.setSortnum(i+1);
+ fileList.add(multifile);
+ }
+ }
+ if(fileList.size()>0){
+ multifileMapper.insert(fileList);
+ }
+
+ return ywProblem.getId();
+ }
+
+ @Override
+ public void deleteById(Integer id) {
+ ywProblemMapper.deleteById(id);
+ }
+
+ @Override
+ public void delete(YwProblem ywProblem) {
+ UpdateWrapper<YwProblem> deleteWrapper = new UpdateWrapper<>(ywProblem);
+ ywProblemMapper.delete(deleteWrapper);
+ }
+
+ @Override
+ public void deleteByIdInBatch(List<Integer> ids) {
+ if (CollectionUtils.isEmpty(ids)) {
+ return;
+ }
+ ywProblemMapper.deleteBatchIds(ids);
+ }
+
+ @Override
+ public void updateById(YwProblem ywProblem) {
+ ywProblemMapper.updateById(ywProblem);
+ }
+
+ @Override
+ public void updateByIdInBatch(List<YwProblem> ywProblems) {
+ if (CollectionUtils.isEmpty(ywProblems)) {
+ return;
+ }
+ for (YwProblem ywProblem: ywProblems) {
+ this.updateById(ywProblem);
+ }
+ }
+
+ @Override
+ public YwProblem findById(Integer id) {
+ return ywProblemMapper.selectById(id);
+ }
+
+ @Override
+ public YwProblem findOne(YwProblem ywProblem) {
+ QueryWrapper<YwProblem> wrapper = new QueryWrapper<>(ywProblem);
+ return ywProblemMapper.selectOne(wrapper);
+ }
+
+ @Override
+ public List<YwProblem> findList(YwProblem ywProblem) {
+ QueryWrapper<YwProblem> wrapper = new QueryWrapper<>(ywProblem);
+ return ywProblemMapper.selectList(wrapper);
+ }
+
+ @Override
+ public PageData<YwProblem> findPage(PageWrap<YwProblem> pageWrap) {
+ IPage<YwProblem> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
+ QueryWrapper<YwProblem> queryWrapper = new QueryWrapper<>();
+ Utils.MP.blankToNull(pageWrap.getModel());
+ if (pageWrap.getModel().getId() != null) {
+ queryWrapper.lambda().eq(YwProblem::getId, pageWrap.getModel().getId());
+ }
+ if (pageWrap.getModel().getCreator() != null) {
+ queryWrapper.lambda().eq(YwProblem::getCreator, pageWrap.getModel().getCreator());
+ }
+ if (pageWrap.getModel().getCreateDate() != null) {
+ queryWrapper.lambda().ge(YwProblem::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate()));
+ queryWrapper.lambda().le(YwProblem::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate()));
+ }
+ if (pageWrap.getModel().getEditor() != null) {
+ queryWrapper.lambda().eq(YwProblem::getEditor, pageWrap.getModel().getEditor());
+ }
+ if (pageWrap.getModel().getEditDate() != null) {
+ queryWrapper.lambda().ge(YwProblem::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate()));
+ queryWrapper.lambda().le(YwProblem::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate()));
+ }
+ if (pageWrap.getModel().getIsdeleted() != null) {
+ queryWrapper.lambda().eq(YwProblem::getIsdeleted, pageWrap.getModel().getIsdeleted());
+ }
+ if (pageWrap.getModel().getPosition() != null) {
+ queryWrapper.lambda().eq(YwProblem::getPosition, pageWrap.getModel().getPosition());
+ }
+ if (pageWrap.getModel().getRemark() != null) {
+ queryWrapper.lambda().eq(YwProblem::getRemark, pageWrap.getModel().getRemark());
+ }
+ if (pageWrap.getModel().getStatus() != null) {
+ queryWrapper.lambda().eq(YwProblem::getStatus, pageWrap.getModel().getStatus());
+ }
+ if (pageWrap.getModel().getContent() != null) {
+ queryWrapper.lambda().eq(YwProblem::getContent, pageWrap.getModel().getContent());
+ }
+ if (pageWrap.getModel().getPhone() != null) {
+ queryWrapper.lambda().eq(YwProblem::getPhone, pageWrap.getModel().getPhone());
+ }
+ if (pageWrap.getModel().getSubmitDate() != null) {
+ queryWrapper.lambda().ge(YwProblem::getSubmitDate, Utils.Date.getStart(pageWrap.getModel().getSubmitDate()));
+ queryWrapper.lambda().le(YwProblem::getSubmitDate, Utils.Date.getEnd(pageWrap.getModel().getSubmitDate()));
+ }
+ if (pageWrap.getModel().getCode() != null) {
+ queryWrapper.lambda().eq(YwProblem::getCode, pageWrap.getModel().getCode());
+ }
+ if (pageWrap.getModel().getDealStatus() != null) {
+ queryWrapper.lambda().eq(YwProblem::getDealStatus, pageWrap.getModel().getDealStatus());
+ }
+ if (pageWrap.getModel().getDealUserId() != null) {
+ queryWrapper.lambda().eq(YwProblem::getDealUserId, pageWrap.getModel().getDealUserId());
+ }
+ if (pageWrap.getModel().getDealDate() != null) {
+ queryWrapper.lambda().ge(YwProblem::getDealDate, Utils.Date.getStart(pageWrap.getModel().getDealDate()));
+ queryWrapper.lambda().le(YwProblem::getDealDate, Utils.Date.getEnd(pageWrap.getModel().getDealDate()));
+ }
+ if (pageWrap.getModel().getDealInfo() != null) {
+ queryWrapper.lambda().eq(YwProblem::getDealInfo, pageWrap.getModel().getDealInfo());
+ }
+ if (pageWrap.getModel().getDealType() != null) {
+ queryWrapper.lambda().eq(YwProblem::getDealType, pageWrap.getModel().getDealType());
+ }
+ if (pageWrap.getModel().getWorkorderId() != null) {
+ queryWrapper.lambda().eq(YwProblem::getWorkorderId, pageWrap.getModel().getWorkorderId());
+ }
+ for(PageWrap.SortData sortData: pageWrap.getSorts()) {
+ if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
+ queryWrapper.orderByDesc(sortData.getProperty());
+ } else {
+ queryWrapper.orderByAsc(sortData.getProperty());
+ }
+ }
+ return PageData.from(ywProblemMapper.selectPage(page, queryWrapper));
+ }
+
+ @Override
+ public long count(YwProblem ywProblem) {
+ QueryWrapper<YwProblem> wrapper = new QueryWrapper<>(ywProblem);
+ return ywProblemMapper.selectCount(wrapper);
+ }
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStockServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStockServiceImpl.java
new file mode 100644
index 0000000..628057e
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStockServiceImpl.java
@@ -0,0 +1,129 @@
+package com.doumee.service.business.impl;
+
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Utils;
+import com.doumee.dao.business.YwStockMapper;
+import com.doumee.dao.business.model.*;
+import com.doumee.dao.system.model.SystemUser;
+import com.doumee.service.business.YwStockService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 杩愮淮搴撳瓨淇℃伅琛⊿ervice瀹炵幇
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Service
+public class YwStockServiceImpl implements YwStockService {
+
+ @Autowired
+ private YwStockMapper ywStockMapper;
+
+ @Override
+ public Integer create(YwStock ywStock) {
+ ywStockMapper.insert(ywStock);
+ return ywStock.getId();
+ }
+
+ @Override
+ public void deleteById(Integer id) {
+ ywStockMapper.deleteById(id);
+ }
+
+ @Override
+ public void delete(YwStock ywStock) {
+ UpdateWrapper<YwStock> deleteWrapper = new UpdateWrapper<>(ywStock);
+ ywStockMapper.delete(deleteWrapper);
+ }
+
+ @Override
+ public void deleteByIdInBatch(List<Integer> ids) {
+ if (CollectionUtils.isEmpty(ids)) {
+ return;
+ }
+ ywStockMapper.deleteBatchIds(ids);
+ }
+
+ @Override
+ public void updateById(YwStock ywStock) {
+ ywStockMapper.updateById(ywStock);
+ }
+
+ @Override
+ public void updateByIdInBatch(List<YwStock> ywStocks) {
+ if (CollectionUtils.isEmpty(ywStocks)) {
+ return;
+ }
+ for (YwStock ywStock: ywStocks) {
+ this.updateById(ywStock);
+ }
+ }
+
+ @Override
+ public YwStock findById(Integer id) {
+ return ywStockMapper.selectById(id);
+ }
+
+ @Override
+ public YwStock findOne(YwStock ywStock) {
+ QueryWrapper<YwStock> wrapper = new QueryWrapper<>(ywStock);
+ return ywStockMapper.selectOne(wrapper);
+ }
+
+ @Override
+ public List<YwStock> findList(YwStock ywStock) {
+ QueryWrapper<YwStock> wrapper = new QueryWrapper<>(ywStock);
+ return ywStockMapper.selectList(wrapper);
+ }
+
+ @Override
+ public PageData<YwStock> findPage(PageWrap<YwStock> pageWrap) {
+ IPage<YwStock> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
+ MPJLambdaWrapper<YwStock> queryWrapper = new MPJLambdaWrapper<YwStock>();
+ Utils.MP.blankToNull(pageWrap.getModel());
+ YwStock model = pageWrap.getModel();
+ queryWrapper.selectAll(YwStock.class)
+ .selectAs(YwWarehouse::getName,YwStock::getWarehouseName)
+ .selectAs(YwMaterial::getCode,YwStock::getMaterialCode)
+ .selectAs(YwMaterial::getName,YwStock::getMaterialName)
+ .selectAs(YwMaterial::getQrcode,YwStock::getMaterialQrcode)
+ .selectAs(YwMaterial::getBrand,YwStock::getMaterialBrand)
+ .selectAs(YwMaterial::getUnitName,YwStock::getMaterialUnitName)
+ .selectAs(YwMaterial::getAttr,YwStock::getMaterialAttr)
+ .leftJoin(YwWarehouse.class,YwWarehouse::getId,YwStock::getWarehouseId)
+ .leftJoin(YwMaterial.class,YwMaterial::getId,YwStock::getMaterialId)
+ .eq(Objects.nonNull(model.getWarehouseId()),YwOutinbound::getWarehouseId,model.getWarehouseId())
+ .and(StringUtils.isNotBlank(model.getMaterialCode()),i->i.like(YwMaterial::getName,model.getMaterialCode()).or().like(YwMaterial::getName,model.getMaterialCode()))
+ .like(StringUtils.isNotBlank(model.getMaterialCode()),YwMaterial::getCode,model.getMaterialCode())
+ .like(StringUtils.isNotBlank(model.getMaterialAttr()),YwMaterial::getAttr,model.getMaterialAttr())
+ .orderByAsc(YwMaterial::getCode)
+ ;
+ IPage iPage = ywStockMapper.selectJoinPage(page,YwStock.class,queryWrapper);
+ return PageData.from(iPage);
+ }
+
+
+
+
+
+
+
+
+ @Override
+ public long count(YwStock ywStock) {
+ QueryWrapper<YwStock> wrapper = new QueryWrapper<>(ywStock);
+ return ywStockMapper.selectCount(wrapper);
+ }
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStocktakingRecordServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStocktakingRecordServiceImpl.java
new file mode 100644
index 0000000..a03a028
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStocktakingRecordServiceImpl.java
@@ -0,0 +1,205 @@
+package com.doumee.service.business.impl;
+
+import com.doumee.core.constants.ResponseStatus;
+import com.doumee.core.exception.BusinessException;
+import com.doumee.core.model.LoginUserInfo;
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Constants;
+import com.doumee.core.utils.DateUtil;
+import com.doumee.core.utils.Utils;
+import com.doumee.dao.business.YwStocktakingMapper;
+import com.doumee.dao.business.YwStocktakingRecordMapper;
+import com.doumee.dao.business.model.*;
+import com.doumee.dao.system.model.SystemUser;
+import com.doumee.service.business.YwStocktakingRecordService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 杩愮淮鐩樼偣鏄庣粏璁板綍琛⊿ervice瀹炵幇
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Service
+public class YwStocktakingRecordServiceImpl implements YwStocktakingRecordService {
+
+ @Autowired
+ private YwStocktakingRecordMapper ywStocktakingRecordMapper;
+
+ @Autowired
+ private YwStocktakingMapper ywStocktakingMapper;
+
+
+ @Override
+ public Integer create(YwStocktakingRecord ywStocktakingRecord) {
+ ywStocktakingRecordMapper.insert(ywStocktakingRecord);
+ return ywStocktakingRecord.getId();
+ }
+
+ @Override
+ public void deleteById(Integer id) {
+ ywStocktakingRecordMapper.deleteById(id);
+ }
+
+ @Override
+ public void delete(YwStocktakingRecord ywStocktakingRecord) {
+ UpdateWrapper<YwStocktakingRecord> deleteWrapper = new UpdateWrapper<>(ywStocktakingRecord);
+ ywStocktakingRecordMapper.delete(deleteWrapper);
+ }
+
+ @Override
+ public void deleteByIdInBatch(List<Integer> ids) {
+ if (CollectionUtils.isEmpty(ids)) {
+ return;
+ }
+ ywStocktakingRecordMapper.deleteBatchIds(ids);
+ }
+
+ @Override
+ public void updateById(YwStocktakingRecord ywStocktakingRecord) {
+ ywStocktakingRecordMapper.updateById(ywStocktakingRecord);
+ }
+
+ @Override
+ public void updateByIdInBatch(List<YwStocktakingRecord> ywStocktakingRecords) {
+ if (CollectionUtils.isEmpty(ywStocktakingRecords)) {
+ return;
+ }
+ for (YwStocktakingRecord ywStocktakingRecord: ywStocktakingRecords) {
+ this.updateById(ywStocktakingRecord);
+ }
+ }
+
+ @Override
+ public YwStocktakingRecord findById(Integer id) {
+ return ywStocktakingRecordMapper.selectById(id);
+ }
+
+
+ @Override
+ public YwStocktakingRecord getDetail(Integer id) {
+ MPJLambdaWrapper<YwStocktakingRecord> queryWrapper = new MPJLambdaWrapper<>();
+ queryWrapper.selectAll(YwStocktakingRecord.class)
+ .selectAs(YwWarehouse::getName, YwStocktakingRecord::getWarehouseName)
+ .selectAs(YwMaterial::getCode,YwStocktakingRecord::getMaterialCode)
+ .selectAs(YwMaterial::getName,YwStocktakingRecord::getMaterialName)
+ .selectAs(YwMaterial::getQrcode,YwStocktakingRecord::getMaterialQrcode)
+ .selectAs(YwMaterial::getBrand,YwStocktakingRecord::getMaterialBrand)
+ .selectAs(YwMaterial::getUnitName,YwStocktakingRecord::getMaterialUnitName)
+ .selectAs(YwMaterial::getAttr,YwStocktakingRecord::getMaterialAttr)
+ .selectAs(Company::getName,YwStocktakingRecord::getCompanyName)
+ .selectAs(SystemUser::getRealname,YwStocktakingRecord::getUserName)
+ .leftJoin(YwStocktaking.class,YwStocktaking::getId,YwStocktakingRecord::getStocktakingId)
+ .leftJoin(YwWarehouse.class,YwWarehouse::getId,YwStocktaking::getWarehouseId)
+ .leftJoin(YwMaterial.class,YwMaterial::getId,YwStocktakingRecord::getMaterialId)
+ .leftJoin(SystemUser.class,SystemUser::getId,YwStocktakingRecord::getUserId)
+ .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId)
+ .eq(YwStocktakingRecord::getId,id)
+ .last(" limit 1 ");
+ ;
+ return ywStocktakingRecordMapper.selectOne(queryWrapper);
+ }
+
+ @Override
+ public YwStocktakingRecord findOne(YwStocktakingRecord ywStocktakingRecord) {
+ QueryWrapper<YwStocktakingRecord> wrapper = new QueryWrapper<>(ywStocktakingRecord);
+ return ywStocktakingRecordMapper.selectOne(wrapper);
+ }
+
+ @Override
+ public List<YwStocktakingRecord> findList(YwStocktakingRecord ywStocktakingRecord) {
+ QueryWrapper<YwStocktakingRecord> wrapper = new QueryWrapper<>(ywStocktakingRecord);
+ return ywStocktakingRecordMapper.selectList(wrapper);
+ }
+
+ @Override
+ public PageData<YwStocktakingRecord> findPage(PageWrap<YwStocktakingRecord> pageWrap) {
+ IPage<YwStocktakingRecord> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
+ MPJLambdaWrapper<YwStocktakingRecord> queryWrapper = new MPJLambdaWrapper<>();
+ Utils.MP.blankToNull(pageWrap.getModel());
+ YwStocktakingRecord model = pageWrap.getModel() ;
+ queryWrapper.selectAll(YwStocktakingRecord.class)
+ .selectAs(YwWarehouse::getName, YwStocktakingRecord::getWarehouseName)
+ .selectAs(YwMaterial::getCode,YwStocktakingRecord::getMaterialCode)
+ .selectAs(YwMaterial::getName,YwStocktakingRecord::getMaterialName)
+ .selectAs(YwMaterial::getQrcode,YwStocktakingRecord::getMaterialQrcode)
+ .selectAs(YwMaterial::getBrand,YwStocktakingRecord::getMaterialBrand)
+ .selectAs(YwMaterial::getUnitName,YwStocktakingRecord::getMaterialUnitName)
+ .selectAs(YwMaterial::getAttr,YwStocktakingRecord::getMaterialAttr)
+ .leftJoin(YwStocktaking.class,YwStocktaking::getId,YwStocktakingRecord::getStocktakingId)
+ .leftJoin(YwWarehouse.class,YwWarehouse::getId,YwStocktaking::getWarehouseId)
+ .leftJoin(YwMaterial.class,YwMaterial::getId,YwStocktakingRecord::getMaterialId)
+ .eq(Objects.nonNull(model.getStocktakingId()),YwStocktakingRecord::getStocktakingId,model.getStocktakingId())
+ .and(StringUtils.isNotBlank(model.getMaterialCode()),i->i.like(YwMaterial::getCode,model.getMaterialCode()).or().like(YwMaterial::getName,model.getMaterialCode()))
+ .eq(Objects.nonNull(model.getType()),YwStocktakingRecord::getType,model.getType())
+ .eq(Objects.nonNull(model.getStatus()),YwStocktakingRecord::getStatus,model.getStatus());
+ IPage iPage = ywStocktakingRecordMapper.selectJoinPage(page, YwStocktakingRecord.class,queryWrapper);
+ return PageData.from(iPage);
+ }
+
+ @Override
+ public long count(YwStocktakingRecord ywStocktakingRecord) {
+ QueryWrapper<YwStocktakingRecord> wrapper = new QueryWrapper<>(ywStocktakingRecord);
+ return ywStocktakingRecordMapper.selectCount(wrapper);
+ }
+
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public void takingData(YwStocktakingRecord ywStocktakingRecord) {
+ if(Objects.isNull(ywStocktakingRecord)
+ || Objects.isNull(ywStocktakingRecord.getId())
+ || Objects.isNull(ywStocktakingRecord.getActStock())
+ || ywStocktakingRecord.getActStock().compareTo(BigDecimal.ZERO) < 0
+ ){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ LoginUserInfo loginUserInfo = ywStocktakingRecord.getLoginUserInfo();
+ YwStocktakingRecord model = ywStocktakingRecordMapper.selectById(ywStocktakingRecord.getId());
+ if(Objects.nonNull(model)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY);
+ }
+ YwStocktaking ywStocktaking = ywStocktakingMapper.selectById(ywStocktakingRecord.getStocktakingId());
+ if(Objects.isNull(ywStocktaking)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY);
+ }
+ if(!Constants.equalsInteger(loginUserInfo.getId(),ywStocktaking.getUserId())){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炴偍鐨勭洏鐐瑰崟鏃犳硶杩涜鎿嶄綔");
+ }
+ if(!Constants.equalsInteger(ywStocktaking.getStatus(),Constants.ONE)){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鐩樼偣璁㈢姸鎬佸凡娴佽浆锛屾棤娉曡繘琛岃鎿嶄綔");
+ }
+ if(ywStocktakingRecord.getActStock().compareTo(model.getStock())==Constants.ZERO){
+ ywStocktakingRecord.setType(Constants.ZERO);
+ }else if(ywStocktakingRecord.getActStock().compareTo(model.getStock())>Constants.ZERO){
+ ywStocktakingRecord.setType(Constants.TWO);
+ }else{
+ ywStocktakingRecord.setType(Constants.ONE);
+ }
+ ywStocktakingRecordMapper.update(new UpdateWrapper<YwStocktakingRecord>().lambda()
+ .set(YwStocktakingRecord::getStatus,Constants.ONE)
+ .set(YwStocktakingRecord::getType,ywStocktakingRecord.getType())
+ .set(YwStocktakingRecord::getActStock,ywStocktakingRecord.getActStock())
+ .set(YwStocktakingRecord::getUserId,loginUserInfo.getId())
+ .set(YwStocktakingRecord::getPlanDate, DateUtil.getCurrDateTime())
+ .eq(YwStocktakingRecord::getId,ywStocktakingRecord.getId())
+ );
+
+
+
+ }
+
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStocktakingServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStocktakingServiceImpl.java
new file mode 100644
index 0000000..cd0e102
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStocktakingServiceImpl.java
@@ -0,0 +1,357 @@
+package com.doumee.service.business.impl;
+
+import com.doumee.core.constants.ResponseStatus;
+import com.doumee.core.exception.BusinessException;
+import com.doumee.core.model.LoginUserInfo;
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Constants;
+import com.doumee.core.utils.DateUtil;
+import com.doumee.core.utils.Utils;
+import com.doumee.core.utils.redis.RedisUtil;
+import com.doumee.dao.business.YwStockMapper;
+import com.doumee.dao.business.YwStocktakingMapper;
+import com.doumee.dao.business.YwStocktakingRecordMapper;
+import com.doumee.dao.business.YwWarehouseMapper;
+import com.doumee.dao.business.model.*;
+import com.doumee.service.business.YwStocktakingService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * 杩愮淮鐩樼偣淇℃伅琛⊿ervice瀹炵幇
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Service
+public class YwStocktakingServiceImpl implements YwStocktakingService {
+
+ @Autowired
+ private YwStocktakingMapper ywStocktakingMapper;
+
+ @Autowired
+ private YwStockMapper ywStockMapper;
+
+
+ @Autowired
+ private YwStocktakingRecordMapper ywStocktakingRecordMapper;
+
+ @Autowired
+ private YwWarehouseMapper ywWarehouseMapper;
+
+ @Autowired
+ private RedisTemplate<String, Object> redisTemplate;
+
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public Integer create(YwStocktaking ywStocktaking) {
+ if(Objects.isNull(ywStocktaking)
+ || StringUtils.isBlank(ywStocktaking.getName())
+ || Objects.isNull(ywStocktaking.getPlanDate())
+ || Objects.isNull(ywStocktaking.getWarehouseId())
+ || Objects.isNull(ywStocktaking.getUserId())
+ ){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ YwWarehouse ywWarehouse = ywWarehouseMapper.selectById(ywStocktaking.getWarehouseId());
+ if(Objects.isNull(ywWarehouse)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌浠撳簱鏁版嵁");
+ }
+ //鍒ゆ柇褰撳墠浠撳簱褰撳墠鏃ユ湡鏄惁瀛樺湪鐩樼偣鍗�
+ if(ywStocktakingMapper.selectCount(new QueryWrapper<YwStocktaking>().lambda().eq(YwStocktaking::getIsdeleted,Constants.ZERO).eq(YwStocktaking::getStatus,Constants.ZERO)
+ .eq(YwStocktaking::getWarehouseId,ywStocktaking.getWarehouseId()).apply(" DATE(PLAN_DATE) = '" + DateUtil.formatDate(ywStocktaking.getPlanDate(),"yyyy-MM-dd") +"'" ))>0){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"["+DateUtil.formatDate(ywStocktaking.getPlanDate(),"yyyy-MM-dd")+"]["+ywWarehouse.getName()+"]宸叉湁鐩樼偣鍗曪紝涓嶅彲閲嶅鍙戣捣鐩樼偣");
+ }
+ LoginUserInfo loginUserInfo = ywStocktaking.getLoginUserInfo();
+ ywStocktaking.setCreator(loginUserInfo.getId());
+ ywStocktaking.setCreateDate(new Date());
+ ywStocktaking.setIsdeleted(Constants.ZERO);
+ ywStocktaking.setStatus(Constants.ZERO);
+ ywStocktaking.setCode(getNextCode());
+ ywStocktakingMapper.insert(ywStocktaking);
+ return ywStocktaking.getId();
+ }
+
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public void deleteById(Integer id, LoginUserInfo loginUserInfo) {
+ YwStocktaking model = ywStocktakingMapper.selectById(id);
+ if(Objects.isNull(model)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌鐩樼偣鍗曟暟鎹�");
+ }
+ if(Constants.equalsInteger(model.getStatus(),Constants.ZERO)||Constants.equalsInteger(model.getStatus(),Constants.THREE)){
+ ywStocktakingMapper.update(new UpdateWrapper<YwStocktaking>().lambda()
+ .set(YwStocktaking::getIsdeleted,Constants.ONE)
+ .set(YwStocktaking::getEditDate,DateUtil.getCurrDateTime())
+ .set(YwStocktaking::getEditor,loginUserInfo.getId())
+ .eq(YwStocktaking::getId,id)
+ );
+ }else{
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鐩樼偣鍗曠姸鎬佸凡娴佽浆锛屾棤娉曡繘琛岃鎿嶄綔");
+ }
+ }
+
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public void cancelById(Integer id, LoginUserInfo loginUserInfo) {
+ YwStocktaking model = ywStocktakingMapper.selectById(id);
+ if(Objects.isNull(model)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌鐩樼偣鍗曟暟鎹�");
+ }
+ if(Constants.equalsInteger(model.getStatus(),Constants.ZERO)||Constants.equalsInteger(model.getStatus(),Constants.ONE)){
+ ywStocktakingMapper.update(new UpdateWrapper<YwStocktaking>().lambda()
+ .set(YwStocktaking::getEditDate,DateUtil.getCurrDateTime())
+ .set(YwStocktaking::getCancelDate,DateUtil.getCurrDateTime())
+ .set(YwStocktaking::getCancelUserId,loginUserInfo.getId())
+ .set(YwStocktaking::getEditor,loginUserInfo.getId())
+ .set(YwStocktaking::getStatus,Constants.THREE).eq(YwStocktaking::getId,id));
+ }else{
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鐩樼偣鍗曠姸鎬佸凡娴佽浆锛屾棤娉曡繘琛岃鎿嶄綔");
+ }
+ }
+
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public void beginById(Integer id, LoginUserInfo loginUserInfo) {
+ YwStocktaking model = ywStocktakingMapper.selectById(id);
+ if(Objects.isNull(model)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌鐩樼偣鍗曟暟鎹�");
+ }
+ if(model.getPlanDate().getTime()<System.currentTimeMillis()){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏈埌寮�濮嬫椂闂达紝鏃犳硶杩涜璇ユ搷浣�");
+ }
+ if(Constants.equalsInteger(model.getStatus(),Constants.ZERO)&&Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
+ ywStocktakingMapper.update(new UpdateWrapper<YwStocktaking>().lambda()
+ .set(YwStocktaking::getEditDate,DateUtil.getCurrDateTime())
+ .set(YwStocktaking::getDealDate,DateUtil.getCurrDateTime())
+ .set(YwStocktaking::getDealUserId,loginUserInfo.getId())
+ .set(YwStocktaking::getEditor,loginUserInfo.getId())
+ .set(YwStocktaking::getStatus,Constants.ONE)
+ .eq(YwStocktaking::getId,model.getId()));
+ //鐢熸垚褰撳墠浠撳簱涓嬫墍鏈夌殑璧勪骇淇℃伅
+ List<YwStock> stockList = ywStockMapper.selectList(new QueryWrapper<YwStock>().lambda().eq(YwStock::getIsdeleted,Constants.ZERO).eq(YwStock::getWarehouseId,model.getWarehouseId()));
+ if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(stockList)){
+ List<YwStocktakingRecord> ywStocktakingRecordList = new ArrayList<>();
+ for (YwStock ywStock:stockList) {
+ YwStocktakingRecord ywStocktakingRecord = new YwStocktakingRecord();
+ ywStocktakingRecord.setCreator(loginUserInfo.getId());
+ ywStocktakingRecord.setCreateDate(new Date());
+ ywStocktakingRecord.setIsdeleted(Constants.ZERO);
+ ywStocktakingRecord.setStatus(Constants.ZERO);
+ ywStocktakingRecord.setMaterialId(ywStock.getMaterialId());
+ ywStocktakingRecord.setStock(ywStock.getStock());
+ ywStocktakingRecord.setStocktakingId(model.getId());
+ ywStocktakingRecordList.add(ywStocktakingRecord);
+ }
+ ywStocktakingRecordMapper.insert(ywStocktakingRecordList);
+ }
+ }else{
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鐩樼偣鍗曠姸鎬佸凡娴佽浆锛屾棤娉曡繘琛岃鎿嶄綔");
+ }
+ }
+
+
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public void finishById(Integer id, LoginUserInfo loginUserInfo) {
+ YwStocktaking model = ywStocktakingMapper.selectById(id);
+ if(Objects.isNull(model)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌鐩樼偣鍗曟暟鎹�");
+ }
+ if(!Constants.equalsInteger(model.getStatus(),Constants.ONE)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鐩樼偣鍗曠姸鎬佸凡娴佽浆锛屾棤娉曡繘琛岃鎿嶄綔锛�");
+ }
+ if(!Constants.equalsInteger(loginUserInfo.getId(),model.getUserId())){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炴偍鐨勭洏鐐瑰崟鏃犳硶杩涜鎿嶄綔");
+ }
+ List<YwStocktakingRecord> recordList = ywStocktakingRecordMapper.selectList(new QueryWrapper<YwStocktakingRecord>().lambda()
+ .eq(YwStocktakingRecord::getStocktakingId,id).eq(YwStocktakingRecord::getIsdeleted,Constants.ZERO));
+ for (YwStocktakingRecord ywStocktakingRecord:recordList) {
+ //鎻愪氦鏃� 鏈繘琛岀洏鐐圭殑鏄庣粏鏁版嵁
+ if(Constants.equalsInteger(ywStocktakingRecord.getStatus(),Constants.ZERO)){
+ ywStocktakingRecordMapper.update(new UpdateWrapper<YwStocktakingRecord>().lambda()
+ .set(YwStocktakingRecord::getStatus,Constants.TWO)
+ .set(YwStocktakingRecord::getUserId,loginUserInfo.getId())
+ .eq(YwStocktakingRecord::getId,ywStocktakingRecord.getId())
+ );
+ }
+ //鏌ヨ搴撳瓨淇℃伅 杩涜搴撳瓨鏇存柊
+ YwStock ywStock = ywStockMapper.selectOne(new QueryWrapper<YwStock>().lambda().eq(YwStock::getMaterialId,ywStocktakingRecord.getMaterialId())
+ .eq(YwStock::getWarehouseId,model.getWarehouseId()).eq(YwStock::getStock,ywStocktakingRecord.getStock()));
+ if(Objects.isNull(ywStock)){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"搴撳瓨淇℃伅寮傚父锛岃鑱旂郴绠$悊鍛�");
+ }
+ if(ywStocktakingRecord.getActStock().compareTo(BigDecimal.ZERO)==Constants.ZERO){
+ ywStockMapper.deleteById(ywStock.getId());
+ }else {
+ ywStockMapper.update(new UpdateWrapper<YwStock>().lambda().set(YwStock::getStock,ywStocktakingRecord.getActStock()).eq(YwStock::getId,ywStock.getId()));
+ }
+ }
+ ywStocktakingMapper.update(new UpdateWrapper<YwStocktaking>().lambda()
+ .set(YwStocktaking::getEditDate,DateUtil.getCurrDateTime())
+ .set(YwStocktaking::getDoneDate,DateUtil.getCurrDateTime())
+ .set(YwStocktaking::getDoneUserId,loginUserInfo.getId())
+ .set(YwStocktaking::getEditor,loginUserInfo.getId())
+ .set(YwStocktaking::getStatus,Constants.TWO)
+ .eq(YwStocktaking::getId,model.getId()));
+
+ }
+
+ @Override
+ public void delete(YwStocktaking ywStocktaking) {
+ UpdateWrapper<YwStocktaking> deleteWrapper = new UpdateWrapper<>(ywStocktaking);
+ ywStocktakingMapper.delete(deleteWrapper);
+ }
+
+ @Override
+ public void deleteByIdInBatch(List<Integer> ids) {
+ if (CollectionUtils.isEmpty(ids)) {
+ return;
+ }
+ ywStocktakingMapper.deleteBatchIds(ids);
+ }
+
+ @Override
+ public void updateById(YwStocktaking ywStocktaking) {
+ if(Objects.isNull(ywStocktaking)
+ || StringUtils.isBlank(ywStocktaking.getName())
+ || Objects.isNull(ywStocktaking.getId())
+ || Objects.isNull(ywStocktaking.getPlanDate())
+ || Objects.isNull(ywStocktaking.getWarehouseId())
+ || Objects.isNull(ywStocktaking.getUserId())
+ ){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ YwStocktaking model = ywStocktakingMapper.selectById(ywStocktaking.getId());
+ if(Objects.isNull(model)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌鐩樼偣鍗曟暟鎹�");
+ }
+ YwWarehouse ywWarehouse = ywWarehouseMapper.selectById(ywStocktaking.getWarehouseId());
+ if(Objects.isNull(ywWarehouse)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌浠撳簱鏁版嵁");
+ }
+ //鍒ゆ柇褰撳墠浠撳簱褰撳墠鏃ユ湡鏄惁瀛樺湪鐩樼偣鍗�
+ if(ywStocktakingMapper.selectCount(new QueryWrapper<YwStocktaking>().lambda().ne(YwStocktaking::getId,ywStocktaking.getId()).eq(YwStocktaking::getIsdeleted,Constants.ZERO).eq(YwStocktaking::getStatus,Constants.ZERO)
+ .eq(YwStocktaking::getWarehouseId,ywStocktaking.getWarehouseId()).apply(" DATE(PLAN_DATE) = '" + DateUtil.formatDate(ywStocktaking.getPlanDate(),"yyyy-MM-dd") +"'" ))>0){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"["+DateUtil.formatDate(ywStocktaking.getPlanDate(),"yyyy-MM-dd")+"]["+ywWarehouse.getName()+"]宸叉湁鐩樼偣鍗曪紝涓嶅彲閲嶅鍙戣捣鐩樼偣");
+ }
+ LoginUserInfo loginUserInfo = ywStocktaking.getLoginUserInfo();
+ ywStocktaking.setEditor(loginUserInfo.getId());
+ ywStocktaking.setEditDate(new Date());
+ ywStocktaking.setCode(null);
+ ywStocktakingMapper.updateById(ywStocktaking);
+ }
+
+ @Override
+ public void updateByIdInBatch(List<YwStocktaking> ywStocktakings) {
+ if (CollectionUtils.isEmpty(ywStocktakings)) {
+ return;
+ }
+ for (YwStocktaking ywStocktaking: ywStocktakings) {
+ this.updateById(ywStocktaking);
+ }
+ }
+
+ @Override
+ public YwStocktaking findById(Integer id) {
+ return ywStocktakingMapper.selectById(id);
+ }
+
+ @Override
+ public YwStocktaking getDetail(Integer id) {
+ MPJLambdaWrapper<YwStocktaking> queryWrapper = new MPJLambdaWrapper<>();
+ queryWrapper.selectAll(YwStocktaking.class)
+ .select(" s.name ", YwStocktaking::getUserName)
+ .select(" s1.name ",YwStocktaking::getCreateName)
+ .selectAs(YwWarehouse::getName,YwStocktaking::getWarehouseName)
+ .leftJoin(YwWarehouse.class,YwWarehouse::getId,YwStocktaking::getWarehouseId)
+ .leftJoin("system_user s on t.user_id = s.id")
+ .leftJoin("system_user s1 on t.creator = s1.id")
+ .eq(YwStocktaking::getId,id)
+ .last("limit 1");
+ YwStocktaking ywStocktaking = ywStocktakingMapper.selectOne(queryWrapper);
+ List<YwStocktakingRecord> recordList = ywStocktakingRecordMapper.selectList(new QueryWrapper<YwStocktakingRecord>().lambda().eq(YwStocktakingRecord::getStocktakingId,id).eq(YwStocktakingRecord::getIsdeleted,Constants.ZERO));
+ if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(recordList)){
+ //鍚堣鐩樼偣鏁版嵁
+ ywStocktaking.setFinishAmount(recordList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ONE)).collect(Collectors.toList()).size());
+ ywStocktaking.setUnFinishAmount(recordList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ZERO)).collect(Collectors.toList()).size());
+ ywStocktaking.setEqualAmount(recordList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ONE)&&Constants.equalsInteger(i.getType(),Constants.ZERO)).collect(Collectors.toList()).size());
+ ywStocktaking.setLossAmount(recordList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ONE)&&Constants.equalsInteger(i.getType(),Constants.ONE)).collect(Collectors.toList()).size());
+ ywStocktaking.setProfitAmount(recordList.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.ONE)&&Constants.equalsInteger(i.getType(),Constants.TWO)).collect(Collectors.toList()).size());
+ }
+ return ywStocktaking;
+ }
+
+ @Override
+ public YwStocktaking findOne(YwStocktaking ywStocktaking) {
+ QueryWrapper<YwStocktaking> wrapper = new QueryWrapper<>(ywStocktaking);
+ return ywStocktakingMapper.selectOne(wrapper);
+ }
+
+ @Override
+ public List<YwStocktaking> findList(YwStocktaking ywStocktaking) {
+ QueryWrapper<YwStocktaking> wrapper = new QueryWrapper<>(ywStocktaking);
+ return ywStocktakingMapper.selectList(wrapper);
+ }
+
+ @Override
+ public PageData<YwStocktaking> findPage(PageWrap<YwStocktaking> pageWrap) {
+ IPage<YwStocktaking> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
+ MPJLambdaWrapper<YwStocktaking> queryWrapper = new MPJLambdaWrapper<>();
+ Utils.MP.blankToNull(pageWrap.getModel());
+ YwStocktaking model = pageWrap.getModel();
+ queryWrapper.selectAll(YwStocktaking.class)
+ .select(" s.name ", YwStocktaking::getUserName)
+ .select(" s1.name ",YwStocktaking::getCreateName)
+ .selectAs(YwWarehouse::getName,YwStocktaking::getWarehouseName)
+ .leftJoin(YwWarehouse.class,YwWarehouse::getId,YwStocktaking::getWarehouseId)
+ .leftJoin("system_user s on t.user_id = s.id")
+ .leftJoin("system_user s1 on t.creator = s1.id")
+ .eq(YwStocktaking::getIsdeleted,Constants.ZERO)
+ .like(StringUtils.isNotBlank(model.getName()),YwStocktaking::getName,model.getName())
+ .eq(Objects.nonNull(model.getStatus()),YwStocktaking::getStatus,model.getStatus())
+ .orderByAsc(YwStocktaking::getStatus)
+ .orderByDesc(YwStocktaking::getPlanDate)
+ ;
+
+ IPage iPage = ywStocktakingMapper.selectJoinPage(page, YwStocktaking.class,queryWrapper);
+ return PageData.from(iPage);
+ }
+
+ @Override
+ public long count(YwStocktaking ywStocktaking) {
+ QueryWrapper<YwStocktaking> wrapper = new QueryWrapper<>(ywStocktaking);
+ return ywStocktakingMapper.selectCount(wrapper);
+ }
+
+
+ public synchronized String getNextCode(){
+ String prefix = "PD-" + DateUtil.getDate(new Date(),"yyyyMMdd") +"-";
+ Integer countNum = RedisUtil.getObject(redisTemplate,
+ Constants.RedisKeys.COM_OUTBOUND_TAKING_KEY,
+ Integer.class);
+ countNum = Constants.formatIntegerNum(countNum)+1;
+ //鏇存柊缂撳瓨
+ RedisUtil.addObject(redisTemplate, Constants.RedisKeys.COM_OUTBOUND_TAKING_KEY,countNum);
+ String nextIndex =Integer.toString( countNum );
+ return prefix + org.apache.commons.lang3.StringUtils.leftPad(nextIndex,4,"0");
+ }
+
+
+}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwWarehouseServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwWarehouseServiceImpl.java
new file mode 100644
index 0000000..35a70ea
--- /dev/null
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwWarehouseServiceImpl.java
@@ -0,0 +1,239 @@
+package com.doumee.service.business.impl;
+
+import com.doumee.core.constants.ResponseStatus;
+import com.doumee.core.exception.BusinessException;
+import com.doumee.core.model.LoginUserInfo;
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Constants;
+import com.doumee.core.utils.DateUtil;
+import com.doumee.core.utils.Utils;
+import com.doumee.dao.business.YwStockMapper;
+import com.doumee.dao.business.YwWarehouseMapper;
+import com.doumee.dao.business.model.*;
+import com.doumee.dao.system.model.SystemUser;
+import com.doumee.service.business.YwWarehouseService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import lombok.extern.java.Log;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.util.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 杩愮淮浠撳簱淇℃伅琛⊿ervice瀹炵幇
+ * @author 姹熻箘韫�
+ * @date 2025/01/06 11:05
+ */
+@Service
+public class YwWarehouseServiceImpl implements YwWarehouseService {
+
+ @Autowired
+ private YwWarehouseMapper ywWarehouseMapper;
+
+ @Autowired
+ private YwStockMapper ywStockMapper;
+
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public Integer create(YwWarehouse ywWarehouse) {
+ if(Objects.isNull(ywWarehouse)
+ || StringUtils.isBlank(ywWarehouse.getName())
+ || Objects.isNull(ywWarehouse.getUserId())
+ || Objects.isNull(ywWarehouse.getStatus())
+ ){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ if(ywWarehouseMapper.selectCount(new QueryWrapper<YwWarehouse>().lambda().eq(YwWarehouse::getIsdeleted,Constants.ZERO).eq(YwWarehouse::getName,ywWarehouse.getName())) > Constants.ZERO){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"浠撳簱鍚嶇О宸插瓨鍦紒");
+ }
+ LoginUserInfo loginUserInfo = ywWarehouse.getLoginUserInfo();
+ ywWarehouse.setCreator(loginUserInfo.getId());
+ ywWarehouse.setCreateDate(new Date());
+ ywWarehouse.setIsdeleted(Constants.ZERO);
+ ywWarehouseMapper.insert(ywWarehouse);
+ return ywWarehouse.getId();
+ }
+
+ @Override
+ public void deleteById(Integer id, LoginUserInfo loginUserInfo) {
+ YwWarehouse ywWarehouse = ywWarehouseMapper.selectById(id);
+ if(Objects.isNull(ywWarehouse)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY);
+ }
+ //鍒ゆ柇鏁版嵁涓嬫槸鍚﹀瓨鍦ㄨ祫浜ф暟鎹�
+ if(ywStockMapper.selectCount(new QueryWrapper<YwStock>().lambda().eq(YwStock::getIsdeleted,Constants.ZERO)
+ .gt(YwStock::getStock,Constants.ZERO)
+ .eq(YwStock::getWarehouseId,ywWarehouse.getId()))>Constants.ZERO){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"褰撳墠浠撳簱鍐呮湁搴撳瓨鐨勮祫浜э紝涓嶅彲鍒犻櫎");
+ };
+ ywWarehouseMapper.update(new UpdateWrapper<YwWarehouse>().lambda()
+ .set(YwWarehouse::getEditDate, DateUtil.getCurrDateTime())
+ .set(YwWarehouse::getEditor, loginUserInfo.getId())
+ .set(YwWarehouse::getIsdeleted,Constants.ONE)
+ .eq(YwWarehouse::getId,ywWarehouse.getId()));
+ }
+
+ @Override
+ public void delete(YwWarehouse ywWarehouse) {
+ UpdateWrapper<YwWarehouse> deleteWrapper = new UpdateWrapper<>(ywWarehouse);
+ ywWarehouseMapper.delete(deleteWrapper);
+ }
+
+ @Override
+ public void deleteByIdInBatch(List<Integer> ids) {
+ if (CollectionUtils.isEmpty(ids)) {
+ return;
+ }
+ ywWarehouseMapper.deleteBatchIds(ids);
+ }
+
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public void updateById(YwWarehouse ywWarehouse) {
+ if(Objects.isNull(ywWarehouse)
+ || StringUtils.isBlank(ywWarehouse.getName())
+ || Objects.isNull(ywWarehouse.getUserId())
+ || Objects.isNull(ywWarehouse.getStatus())
+ || Objects.isNull(ywWarehouse.getId())
+ ){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST);
+ }
+ if(ywWarehouseMapper.selectCount(new QueryWrapper<YwWarehouse>().lambda().ne(YwWarehouse::getId,ywWarehouse.getId()).eq(YwWarehouse::getIsdeleted,Constants.ZERO).eq(YwWarehouse::getName,ywWarehouse.getName())) > Constants.ZERO){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"浠撳簱鍚嶇О宸插瓨鍦紒");
+ }
+ LoginUserInfo loginUserInfo = ywWarehouse.getLoginUserInfo();
+ ywWarehouse.setEditor(loginUserInfo.getId());
+ ywWarehouse.setEditDate(new Date());
+ ywWarehouse.setIsdeleted(Constants.ZERO);
+ ywWarehouseMapper.updateById(ywWarehouse);
+ }
+
+ @Override
+ public void updateByIdInBatch(List<YwWarehouse> ywWarehouses) {
+ if (CollectionUtils.isEmpty(ywWarehouses)) {
+ return;
+ }
+ for (YwWarehouse ywWarehouse: ywWarehouses) {
+ this.updateById(ywWarehouse);
+ }
+ }
+
+ @Override
+ public YwWarehouse findById(Integer id) {
+ return ywWarehouseMapper.selectById(id);
+ }
+
+ @Override
+ public YwWarehouse findOne(YwWarehouse ywWarehouse) {
+ QueryWrapper<YwWarehouse> wrapper = new QueryWrapper<>(ywWarehouse);
+ return ywWarehouseMapper.selectOne(wrapper);
+ }
+
+ @Override
+ public List<YwWarehouse> findList(YwWarehouse model) {
+ MPJLambdaWrapper<YwWarehouse> queryWrapper = new MPJLambdaWrapper<YwWarehouse>();
+ queryWrapper.selectAll(YwWarehouse.class)
+ .eq(Objects.nonNull(model.getStatus()),YwWarehouse::getStatus,model.getStatus())
+ .eq(YwWarehouse::getIsdeleted,Constants.ZERO)
+ .eq(YwWarehouse::getStatus,Constants.ZERO)
+ .orderByAsc(YwWarehouse::getSortnum)
+ ;
+ return ywWarehouseMapper.selectList(queryWrapper);
+ }
+
+ @Override
+ public PageData<YwWarehouse> findPage(PageWrap<YwWarehouse> pageWrap) {
+ IPage<YwWarehouse> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
+ MPJLambdaWrapper<YwWarehouse> queryWrapper = new MPJLambdaWrapper<YwWarehouse>();
+ Utils.MP.blankToNull(pageWrap.getModel());
+ YwWarehouse model = pageWrap.getModel();
+ queryWrapper.selectAll(YwWarehouse.class)
+ .selectAs(SystemUser::getRealname, YwWarehouse::getUserName)
+ .leftJoin(SystemUser.class,SystemUser::getId,YwWarehouse::getUserId)
+ .eq(Objects.nonNull(model.getStatus()),YwWarehouse::getStatus,model.getStatus())
+ .like(StringUtils.isNotBlank(model.getName()),YwWarehouse::getName,model.getName())
+ .eq(YwWarehouse::getIsdeleted,Constants.ZERO)
+ ;
+ for(PageWrap.SortData sortData: pageWrap.getSorts()) {
+ if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
+ queryWrapper.orderByDesc(sortData.getProperty());
+ } else {
+ queryWrapper.orderByAsc(sortData.getProperty());
+ }
+ }
+ IPage iPage = ywWarehouseMapper.selectJoinPage(page,YwWarehouse.class,queryWrapper);
+ return PageData.from(iPage);
+ }
+
+
+// @Override
+// public PageData<YwWarehouse> findPage(PageWrap<YwWarehouse> pageWrap) {
+// IPage<YwWarehouse> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
+// QueryWrapper<YwWarehouse> queryWrapper = new QueryWrapper<>();
+// Utils.MP.blankToNull(pageWrap.getModel());
+//
+// if (pageWrap.getModel().getId() != null) {
+// queryWrapper.lambda().eq(YwWarehouse::getId, pageWrap.getModel().getId());
+// }
+// if (pageWrap.getModel().getCreator() != null) {
+// queryWrapper.lambda().eq(YwWarehouse::getCreator, pageWrap.getModel().getCreator());
+// }
+// if (pageWrap.getModel().getCreateDate() != null) {
+// queryWrapper.lambda().ge(YwWarehouse::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate()));
+// queryWrapper.lambda().le(YwWarehouse::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate()));
+// }
+// if (pageWrap.getModel().getEditor() != null) {
+// queryWrapper.lambda().eq(YwWarehouse::getEditor, pageWrap.getModel().getEditor());
+// }
+// if (pageWrap.getModel().getEditDate() != null) {
+// queryWrapper.lambda().ge(YwWarehouse::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate()));
+// queryWrapper.lambda().le(YwWarehouse::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate()));
+// }
+// if (pageWrap.getModel().getRemark() != null) {
+// queryWrapper.lambda().eq(YwWarehouse::getRemark, pageWrap.getModel().getRemark());
+// }
+// if (pageWrap.getModel().getStatus() != null) {
+// queryWrapper.lambda().eq(YwWarehouse::getStatus, pageWrap.getModel().getStatus());
+// }
+// if (pageWrap.getModel().getName() != null) {
+// queryWrapper.lambda().like(YwWarehouse::getName, pageWrap.getModel().getName());
+// }
+// if (pageWrap.getModel().getPosition() != null) {
+// queryWrapper.lambda().eq(YwWarehouse::getPosition, pageWrap.getModel().getPosition());
+// }
+// if (pageWrap.getModel().getCode() != null) {
+// queryWrapper.lambda().eq(YwWarehouse::getCode, pageWrap.getModel().getCode());
+// }
+// if (pageWrap.getModel().getUserId() != null) {
+// queryWrapper.lambda().eq(YwWarehouse::getUserId, pageWrap.getModel().getUserId());
+// }
+// if (pageWrap.getModel().getSortnum() != null) {
+// queryWrapper.lambda().eq(YwWarehouse::getSortnum, pageWrap.getModel().getSortnum());
+// }
+// for(PageWrap.SortData sortData: pageWrap.getSorts()) {
+// if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
+// queryWrapper.orderByDesc(sortData.getProperty());
+// } else {
+// queryWrapper.orderByAsc(sortData.getProperty());
+// }
+// }
+// return PageData.from(ywWarehouseMapper.selectPage(page, queryWrapper));
+// }
+
+ @Override
+ public long count(YwWarehouse ywWarehouse) {
+ QueryWrapper<YwWarehouse> wrapper = new QueryWrapper<>(ywWarehouse);
+ return ywWarehouseMapper.selectCount(wrapper);
+ }
+}
--
Gitblit v1.9.3