MrShi
2025-01-08 cfbf7533b8cfc395a110390da23cf6bb641daff9
Merge branch '2.0.1' of http://139.186.142.91:10010/r/productDev/funingyunwei into 2.0.1
已添加47个文件
已修改4个文件
4676 ■■■■■ 文件已修改
server/db/business.yw_material.permissions.sql 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/db/business.yw_outinbound.permissions.sql 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/db/business.yw_outinbound_record.permissions.sql 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/db/business.yw_problem.permissions.sql 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/db/business.yw_stock.permissions.sql 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/db/business.yw_stocktaking.permissions.sql 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/db/business.yw_stocktaking_record.permissions.sql 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/db/business.yw_warehouse.permissions.sql 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/core/utils/Constants.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/dao/system/model/Multifile.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/admin_timer/src/main/java/com/doumee/api/YwTimerController.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwMaterialController.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwOutinboundController.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwProblemController.java 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStockController.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStocktakingController.java 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwStocktakingRecordController.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/YwWarehouseController.java 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwMaterialMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwOutinboundMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwOutinboundRecordMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwProblemMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStockMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStocktakingMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwStocktakingRecordMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/YwWarehouseMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Category.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwMaterial.java 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwOutinbound.java 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwOutinboundRecord.java 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwProblem.java 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStock.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStocktaking.java 181 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwStocktakingRecord.java 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/YwWarehouse.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwMaterialService.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwOutinboundRecordService.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwOutinboundService.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwProblemService.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStockService.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStocktakingRecordService.java 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwStocktakingService.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/YwWarehouseService.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwMaterialServiceImpl.java 237 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwOutinboundRecordServiceImpl.java 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwOutinboundServiceImpl.java 391 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwProblemServiceImpl.java 212 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStockServiceImpl.java 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStocktakingRecordServiceImpl.java 205 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwStocktakingServiceImpl.java 357 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwWarehouseServiceImpl.java 239 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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);
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);
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);
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);
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);
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);
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);
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);
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, "问题附件 ", "问题附件 "),
        ;
        // æˆå‘˜å˜é‡
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 = "文件地址")
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数据");
    }
}
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));
    }
}
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));
    }
}
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));
    }
}
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));
    }
}
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);
    }
}
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);
    }
}
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));
    }
}
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> {
}
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> {
}
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> {
}
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> {
}
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> {
}
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> {
}
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> {
}
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> {
}
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;
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;
}
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 = "物资编码(关联yw_material)", example = "1")
    @ExcelColumn(name="物资编码(关联yw_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正常", example = "1")
    @ExcelColumn(name="状态 0正常")
    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;
}
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 = "物资编码(关联yw_material)", example = "1")
    @ExcelColumn(name="物资编码(关联yw_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;
}
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 = "关联工单编码(关联yw_workorder)", example = "1")
    @ExcelColumn(name="关联工单编码(关联yw_workorder)")
    private Integer workorderId;
    @ApiModelProperty(value = "附件信息")
    @TableField(exist = false)
    private List<Multifile> fileList;
}
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 = "物资编码(关联yw_material)", example = "1")
    @ExcelColumn(name="物资编码(关联yw_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;
}
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;
}
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 = "物资编码(关联yw_material)", example = "1")
    @ExcelColumn(name="物资编码(关联yw_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;
}
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;
}
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;
/**
 * è¿ç»´èµ„产信息表Service定义
 * @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);
}
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);
}
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);
}
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;
/**
 * è¿ç»´é—®é¢˜ä¸ŠæŠ¥ä¿¡æ¯è¡¨Service定义
 * @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);
}
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;
/**
 * è¿ç»´åº“存信息表Service定义
 * @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);
}
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;
/**
 * è¿ç»´ç›˜ç‚¹æ˜Žç»†è®°å½•表Service定义
 * @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);
}
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;
/**
 * è¿ç»´ç›˜ç‚¹ä¿¡æ¯è¡¨Service定义
 * @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);
}
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;
/**
 * è¿ç»´ä»“库信息表Service定义
 * @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);
}
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;
/**
 * è¿ç»´èµ„产信息表Service实现
 * @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);
    }
}
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);
    }
}
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");
    }
}
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;
/**
 * è¿ç»´é—®é¢˜ä¸ŠæŠ¥ä¿¡æ¯è¡¨Service实现
 * @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);
    }
}
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;
/**
 * è¿ç»´åº“存信息表Service实现
 * @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);
    }
}
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;
/**
 * è¿ç»´ç›˜ç‚¹æ˜Žç»†è®°å½•表Service实现
 * @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())
        );
    }
}
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;
/**
 * è¿ç»´ç›˜ç‚¹ä¿¡æ¯è¡¨Service实现
 * @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");
    }
}
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;
/**
 * è¿ç»´ä»“库信息表Service实现
 * @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);
    }
}