From 9d2adb33c45bdcc6b2d2e94304923c8b90d894e9 Mon Sep 17 00:00:00 2001 From: "djz236@163.com" Date: Mon, 23 Oct 2023 21:39:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=96=9C=E7=9B=B8=E9=9A=8F?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/wh-manage-xxs/pom.xml | 122 +++ .../com/wh/WarehouseApplicationNoNacos.java | 42 + .../main/java/com/wh/aop/AOPException.java | 15 + .../java/com/wh/config/FileUploadConfig.java | 29 + .../java/com/wh/config/MyInterceptor.java | 16 + .../java/com/wh/config/MybatisPlusConfig.java | 67 ++ .../main/java/com/wh/config/WebMvcConfig.java | 36 + .../com/wh/controller/RightsController.java | 35 + .../com/wh/controller/UserController.java | 36 + .../com/wh/controller/UserInterceptor.java | 33 + .../api/input/InStoreHouseMainController.java | 76 ++ .../output/OutStorehouseMainController.java | 79 ++ .../api/prodstock/ProdStockController.java | 46 + .../controller/brandinfo/BrandInfoRest.java | 95 ++ .../controller/dictcommon/DictCommonRest.java | 92 ++ .../wh/controller/dicttype/DictTypeRest.java | 94 ++ .../wh/controller/entinfo/EntInfoRest.java | 103 +++ .../initial/LocationController.java | 93 ++ .../controller/initial/ProductController.java | 57 ++ .../initial/StorehouseController.java | 41 + .../initial/SupplierController.java | 60 ++ .../instorehouse/PurchaseController.java | 70 ++ .../instorehouse/ReceivingController.java | 52 ++ .../OutStorehouseController.java | 60 ++ .../outstorehouse/PickingController.java | 68 ++ .../purchasenew/PurchasenewController.java | 84 ++ .../PurchasenewProductController.java | 54 ++ .../shstorehouse/ShStorehouseRest.java | 246 ++++++ .../ShStorehouseAttachmentRest.java | 96 ++ .../ShStorehouseAttributeRest.java | 96 ++ .../wh/controller/stock/StockController.java | 26 + .../storehousemanage/PutInController.java | 54 ++ .../storehousemanage/RemoveController.java | 44 + .../storehousemanage/ShelvesController.java | 57 ++ .../StoreHouseProjectRest.java | 35 + .../wh/controller/sysuser/SysUserRest.java | 198 +++++ .../main/java/com/wh/mapper/RightsMapper.java | 7 + .../main/java/com/wh/mapper/UserMapper.java | 7 + .../InStorehouseListingMapper.java | 9 + .../instorehouse/InStorehouseMainMapper.java | 19 + .../OutStorehouseListingMapper.java | 13 + .../OutStorehouseMainMapper.java | 23 + .../mapper/api/prodstock/ProdStockMapper.java | 22 + .../wh/mapper/brandinfo/BrandInfoMapper.java | 69 ++ .../mapper/dictcommon/DictCommonMapper.java | 73 ++ .../wh/mapper/dicttype/DictTypeMapper.java | 65 ++ .../com/wh/mapper/entinfo/EntInfoMapper.java | 65 ++ .../com/wh/mapper/initial/LocationMapper.java | 15 + .../wh/mapper/initial/LocationTypeMapper.java | 7 + .../com/wh/mapper/initial/ProductMapper.java | 7 + .../wh/mapper/initial/StorehouseMapper.java | 7 + .../com/wh/mapper/initial/SupplierMapper.java | 12 + .../mapper/instorehouse/PurchaseMapper.java | 7 + .../wh/mapper/instorehouse/PutInMapper.java | 8 + .../mapper/instorehouse/ReceivingMapper.java | 7 + .../outstorehouse/OutStorehouseMapper.java | 7 + .../mapper/outstorehouse/PickingMapper.java | 7 + .../mapper/purchasenew/PurchasenewMapper.java | 76 ++ .../PurchasenewProductMapper.java | 73 ++ .../shstorehouse/ShStorehouseMapper.java | 75 ++ .../ShStorehouseAttachmentMapper.java | 68 ++ .../ShStorehouseAttributeMapper.java | 65 ++ .../java/com/wh/mapper/stock/StockMapper.java | 7 + .../mapper/storehousemanage/RemoveMapper.java | 7 + .../storehousemanage/ShelvesMapper.java | 7 + .../StoreHouseProjectMapper.java | 13 + .../com/wh/mapper/sysuser/SysUserMapper.java | 157 ++++ .../java/com/wh/service/RightsService.java | 9 + .../com/wh/service/RightsServiceImpl.java | 42 + .../main/java/com/wh/service/UserService.java | 7 + .../java/com/wh/service/UserServiceImpl.java | 28 + .../InStorehouseListingService.java | 48 + .../instorehouse/InStorehouseMainService.java | 499 +++++++++++ .../OutStorehouseListingService.java | 30 + .../OutStorehouseMainService.java | 299 +++++++ .../api/prodstock/ProdStockService.java | 127 +++ .../service/brandinfo/BrandInfoService.java | 113 +++ .../service/dictcommon/DictCommonService.java | 117 +++ .../wh/service/dicttype/DictTypeService.java | 102 +++ .../wh/service/entinfo/EntInfoService.java | 119 +++ .../wh/service/initial/LocationService.java | 29 + .../service/initial/LocationServiceImpl.java | 118 +++ .../wh/service/initial/ProductService.java | 48 + .../service/initial/ProductServiceImpl.java | 95 ++ .../wh/service/initial/StorehouseService.java | 14 + .../initial/StorehouseServiceImpl.java | 67 ++ .../wh/service/initial/SupplierService.java | 22 + .../service/initial/SupplierServiceImpl.java | 78 ++ .../service/instorehouse/PurchaseService.java | 25 + .../instorehouse/PurchaseServiceImpl.java | 84 ++ .../wh/service/instorehouse/PutInService.java | 20 + .../instorehouse/PutInServiceImpl.java | 220 +++++ .../instorehouse/ReceivingService.java | 19 + .../instorehouse/ReceivingServiceImpl.java | 132 +++ .../outstorehouse/OutStorehouseService.java | 20 + .../OutStorehouseServiceImpl.java | 157 ++++ .../service/outstorehouse/PickingService.java | 20 + .../outstorehouse/PickingServiceImpl.java | 108 +++ .../purchasenew/PurchasenewService.java | 226 +++++ .../PurchasenewProductService.java | 138 +++ .../shstorehouse/ShStorehouseService.java | 244 +++++ .../ShStorehouseAttachmentService.java | 120 +++ .../ShStorehouseAttributeService.java | 106 +++ .../com/wh/service/stock/StockService.java | 8 + .../wh/service/stock/StockServiceImpl.java | 29 + .../storehousemanage/RemoveService.java | 17 + .../storehousemanage/RemoveServiceImpl.java | 119 +++ .../storehousemanage/ShelvesService.java | 19 + .../storehousemanage/ShelvesServiceImpl.java | 295 +++++++ .../StoreHouseProjectService.java | 65 ++ .../wh/service/sysuser/SysUserService.java | 830 ++++++++++++++++++ .../src/main/resources/application-devv.yml | 24 + .../src/main/resources/application-pro.yml | 25 + .../src/main/resources/application-test.yml | 22 + .../src/main/resources/application.yml | 57 ++ .../src/main/resources/logback-spring.xml | 37 + .../resources/mappers/BrandInfoMapper.xml | 13 + .../resources/mappers/DictCommonMapper.xml | 13 + .../main/resources/mappers/DictTypeMapper.xml | 13 + .../main/resources/mappers/EntInfoMapper.xml | 13 + .../mappers/InStorehouseMainMapper.xml | 8 + .../mappers/OutStorehouseMainMapper.xml | 8 + .../resources/mappers/PurchasenewMapper.xml | 19 + .../mappers/PurchasenewProductMapper.xml | 13 + .../mappers/ShStorehouseAttachmentMapper.xml | 13 + .../mappers/ShStorehouseAttributeMapper.xml | 13 + .../resources/mappers/ShStorehouseMapper.xml | 22 + .../mappers/StoreHouseProjectMapper.xml | 15 + .../main/resources/mappers/SysUserMapper.xml | 397 +++++++++ .../src/main/resources/mappers/UserMapper.xml | 7 + .../wh-manage-xxs/src/test/java/Test01.java | 11 + 131 files changed, 9286 insertions(+) create mode 100644 warehousing-system/project/wh-manage-xxs/pom.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/WarehouseApplicationNoNacos.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/aop/AOPException.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/FileUploadConfig.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/MyInterceptor.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/MybatisPlusConfig.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/WebMvcConfig.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/RightsController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/UserController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/UserInterceptor.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/api/input/InStoreHouseMainController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/api/output/OutStorehouseMainController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/api/prodstock/ProdStockController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/brandinfo/BrandInfoRest.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/dictcommon/DictCommonRest.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/dicttype/DictTypeRest.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/entinfo/EntInfoRest.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/LocationController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/ProductController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/StorehouseController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/SupplierController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/instorehouse/PurchaseController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/instorehouse/ReceivingController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/outstorehouse/OutStorehouseController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/outstorehouse/PickingController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/purchasenew/PurchasenewController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/purchasenewproduct/PurchasenewProductController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/shstorehouse/ShStorehouseRest.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/shstorehouseattachment/ShStorehouseAttachmentRest.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/shstorehouseattribute/ShStorehouseAttributeRest.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/stock/StockController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehousemanage/PutInController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehousemanage/RemoveController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehousemanage/ShelvesController.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehouseproject/StoreHouseProjectRest.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/sysuser/SysUserRest.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/RightsMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/UserMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/instorehouse/InStorehouseListingMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/instorehouse/InStorehouseMainMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/outstorehouse/OutStorehouseListingMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/outstorehouse/OutStorehouseMainMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/prodstock/ProdStockMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/brandinfo/BrandInfoMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/dictcommon/DictCommonMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/dicttype/DictTypeMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/entinfo/EntInfoMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/LocationMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/LocationTypeMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/ProductMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/StorehouseMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/SupplierMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/instorehouse/PurchaseMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/instorehouse/PutInMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/instorehouse/ReceivingMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/outstorehouse/OutStorehouseMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/outstorehouse/PickingMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/purchasenew/PurchasenewMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/purchasenewproduct/PurchasenewProductMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/shstorehouse/ShStorehouseMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/shstorehouseattachment/ShStorehouseAttachmentMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/shstorehouseattribute/ShStorehouseAttributeMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/stock/StockMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/storehousemanage/RemoveMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/storehousemanage/ShelvesMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/storehouseproject/StoreHouseProjectMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/sysuser/SysUserMapper.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/RightsService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/RightsServiceImpl.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/UserService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/UserServiceImpl.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/instorehouse/InStorehouseListingService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/instorehouse/InStorehouseMainService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/outstorehouse/OutStorehouseListingService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/outstorehouse/OutStorehouseMainService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/prodstock/ProdStockService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/brandinfo/BrandInfoService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/dictcommon/DictCommonService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/dicttype/DictTypeService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/entinfo/EntInfoService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/LocationService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/LocationServiceImpl.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/ProductService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/ProductServiceImpl.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/StorehouseService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/StorehouseServiceImpl.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/SupplierService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/SupplierServiceImpl.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PurchaseService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PurchaseServiceImpl.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PutInService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PutInServiceImpl.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/ReceivingService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/ReceivingServiceImpl.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/OutStorehouseService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/OutStorehouseServiceImpl.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/PickingService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/PickingServiceImpl.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/purchasenew/PurchasenewService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/purchasenewproduct/PurchasenewProductService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/shstorehouse/ShStorehouseService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/shstorehouseattachment/ShStorehouseAttachmentService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/shstorehouseattribute/ShStorehouseAttributeService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/stock/StockService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/stock/StockServiceImpl.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/RemoveService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/RemoveServiceImpl.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/ShelvesService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/ShelvesServiceImpl.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehouseproject/StoreHouseProjectService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/sysuser/SysUserService.java create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/application-devv.yml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/application-pro.yml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/application-test.yml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/application.yml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/logback-spring.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/BrandInfoMapper.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/DictCommonMapper.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/DictTypeMapper.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/EntInfoMapper.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/InStorehouseMainMapper.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/OutStorehouseMainMapper.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/PurchasenewMapper.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/PurchasenewProductMapper.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/ShStorehouseAttachmentMapper.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/ShStorehouseAttributeMapper.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/ShStorehouseMapper.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/StoreHouseProjectMapper.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/SysUserMapper.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/UserMapper.xml create mode 100644 warehousing-system/project/wh-manage-xxs/src/test/java/Test01.java diff --git a/warehousing-system/project/wh-manage-xxs/pom.xml b/warehousing-system/project/wh-manage-xxs/pom.xml new file mode 100644 index 00000000..73661180 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/pom.xml @@ -0,0 +1,122 @@ + + + + wh + com.wh + 1.0-SNAPSHOT + + 4.0.0 + + wh-manage-xxs + + + + + com.wh + wh-common + 1.0-SNAPSHOT + + + org.jetbrains + annotations + 21.0.1 + compile + + + com.yxt + yxt-common-base + 0.0.1 + + + org.springframework.boot + spring-boot-starter-cache + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + + + + + + com.yxt + yxt-common-base + 0.0.1 + + + + + + + + org.projectlombok + lombok + 1.18.24 + true + + + + mysql + mysql-connector-java + + + org.apache.poi + poi-ooxml + + + io.jsonwebtoken + jjwt + + + cn.hutool + hutool-extra + + + cn.hutool + hutool-http + + + cn.hutool + hutool-crypto + + + cn.hutool + hutool-cache + + + + com.github.xiaoymin + knife4j-spring-boot-starter + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + wm-manager + + + org.springframework.boot + spring-boot-maven-plugin + 2.5.6 + + + + repackage + + + + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/WarehouseApplicationNoNacos.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/WarehouseApplicationNoNacos.java new file mode 100644 index 00000000..340e1f90 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/WarehouseApplicationNoNacos.java @@ -0,0 +1,42 @@ +package com.wh; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +//@EnableDiscoveryClient +//@EnableFeignClients(basePackages = {"com.wh.*"}) +@MapperScan("com.wh.mapper") +@SpringBootApplication(scanBasePackages = { + "com.yxt.common.base.config", + "com.wh.*" +}) +public class WarehouseApplicationNoNacos { + + private CorsConfiguration buildConfig() { + CorsConfiguration corsConfiguration = new CorsConfiguration(); + corsConfiguration.addAllowedOrigin("*"); + corsConfiguration.addAllowedHeader("*"); + corsConfiguration.addAllowedMethod("*"); + corsConfiguration.setAllowCredentials(true);//这两句不加不能跨域上传文件, + corsConfiguration.setMaxAge(3600l);//加上去就可以了 + return corsConfiguration; + } + /** + * 跨域过滤器 + * @return + */ + @Bean + public CorsFilter corsFilter() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", buildConfig()); // 4 + return new CorsFilter(source); + } + public static void main(String[] args) { + SpringApplication.run(WarehouseApplicationNoNacos.class,args); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/aop/AOPException.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/aop/AOPException.java new file mode 100644 index 00000000..4b47e1bf --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/aop/AOPException.java @@ -0,0 +1,15 @@ +package com.wh.aop; + +import com.wh.vo.SysResult; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@RestControllerAdvice +public class AOPException { + + @ExceptionHandler({RuntimeException.class}) + public Object Exception(){ + return SysResult.fail(); + } + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/FileUploadConfig.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/FileUploadConfig.java new file mode 100644 index 00000000..fa01c9dd --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/FileUploadConfig.java @@ -0,0 +1,29 @@ +package com.wh.config; + +import org.springframework.boot.web.servlet.MultipartConfigFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.util.unit.DataSize; + +import javax.servlet.MultipartConfigElement; + +/** + * 文件上传配置类 + * + * @Author mashanghaoyun + * @Date 2020/11/11 01:34 + * @Version 1.0 + **/ +@Configuration +public class FileUploadConfig { + @Bean + public MultipartConfigElement multipartConfigElement() { + MultipartConfigFactory factory = new MultipartConfigFactory(); + // 单个数据大小 + factory.setMaxFileSize(DataSize.parse("502400KB")); // KB,MB + // 总上传数据大小 + factory.setMaxRequestSize(DataSize.parse("1024000KB")); + return factory.createMultipartConfig(); + } + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/MyInterceptor.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/MyInterceptor.java new file mode 100644 index 00000000..e74597c2 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/MyInterceptor.java @@ -0,0 +1,16 @@ +package com.wh.config; +import com.wh.controller.UserInterceptor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +@Configuration +public class MyInterceptor implements WebMvcConfigurer { +// @Autowired +// private UserInterceptor userInterceptor; + + @Override + public void addInterceptors(InterceptorRegistry registry) { +// registry.addInterceptor(userInterceptor); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/MybatisPlusConfig.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/MybatisPlusConfig.java new file mode 100644 index 00000000..116d0050 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/MybatisPlusConfig.java @@ -0,0 +1,67 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.config; + +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Project: yxt-common
+ * File: MybatisPlusConfig.java
+ * Class: com.yxt.common.base.config.MybatisPlusConfig
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2020/8/24 下午12:42
+ * + * @author popo + * @version 1.0 + * @since 1.0 + */ +//@Configuration +public class MybatisPlusConfig { + /* + * 分页插件,自动识别数据库类型 多租户,请参考官网【插件扩展】 + */ +// @Bean +// public MybatisPlusInterceptor paginationInterceptor() { +// return new MybatisPlusInterceptor(); +// } + + @Bean + public PaginationInterceptor paginationInterceptor() { + PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); + // 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false + // paginationInterceptor.setOverflow(false); + // 设置最大单页限制数量,默认 500 条,-1 不受限制 + // paginationInterceptor.setLimit(500); + // 开启 count 的 join 优化,只针对部分 left join + paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true)); + return paginationInterceptor; + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/WebMvcConfig.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/WebMvcConfig.java new file mode 100644 index 00000000..c2f470de --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/config/WebMvcConfig.java @@ -0,0 +1,36 @@ +package com.wh.config; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class WebMvcConfig implements WebMvcConfigurer { + @Value("${yuan.file.root.path}") + public String fileRootPath; + + /** + * 资源映射:把请求的/archive/** 映射到该文件根路径 + */ + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("/archive/**").addResourceLocations("file:" + fileRootPath); + } + @Override + public void addCorsMappings(CorsRegistry registry){ + //设置允许跨域的路径 + registry.addMapping ("/**") + //设置允许跨域请求的域名 + .allowedOrigins("*") + //是否允许证书 + .allowCredentials (true) + //设置允许的方法 + .allowedMethods ("GET","POST") + //设置允许的header属性 + .allowedHeaders ("*") + //允许跨域时间 + .maxAge (3600); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/RightsController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/RightsController.java new file mode 100644 index 00000000..4a82e132 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/RightsController.java @@ -0,0 +1,35 @@ +package com.wh.controller; + +import com.wh.pojo.Rights; +import com.wh.service.RightsService; +import com.wh.vo.SysResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController("com.wh.controller.RightsController") +@CrossOrigin +@RequestMapping("/rights") +public class RightsController { + + @Autowired + private RightsService rightsService; + + /** + * URL: /rights/getRightsList + * 参数: null + * 类型: get + * 返回值: SysResult对象 List + * 业务: 只查询前 2级权限 + */ + @GetMapping("/getRightsList") + public SysResult getRightsList(){ + List rightsList = + rightsService.findRightsList(); + return SysResult.success(rightsList); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/UserController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/UserController.java new file mode 100644 index 00000000..6b8f8ec8 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/UserController.java @@ -0,0 +1,36 @@ +package com.wh.controller; + +import com.wh.pojo.User; +import com.wh.service.UserService; +import com.wh.vo.SysResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpSession; + +@RestController +@CrossOrigin +@RequestMapping("/user/") +public class UserController { + + @Autowired + private UserService userService; + @Autowired + private HttpSession session; + @PostMapping("login") + public SysResult login(@RequestBody User user){ + String fixationToken = (String)session.getAttribute("token"); + if (StringUtils.hasLength(fixationToken)){ + return SysResult.success(fixationToken); + }else { + String token = userService.findUserByUP(user); + if (StringUtils.hasLength(token)){ + session.setAttribute("token",token); + return SysResult.success(token); + }else { + return SysResult.fail(); + } + } + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/UserInterceptor.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/UserInterceptor.java new file mode 100644 index 00000000..f1132ea5 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/UserInterceptor.java @@ -0,0 +1,33 @@ +package com.wh.controller; + +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +@Component +public class UserInterceptor implements HandlerInterceptor { + long start; + long end ; + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + System.out.println("拦截器拦截成功"); + start = System.currentTimeMillis(); + return true; + } + + @Override + public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { + end = System.currentTimeMillis(); + System.out.println("拦截结束"); + + } + + @Override + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { + System.out.println("释放资源"+(end-start)+"ms"); + + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/api/input/InStoreHouseMainController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/api/input/InStoreHouseMainController.java new file mode 100644 index 00000000..3e64147c --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/api/input/InStoreHouseMainController.java @@ -0,0 +1,76 @@ +package com.wh.controller.api.input; + + +import com.alibaba.fastjson.JSONObject; +import com.wh.pojo.api.*; +import com.wh.pojo.purchasenew.PurchasenewQuery; +import com.wh.pojo.purchasenew.PurchasenewVo; +import com.wh.service.api.instorehouse.InStorehouseMainService; +import com.wh.service.purchasenew.PurchasenewService; +import com.wh.service.purchasenewproduct.PurchasenewProductService; +import com.wh.vo.SysResult; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.Map; +@Slf4j +@RestController +@CrossOrigin +@RequestMapping("/input/") +public class InStoreHouseMainController { + + @Autowired + private InStorehouseMainService inStorehouseMainService; + @Autowired + private PurchasenewService purchasenewService; + @Autowired + private PurchasenewProductService purchasenewProductService; +// @ApiOperation("根据条件分页查询数据的列表") +// @PostMapping("/listPage") +// public ResultBean> listPage(@RequestBody PagerQuery pq){ +// pq.getParams().setState("2"); +// ResultBean rb = ResultBean.fireFail(); +// PagerVo pv = purchasenewService.listPageVo(pq); +// return rb.success().setData(pv); +// } + @PostMapping("addInStorehouse") + public ResultBean addInStorehouse(@RequestBody InStoreHouseMainDto inStoreHouseMainDto){ + log.info("/input/addInStorehouse:{}", JSONObject.toJSONString(inStoreHouseMainDto)); + ResultBean resultBean = inStorehouseMainService.addInStorehouse(inStoreHouseMainDto); + return resultBean; + } + @PostMapping("addInStorehouseByPurchase") + public ResultBean addInStorehouseByPurchase(@RequestBody PurchaseInStoreHouseParams purchaseInStoreHouseParams){ + log.info("/input/addInStorehouseByPurchase:{}", JSONObject.toJSONString(purchaseInStoreHouseParams)); + return inStorehouseMainService.addInStorehouseByPurchase(purchaseInStoreHouseParams); + } + @PostMapping("listPage") + public ResultBean listPage(@RequestBody PagerQuery pq){ + PagerVo pv = inStorehouseMainService.listPage(pq); + ResultBean> r = ResultBean.fireSuccess(); + return r.setData(pv); + } + @GetMapping("getInStorehouse/{sid}") + public ResultBean getInStorehouse(@PathVariable(value = "sid") String sid){ + return inStorehouseMainService.getInStorehouse(sid); + } + + /** + * 获取所有未入库的采购订单编号和仓库信息 + * @return + */ + @GetMapping("getQuery") + public SysResult getQuery(@RequestBody InStorehouseMainQuery query){ + Map map = inStorehouseMainService.getQuery(query); + return SysResult.success(map); + } + + + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/api/output/OutStorehouseMainController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/api/output/OutStorehouseMainController.java new file mode 100644 index 00000000..50823b67 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/api/output/OutStorehouseMainController.java @@ -0,0 +1,79 @@ +package com.wh.controller.api.output; + +import com.alibaba.fastjson.JSONObject; +import com.wh.pojo.api.*; +import com.wh.pojo.purchasenew.Purchasenew; +import com.wh.service.api.outstorehouse.OutStorehouseListingService; +import com.wh.service.api.outstorehouse.OutStorehouseMainService; +import com.wh.vo.SysResult; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@Slf4j +@RestController +@CrossOrigin +@RequestMapping("/output/") +public class OutStorehouseMainController { + + @Autowired + private OutStorehouseMainService outStorehouseMainService; + + @Autowired + private OutStorehouseListingService outStorehouseListingService; + + @PostMapping("importOutStorehouse") + public ResultBean importOutStorehouse(@RequestBody OutStorehouseMainDto outStorehouseMainDto){ + log.info("/output/importOutStorehouse:{}", JSONObject.toJSONString(outStorehouseMainDto)); + ResultBean resultBean = outStorehouseMainService.importOutStorehouse(outStorehouseMainDto); + return resultBean; + } + + @PostMapping("addOutStorehouse") + public ResultBean addOutStorehouse(@RequestBody OutStorehouseMainDto outStorehouseMainDto){ + log.info("/output/addOutStorehouse:{}", JSONObject.toJSONString(outStorehouseMainDto)); + ResultBean resultBean = outStorehouseMainService.addOutStorehouse(outStorehouseMainDto); + return resultBean; + } + @PostMapping("listPage") + public ResultBean listPage(@RequestBody PagerQuery pq){ + PagerVo pv = outStorehouseMainService.listPage(pq); + ResultBean> r = ResultBean.fireSuccess(); + return r.setData(pv); + } + @PostMapping("listAllForPicking") + public ResultBean listAllForPicking(@RequestBody OutStorehouseMainQuery pq){ + ResultBean r=ResultBean.fireFail(); + if(StringUtils.isBlank(pq.getCusterSid())){ + return r.setMsg("CusterSid不能为空"); + } + List list= outStorehouseMainService.listAllForPicking(pq); + return r.success().setData(list); + } + @GetMapping("getOutStorehouse/{sid}") + public ResultBean getOutStorehouse(@PathVariable(value = "sid") String sid){ + return outStorehouseMainService.getOutStorehouse(sid); + } + @ApiOperation("根据sid批量删除") + @PostMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + for (String sid : sids) { + OutStorehouseMain entity=outStorehouseMainService.fetchBySid(sid); + int state = entity.getState(); + if(2==state){ + continue; + } + int i = outStorehouseMainService.deleteOutStorehouseMainBySid(sid); + } + return rb.success(); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/api/prodstock/ProdStockController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/api/prodstock/ProdStockController.java new file mode 100644 index 00000000..f3b5f720 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/api/prodstock/ProdStockController.java @@ -0,0 +1,46 @@ +package com.wh.controller.api.prodstock; + +import com.alibaba.fastjson.JSONObject; +import com.wh.pojo.api.*; +import com.wh.service.api.outstorehouse.OutStorehouseMainService; +import com.wh.service.api.prodstock.ProdStockService; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +@Slf4j +@RestController +@CrossOrigin +@RequestMapping("/stock/") +public class ProdStockController { + @Autowired + private ProdStockService prodStockService; + + @PostMapping("listPage") + public ResultBean listPage(@RequestBody PagerQuery pq){ + PagerVo pv = prodStockService.listPage(pq); + ResultBean> r = ResultBean.fireSuccess(); + return r.setData(pv); + } + @PostMapping("importStock") + public ResultBean importStock(@RequestBody ProdStocks datas){ + log.info("/stock/importStock:{}", JSONObject.toJSONString(datas)); + ResultBean rb=ResultBean.fireFail(); + List list = datas.getList(); + if(list.size()>0){ + List prodStocks = prodStockService.importStock(list); + if(prodStocks.size()>0){ + return rb.fail().setData(prodStocks).setMsg("部分数据导入失败,商品、仓库、货位信息不能为空," + + "storeHouseSid(仓库),proSid(商品id),proName(商品名称))," + + "locationId(货位编码),locationNumber(货位名称)"); + } + }else{ + return rb.setMsg("导入失败"); + } + return rb.success(); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/brandinfo/BrandInfoRest.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/brandinfo/BrandInfoRest.java new file mode 100644 index 00000000..f250e7a7 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/brandinfo/BrandInfoRest.java @@ -0,0 +1,95 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.controller.brandinfo; + +import com.wh.pojo.brandinfo.BrandInfoDetailsVo; +import com.wh.pojo.brandinfo.BrandInfoDto; +import com.wh.pojo.brandinfo.BrandInfoQuery; +import com.wh.pojo.brandinfo.BrandInfoVo; +import com.wh.service.brandinfo.BrandInfoService; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: BrandInfoFeignFallback.java
+ * Class: com.supervise.biz.brandinfo.BrandInfoRest
+ * Description: 品牌信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:28
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@CrossOrigin +@Api(tags = "品牌信息") +@RestController("com.supervise.biz.brandinfo.BrandInfoRest") +@RequestMapping("v1/brandinfo") +public class BrandInfoRest { + + @Autowired + private BrandInfoService brandInfoService; + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = brandInfoService.listPageVo(pq); + return rb.success().setData(pv); + } + + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody BrandInfoDto dto){ + ResultBean rb = ResultBean.fireFail(); + brandInfoService.saveOrUpdateDto(dto); + return rb.success(); + } + + @ApiOperation("根据sid批量删除") + @PostMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + brandInfoService.delBySids(sids); + return rb.success(); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + BrandInfoDetailsVo vo = brandInfoService.fetchDetailsVoBySid(sid); + return rb.success().setData(vo); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/dictcommon/DictCommonRest.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/dictcommon/DictCommonRest.java new file mode 100644 index 00000000..fb0918a3 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/dictcommon/DictCommonRest.java @@ -0,0 +1,92 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.controller.dictcommon; + + +import com.wh.pojo.dictcommon.*; +import com.wh.service.dictcommon.DictCommonService; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: DictCommonFeignFallback.java
+ * Class: com.supervise.biz.dictcommon.DictCommonRest
+ * Description: 数据字典——数据项.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:29
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@CrossOrigin +@Api(tags = "数据字典——数据项") +@RestController("com.wh.controller.dictcommon.DictCommonRest") +@RequestMapping("v1/dictcommon") +public class DictCommonRest { + + @Autowired + private DictCommonService dictCommonService; + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = dictCommonService.listPageVo(pq); + return rb.success().setData(pv); + } + + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody DictCommonDto dto){ + ResultBean rb = ResultBean.fireFail(); + dictCommonService.saveOrUpdateDto(dto); + return rb.success(); + } + + @ApiOperation("根据sid批量删除") + @PostMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + dictCommonService.delBySids(sids); + return rb.success(); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + DictCommonDetailsVo vo = dictCommonService.fetchDetailsVoBySid(sid); + return rb.success().setData(vo); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/dicttype/DictTypeRest.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/dicttype/DictTypeRest.java new file mode 100644 index 00000000..24f0b616 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/dicttype/DictTypeRest.java @@ -0,0 +1,94 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.controller.dicttype; + +import com.wh.pojo.dicttype.DictTypeDetailsVo; +import com.wh.pojo.dicttype.DictTypeDto; +import com.wh.pojo.dicttype.DictTypeQuery; +import com.wh.pojo.dicttype.DictTypeVo; +import com.wh.service.dicttype.DictTypeService; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: DictTypeFeignFallback.java
+ * Class: com.supervise.biz.dicttype.DictTypeRest
+ * Description: 数据字典——数据类型.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:29
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@CrossOrigin +@Api(tags = "数据字典——数据类型") +@RestController("com.wh.controller.dicttype.DictTypeRest") +@RequestMapping("v1/dicttype") +public class DictTypeRest { + + @Autowired + private DictTypeService dictTypeService; + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = dictTypeService.listPageVo(pq); + return rb.success().setData(pv); + } + + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody DictTypeDto dto){ + ResultBean rb = ResultBean.fireFail(); + dictTypeService.saveOrUpdateDto(dto); + return rb.success(); + } + + @ApiOperation("根据sid批量删除") + @PostMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + dictTypeService.delBySids(sids); + return rb.success(); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + DictTypeDetailsVo vo = dictTypeService.fetchDetailsVoBySid(sid); + return rb.success().setData(vo); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/entinfo/EntInfoRest.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/entinfo/EntInfoRest.java new file mode 100644 index 00000000..242f3f44 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/entinfo/EntInfoRest.java @@ -0,0 +1,103 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.controller.entinfo; + +import com.wh.pojo.entinfo.EntInfoDetailsVo; +import com.wh.pojo.entinfo.EntInfoDto; +import com.wh.pojo.entinfo.EntInfoQuery; +import com.wh.pojo.entinfo.EntInfoVo; +import com.wh.service.entinfo.EntInfoService; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * Project: warehouse(仓储)
+ * File: EntInfoFeignFallback.java
+ * Class: com.wh.biz.entinfo.EntInfoRest
+ * Description: 客户信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-13 22:19:45
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@CrossOrigin +@Api(tags = "客户信息") +@RestController("com.wh.biz.entinfo.EntInfoRest") +@RequestMapping("v1/entinfo") +public class EntInfoRest { + + @Autowired + private EntInfoService entInfoService; + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = entInfoService.listPageVo(pq); + return rb.success().setData(pv); + } +// @ApiOperation("查询所有的企业信息") +// @GetMapping("/listAll") +// public ResultBean> listAll(){ +// ResultBean rb = ResultBean.fireFail(); +// List pv = entInfoService.listAll(); +// return rb.success().setData(pv); +// } + + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody EntInfoDto dto){ + ResultBean rb = ResultBean.fireFail(); + entInfoService.saveOrUpdateDto(dto); + return rb.success(); + } + + @ApiOperation("根据sid批量删除") + @PostMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + entInfoService.delBySids(sids); + return rb.success(); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + EntInfoDetailsVo vo = entInfoService.fetchDetailsVoBySid(sid); + return rb.success().setData(vo); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/LocationController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/LocationController.java new file mode 100644 index 00000000..72e580ff --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/LocationController.java @@ -0,0 +1,93 @@ +package com.wh.controller.initial; + +import com.wh.pojo.*; +import com.wh.pojo.shstorehouse.ShStorehouse; +import com.wh.service.initial.LocationService; +import com.wh.service.shstorehouse.ShStorehouseService; +import com.wh.vo.PageResult; +import com.wh.vo.SysResult; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@CrossOrigin +@RequestMapping("/location/") +public class LocationController { + + @Autowired + private LocationService locationService; + @Autowired + private ShStorehouseService shStorehouseService; + + @PostMapping("list") + public ResultBean getLocationList(@RequestBody PagerQuery pq){ +// pageResult = locationService.getLocationList(pageResult); +// return SysResult.success(pageResult); + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = locationService.getSupplierList(pq); + return rb.success().setData(pv); + } + @GetMapping("listAll") + public SysResult listAll(PageResult pageResult){ + List locations = locationService.getLocations(); + return SysResult.success(locations); + } + + @PostMapping("addLocation") + public SysResult addLocation(@RequestBody Location location){ + if(StringUtils.isBlank(location.getStorehouseid())){ + return SysResult.fail(); + } + ShStorehouse shStorehouse = shStorehouseService.fetchBySid(location.getStorehouseid()); + if(shStorehouse==null){ + return SysResult.fail(); + } + location.setStorehouse(shStorehouse.getName()); + locationService.addLocation(location); + return SysResult.success(); + } + + @PutMapping("updataLocation") + public SysResult updataLocation(@RequestBody Location location){ + locationService.updataLocation(location); + return SysResult.success(); + } + + @DeleteMapping("delete/{name}") + public SysResult deleteLocation(@PathVariable String name){ + locationService.deleteLocation(name); + return SysResult.success(); + } + @DeleteMapping("deleteById/{id}") + public ResultBean deleteById(@PathVariable String id){ + ResultBean rb = ResultBean.fireFail(); + int i = locationService.deleteById(id); + if(i==0){ + return rb; + } + return rb.success(); + } + + @GetMapping("getStorehouse") + public SysResult getStorehouse(){ + List storehouseList = locationService.getStorehouse(); + return SysResult.success(storehouseList); + } + @GetMapping("getLocationsByStoreId/{id}") + public SysResult getLocationsByStoreId(String id){ + List locations = locationService.getLocationsByStoreId(id); + return SysResult.success(locations); + } + + @GetMapping("getType") + public SysResult getType(){ + List locationTypeList = locationService.getType(); + return SysResult.success(locationTypeList); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/ProductController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/ProductController.java new file mode 100644 index 00000000..6cbde07c --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/ProductController.java @@ -0,0 +1,57 @@ +package com.wh.controller.initial; + +import com.wh.pojo.Product; +import com.wh.pojo.ProductQuery; +import com.wh.pojo.Storehouse; +import com.wh.pojo.shstorehouse.ShStorehouseQuery; +import com.wh.pojo.shstorehouse.ShStorehouseVo; +import com.wh.service.initial.ProductService; +import com.wh.vo.PageResult; +import com.wh.vo.SysResult; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@CrossOrigin +@RequestMapping("/product/") +public class ProductController { + @Autowired + private ProductService productService; + + @PostMapping("list") + public ResultBean getProductList(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = productService.getProductList(pq); + return rb.success().setData(pv); + } + + @PostMapping("addProduct") + public SysResult addProduct(@RequestBody Product product){ + productService.addProduct(product); + return SysResult.success(); + } + + @PutMapping("updataProduct") + public SysResult updataProduct(@RequestBody Product product){ + productService.updataProduct(product); + return SysResult.success(); + } + + @DeleteMapping("delete/{barCode}") + public SysResult deleteProduct(@PathVariable String barCode){ + productService.deleteProduct(barCode); + return SysResult.success(); + } + + @GetMapping("getStorehouse") + public SysResult getStorehouse(){ + List storehouses = productService.getStorehouse(); + return SysResult.success(storehouses); + } + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/StorehouseController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/StorehouseController.java new file mode 100644 index 00000000..2c5ab744 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/StorehouseController.java @@ -0,0 +1,41 @@ +package com.wh.controller.initial; + +import com.wh.pojo.Storehouse; +import com.wh.service.initial.StorehouseService; +import com.wh.vo.PageResult; +import com.wh.vo.SysResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@RestController +@CrossOrigin +@RequestMapping("/storehouse/") +public class StorehouseController { + + @Autowired + private StorehouseService storehouseService; + + @GetMapping("list") + public SysResult getStorehouseList(PageResult pageResult){ + pageResult = storehouseService.getStorehouseList(pageResult); + return SysResult.success(pageResult); + } + + @PostMapping("addStorehouse") + public SysResult addStorehouse(@RequestBody Storehouse storehouse){ + storehouseService.addStorehouse(storehouse); + return SysResult.success(); + } + + @PutMapping("updataStorehouse") + public SysResult updataStorehouse(@RequestBody Storehouse storehouse){ + storehouseService.updataStorehouse(storehouse); + return SysResult.success(); + } + + @DeleteMapping("delete/{name}") + public SysResult deleteStorehouse(@PathVariable String name) throws Exception { + storehouseService.deleteStorehouse(name); + return SysResult.success(); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/SupplierController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/SupplierController.java new file mode 100644 index 00000000..85e04b0a --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/initial/SupplierController.java @@ -0,0 +1,60 @@ +package com.wh.controller.initial; + +import com.wh.pojo.Product; +import com.wh.pojo.ProductQuery; +import com.wh.pojo.Supplier; +import com.wh.pojo.SupplierQuery; +import com.wh.service.initial.SupplierService; +import com.wh.vo.PageResult; +import com.wh.vo.SysResult; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@CrossOrigin +@RequestMapping("/supplier/") +public class SupplierController { + + @Autowired + private SupplierService supplierService; + + @PostMapping("list") + public ResultBean getSupplierList(@RequestBody PagerQuery pq){ +// pageResult = supplierService.getSupplierList(pageResult); +// return SysResult.success(pageResult); + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = supplierService.getSupplierList(pq); + return rb.success().setData(pv); + } + @PostMapping("listAll") + public ResultBean listAll(@RequestBody PagerQuery pq){ +// pageResult = supplierService.getSupplierList(pageResult); +// return SysResult.success(pageResult); + ResultBean rb = ResultBean.fireFail(); + List list=supplierService.listAll(); + return rb.success().setData(list); + } + + @PostMapping("addSupplier") + public SysResult addSupplier(@RequestBody Supplier supplier){ + supplierService.addSupplier(supplier); + return SysResult.success(); + } + + @PutMapping("updataSupplier") + public SysResult updataSupplier(@RequestBody Supplier supplier){ + supplierService.updataSupplier(supplier); + return SysResult.success(); + } + + @DeleteMapping("delete/{name}") + public SysResult deleteSupplier(@PathVariable String name){ + supplierService.deleteSupplier(name); + return SysResult.success(); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/instorehouse/PurchaseController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/instorehouse/PurchaseController.java new file mode 100644 index 00000000..20c76b24 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/instorehouse/PurchaseController.java @@ -0,0 +1,70 @@ +package com.wh.controller.instorehouse; + + +import com.wh.controller.initial.StorehouseController; +import com.wh.pojo.Product; +import com.wh.pojo.Purchase; +import com.wh.pojo.Storehouse; +import com.wh.pojo.Supplier; +import com.wh.service.instorehouse.PurchaseService; +import com.wh.vo.PageResult; +import com.wh.vo.SysResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +@RestController +@CrossOrigin +@RequestMapping("/purchase/") +public class PurchaseController { + + @Autowired + private PurchaseService purchaseService; + + @GetMapping("list") + public SysResult getPurchaseList(PageResult pageResult){ + pageResult = purchaseService.getPurchaseList(pageResult); + return SysResult.success(pageResult); + } + + @PostMapping("addPurchase") + public SysResult addPurchase(@RequestBody Purchase purchase){ + purchaseService.addPurchase(purchase); + return SysResult.success(); + } + + @GetMapping("getProductList") + public SysResult getProductList(Product product){ +// String name = (String) map.get("name"); +// System.out.println(product.getName()); +// System.out.println(map.toString()); + List productList = purchaseService.getProductList(product.getName()); + return SysResult.success(productList); + } + + @GetMapping("getSupplier") + public SysResult getSupplier(){ + List supplierList = purchaseService.getSupplier(); + return SysResult.success(supplierList); + } + + @GetMapping("getStorehouse") + public SysResult getStorehouse(){ + List storehouseList = purchaseService.getStorehouse(); + return SysResult.success(storehouseList); + } + + @DeleteMapping("delete/{purchaseId}") + public SysResult deletePurchase(@PathVariable String purchaseId){ + purchaseService.deletePurchase(purchaseId); + return SysResult.success(); + } + + @PutMapping("updata") + public SysResult updataPurchase(@RequestBody Purchase purchase){ + purchaseService.updataPurchase(purchase); + return SysResult.success(); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/instorehouse/ReceivingController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/instorehouse/ReceivingController.java new file mode 100644 index 00000000..e09ee4a3 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/instorehouse/ReceivingController.java @@ -0,0 +1,52 @@ +package com.wh.controller.instorehouse; + +import com.wh.pojo.Receiving; +import com.wh.service.instorehouse.ReceivingService; +import com.wh.vo.Options; +import com.wh.vo.PageResult; +import com.wh.vo.SysResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +@RestController +@CrossOrigin +@RequestMapping("/receiving/") +public class ReceivingController { + + @Autowired + private ReceivingService receivingService; + + @GetMapping("getOptions") + public SysResult getOptions(){ + List optionsList = receivingService.getOptions(); + return SysResult.success(optionsList); + } + + @PostMapping("addReceiving") + public SysResult addReceiving(@RequestBody Map map){ + System.out.println(map); + receivingService.addReceiving(map.get("id"),map.get("user")); + return SysResult.success(); + } + + @GetMapping("getReceiving") + public SysResult getReceiving(PageResult pageResult){ + pageResult = receivingService.getReceiving(pageResult); + return SysResult.success(pageResult); + } + + @PutMapping("updataReceiving") + public SysResult updataReceiving(@RequestBody Receiving receiving){ + receivingService.updataReceiving(receiving); + return SysResult.success(); + } + + @DeleteMapping("deleteReceiving/{receivingId}/{purchaseId}") + public SysResult deleteReceiving(@PathVariable String receivingId,@PathVariable String purchaseId){ + receivingService.deleteReceiving(receivingId,purchaseId); + return SysResult.success(); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/outstorehouse/OutStorehouseController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/outstorehouse/OutStorehouseController.java new file mode 100644 index 00000000..508cd06b --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/outstorehouse/OutStorehouseController.java @@ -0,0 +1,60 @@ +package com.wh.controller.outstorehouse; + +import com.alibaba.fastjson.JSONObject; +import com.wh.pojo.OutStorehouse; +import com.wh.service.outstorehouse.OutStorehouseService; +import com.wh.vo.PageResult; +import com.wh.vo.SysResult; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; +@Slf4j +@RestController +@CrossOrigin +@RequestMapping("/outStorehouse/") +public class OutStorehouseController { + + @Autowired + private OutStorehouseService outStorehouseService; + + + + @GetMapping("getQuery") + public SysResult getQuery(OutStorehouse outStorehouse){ + Map map = outStorehouseService.getQuery(outStorehouse); + return SysResult.success(map); + } + + @GetMapping("list") + public SysResult getOutStorehouseList(PageResult pageResult){ + pageResult = outStorehouseService.getOutStorehouseList(pageResult); + return SysResult.success(pageResult); + } + + @PostMapping("addOutStorehouse") + public SysResult addOutStorehouse(@RequestBody OutStorehouse outStorehouse){ + log.info("/outStorehouse/addOutStorehouse:{}", JSONObject.toJSONString(outStorehouse)); + outStorehouseService.addOutStorehouse(outStorehouse); + return SysResult.success(); + } + + @PutMapping("updataOutStorehouse") + public SysResult updataOutStorehouse(@RequestBody OutStorehouse outStorehouse){ + outStorehouseService.updataOutStorehouse(outStorehouse); + return SysResult.success(); + } + + @DeleteMapping("delete/{outStorehouseId}") + public SysResult deleteOutStorehouse(@PathVariable String outStorehouseId){ +// outStorehouseService.deleteOutStorehouse(outStorehouseId); + return SysResult.success("连接成功"); + } + + @PutMapping("out") + public SysResult out(@RequestBody OutStorehouse outStorehouse){ + outStorehouseService.out(outStorehouse); + return SysResult.success(); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/outstorehouse/PickingController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/outstorehouse/PickingController.java new file mode 100644 index 00000000..d6283b7d --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/outstorehouse/PickingController.java @@ -0,0 +1,68 @@ +package com.wh.controller.outstorehouse; + +import com.alibaba.fastjson.JSONObject; +import com.wh.pojo.Picking; +import com.wh.pojo.api.OutStorehouseListing; +import com.wh.pojo.api.OutStorehouseMain; +import com.wh.pojo.api.OutStorehouseMainQuery; +import com.wh.pojo.api.OutStorehouseVo; +import com.wh.service.api.outstorehouse.OutStorehouseListingService; +import com.wh.service.api.outstorehouse.OutStorehouseMainService; +import com.wh.service.outstorehouse.PickingService; +import com.wh.vo.PageResult; +import com.wh.vo.PickingUser; +import com.wh.vo.SysResult; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.xml.transform.Result; +import java.util.List; +@Slf4j +@RestController +@CrossOrigin +@RequestMapping("/picking/") +public class PickingController { + + @Autowired + private PickingService pickingService; + @Autowired + private OutStorehouseMainService outStorehouseMainService; + @PostMapping("listPage") + public ResultBean listPage(@RequestBody PagerQuery pq){ + pq.getParams().setState("2"); + PagerVo pv = outStorehouseMainService.listPage(pq); + ResultBean> r = ResultBean.fireSuccess(); + return r.setData(pv); + } + @GetMapping("getOptions") + public SysResult getOptions(){ + List outStorehouseIdList = pickingService.getOptions(); + return SysResult.success(outStorehouseIdList); + } + + @PutMapping("picking") + public ResultBean picking(@RequestBody PickingUser pickingUser){ + log.info("/picking/picking:{}", JSONObject.toJSONString(pickingUser)); + return pickingService.picking(pickingUser); + // ss pickingService.picking(pickingUser.getOutStorehouseId(),pickingUser.getUser()); + } + + @GetMapping("list") + public SysResult getPickingList(PageResult pageResult){ + pageResult = pickingService.getPickingList(pageResult); + return SysResult.success(pageResult); + } + + @PutMapping("finish") + public SysResult finish(@RequestBody Picking picking){ + pickingService.finish(picking); + return SysResult.success(); + } + + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/purchasenew/PurchasenewController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/purchasenew/PurchasenewController.java new file mode 100644 index 00000000..eb51bf27 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/purchasenew/PurchasenewController.java @@ -0,0 +1,84 @@ +package com.wh.controller.purchasenew; + +import com.alibaba.fastjson.JSONObject; +import com.wh.pojo.purchasenew.*; +import com.wh.service.purchasenew.PurchasenewService; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +@Slf4j +@RestController +@CrossOrigin +@RequestMapping("/purchasenew") +public class PurchasenewController { + @Autowired + private PurchasenewService purchasenewService; + + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = purchasenewService.listPageVo(pq); + return rb.success().setData(pv); + } + @ApiOperation("获取所有的采购订单") + @PostMapping("/listAll") + public ResultBean> listAll(@RequestBody PurchasenewQuery pq){ + ResultBean rb = ResultBean.fireFail(); +// String custId = pq.getCustId(); +// if(StringUtils.isBlank(custId)){ +// return rb.setMsg("企业id不能为空"); +// } + List list = purchasenewService.listForInput(pq); + return rb.success().setData(list); + } + + @ApiOperation("导入采购订单 入库") + @PostMapping("/importPurchase") + public ResultBean importPurchase(@RequestBody PurchasenewForImportDto dto){ + log.info("/stock/importStock:{}", JSONObject.toJSONString(dto)); + return purchasenewService.importPurchase(dto); + } + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody PurchasenewDto dto){ + log.info("/stock/importStock:{}", JSONObject.toJSONString(dto)); + return purchasenewService.saveOrUpdateDto(dto); + } + + @ApiOperation("根据sid批量删除") + @PostMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + int i = purchasenewService.delByPurchasenewSids(sids); + if (i==0) + return rb; + return rb.success(); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + PurchasenewDetailsVo vo = purchasenewService.fetchDetailsVoBySid(sid); + if(vo==null){ + return rb; + } + return rb.success().setData(vo); + } +// @ApiOperation("获取所有的企业信息") +// @GetMapping("/fetchEntList") +// public ResultBean> fetchDetailsBySid(){ +// ResultBean> enterpriseBySid = whEnterpriseInformationFeign.EnterpriseList(); +// return enterpriseBySid; +// } + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/purchasenewproduct/PurchasenewProductController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/purchasenewproduct/PurchasenewProductController.java new file mode 100644 index 00000000..8325a396 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/purchasenewproduct/PurchasenewProductController.java @@ -0,0 +1,54 @@ +package com.wh.controller.purchasenewproduct; + +import com.wh.pojo.purchasenewproduct.PurchasenewProductDetailsVo; +import com.wh.pojo.purchasenewproduct.PurchasenewProductDto; +import com.wh.pojo.purchasenewproduct.PurchasenewProductQuery; +import com.wh.pojo.purchasenewproduct.PurchasenewProductVo; +import com.wh.service.purchasenewproduct.PurchasenewProductService; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@RestController +@CrossOrigin +@RequestMapping("/purchasenewproduct/") +public class PurchasenewProductController { + + @Autowired + private PurchasenewProductService purchasenewProductService; + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = purchasenewProductService.listPageVo(pq); + return rb.success().setData(pv); + } + + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody PurchasenewProductDto dto){ + ResultBean rb = ResultBean.fireFail(); + purchasenewProductService.saveOrUpdateDto(dto); + return rb.success(); + } + + @ApiOperation("根据sid批量删除") + @PostMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + purchasenewProductService.delBySids(sids); + return rb.success(); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + PurchasenewProductDetailsVo vo = purchasenewProductService.fetchDetailsVoBySid(sid); + return rb.success().setData(vo); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/shstorehouse/ShStorehouseRest.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/shstorehouse/ShStorehouseRest.java new file mode 100644 index 00000000..edd84537 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/shstorehouse/ShStorehouseRest.java @@ -0,0 +1,246 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.controller.shstorehouse; + +import cn.hutool.core.lang.Assert; +//import com.wh.feign.crm.ProjectInformationFeign; +//import com.wh.feign.enterpriseinformation.WhEnterpriseInformationFeign; +//import com.wh.feign.enterpriseinformation.WhEnterpriseInformationVo; +import com.wh.pojo.Supplier; +import com.wh.pojo.shstorehouse.*; +import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentDto; +import com.wh.service.initial.SupplierService; +import com.wh.service.shstorehouse.ShStorehouseService; +import com.wh.service.shstorehouseattachment.ShStorehouseAttachmentService; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import java.io.File; +import java.util.List; +import java.util.UUID; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: ShStorehouseFeignFallback.java
+ * Class: com.wh.biz.shstorehouse.ShStorehouseRest
+ * Description: 库房信息表.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-14 23:18:54
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@CrossOrigin +@Api(tags = "库房信息表") +@RestController("com.wh.biz.shstorehouse.ShStorehouseRest") +@RequestMapping("v1/shstorehouse") +public class ShStorehouseRest { + + @Autowired + private ShStorehouseService shStorehouseService; + @Autowired + private ShStorehouseAttachmentService shStorehouseAttachmentService; +// @Autowired +// private WhEnterpriseInformationFeign whEnterpriseInformationFeign; +// @Autowired +// private ProjectInformationFeign projectInformationFeign; + @Autowired + private SupplierService supplierService; + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = shStorehouseService.listPageVo(pq); + return rb.success().setData(pv); + } +// @ApiOperation("查询项目所有") +// @GetMapping("/selectAllProject") +// public ResultBean selectAllProject(){ +// ResultBean rb = ResultBean.fireFail(); +// ResultBean resultBean = projectInformationFeign.listAll(); +// return resultBean; +// } + @ApiOperation("查询所有可用仓库") + @PostMapping("/selectStoreHouse") + public ResultBean selectStoreHouse(@RequestBody List List){ + ResultBean rb = ResultBean.fireFail(); + List list= shStorehouseService.selectStoreHouse(List); + return rb.success().setData(list); + } + + /** + * 根据仓库sid查询仓库信息 + * @return + */ + @ApiOperation("根据仓库sid查询仓库信息") + @GetMapping("/selectStoreBySid") + public ResultBean selectStoreBySid(@RequestParam("shSid")String shSid){ + ResultBean rb = ResultBean.fireFail(); + ShStorehouseVo shStorehouseVo= shStorehouseService.selectStoreBySid(shSid); + return rb.success().setData(shStorehouseVo); + } + @ApiOperation("根据项目sid查询仓库") + @GetMapping("/getStorehouseBySid") + public ResultBean> getStorehouseBySid(String sid){ + ResultBean rb = ResultBean.fireFail(); + List pv = shStorehouseService.getStorehouseBySid(sid); + return rb.success().setData(pv); + } + @ApiOperation("根据客户sid获取所有的仓库") + @GetMapping("/listAllBycusterSid") + public ResultBean> listAllBycusterSid(@RequestParam("custerSid") String custerSid){ + ResultBean rb = ResultBean.fireFail(); + List pv = shStorehouseService.listAllBycusterSid(custerSid); + return rb.success().setData(pv); + } + @ApiOperation("获取所有的仓库") + @GetMapping("/listAll") + public ResultBean> listAll(){ + ResultBean rb = ResultBean.fireFail(); + return rb.success().setData(shStorehouseService.list()); + } + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody ShStorehouseDto dto){ + ResultBean rb = ResultBean.fireFail(); + shStorehouseService.saveOrUpdateDto(dto); + return rb.success(); + } + + @ApiOperation("根据sid批量删除") + @PostMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + int i = shStorehouseService.delBySids(sids); + if(i==0){ + return rb; + } + return rb.success(); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + ShStorehouseDetailsVo vo = shStorehouseService.fetchDetailsVoBySid(sid); + if(vo==null) + return rb.setMsg("没有查询到数据"); + return rb.success().setData(vo); + } +// @ApiOperation(value = "上传附件") +// @ResponseBody +// @PostMapping("/uploadFile") +// public ResultBean updateHeadImage(@RequestParam("file")MultipartFile multipartFile) { +// if (multipartFile.isEmpty()) { +// return new ResultBean().fail().setMsg("上传附件不能为空"); +// } +// +// return shStorehouseService.updateFile(multipartFile); +// +// } + @Value("${yuan.file.root.path}") + public String fileRootPath; + @ApiOperation("文件上传") + @PostMapping("/upload") + public ResultBean upload(@RequestParam("file") MultipartFile file, HttpServletRequest request) { + String filePath = ""; // 文件保存的位置 + String urlPath = "";// 文件web浏览路径 + Assert.isTrue(!file.isEmpty(), "文件为空"); + // 原始名 以 a.jpg为例 + String originalFilename = file.getOriginalFilename(); + // 获取后缀并拼接'/'用于分类,也可以用日期 例: suffix = "jpg/" + String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1) + "/"; + // 加上时间戳生成新的文件名,防止重复 newFileName = "1595511980146a.jpg" + String newFileName = System.currentTimeMillis() + originalFilename; + filePath = fileRootPath+ suffix + newFileName; + System.out.println(filePath); + try { + File file1 = new File(filePath); + if (!file1.exists()) file1.mkdirs(); // 要是目录不存在,创建一个 + file.transferTo(file1); // 保存起来 + //urlPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/archive/" + suffix + newFileName; + + urlPath = "http://jianguan.yyundong.com/warehouseapi/archive/" + suffix + newFileName; + } catch (Exception e) { + e.printStackTrace(); + } + return ResultBean.fireSuccess().setData(urlPath); + } + @ApiOperation("图片上传") + @PostMapping("/uploadPics") + public ResultBean uploadPics(@RequestParam("file") MultipartFile file, HttpServletRequest request) { + String filePath = ""; // 文件保存的位置 + String urlPath = "";// 文件web浏览路径 + Assert.isTrue(!file.isEmpty(), "文件为空"); + // 原始名 以 a.jpg为例 + String originalFilename = file.getOriginalFilename(); + // 获取后缀并拼接'/'用于分类,也可以用日期 例: suffix = "jpg/" + String suffix = originalFilename.substring(originalFilename.lastIndexOf(".") + 1) + "/"; + // 加上时间戳生成新的文件名,防止重复 newFileName = "1595511980146a.jpg" + String newFileName = System.currentTimeMillis() + originalFilename; + filePath = fileRootPath+ suffix + newFileName; + System.out.println(filePath); + ShStorehouseAttachmentDto dto=new ShStorehouseAttachmentDto(); + String s = UUID.randomUUID().toString(); + try { + File file1 = new File(filePath); + if (!file1.exists()) file1.mkdirs(); // 要是目录不存在,创建一个 + file.transferTo(file1); // 保存起来 + //urlPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + "/archive/" + suffix + newFileName; + urlPath = "http://jianguan.yyundong.com/warehouseapi/archive/" + suffix + newFileName; + +// dto.setStorehouseSid(); // 库房sid +// dto.setStorehouseName(); // 库房名称 + dto.setFileName(newFileName); // 文件名称 + dto.setFileDesc(""); // 文件描述 + dto.setFileType(suffix); // 文件类型,Word,Excel,PDF或图片 + dto.setFileSuffix(suffix); // 文件后缀,如:png,jpg,xls,xlsx + dto.setFilePath(filePath); // 文件在服务器的存放路径 + dto.setFileUrl(urlPath); // 文件获取的url地址 + dto.setSid(s); + shStorehouseAttachmentService.insertByDto(dto); + } catch (Exception e) { + e.printStackTrace(); + } + return ResultBean.fireSuccess().setData(dto); + } + @ApiOperation("获取所有的企业信息") + @GetMapping("/fetchEntList") + public ResultBean fetchDetailsBySid(){ + return ResultBean.fireSuccess().setData(supplierService.listAll()); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/shstorehouseattachment/ShStorehouseAttachmentRest.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/shstorehouseattachment/ShStorehouseAttachmentRest.java new file mode 100644 index 00000000..91c29634 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/shstorehouseattachment/ShStorehouseAttachmentRest.java @@ -0,0 +1,96 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.controller.shstorehouseattachment; + +import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentDetailsVo; +import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentDto; +import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentQuery; +import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentVo; +import com.wh.service.shstorehouseattachment.ShStorehouseAttachmentService; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: ShStorehouseAttachmentFeignFallback.java
+ * Class: com.wh.biz.shstorehouseattachment.ShStorehouseAttachmentRest
+ * Description: 库房附件,如合同,图片等.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-14 23:18:54
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@CrossOrigin +@Api(tags = "库房附件,如合同,图片等") +@RestController("com.wh.biz.shstorehouseattachment.ShStorehouseAttachmentRest") +@RequestMapping("v1/shstorehouseattachment") +public class ShStorehouseAttachmentRest { + + @Autowired + private ShStorehouseAttachmentService shStorehouseAttachmentService; + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = shStorehouseAttachmentService.listPageVo(pq); + return rb.success().setData(pv); + } + + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody ShStorehouseAttachmentDto dto){ + ResultBean rb = ResultBean.fireFail(); + shStorehouseAttachmentService.saveOrUpdateDto(dto); + return rb.success(); + } + + @ApiOperation("根据sid批量删除") + @PostMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + shStorehouseAttachmentService.delBySids(sids); + return rb.success(); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + ShStorehouseAttachmentDetailsVo vo = shStorehouseAttachmentService.fetchDetailsVoBySid(sid); + return rb.success().setData(vo); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/shstorehouseattribute/ShStorehouseAttributeRest.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/shstorehouseattribute/ShStorehouseAttributeRest.java new file mode 100644 index 00000000..8e883246 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/shstorehouseattribute/ShStorehouseAttributeRest.java @@ -0,0 +1,96 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.controller.shstorehouseattribute; + +import com.wh.pojo.shstorehouseattribute.ShStorehouseAttributeDetailsVo; +import com.wh.pojo.shstorehouseattribute.ShStorehouseAttributeDto; +import com.wh.pojo.shstorehouseattribute.ShStorehouseAttributeQuery; +import com.wh.pojo.shstorehouseattribute.ShStorehouseAttributeVo; +import com.wh.service.shstorehouseattribute.ShStorehouseAttributeService; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: ShStorehouseAttributeFeignFallback.java
+ * Class: com.wh.biz.shstorehouseattribute.ShStorehouseAttributeRest
+ * Description: 库房性质.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-14 23:18:54
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@CrossOrigin +@Api(tags = "库房性质") +@RestController("com.wh.biz.shstorehouseattribute.ShStorehouseAttributeRest") +@RequestMapping("v1/shstorehouseattribute") +public class ShStorehouseAttributeRest { + + @Autowired + private ShStorehouseAttributeService shStorehouseAttributeService; + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = shStorehouseAttributeService.listPageVo(pq); + return rb.success().setData(pv); + } + + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody ShStorehouseAttributeDto dto){ + ResultBean rb = ResultBean.fireFail(); + shStorehouseAttributeService.saveOrUpdateDto(dto); + return rb.success(); + } + + @ApiOperation("根据sid批量删除") + @PostMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + shStorehouseAttributeService.delBySids(sids); + return rb.success(); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + ShStorehouseAttributeDetailsVo vo = shStorehouseAttributeService.fetchDetailsVoBySid(sid); + return rb.success().setData(vo); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/stock/StockController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/stock/StockController.java new file mode 100644 index 00000000..5f396218 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/stock/StockController.java @@ -0,0 +1,26 @@ +package com.wh.controller.stock; + + +import com.wh.service.stock.StockService; +import com.wh.vo.PageResult; +import com.wh.vo.SysResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@CrossOrigin +@RequestMapping("/stock/") +public class StockController { + + @Autowired + private StockService stockService; + + @GetMapping("list") + public SysResult getStockList(PageResult pageResult){ + pageResult = stockService.getStockList(pageResult); + return SysResult.success(pageResult); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehousemanage/PutInController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehousemanage/PutInController.java new file mode 100644 index 00000000..6ef28d9f --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehousemanage/PutInController.java @@ -0,0 +1,54 @@ +package com.wh.controller.storehousemanage; + + +import com.wh.pojo.InStorehouse; +import com.wh.service.instorehouse.PutInService; +import com.wh.vo.PageResult; +import com.wh.vo.SysResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +@RestController +@CrossOrigin +@RequestMapping("/putIn/") +public class PutInController { + + @Autowired + private PutInService putInService; + + @GetMapping("getQuery") + public SysResult getQuery(InStorehouse inStorehouse){ + Map map = putInService.getQuery(inStorehouse); + return SysResult.success(map); + } + + @PostMapping("addInStorehouse") + public SysResult addInStorehouse(@RequestBody InStorehouse inStorehouse){ + String data = putInService.addInStorehouse(inStorehouse); + return SysResult.success(data); + } + + @GetMapping("list") + public SysResult getInStorehouseList(PageResult pageResult){ + pageResult = putInService.getInStorehouseList(pageResult); + return SysResult.success(pageResult); + } + + @PutMapping("updataInStorehouse") + public SysResult updataInStorehouse(@RequestBody InStorehouse inStorehouse){ +// System.out.println(inStorehouse); + putInService.updataInStorehouse(inStorehouse); + return SysResult.success(); + } + + @DeleteMapping("deleteInStorehouse/{inStorehouseId}/{receivingId}") + public SysResult deleteInStorehouse(@PathVariable String inStorehouseId,@PathVariable String receivingId){ + String data = putInService.deleteInStorehouse(inStorehouseId,receivingId); + return SysResult.success(data); + } + + + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehousemanage/RemoveController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehousemanage/RemoveController.java new file mode 100644 index 00000000..540f448d --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehousemanage/RemoveController.java @@ -0,0 +1,44 @@ +package com.wh.controller.storehousemanage; + +import com.wh.pojo.Remove; +import com.wh.service.storehousemanage.RemoveService; +import com.wh.vo.PageResult; +import com.wh.vo.SysResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +@RestController +@CrossOrigin +@RequestMapping("/remove/") +public class RemoveController { + + @Autowired + private RemoveService removeService; + + @GetMapping("getQuery") + public SysResult getQuery(Remove remove){ + Map map = removeService.getQuery(remove); + return SysResult.success(map); + } + + @PostMapping("addRemove") + public SysResult addRemove(@RequestBody Remove remove){ + removeService.addRemove(remove); + return SysResult.success(); + } + + @GetMapping("list") + public SysResult getRemoveList(PageResult pageResult){ + pageResult = removeService.getRemoveList(pageResult); + return SysResult.success(pageResult); + } + + @PutMapping("updata") + public SysResult updataRemove(@RequestBody Remove remove){ + removeService.updataRemove(remove); + return SysResult.success(); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehousemanage/ShelvesController.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehousemanage/ShelvesController.java new file mode 100644 index 00000000..85d7565a --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehousemanage/ShelvesController.java @@ -0,0 +1,57 @@ +package com.wh.controller.storehousemanage; + +import com.wh.pojo.OnShelves; +import com.wh.service.storehousemanage.ShelvesService; +import com.wh.vo.PageResult; +import com.wh.vo.QueryInfo; +import com.wh.vo.SysResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +@RestController +@CrossOrigin +@RequestMapping("/shelves/") +public class ShelvesController { + + @Autowired + private ShelvesService shelvesService; + + @GetMapping("getQuery") + public SysResult getQuery(QueryInfo queryInfo){ + Map map = shelvesService.getQuery(queryInfo); + if (map.size()==0){ + return SysResult.notEnough(); + }else { + return SysResult.success(map); + } + } + + @PostMapping("add") + public SysResult addShelves(@RequestBody OnShelves onShelves){ +// System.out.println(onShelves); + shelvesService.addShelves(onShelves); + return SysResult.success(); + } + + @GetMapping("getShelves") + public SysResult getShelves(PageResult pageResult){ + pageResult = shelvesService.getShelves(pageResult); + return SysResult.success(pageResult); + } + + @DeleteMapping("deleteShelves/{id}") + public SysResult deleteShelves(@PathVariable String id){ + shelvesService.deleteShelves(id); + return SysResult.success(); + } + + @PutMapping("updataShelves") + public SysResult updataShelves(@RequestBody OnShelves onShelves) throws Exception { + System.out.println(onShelves); + shelvesService.updataShelves(onShelves); + return SysResult.success(); + } + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehouseproject/StoreHouseProjectRest.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehouseproject/StoreHouseProjectRest.java new file mode 100644 index 00000000..b0c6b0f5 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/storehouseproject/StoreHouseProjectRest.java @@ -0,0 +1,35 @@ +package com.wh.controller.storehouseproject; + +import com.wh.pojo.shstorehouse.ShStorehouseDto; +import com.wh.pojo.storehouseproject.StoreHouseProjectDto; +import com.wh.service.storehouseproject.StoreHouseProjectService; +import com.yxt.common.core.result.ResultBean; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @author wangpengfei + * @date 2023/7/19 15:31 + */ +@CrossOrigin +@Api(tags = "库房信息表") +@RestController("com.wh.biz.storehouseproject.StoreHouseProjectRest") +@RequestMapping("v1/storehouseproject") +public class StoreHouseProjectRest { + + @Autowired + StoreHouseProjectService storeHouseProjectService; + + + + // + @ApiOperation("新增或修改") + @PostMapping("/saveOrUpdateDto") + public ResultBean saveOrUpdateDto(@RequestBody StoreHouseProjectDto dto){ + ResultBean rb = ResultBean.fireFail(); + storeHouseProjectService.saveOrUpdateDto(dto); + return rb.success(); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/sysuser/SysUserRest.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/sysuser/SysUserRest.java new file mode 100644 index 00000000..a24ea424 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/controller/sysuser/SysUserRest.java @@ -0,0 +1,198 @@ +package com.wh.controller.sysuser; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.wh.pojo.sysuser.*; +import com.wh.service.sysuser.SysUserService; +import com.yxt.common.base.config.RedisUtil; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.utils.Encodes; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.FileUploadResult; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** + * Project: anrui_portal(门户建设)
+ * File: SysUserFeignFallback.java
+ * Class: SysUserRest
+ * Description: 用户表.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2021-08-03 00:24:30
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Api(tags = "用户表") +@RestController +@RequestMapping("v1/sysuser") +public class SysUserRest { + @Autowired + private RedisUtil redisUtil; + @Autowired + private SysUserService sysUserService; + @Autowired + private FileUploadComponent fileUploadComponent; + // 定义点选文字图片验证码允许的误差值 + private static final int ERROR_AMOUNT = 50;// 定义允许的误差值,单位是px + @ApiOperation("根据条件分页查询数据的列表 ") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + ResultBean rb = ResultBean.fireFail();//roleSid + PagerVo pv = sysUserService.listPageVo(pq); + return rb.success().setData(pv); + } + @ApiOperation("根据条件查询所有数据列表") + @PostMapping("/listAll") + public ResultBean> listAll(@RequestBody SysUserQuery query) { + ResultBean rb = ResultBean.fireFail(); + List list = sysUserService.listAllVo(query); + return rb.success().setData(list); + } + @ApiOperation("所有数据列表") + @GetMapping("/list") + public ResultBean> list() { + ResultBean rb = ResultBean.fireFail(); + List list = sysUserService.listVo(); + return rb.success().setData(list); + } + + @PostMapping("/saveOpenId") + public ResultBean saveOpenId(@RequestBody SysUserDto dto){ + ResultBean rb=new ResultBean(); + SysUser sysUser=sysUserService.getOne(new QueryWrapper().eq("sid",dto.getSid())); + sysUser.setOpenId(dto.getOpenid()); + sysUserService.update(sysUser,new QueryWrapper().eq("sid",dto.getSid())); + return rb.success().setMsg("保存成功"); + } + @PostMapping("/saveBank") + public ResultBean saveBank(@RequestBody SysUserDto dto) { + ResultBean rb = ResultBean.fireFail(); + //手机号 + String mobile = dto.getMobile(); + //姓名 + String name = dto.getName(); + //用户类型 + int userType = dto.getUserType(); + //部门sid + if (StringUtils.isBlank(mobile)) { + return new ResultBean().fail().setMsg("手机号不能为空"); + } else { + SysUser one = sysUserService.fetchByUserName(mobile); + if (null != one) { + return new ResultBean().fail().setMsg("手机号重复!`"); + } + } + if (StringUtils.isBlank(name)) { + return new ResultBean().fail().setMsg("姓名不能为空"); + } + if (userType == 0) { + return new ResultBean().fail().setMsg("用户类型不能为空"); + } + String password = mobile.substring(5, 11); + String md5 = Encodes.md5(password); + SysUser su = new SysUser(); + dto.fillEntity(su); + su.setSid(UUID.randomUUID().toString()); + su.setStaffSid(dto.getBankMessageSid()); + su.setUserName(mobile); + su.setPassword(md5); + sysUserService.save(su); + return rb.success(); + } + + @GetMapping("/getUserBySid") + public ResultBean getUserBySid(@RequestParam("sid")String sid) { + SysUser sysUser = sysUserService.getUserBySid(sid); + return new ResultBean().success().setData(sysUser); + } + + @PostMapping("/login") + @ResponseBody + @ApiOperation(value = "3、登录") + @ApiOperationSupport(order = 30) + public ResultBean login(@RequestBody SysUserQuery userQuery) { + String userName = userQuery.getUserName(); + String password = userQuery.getPassword(); + // 遍历其中的map,取出每个属性值 + if (StringUtils.isBlank(userName)) { + return new ResultBean().fail().setMsg("用户名不能为空"); + } + if (StringUtils.isBlank(password)) { + return new ResultBean().fail().setMsg("密码不能为空"); + } + SysUser user = null; + // 验证通过之后删除redis上的验证过的该条uuid + String md5 = Encodes.md5(password); + user = sysUserService.selectByUserNameAndPassword(userName,md5); + if (user == null) { + return new ResultBean().fail().setMsg("用户名或密码错误"); + } + // 根据用户信息查询用户的角色信息 + SysUserVo userInfoOneVo = new SysUserVo();//sysUserService.setUserRedisSessionToken(user); + BeanUtil.copyProperties(user,userInfoOneVo); + return new ResultBean().success().setData(userInfoOneVo); + } + + /** + * 退出登录 + * + * @return + */ + @PostMapping("/signOut") + @ResponseBody + @ApiOperation(value = "退出登录") + @ApiOperationSupport(order = 30) + public ResultBean signOut(HttpServletRequest httpServletRequest) { + String token = httpServletRequest.getHeader("token"); + String redisToken = redisUtil.get(token); + if (StringUtils.isBlank(redisToken)) { + return ResultBean.fireSuccess().setMsg("您已退出,请刷新"); + } + redisUtil.remove(token); + return ResultBean.fireSuccess().setMsg("退出成功"); + } + + + @GetMapping("getUserByType") + public ResultBean getUserByType(@RequestParam("userType") String userType){ + return sysUserService.getUserByType(userType); + } + @GetMapping("getUserOrgBySid") + public ResultBean getUserOrgBySid(@RequestParam("sid") String sid){ + return sysUserService.getUserOrgBySid(sid); + } + + @PostMapping("/uploadfile") + public ResultBean uploadImage(@RequestParam(value = "file") MultipartFile file) { + ResultBean rb = ResultBean.fireFail(); + if (file == null || file.isEmpty()) { + return rb.setMsg("文件为空"); + } + rb = fileUploadComponent.uploadFile(file, null); + return rb; + } + + @PostMapping("/uploadImage") + public ResultBean updateSysUserImage(@RequestBody Map map){ + return sysUserService.updateSysUserImage(map); + } + @PostMapping("/getUsersBySid") + public ResultBean> getUsersBySid(@RequestBody List list){ + return sysUserService.getUsersBySid(list); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/RightsMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/RightsMapper.java new file mode 100644 index 00000000..0d11b903 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/RightsMapper.java @@ -0,0 +1,7 @@ +package com.wh.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.Rights; + +public interface RightsMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/UserMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/UserMapper.java new file mode 100644 index 00000000..6f3d33bb --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/UserMapper.java @@ -0,0 +1,7 @@ +package com.wh.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.User; + +public interface UserMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/instorehouse/InStorehouseListingMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/instorehouse/InStorehouseListingMapper.java new file mode 100644 index 00000000..3a1f0ced --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/instorehouse/InStorehouseListingMapper.java @@ -0,0 +1,9 @@ +package com.wh.mapper.api.instorehouse; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.api.InStorehouseListing; +import com.wh.pojo.api.InStorehouseMain; + + +public interface InStorehouseListingMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/instorehouse/InStorehouseMainMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/instorehouse/InStorehouseMainMapper.java new file mode 100644 index 00000000..2e70c310 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/instorehouse/InStorehouseMainMapper.java @@ -0,0 +1,19 @@ +package com.wh.mapper.api.instorehouse; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.wh.pojo.InStorehouse; +import com.wh.pojo.api.InStoreHouseMainVo; +import com.wh.pojo.api.InStorehouseMain; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface InStorehouseMainMapper extends BaseMapper { + IPage selectPageVo(IPage page, + @Param(Constants.WRAPPER) Wrapper qw); + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/outstorehouse/OutStorehouseListingMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/outstorehouse/OutStorehouseListingMapper.java new file mode 100644 index 00000000..60cf89cf --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/outstorehouse/OutStorehouseListingMapper.java @@ -0,0 +1,13 @@ +package com.wh.mapper.api.outstorehouse; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.api.InStorehouseListing; +import com.wh.pojo.api.OutStorehouseListing; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.Param; + + +public interface OutStorehouseListingMapper extends BaseMapper { + @Delete("delete from out_storehouse_listing where main_sid=#{mainSid}") + int deleteByMainSid(@Param("mainSid") String sid); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/outstorehouse/OutStorehouseMainMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/outstorehouse/OutStorehouseMainMapper.java new file mode 100644 index 00000000..f8a79e15 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/outstorehouse/OutStorehouseMainMapper.java @@ -0,0 +1,23 @@ +package com.wh.mapper.api.outstorehouse; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.wh.pojo.api.InStoreHouseMainVo; +import com.wh.pojo.api.InStorehouseMain; +import com.wh.pojo.api.OutStorehouseMain; +import com.wh.pojo.api.OutStorehouseVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +@Mapper +public interface OutStorehouseMainMapper extends BaseMapper { + IPage selectPageVo(IPage page, + @Param(Constants.WRAPPER) Wrapper qw); +@Select("select * from out_storehouse_main where state=1 and custer_sid=#{custerSid};") + List listAllForPicking(@Param("custerSid")String custerSid); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/prodstock/ProdStockMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/prodstock/ProdStockMapper.java new file mode 100644 index 00000000..7e9fb78f --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/api/prodstock/ProdStockMapper.java @@ -0,0 +1,22 @@ +package com.wh.mapper.api.prodstock; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.api.InStorehouseMain; +import com.wh.pojo.api.ProdStock; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Update; + + +public interface ProdStockMapper extends BaseMapper { + @Update("update prod_stock set num=num-#{num} , calculated_value=(num*confirmed_price) where pro_sid=#{proSid} and custer_sid=#{custerSid}") + void reduceNumByProdSidAndCustSid(@Param("proSid") String proSid, @Param("custerSid")String custerSid, + @Param("num")String num); + @Update("update prod_stock set num=num+#{num}, calculated_value=(num*confirmed_price) " + + " where pro_sid=#{proSid} and custer_sid=#{custerSid} and store_house_sid=#{storehousesid}" + + " and location_number=#{locationnum}") + void addNumByProdSidAndCustSid(@Param("proSid")String proSid, @Param("custerSid")String custerSid, + @Param("num")String num, @Param("storehousesid")String storehousesid, + @Param("locationnum")String locationnum); + @Update("update prod_stock set num=#{num} , calculated_value=#{value} where id=#{id} ") + void updateByProdStockId(@Param("num")String num, @Param("value")String value, @Param("id")int id); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/brandinfo/BrandInfoMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/brandinfo/BrandInfoMapper.java new file mode 100644 index 00000000..b81b3699 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/brandinfo/BrandInfoMapper.java @@ -0,0 +1,69 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.mapper.brandinfo; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.wh.pojo.brandinfo.BrandInfo; +import com.wh.pojo.brandinfo.BrandInfoVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: BrandInfoMapper.java
+ * Class: com.supervise.biz.brandinfo.BrandInfoMapper
+ * Description: 品牌信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:28
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface BrandInfoMapper extends BaseMapper { + + //@Update("update brand_info set name=#{msg} where id=#{id}") + //IPage voPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from brand_info") + List selectListVo(); + @Select("select * from brand_info where code=#{code}") + BrandInfoVo selectByCode(String code); + @Select("select name,code from restricted_brand where code=#{code} group by name") + BrandInfo fetchByCodeForLimit(String brandSid); +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/dictcommon/DictCommonMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/dictcommon/DictCommonMapper.java new file mode 100644 index 00000000..6bf25ee0 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/dictcommon/DictCommonMapper.java @@ -0,0 +1,73 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.mapper.dictcommon; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.wh.pojo.dictcommon.DictCommon; +import com.wh.pojo.dictcommon.DictCommonDetailsVo; +import com.wh.pojo.dictcommon.DictCommonVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: DictCommonMapper.java
+ * Class: com.supervise.biz.dictcommon.DictCommonMapper
+ * Description: 数据字典——数据项.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:29
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface DictCommonMapper extends BaseMapper { + + //@Update("update dict_common set name=#{msg} where id=#{id}") + //IPage voPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from dict_common") + List selectListVo(); + @Select("select * from dict_common where dictkey=#{key}") + DictCommonDetailsVo fetchByKey(@Param("key")String key); + @Select("select * from dict_common where dictkey=#{key} and dictType=#{type}") + DictCommonDetailsVo fetchByKeyAndType(@Param("key")String key, @Param("type")String type); + @Select("select * from restricted_category where dictkey=#{key} and dictType=#{type}") + DictCommonDetailsVo fetchByKeyAndTypeForLimit(@Param("type")String category, @Param("key")String categoryKey); +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/dicttype/DictTypeMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/dicttype/DictTypeMapper.java new file mode 100644 index 00000000..11070e76 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/dicttype/DictTypeMapper.java @@ -0,0 +1,65 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.mapper.dicttype; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.wh.pojo.dicttype.DictType; +import com.wh.pojo.dicttype.DictTypeVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: DictTypeMapper.java
+ * Class: com.supervise.biz.dicttype.DictTypeMapper
+ * Description: 数据字典——数据类型.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:29
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface DictTypeMapper extends BaseMapper { + + //@Update("update dict_type set name=#{msg} where id=#{id}") + //IPage voPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from dict_type") + List selectListVo(); +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/entinfo/EntInfoMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/entinfo/EntInfoMapper.java new file mode 100644 index 00000000..5e02c5ff --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/entinfo/EntInfoMapper.java @@ -0,0 +1,65 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.mapper.entinfo; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.wh.pojo.entinfo.EntInfo; +import com.wh.pojo.entinfo.EntInfoVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * Project: warehouse(仓储)
+ * File: EntInfoMapper.java
+ * Class: com.wh.biz.entinfo.EntInfoMapper
+ * Description: 客户信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-13 22:19:45
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface EntInfoMapper extends BaseMapper { + + //@Update("update ent_info set name=#{msg} where id=#{id}") + //IPage voPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from ent_info") + List selectListVo(); +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/LocationMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/LocationMapper.java new file mode 100644 index 00000000..99c2b0f6 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/LocationMapper.java @@ -0,0 +1,15 @@ +package com.wh.mapper.initial; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.Location; +import com.wh.pojo.LocationVo; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +public interface LocationMapper extends BaseMapper { + @Select("select * from location ") + List listAll(); + @Select("select * from location where storehouseid=#{id};") + List getLocationsByStoreId(String id); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/LocationTypeMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/LocationTypeMapper.java new file mode 100644 index 00000000..e67b5458 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/LocationTypeMapper.java @@ -0,0 +1,7 @@ +package com.wh.mapper.initial; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.LocationType; + +public interface LocationTypeMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/ProductMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/ProductMapper.java new file mode 100644 index 00000000..004333da --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/ProductMapper.java @@ -0,0 +1,7 @@ +package com.wh.mapper.initial; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.Product; + +public interface ProductMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/StorehouseMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/StorehouseMapper.java new file mode 100644 index 00000000..3dc93d21 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/StorehouseMapper.java @@ -0,0 +1,7 @@ +package com.wh.mapper.initial; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.Storehouse; + +public interface StorehouseMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/SupplierMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/SupplierMapper.java new file mode 100644 index 00000000..1342b86d --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/initial/SupplierMapper.java @@ -0,0 +1,12 @@ +package com.wh.mapper.initial; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.Supplier; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +public interface SupplierMapper extends BaseMapper { + @Select("select * from supplier") + List listAll(); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/instorehouse/PurchaseMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/instorehouse/PurchaseMapper.java new file mode 100644 index 00000000..cf2c8761 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/instorehouse/PurchaseMapper.java @@ -0,0 +1,7 @@ +package com.wh.mapper.instorehouse; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.Purchase; + +public interface PurchaseMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/instorehouse/PutInMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/instorehouse/PutInMapper.java new file mode 100644 index 00000000..66e95579 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/instorehouse/PutInMapper.java @@ -0,0 +1,8 @@ +package com.wh.mapper.instorehouse; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.InStorehouse; + + +public interface PutInMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/instorehouse/ReceivingMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/instorehouse/ReceivingMapper.java new file mode 100644 index 00000000..dc56c74c --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/instorehouse/ReceivingMapper.java @@ -0,0 +1,7 @@ +package com.wh.mapper.instorehouse; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.Receiving; + +public interface ReceivingMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/outstorehouse/OutStorehouseMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/outstorehouse/OutStorehouseMapper.java new file mode 100644 index 00000000..c5feff99 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/outstorehouse/OutStorehouseMapper.java @@ -0,0 +1,7 @@ +package com.wh.mapper.outstorehouse; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.OutStorehouse; + +public interface OutStorehouseMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/outstorehouse/PickingMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/outstorehouse/PickingMapper.java new file mode 100644 index 00000000..440ea3c5 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/outstorehouse/PickingMapper.java @@ -0,0 +1,7 @@ +package com.wh.mapper.outstorehouse; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.Picking; + +public interface PickingMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/purchasenew/PurchasenewMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/purchasenew/PurchasenewMapper.java new file mode 100644 index 00000000..c5cfff2d --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/purchasenew/PurchasenewMapper.java @@ -0,0 +1,76 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.mapper.purchasenew; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.wh.pojo.purchasenew.Purchasenew; +import com.wh.pojo.purchasenew.PurchasenewVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.Update; + +import java.util.List; + +/** + * Project: warehouse(仓储)
+ * File: PurchasenewMapper.java
+ * Class: com.wh..biz.purchasenew.PurchasenewMapper
+ * Description: 采购订单.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-10 18:09:57
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface PurchasenewMapper extends BaseMapper { + + //@Update("update purchasenew set name=#{msg} where id=#{id}") + //IPage voPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from purchasenew") + List selectListVo(); + + /** + * 将采购订单的状态修改为已入库 + * @param sid + * @return + */ + @Update("update purchasenew set status='2' where sid=#{sid}") + int updatePutInStatus(@Param("sid") String sid); + @Select("select * from purchasenew where state=1 ")//and cust_id=#{custId} + List listForInput( String custId);//@Param("custId") +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/purchasenewproduct/PurchasenewProductMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/purchasenewproduct/PurchasenewProductMapper.java new file mode 100644 index 00000000..fd40ac7b --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/purchasenewproduct/PurchasenewProductMapper.java @@ -0,0 +1,73 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.mapper.purchasenewproduct; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.wh.pojo.purchasenewproduct.PurchasenewProduct; +import com.wh.pojo.purchasenewproduct.PurchasenewProductVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * Project: warehouse(仓储)
+ * File: PurchasenewProductMapper.java
+ * Class: com.wh..biz.purchasenewproduct.PurchasenewProductMapper
+ * Description: purchasenew_product.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-10 18:09:57
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface PurchasenewProductMapper extends BaseMapper { + + //@Update("update purchasenew_product set name=#{msg} where id=#{id}") + //IPage voPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from purchasenew_product") + List selectListVo(); + + /** + * 根据采购订单的sid查询 对应的商品列表 + * @param sid + * @return + */ + @Select("select * from purchasenew_product where main_sid=#{sid}") + List fetchDetailsVoByPurchaseSid(String sid); +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/shstorehouse/ShStorehouseMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/shstorehouse/ShStorehouseMapper.java new file mode 100644 index 00000000..3542e3ea --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/shstorehouse/ShStorehouseMapper.java @@ -0,0 +1,75 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.mapper.shstorehouse; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.wh.pojo.shstorehouse.ShStorehouse; +import com.wh.pojo.shstorehouse.ShStorehouseVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.Update; + +import java.util.List; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: ShStorehouseMapper.java
+ * Class: com.wh.biz.shstorehouse.ShStorehouseMapper
+ * Description: 库房信息表.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-14 23:18:54
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface ShStorehouseMapper extends BaseMapper { + + //@Update("update sh_storehouse set name=#{msg} where id=#{id}") + //IPage voPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectSh(List list); + @Select("select * from sh_storehouse where sid=#{shSid}") + ShStorehouseVo selectStoreBySid(@Param("shSid")String shSid); + @Select("select * from storehouse_project p left join sh_storehouse s on s.sid=p.sh_sid where p.project_sid=#{sid}") + List getStorehouseBySid(@Param("sid") String sid); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from sh_storehouse") + List selectListVo(); + + @Update("update sh_storehouse set picurl=#{url} where sid=#{sid} ") + int updatePicUrl(@Param("sid")String sid,@Param("url") String url); +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/shstorehouseattachment/ShStorehouseAttachmentMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/shstorehouseattachment/ShStorehouseAttachmentMapper.java new file mode 100644 index 00000000..61351b66 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/shstorehouseattachment/ShStorehouseAttachmentMapper.java @@ -0,0 +1,68 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.mapper.shstorehouseattachment; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachment; +import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentVo; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: ShStorehouseAttachmentMapper.java
+ * Class: com.wh.biz.shstorehouseattachment.ShStorehouseAttachmentMapper
+ * Description: 库房附件,如合同,图片等.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-14 23:18:54
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface ShStorehouseAttachmentMapper extends BaseMapper { + + //@Update("update sh_storehouse_attachment set name=#{msg} where id=#{id}") + //IPage voPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from sh_storehouse_attachment") + List selectListVo(); + @Delete("delete from sh_storehouse_attachment where storehouse_sid=#{shsid}") + void deleteByHouseSid(@Param("shsid") String dtoSid); +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/shstorehouseattribute/ShStorehouseAttributeMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/shstorehouseattribute/ShStorehouseAttributeMapper.java new file mode 100644 index 00000000..b31aad64 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/shstorehouseattribute/ShStorehouseAttributeMapper.java @@ -0,0 +1,65 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.mapper.shstorehouseattribute; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.wh.pojo.shstorehouseattribute.ShStorehouseAttribute; +import com.wh.pojo.shstorehouseattribute.ShStorehouseAttributeVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: ShStorehouseAttributeMapper.java
+ * Class: com.wh.biz.shstorehouseattribute.ShStorehouseAttributeMapper
+ * Description: 库房性质.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-14 23:18:54
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface ShStorehouseAttributeMapper extends BaseMapper { + + //@Update("update sh_storehouse_attribute set name=#{msg} where id=#{id}") + //IPage voPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from sh_storehouse_attribute") + List selectListVo(); +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/stock/StockMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/stock/StockMapper.java new file mode 100644 index 00000000..ce34d161 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/stock/StockMapper.java @@ -0,0 +1,7 @@ +package com.wh.mapper.stock; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.Stock; + +public interface StockMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/storehousemanage/RemoveMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/storehousemanage/RemoveMapper.java new file mode 100644 index 00000000..b2219cbd --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/storehousemanage/RemoveMapper.java @@ -0,0 +1,7 @@ +package com.wh.mapper.storehousemanage; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.Remove; + +public interface RemoveMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/storehousemanage/ShelvesMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/storehousemanage/ShelvesMapper.java new file mode 100644 index 00000000..f564b93e --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/storehousemanage/ShelvesMapper.java @@ -0,0 +1,7 @@ +package com.wh.mapper.storehousemanage; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.OnShelves; + +public interface ShelvesMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/storehouseproject/StoreHouseProjectMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/storehouseproject/StoreHouseProjectMapper.java new file mode 100644 index 00000000..ba4a4ea6 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/storehouseproject/StoreHouseProjectMapper.java @@ -0,0 +1,13 @@ +package com.wh.mapper.storehouseproject; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.wh.pojo.storehouseproject.StoreHouseProject; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author wangpengfei + * @date 2023/7/19 15:43 + */ +@Mapper +public interface StoreHouseProjectMapper extends BaseMapper { +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/sysuser/SysUserMapper.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/sysuser/SysUserMapper.java new file mode 100644 index 00000000..b129706b --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/mapper/sysuser/SysUserMapper.java @@ -0,0 +1,157 @@ +package com.wh.mapper.sysuser; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.wh.pojo.sysuser.SysUser; +import com.wh.pojo.sysuser.SysUserInfoVo; +import com.wh.pojo.sysuser.SysUserVo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.Update; + +import java.util.List; +import java.util.Map; + +/** + * Project: anrui_portal(门户建设)
+ * File: SysUserMapper.java
+ * Class: SysUserMapper
+ * Description: 用户表.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2021-08-03 00:24:30
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface SysUserMapper extends BaseMapper { + + //@Update("update sys_user set name=#{msg} where id=#{id}") + //IPage voPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper ew, @Param("orgName") String orgName, @Param("userName") String userName); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("SELECT user.*,staff.name FROM sys_user user left join sys_staffinfo staff on user.staffSid=staff.sid where user.isDelete=0") + List selectListVo(); + + public int updatePassword(String sid, String password); + public int deleteBySid(String sid); + + public int updatePasswordApp(String sid, String password); + + SysUser selectByUserName(String userName); + + SysUser selectByUserNameApp(String userName); + + SysUser selectByAppId(String appId); + + @Update("UPDATE sys_user SET appId=#{appId} WHERE sid=#{sid} and userType=1") + int updateAppId(@Param("sid") String sid, @Param("appId") String appId); + + @Update("UPDATE sys_user SET token=#{token} WHERE sid=#{sid}") + int updateToken(@Param("sid") String sid, @Param("token") String token); + + SysUser fetchByUserName(String userName); + + void delBySid(String sid); + + @Update("UPDATE sys_user SET headImage=#{headImage} WHERE sid=#{sid}") + int updateHeadImage(@Param("sid") String sid, @Param("headImage") String headImage); + + /** + * @param mobile 手机号 + * @param userType 用户类型 + * @description: 根据手机号和用户类型查询客户是否存在 + * @return: + * @Author: dimengzhe + * @Date: 2021/10/6 11:35 + */ + SysUser selectByMobileAndType(@Param("mobile") String mobile, @Param("userType") int userType); + + + // @Select("SELECT * FROM sys_user WHERE staffSid=#{staffSid} and isDelete=0") + SysUserVo selectByStaffsid(@Param("staffSid") String staffSid); + + @Update("update sys_user set isDelete=1 where isDelete=0 and userType=2 and userName=#{mobile}") + int delSysUserByMobile(@Param("mobile") String mobile); + + @Select("select sid from sys_user") + List selectAllUserSid(); + + + /** + * 根据用户sid查询用户的组织信息 + * + * @param userSid 用户的sid + * @return + */ + SysUserInfoVo selectUserInfoByUserSid(String userSid); + SysUserInfoVo selectUserInfoByUserSidOne(@Param("userSid") String userSid,@Param("orgSid") String orgSid); + + /** + * 根据员工sid更新用户的工号以及手机号 + * + * @param mobile 手机号 + * @param sid 员工sid + * @return + */ + int updateByStaffSid( @Param("mobile") String mobile, @Param("sid") String sid); + + /** + * 根据员工sid更新用户中的员工工号 + * + * @param jobNumber 员工工号 + * @param sid 员工sid + * @return + */ + int updateByStaSid(@Param("jobNumber") String jobNumber, @Param("sid") String sid); + + /** + * 根据手机号查询用户是否存在 + * + * @param mobile 手机号 + * @return + */ + SysUser selectByMobile(String mobile); + + int updateIsEnable(@Param("sid") String sid, @Param("isEnable") String isEnable); + + List getUsersByRoleSid(@Param("roleSid") String roleSid); + + List getUserByRole(@Param("roleSid") String roleSid, @Param("levelOrgSid") String levelOrgSid); + List getUserByRoleNoOrgPath(@Param("roleSid") String roleSid ); + List> getUserByOrgSid(@Param("orgSid") String orgSid,@Param("userSid") String userSid); + + List fetchBySids(@Param("sids")List sids); + + List getUserByRoleSid(String roleSid); + + /** + * 根据手机号解绑用户绑定的设备 + * @param mobile + * @return + */ + int updateAppIdByMobile(String mobile); + + /** + * 解绑所有用户绑定的设备 + * @return + */ + int updateAppIdAll(); + + String selectIdBySid(@Param("list") List stringList); + + List getUserMessageByRole(@Param("roleSid") String roleSid,@Param("levelOrgSid") String levelOrgSid, @Param("list") List stringList); + String fetchByUserNameAndUserPhone(@Param("userName") String userName, @Param("userPhone") String userPhone); + List getUserByType(@Param("userType")String userType); + List getUserOrgBySid(@Param("sid")String sid); + @Select("select * from sys_user where userName=#{userName} and password=#{md5}") + SysUser selectByUserNameAndPassword(@Param("userName")String userName, @Param("md5")String md5); +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/RightsService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/RightsService.java new file mode 100644 index 00000000..331d66fc --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/RightsService.java @@ -0,0 +1,9 @@ +package com.wh.service; + +import com.wh.pojo.Rights; + +import java.util.List; + +public interface RightsService { + List findRightsList(); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/RightsServiceImpl.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/RightsServiceImpl.java new file mode 100644 index 00000000..07c33f91 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/RightsServiceImpl.java @@ -0,0 +1,42 @@ +package com.wh.service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.wh.mapper.RightsMapper; +import com.wh.pojo.Rights; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class RightsServiceImpl implements RightsService{ + + @Autowired + private RightsMapper rightsMapper; + + /** + * 查询一级/二级菜单 + * 查询条件: 一级菜单 parent_id = 0 + * 二级菜单 parent_id = 一级的Id + * 作业: 利用左连接的方式 实现数据的封装 restMap + * @return + */ + @Override + public List findRightsList() { + //1.查询一级菜单数据 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("parent_id",0); + List oneList = + rightsMapper.selectList(queryWrapper); + //2.如何查询二级菜单 父子关系的封装!!! + for (Rights oneRights : oneList){ + //查询该元素的二级菜单 + //QueryWrapper queryWrapper2 = new QueryWrapper<>(); + queryWrapper.clear(); + queryWrapper.eq("parent_id",oneRights.getId()); + List twoList = rightsMapper.selectList(queryWrapper); + oneRights.setChildren(twoList); + } + return oneList; + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/UserService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/UserService.java new file mode 100644 index 00000000..af281d9d --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/UserService.java @@ -0,0 +1,7 @@ +package com.wh.service; + +import com.wh.pojo.User; + +public interface UserService { + String findUserByUP(User user); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/UserServiceImpl.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/UserServiceImpl.java new file mode 100644 index 00000000..f1e15978 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/UserServiceImpl.java @@ -0,0 +1,28 @@ +package com.wh.service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.wh.mapper.UserMapper; +import com.wh.pojo.User; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.DigestUtils; + +import java.util.UUID; + +@Service +public class UserServiceImpl implements UserService{ + + @Autowired + private UserMapper userMapper; + + @Override + public String findUserByUP(User user) { + String md5Pass = DigestUtils.md5DigestAsHex(user.getPassword().getBytes()); + user.setPassword(md5Pass); + QueryWrapper queryWrapper = new QueryWrapper(user); + User userDB = userMapper.selectOne(queryWrapper); + + String token = UUID.randomUUID().toString().replace("-", "")+user.getUsername(); + return userDB==null?null:token; + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/instorehouse/InStorehouseListingService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/instorehouse/InStorehouseListingService.java new file mode 100644 index 00000000..c1e5f34e --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/instorehouse/InStorehouseListingService.java @@ -0,0 +1,48 @@ +package com.wh.service.api.instorehouse; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.wh.mapper.api.instorehouse.InStorehouseListingMapper; +import com.wh.pojo.*; +import com.wh.pojo.api.*; +import com.yxt.common.base.service.MybatisBaseService; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class InStorehouseListingService extends MybatisBaseService { + + public Map getQuery(InStorehouse inStorehouse) { + + Map map = new HashMap<>(); + + return map; + } + + public List selectInStorehouseListingsByMainSid(String sid) { + List list=baseMapper.selectList( + new QueryWrapper().eq("main_sid",sid)); + return list; + } + + private QueryWrapper createQueryWrapper(OutStorehouseMainQuery query) { + // todo: 这里根据具体业务调整查询条件 + QueryWrapper qw = new QueryWrapper<>(); + + if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getApplicationDateStart())) { + qw.eq("main_sid", query.getMainSid()); + } + + return qw; + } + + public void deleteByMainSid(String sid) { + Map params=new HashMap<>(); + params.put("main_sid",sid); + baseMapper.deleteByMap(params); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/instorehouse/InStorehouseMainService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/instorehouse/InStorehouseMainService.java new file mode 100644 index 00000000..5635aa96 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/instorehouse/InStorehouseMainService.java @@ -0,0 +1,499 @@ +package com.wh.service.api.instorehouse; + + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.wh.api.Api; +import com.wh.mapper.api.instorehouse.InStorehouseMainMapper; +import com.wh.mapper.initial.LocationMapper; +import com.wh.pojo.*; +import com.wh.pojo.api.*; +import com.wh.pojo.purchasenew.Purchasenew; +import com.wh.pojo.purchasenew.PurchasenewDto; +import com.wh.pojo.purchasenewproduct.PurchasenewProduct; +import com.wh.pojo.purchasenewproduct.PurchasenewProductDto; +import com.wh.pojo.purchasenewproduct.PurchasenewProductVo; +import com.wh.service.api.prodstock.ProdStockService; +import com.wh.service.initial.LocationService; +import com.wh.service.initial.ProductService; +import com.wh.service.purchasenew.PurchasenewService; +import com.wh.service.purchasenewproduct.PurchasenewProductService; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Positive; +import java.math.BigDecimal; +import java.util.*; + +@Slf4j +@Service +public class InStorehouseMainService extends MybatisBaseService { + + @Autowired + private InStorehouseListingService inStorehouseListingService; + @Autowired + private ProdStockService prodStockService; + @Autowired + private LocationService locationService; + @Autowired + private LocationMapper locationMapper; + @Autowired + private PurchasenewService purchasenewService; + @Autowired + private PurchasenewProductService purchasenewProductService; + @Autowired + private InStorehouseMainService inStorehouseMainService; + @Autowired + private ProductService productService; + public ResultBean addInStorehouse(InStoreHouseMainDto inStoreHouseMainDto) { + log.info("/InStorehouseMainService/addInStorehouse:{}", JSONObject.toJSONString(inStoreHouseMainDto)); + ResultBean r = ResultBean.fireFail(); + if(inStoreHouseMainDto==null){ + return r.setMsg("数据不能为空"); + } + if(StringUtils.isBlank(inStoreHouseMainDto.getNo())){ + return r.setMsg("申请单编号不能为空"); + } + if(StringUtils.isBlank(inStoreHouseMainDto.getLocationId())){ + return r.setMsg("货位不能为空"); + } + List locationByLocationId = locationService.getLocationByLocationId(inStoreHouseMainDto.getLocationId()); + if(locationByLocationId==null||locationByLocationId.size()==0){ + return r.setMsg("货位信息不存在"); + } + if(locationByLocationId.size()>1){ + return r.setMsg("货位编号重复"); + } + Location location =locationByLocationId.get(0) ; + + QueryWrapper purchasenewWrapper = new QueryWrapper<>(); + purchasenewWrapper.eq("purchase_no",inStoreHouseMainDto.getNo()); + List list1 = purchasenewService.list(purchasenewWrapper); + if(list1==null||list1.size()==0){ + return r.setMsg("申请单不存在"); + } + Purchasenew purchasenew = list1.get(0); + PurchasenewDto dto =new PurchasenewDto(); + BeanUtil.copyProperties(purchasenew,dto); + String purchaseSid=purchasenew.getSid(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("purchase_sid",purchasenew.getSid()); + List inStorehouseMains = baseMapper.selectList(queryWrapper); + if(inStorehouseMains!=null&&inStorehouseMains.size()>0){ + return r.setMsg("申请单编号已经入库"); + } + List purchasenewProductVos = + purchasenewProductService.fetchDetailsVoByPurchaseSid(purchaseSid); + List products=new ArrayList<>(); + for (PurchasenewProductVo purchasenewProductVo : purchasenewProductVos) { + PurchasenewProductDto d=new PurchasenewProductDto(); + BeanUtil.copyProperties(purchasenewProductVo,d); + d.setStoreHouseName(location.getStorehouse()); + d.setStoreHouseSid(location.getStorehouseid()); + d.setLocationNumber(location.getName()); + d.setLocationId(location.getLocationId()); + products.add(d); + } + dto.setProducts(products); + saveOrUpdateByPurchaseSid(dto,purchaseSid); +// InStorehouseMain in=new InStorehouseMain(); +// BeanUtils.copyProperties(inStoreHouseMainDto,in); +// List list = inStoreHouseMainDto.getList(); +// if(list==null||list.size()==0){ +// return r.setMsg("商品不能为空"); +// } +// //申请单主表信息 +// baseMapper.insert(in); +// addListing(in, list); + return ResultBean.fireSuccess().setMsg("添加成功"); + } + @Transactional + public ResultBean addInStorehouses(InStoreHouseMainDto inStoreHouseMainDto) { + ResultBean r = ResultBean.fireFail(); + + InStorehouseMain in=new InStorehouseMain(); + BeanUtils.copyProperties(inStoreHouseMainDto,in); + List list = inStoreHouseMainDto.getList(); + + //申请单主表信息 + baseMapper.insert(in); + addListing(in, list); + String purchaseSid = in.getPurchaseSid(); + QueryWrapper qw = new QueryWrapper<>(); + qw.eq("sid",purchaseSid); + Purchasenew one = purchasenewService.getOne(qw); + one.setState(2); + one.setModifyTime(new Date()); + purchasenewService.updateById(one); + //purchasenewService.updateStateToInputBySid(in.getPurchaseSid()); + return ResultBean.fireSuccess().setMsg("添加成功"); + + } + public PagerVo listPage(PagerQuery pq) { + InStorehouseMainQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + private QueryWrapper createQueryWrapper(InStorehouseMainQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wraInStorehouseMainpper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + + if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getNo())) { + qw.like("no", query.getNo()); + } + if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getApplicationDateStart())) { + qw.ge("application_date", query.getApplicationDateStart()); + } + if (StrUtil.isNotBlank(query.getApplicationDateEnd())) { + qw.lt("application_date", query.getApplicationDateEnd()); + } + if (StrUtil.isNotBlank(query.getCreatorName())) { + qw.like("creator_name", query.getCreatorName()); + } + if (StrUtil.isNotBlank(query.getCusterName())) { + qw.like("custer_name", query.getCusterName()); + } + if (StrUtil.isNotBlank(query.getCusterSid())) { + qw.eq("custer_sid", query.getCusterSid()); + } + if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getStoreHouseName())) { + qw.like("store_house_name", query.getStoreHouseName()); + } + return qw; + } + /** + * 新增商品信息 + * @param in + * @param list + */ + @Transactional + public void addListing(InStorehouseMain in, List list) { + list.forEach(l->{ + l.setCusterSid(in.getCusterSid()); + l.setCusterName(in.getCusterName()); + l.setMainSid(in.getSid()); + inStorehouseListingService.insert(l); + saveOrUpdateProdStock(l); + }); + } + + /** + * 新增或者修改商品库存信息 + * @param l + */ + private void saveOrUpdateProdStock(InStorehouseListing l) { + PagerVo proStocks = getProdStock(l); + long total = proStocks.getTotal(); + if(total==0){ + addProdStock(l); + }else{ + updateProdStock(l, proStocks); + } + } + + /** + * 修改商品库存信息 + * @param l + * @param proStocks + */ + private void updateProdStock(InStorehouseListing l, PagerVo proStocks) { + ResultBean r = ResultBean.fireFail(); + ProdStock prodStock = proStocks.getRecords().get(0); + String num = prodStock.getNum(); + if(com.yxt.common.base.utils.StringUtils.isBlank(num)){ + // log.info("{}",l.getProName()+"商品数量不能为空"); + } + BigDecimal i=new BigDecimal(num).add(new BigDecimal(l.getNum())); + // prodStock.setNum(l.getNum()); + prodStock.setConfirmedPrice(l.getConfirmedPrice()); + prodStock.setNum(i.toString()); // TODO 当系统调试通后需要做修改 将下一行代码注释去掉 + BigDecimal multiply = new BigDecimal(prodStock.getNum()).multiply(new BigDecimal(prodStock.getConfirmedPrice())); + prodStock.setCalculatedValue(multiply.toString()); + prodStock.setStoreHouseName(l.getStoreHouseName()); + prodStock.setStoreHouseSid(l.getStoreHouseSid()); + prodStock.setModifyTime(new Date()); + prodStockService.updateById(prodStock); + } + + /** + * 新增商品库存信息 + * @param l + */ + private void addProdStock(InStorehouseListing l) { + ProdStock prodStock=new ProdStock(); + prodStock.setProName(l.getProName());// varchar 50 质物名称 + prodStock.setProModel(l.getProModel());// varchar 50 规格(型号) + prodStock.setManufacturer(l.getManufacturer());// varchar 50 生成厂家(产地) + prodStock.setNum(l.getNum());// varchar 10 数量 + prodStock.setWeight(l.getWeight());// varchar 50 重量 + prodStock.setConfirmedPrice(l.getConfirmedPrice());// decime 50 2 质权人确认的单价 + prodStock.setCalculatedValue(l.getCalculatedValue());// decime 50 2 核算的价值 + prodStock.setLocationNumber(l.getLocationNumber());// varchar 10 货位号 + prodStock.setLocationId(l.getLocationId());// varchar 10 货位号 + prodStock.setCusterName(l.getCusterName());// varchar 50 客户名称(企业) + prodStock.setProUnit(l.getProUnit());// varchar 50 规格单位 + prodStock.setCusterSid(l.getCusterSid());// varchar 64 客户Sid(企业) + prodStock.setStoreHouseSid(l.getStoreHouseSid());// varchar 64 仓库Sid + prodStock.setStoreHouseName(l.getStoreHouseName());// varchar 100 仓库名称 + prodStock.setProSid(l.getProSid()); + prodStock.setBrandInfoName(l.getBrandInfoName());//品牌名称 + prodStock.setBrandInfoKey(l.getBrandInfoKey());//品牌名称 + prodStock.setProductTypeName(l.getProductTypeName());//分类名称 + prodStock.setProductTypeKey(l.getProductTypeKey());//分类key + prodStockService.insert(prodStock); + ResultBean productListByNameAndCode = productService.getProductListByNameAndCode(l.getProName(), l.getProSid()); + if (productListByNameAndCode.getSuccess()){ + List data = (List) productListByNameAndCode.getData(); + if(data.size()==0){ + Product product=new Product(); + product.setName(l.getProName()); + product.setBarCode(l.getProSid()); + productService.addProduct(product); + } + } + } + + /** + * 根据商品的名称 规格 客户查询库存信息 + * @param l + * @return + */ + private PagerVo getProdStock(InStorehouseListing l) { + PagerQuery pq=new PagerQuery<>(); + pq.setCurrent(0); + pq.setSize(10); + ProdStockQuery stockQuery = new ProdStockQuery(); + stockQuery.setCusterSid(l.getCusterSid()); + stockQuery.setProModel(l.getProModel()); + stockQuery.setProName(l.getProName()); + stockQuery.setProSid(l.getProSid()); + stockQuery.setStoreHouseSid(l.getStoreHouseSid()); + stockQuery.setLocationNumber(l.getLocationNumber()); + stockQuery.setLocationId(l.getLocationId()); + pq.setParams(stockQuery); + PagerVo proStocks = prodStockService.getProStocks(pq); + return proStocks; + } + + public ResultBean getInStorehouse(String sid) { + ResultBean r = ResultBean.fireFail(); + InStorehouseMain inStorehouseMain = baseMapper.selectOne( + new QueryWrapper().eq("sid",sid)); + if(inStorehouseMain==null){ + return r.setMsg("数据不存在"); + } + InStoreHouseMainDetailVo ihmdv=new InStoreHouseMainDetailVo(); + BeanUtils.copyProperties(inStorehouseMain,ihmdv); + List list=inStorehouseListingService.selectInStorehouseListingsByMainSid(sid); + ihmdv.setList(list); + return ResultBean.fireSuccess().setData(ihmdv); + } + + /** + * 根据采购申请单保存入库单相关数据 + * @param dto + * @return + */ + @Transactional + public ResultBean saveOrUpdateByPurchaseSid(PurchasenewDto dto,String purchaseSid) { + ResultBean r = ResultBean.fireFail(); + Map params=new HashMap<>(); + params.put("purchase_sid",purchaseSid); + List inStorehouseMains = baseMapper.selectByMap(params); + if(inStorehouseMains!=null&&inStorehouseMains.size()>0){ + InStorehouseMain inStorehouseMain = inStorehouseMains.get(0); + dto.setSid(inStorehouseMain.getSid()); + deleteByMainSid(inStorehouseMain.getSid()); + deleteBySid(inStorehouseMain.getSid()); + } + InStoreHouseMainDto inStoreHouseMainDto=new InStoreHouseMainDto(); + inStoreHouseMainDto.setLocationName(dto.getProducts().get(0).getLocationNumber()); + inStoreHouseMainDto.setLocationId(dto.getProducts().get(0).getLocationId()); + inStoreHouseMainDto.setNo("RK"+dto.getPurchaseNo()); //varchar 50 编号 + inStoreHouseMainDto.setApplicationDate(dto.getPurchaseDate()); //date 50 制单日期 + inStoreHouseMainDto.setCreatorSid(dto.getPurchasePersonSid()); //varchar 64 制单人Sid + inStoreHouseMainDto.setCreatorName(dto.getPurchasePerson()); /// varchar 50 制单人姓名 + inStoreHouseMainDto.setCusterSid(dto.getCustId()); //varchar 64 客户Sid(企业) + inStoreHouseMainDto.setCusterName(dto.getCustName()); // varchar 100 客户名称(企业) + inStoreHouseMainDto.setStoreHouseSid(dto.getStorehouseId()); // varchar 64 仓库Sid + inStoreHouseMainDto.setStoreHouseName(dto.getStorehouseName()); // varchar 100 仓库名称 + List list=new ArrayList<>(); + List products = dto.getProducts(); + products.forEach(p->{ + InStorehouseListing ppd=new InStorehouseListing(); + ppd.setCusterSid(p.getCusterSid());// varchar 64 客户Sid(企业) + ppd.setCusterName(p.getCusterName()) ;//varchar 100 客户名称(企业) + ppd.setStoreHouseSid(p.getStoreHouseSid()) ;//varchar 64 仓库Sid + ppd.setStoreHouseName(p.getStoreHouseName()) ;//varchar 100 仓库名称 + ppd.setProName(p.getProName());// varchar 50 质物名称 + ppd.setProSid(p.getProId());// varchar 50 质物名称 + ppd.setProModel(p.getProModel()) ;//varchar 50 规格(型号) + ppd.setProUnit(p.getProUnit()) ;//varchar 50 规格单位 + ppd.setManufacturer(p.getManufacturer());// varchar 50 生成厂家(产地) + ppd.setNum(p.getEstimateNum()) ;//varchar 10 数量 + ppd.setWeight(p.getEstimateWeight()) ;//varchar 50 重量 + ppd.setConfirmedPrice(p.getEstimateConfirmedPrice());// decime 50 2 质权人确认的单价 + ppd.setCalculatedValue(p.getEstimateCalculatedValue()) ;//decime 50 2 核算的价值 + ppd.setLocationNumber(p.getLocationNumber()) ;//varchar 10 货位号 + ppd.setLocationId(p.getLocationId()) ;//varchar 10 货位号id + ppd.setPurchaseSid(purchaseSid);//采购申请单的sid + ppd.setBrandInfoName(p.getBrandInfoName());//品牌名称 + ppd.setBrandInfoKey(p.getBrandInfoKey());//品牌名称 + ppd.setProductTypeName(p.getProductTypeName());//分类名称 + ppd.setProductTypeKey(p.getProductTypeKey());//分类key + list.add(ppd); + }); + inStoreHouseMainDto.setList(list); + inStoreHouseMainDto.setPurchaseSid(purchaseSid);//采购申请单的sid + addInStorehouses(inStoreHouseMainDto); + return r.success(); + } + + /** + * 根据入库单的sid删除商品信息 减少库存数量 + * @param sid + * @return + */ + @Transactional + public ResultBean deleteByMainSid(String sid){ + ResultBean r = ResultBean.fireFail(); + List inStorehouseListings = inStorehouseListingService.selectInStorehouseListingsByMainSid(sid); +// inStorehouseListings.forEach(i->{ +// prodStockService.reduceNumByProdSidAndCustSid(i.getProSid(), i.getCusterSid(),i.getNum()); +// }); + inStorehouseListingService.deleteByMainSid(sid); + Map params=new HashMap<>(); + params.put("sid",sid); + baseMapper.deleteByMap(params); + return r.success(); + } + + public void deleteByPurchaseSid(String sid) { + Map params=new HashMap<>(); + params.put("purchase_sid",sid); + List inStorehouseMains = baseMapper.selectByMap(params); + if(inStorehouseMains!=null&&inStorehouseMains.size()>0){ + InStorehouseMain inStorehouseMain = inStorehouseMains.get(0); + deleteByMainSid(inStorehouseMain.getSid()); + } + } + + /** + * 获取所有未入库的采购订单编号和仓库信息 + * @return + */ + public Map getQuery(InStorehouseMainQuery query) { +// Purchasenew purchase = new Purchasenew(); +// if (org.springframework.util.StringUtils.hasLength(inStorehouse.getReceivingId())){ +// Receiving receivingAble = receivingMapper.selectById(inStorehouse.getReceivingId()); +// purchase = purchaseMapper.selectById(receivingAble.getPurchaseId()); +// } + + QueryWrapper receivingQueryWrapper = new QueryWrapper<>(); + receivingQueryWrapper.eq("status","已审核") + .select("receiving_id"); + + + QueryWrapper locationQueryWrapper = new QueryWrapper<>(); + locationQueryWrapper.eq("status","空闲") + .eq("type","入库区") + //.eq(org.springframework.util.StringUtils.hasLength(purchase.getStorehouse()),"storehouse",purchase.getStorehouse()) + .select("location_id"); + + //List receivingList = receivingMapper.selectList(receivingQueryWrapper); + Map params=new HashMap<>(); + params.put("status","1");//未入库的采购订单 + params.put("cust_id",query.getCusterSid());//未入库的采购订单 + List purchasenews = purchasenewService.listByMap(params); + List locationList = locationMapper.selectList(locationQueryWrapper); + + List> receivingIdList = new ArrayList<>(); + List> locationIdList = new ArrayList<>(); + + for (Purchasenew receiving : purchasenews){ + Map map=new HashMap<>(); + map.put("no",receiving.getPurchaseNo()); + map.put("sid",receiving.getSid()); + receivingIdList.add(map); + } + + if (locationList != null){ + for (Location location : locationList){ + Map map=new HashMap<>(); + map.put("locationId",location.getLocationId()); + map.put("locationName",location.getName()); + locationIdList.add(map); + } + } + Map map = new HashMap<>(); + map.put("receivingIdList",receivingIdList); + map.put("locationIdList",locationIdList); + return map; + } + + public ResultBean addInStorehouseByPurchase(PurchaseInStoreHouseParams params) { + ResultBean r = ResultBean.fireFail(); + String purchaseSid = params.getPurchaseSid(); + String userName = params.getUserName(); + String storeHouseSid = params.getStoreHouseSid(); + String storeHouseName = params.getStoreHouseName(); + +// Location location = locationMapper.selectById(storeHouseSid); +// if(location==null){ +// return r.setMsg("仓库信息不存在"); +// } + String custerSid = params.getCusterSid(); + Map param5=new HashMap<>(); + param5.put("sid",purchaseSid); + List purchasenews = purchasenewService.listByMap(param5); + if(purchasenews==null||purchasenews.size()==0){ + return r.setMsg("数据不存在"); + } + Purchasenew purchasenew = purchasenews.get(0); + Map params2=new HashMap<>(); + params2.put("purchase_sid",purchasenew.getSid()); + List inStorehouseMains = baseMapper.selectByMap(params2); + if(inStorehouseMains.size()>0){ + return r.setMsg("采购订单已经有入库记录"); + } + PurchasenewDto pd=new PurchasenewDto(); + BeanUtil.copyProperties(purchasenew,pd); + Map params3=new HashMap<>(); + params3.put("main_sid",purchasenew.getSid()); + List purchasenewProducts = purchasenewProductService.listByMap(params3); + if (purchasenewProducts==null||purchasenewProducts.size()==0){ + return r.setMsg("没有商品信息!"); + } + List purchasenewProductDtos =new ArrayList<>(); + purchasenewProducts.forEach(p->{ + PurchasenewProductDto ppd=new PurchasenewProductDto(); + BeanUtil.copyProperties(p,ppd); + ppd.setStoreHouseSid(storeHouseSid); + ppd.setStoreHouseName(storeHouseName); + purchasenewProductDtos.add(ppd); + }); + pd.setProducts(purchasenewProductDtos); + pd.setPurchasePersonSid(custerSid); + pd.setPurchasePerson(userName); + saveOrUpdateByPurchaseSid(pd,purchasenew.getSid()); + purchasenewService.updatePutInStatus(purchasenew.getSid()); + return r.success(); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/outstorehouse/OutStorehouseListingService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/outstorehouse/OutStorehouseListingService.java new file mode 100644 index 00000000..5e353d34 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/outstorehouse/OutStorehouseListingService.java @@ -0,0 +1,30 @@ +package com.wh.service.api.outstorehouse; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.wh.mapper.api.instorehouse.InStorehouseMainMapper; +import com.wh.mapper.api.outstorehouse.OutStorehouseListingMapper; +import com.wh.mapper.api.outstorehouse.OutStorehouseMainMapper; +import com.wh.pojo.api.InStorehouseListing; +import com.wh.pojo.api.InStorehouseMain; +import com.wh.pojo.api.OutStorehouseListing; +import com.wh.pojo.api.OutStorehouseMain; +import com.yxt.common.base.service.MybatisBaseService; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class OutStorehouseListingService extends MybatisBaseService { + + + public List selectInStorehouseListingsByMainSid(String sid) { + List list=baseMapper.selectList( + new QueryWrapper().eq("main_sid",sid)); + return list; + } + + public int deleteByMainSid(String sid) { + return baseMapper.deleteByMainSid(sid); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/outstorehouse/OutStorehouseMainService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/outstorehouse/OutStorehouseMainService.java new file mode 100644 index 00000000..aee82375 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/outstorehouse/OutStorehouseMainService.java @@ -0,0 +1,299 @@ +package com.wh.service.api.outstorehouse; + + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wh.api.Api; +import com.wh.mapper.api.instorehouse.InStorehouseMainMapper; +import com.wh.mapper.api.outstorehouse.OutStorehouseMainMapper; +import com.wh.mapper.initial.LocationMapper; +import com.wh.mapper.initial.ProductMapper; +import com.wh.mapper.instorehouse.PurchaseMapper; +import com.wh.mapper.instorehouse.PutInMapper; +import com.wh.mapper.instorehouse.ReceivingMapper; +import com.wh.mapper.stock.StockMapper; +import com.wh.mapper.storehousemanage.RemoveMapper; +import com.wh.pojo.*; +import com.wh.pojo.api.*; +import com.wh.service.api.instorehouse.InStorehouseListingService; +import com.wh.service.api.instorehouse.InStorehouseMainService; +import com.wh.service.api.prodstock.ProdStockService; +import com.wh.service.outstorehouse.PickingService; +import com.wh.vo.PageResult; +import com.wh.vo.PickingUser; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.*; + +@Slf4j +@Service +public class OutStorehouseMainService extends MybatisBaseService { + @Autowired + private OutStorehouseListingService outStorehouseListingService; + @Autowired + private ProdStockService prodStockService; + @Autowired + private InStorehouseMainService inStorehouseMainService; + @Autowired + private PickingService pickingService; + @Transactional + public ResultBean addOutStorehouse(OutStorehouseMainDto outStorehouseMainDto) { + + ResultBean r = ResultBean.fireFail(); + if(outStorehouseMainDto==null){ + return r.setMsg("数据不能为空"); + } + String no = outStorehouseMainDto.getNo(); + if(StringUtils.isBlank(no)){ + return r.setMsg("编码不能为空"); + } + List list = outStorehouseMainDto.getList(); + if(list==null||list.size()==0){ + return r.setMsg("商品信息不能为空"); + } + if(com.yxt.common.base.utils.StringUtils.isNotBlank(outStorehouseMainDto.getSid())){ + String sid = outStorehouseMainDto.getSid(); + OutStorehouseMain outStorehouseMain = fetchBySid(sid); + outStorehouseMain.setApplicationDate(outStorehouseMainDto.getApplicationDate()); + outStorehouseMain.setCreatorName(outStorehouseMainDto.getCreatorName()); + outStorehouseMain.setNo(outStorehouseMainDto.getNo()); //varchar 50 编号 + outStorehouseMain.setCusterSid(outStorehouseMainDto.getCusterSid()); //varchar 64 客户Sid(企业) + outStorehouseMain.setCusterName(outStorehouseMainDto.getCusterName()); // varchar 100 客户名称(企业) + outStorehouseMain.setStoreHouseSid(outStorehouseMainDto.getStoreHouseSid()); // varchar 64 仓库Sid + outStorehouseMain.setStoreHouseName(outStorehouseMainDto.getStoreHouseName()); // varchar 100 仓库名称 + outStorehouseMain.setOutDate(outStorehouseMainDto.getOutDate()); //出库日期 + baseMapper.updateById(outStorehouseMain); + outStorehouseListingService.deleteByMainSid(sid); + try{ + boolean b = validaProStock(list,outStorehouseMain); + if(!b){ + return r.setMsg("出库数量大于库存数量"); + } + }catch (Exception e){ + return r.setMsg(e.getMessage()); + } + addListing(outStorehouseMain, list); + return r.success(); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("no",outStorehouseMainDto.getNo()); + if(baseMapper.selectCount(queryWrapper) != 0){ + return r.setMsg("申请单编号已经存在"); + } + OutStorehouseMain out=new OutStorehouseMain(); + BeanUtils.copyProperties(outStorehouseMainDto,out); + out.setSid(UUID.randomUUID().toString()); + try{ + boolean b = validaProStock(list,out); + if(!b){ + return r.setMsg("出库数量大于库存数量"); + } + }catch (Exception e){ + return r.setMsg(e.getMessage()); + } + //申请单主表信息 + baseMapper.insert(out); + addListing(out, list); + return ResultBean.fireSuccess().setMsg("添加成功").setData(out); + } + /** + * 新增商品信息 + * @param out + * @param list + */ + @Transactional + public void addListing(OutStorehouseMain out, List list) throws RuntimeException{ + list.forEach(l->{ + l.setCusterSid(out.getCusterSid()); + l.setCusterName(out.getCusterName()); + l.setMainSid(out.getSid()); + outStorehouseListingService.insert(l); + // saveOrUpdateProdStock(l,out); + }); + } + + /** + * 新增或者修改商品库存信息 + * @param l + */ + public void saveOrUpdateProdStock(OutStorehouseListing l,OutStorehouseMain out) { + PagerVo proStocks = getProdStock(l,out); + long total = proStocks.getTotal(); + if(total==0){ + throw new RuntimeException(l.getProName()+"库存信息不存在"); + }else{ + updateProdStock(l, proStocks); + } + } + + /** + * 修改商品库存信息 + * @param l + * @param proStocks + */ + private void updateProdStock(OutStorehouseListing l, PagerVo proStocks) { + log.info("OutStorehouseMainService/updateProdStock/l:{}", JSONObject.toJSONString(l)); + log.info("OutStorehouseMainService/updateProdStock/proStocks:{}", JSONObject.toJSONString(proStocks)); + ResultBean r = ResultBean.fireFail(); + ProdStock prodStock = proStocks.getRecords().get(0); + String num = prodStock.getNum(); + if(com.yxt.common.base.utils.StringUtils.isBlank(num)){ + // log.info("{}",l.getProName()+"商品数量不能为空"); + } + if(Integer.valueOf(l.getRealityNum())>Integer.valueOf(num)){ + throw new RuntimeException(l.getProName()+"出库信息超出库存信息"); + } + int i=Integer.valueOf(num)-Integer.valueOf(l.getRealityNum()); + prodStock.setNum(i+""); + String mainSid = l.getMainSid(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("sid",mainSid); + OutStorehouseMain outStorehouseMain = baseMapper.selectOne(queryWrapper); + outStorehouseMain.setModifyTime(new Date()); + outStorehouseMain.setState(2); + baseMapper.updateById(outStorehouseMain); + BigDecimal multiply = new BigDecimal(prodStock.getNum()).multiply(new BigDecimal(prodStock.getConfirmedPrice())); + prodStockService.updateByProdStockId(prodStock.getNum(),multiply.toString(),prodStock.getId()); + + } + + /** + * 验证库存信息 + * @param list + * @return + * @throws RuntimeException + */ + private boolean validaProStock(List list,OutStorehouseMain out) throws RuntimeException{ + list.forEach(l->{ + PagerVo prodStock = getProdStock(l,out); + long total = prodStock.getTotal(); + if(total==0){ + throw new RuntimeException(l.getProName()+"不存在库存"); // 抛出异常,事务回滚, + } + ProdStock prodStock1 = prodStock.getRecords().get(0); + String num = prodStock1.getNum(); + int r=Integer.valueOf(num)-Integer.valueOf(l.getRealityNum()); + if(r<0){ + throw new RuntimeException(l.getProName()+"出库数量超出库存"); // 抛出异常,事务回滚, + } + }); + return true; + } + + /** + * 根据商品的名称 规格 客户查询库存信息 + * @param l + * @return + */ + private PagerVo getProdStock(OutStorehouseListing l,OutStorehouseMain out) { + PagerQuery pq=new PagerQuery<>(); + pq.setCurrent(0); + pq.setSize(10); + ProdStockQuery stockQuery = new ProdStockQuery(); + stockQuery.setCusterSid(out.getCusterSid()); + stockQuery.setProModel(l.getProModel()); + stockQuery.setProName(l.getProName()); + stockQuery.setProSid(l.getProSid()); + stockQuery.setStoreHouseSid(l.getStoreHouseSid()); + stockQuery.setLocationId(l.getLocationId()); + stockQuery.setLocationNumber(l.getLocationNumber()); + pq.setParams(stockQuery); + PagerVo proStocks = prodStockService.getProStocks(pq); + return proStocks; + } + + public PagerVo listPage(PagerQuery pq) { + OutStorehouseMainQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + private QueryWrapper createQueryWrapper(OutStorehouseMainQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wraInStorehouseMainpper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + qw.eq("1",1); + if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getNo())) { + qw.like("no", query.getNo()); + } + if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getApplicationDateStart())) { + qw.ge("application_date", query.getApplicationDateStart()); + } + if (StrUtil.isNotBlank(query.getApplicationDateEnd())) { + qw.lt("application_date", query.getApplicationDateEnd()); + } + if (StrUtil.isNotBlank(query.getCreatorName())) { + qw.like("creator_name", query.getCreatorName()); + } + if (StrUtil.isNotBlank(query.getCusterName())) { + qw.like("custer_name", query.getCusterName()); + } + if (StrUtil.isNotBlank(query.getCusterSid())) { + qw.eq("custer_sid", query.getCusterSid()); + } + + if (StrUtil.isNotBlank(query.getState())) { + qw.like("state", query.getState()); + } + qw.orderByDesc("id"); + return qw; + } + + public ResultBean getOutStorehouse(String sid) { + ResultBean r = ResultBean.fireFail(); + OutStorehouseMain outStorehouseMain = baseMapper.selectOne( + new QueryWrapper().eq("sid",sid)); + if(outStorehouseMain==null){ + return r.setMsg("数据不存在"); + } + OutStorehouseDetailVo osv=new OutStorehouseDetailVo(); + BeanUtils.copyProperties(outStorehouseMain,osv); + List list=outStorehouseListingService.selectInStorehouseListingsByMainSid(sid); + osv.setList(list); + return ResultBean.fireSuccess().setData(osv); + } +@Transactional + public int deleteOutStorehouseMainBySid(String sid) { + int i = deleteBySid(sid); + List list=outStorehouseListingService.selectInStorehouseListingsByMainSid(sid); + int ii=outStorehouseListingService.deleteByMainSid(sid); +// list.forEach(l->{ +// prodStockService.addNumByProdSidAndCustSid(l.getProSid(), l.getCusterSid(),l.getRealityNum(), +// l.getStoreHouseSid(), l.getLocationNumber()); +// }); + return i; + } + @Transactional + public ResultBean importOutStorehouse(OutStorehouseMainDto outStorehouseMainDto) { + ResultBean resultBean = addOutStorehouse(outStorehouseMainDto); + if(!resultBean.getSuccess()){ + return resultBean; + } + OutStorehouseMain out = (OutStorehouseMain) resultBean.getData(); + PickingUser pu=new PickingUser(); + pu.setOutStorehouseId(out.getSid()); + ResultBean picking = pickingService.picking(pu); + return picking; + } + + public List listAllForPicking(OutStorehouseMainQuery pq) { + return baseMapper.listAllForPicking(pq.getCusterSid()); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/prodstock/ProdStockService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/prodstock/ProdStockService.java new file mode 100644 index 00000000..13dbef7c --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/api/prodstock/ProdStockService.java @@ -0,0 +1,127 @@ +package com.wh.service.api.prodstock; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wh.mapper.api.prodstock.ProdStockMapper; +import com.wh.pojo.Product; +import com.wh.pojo.api.*; +import com.wh.service.initial.ProductService; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import lombok.extern.slf4j.Slf4j; +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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +@Slf4j +@Service +public class ProdStockService extends MybatisBaseService { + @Autowired + private ProductService productService; + public PagerVo getProStocks(PagerQuery pq ) { + ProdStockQuery params = pq.getParams(); + QueryWrapper qw = createQueryWrapper(params); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + Integer integer = baseMapper.selectCount(qw); + p.setTotal(integer); + return p; + } + + public PagerVo listPage(PagerQuery pq) { + ProdStockQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + IPage prodStockIPage = baseMapper.selectPage(page, qw); + PagerVo p = PagerUtil.pageToVo(prodStockIPage, null); + return p; + } + private QueryWrapper createQueryWrapper(ProdStockQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + + if (StringUtils.isNotBlank(query.getCusterSid())) { + qw.eq("custer_sid", query.getCusterSid()); + } + if (StringUtils.isNotBlank(query.getProName())) { + qw.eq("pro_name", query.getProName()); + } + if (StringUtils.isNotBlank(query.getProModel())) { + qw.eq("pro_model", query.getProModel()); + } + if (StringUtils.isNotBlank(query.getProSid())) { + qw.eq("pro_sid", query.getProSid()); + } + if (StringUtils.isNotBlank(query.getLocationNumber())) { + qw.eq("location_number", query.getLocationNumber()); + } + if(StringUtils.isNotBlank(query.getStoreHouseSid())){ + qw.eq("store_house_sid",query.getStoreHouseSid()); + } + return qw; + } + + public void reduceNumByProdSidAndCustSid(String proSid, String custerSid, String num) { + log.info("reduceNumByProdSidAndCustSid:{},{},{}",proSid,custerSid,num); + baseMapper.reduceNumByProdSidAndCustSid(proSid,custerSid,num); + } + public void addNumByProdSidAndCustSid(String proSid, String custerSid, String num, String storehousesid, String locationnum) { + log.info("addNumByProdSidAndCustSid:{},{},{}",proSid,custerSid,num); + baseMapper.addNumByProdSidAndCustSid(proSid,custerSid,storehousesid,locationnum,num); + } + @Transactional + public List importStock(List list) { + List r=new ArrayList<>(); + for (ProdStock l : list) { + String storeHouseSid = l.getStoreHouseSid(); + String custerSid = l.getCusterSid(); + String proSid = l.getProSid(); + if(StringUtils.isBlank(storeHouseSid)|| + /* StringUtils.isBlank(custerSid)||*/ + StringUtils.isBlank(proSid)|| + StringUtils.isBlank(l.getProName())|| + /* StringUtils.isBlank(l.getProModel())||*/ + StringUtils.isBlank(l.getLocationId())|| + StringUtils.isBlank(l.getLocationNumber())){ + r.add(l); + continue; + } + Map columnMap=new HashMap<>(); + columnMap.put("store_house_sid",storeHouseSid); + // columnMap.put("custer_sid",custerSid); + columnMap.put("pro_sid",proSid); + columnMap.put("pro_model",l.getProModel()); + columnMap.put("pro_name",l.getProName()); + baseMapper.deleteByMap(columnMap); //依据最新的库存为准 之前的库存删了 + baseMapper.insert(l); + + ResultBean productListByNameAndCode = productService.getProductListByNameAndCode(l.getProName(), proSid); + if (productListByNameAndCode.getSuccess()){ + List data = (List) productListByNameAndCode.getData(); + if(data.size()==0){ + Product product=new Product(); + product.setName(l.getProName()); + product.setBarCode(proSid); + productService.addProduct(product); + } + } + } + return r; + } + + public void updateByProdStockId(String num, String value, Integer id) { + baseMapper.updateByProdStockId(num,value,id); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/brandinfo/BrandInfoService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/brandinfo/BrandInfoService.java new file mode 100644 index 00000000..c8675a18 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/brandinfo/BrandInfoService.java @@ -0,0 +1,113 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.service.brandinfo; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.wh.mapper.brandinfo.BrandInfoMapper; +import com.wh.pojo.brandinfo.*; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.vo.PagerVo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: BrandInfoService.java
+ * Class: com.supervise.biz.brandinfo.BrandInfoService
+ * Description: 品牌信息 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:28
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Service +public class BrandInfoService extends MybatisBaseService { + private QueryWrapper createQueryWrapper(BrandInfoQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + return qw; + } + + public PagerVo listPageVo(PagerQuery pq) { + BrandInfoQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void saveOrUpdateDto(BrandInfoDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(BrandInfoDto dto){ + BrandInfo entity = new BrandInfo(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + } + + public void updateByDto(BrandInfoDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + BrandInfo entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public BrandInfoDetailsVo fetchDetailsVoBySid(String sid){ + BrandInfo entity = fetchBySid(sid); + BrandInfoDetailsVo vo = new BrandInfoDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } + + public BrandInfoVo selectByCode(String key) { + BrandInfoVo vo = baseMapper.selectByCode(key); + return vo; + } + + public BrandInfo fetchByCodeForLimit(String brandSid) { + BrandInfo vo = baseMapper.fetchByCodeForLimit(brandSid); + return vo; + } +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/dictcommon/DictCommonService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/dictcommon/DictCommonService.java new file mode 100644 index 00000000..6d0ac0af --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/dictcommon/DictCommonService.java @@ -0,0 +1,117 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.service.dictcommon; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.wh.mapper.dictcommon.DictCommonMapper; +import com.wh.pojo.dictcommon.*; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.vo.PagerVo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: DictCommonService.java
+ * Class: com.supervise.biz.dictcommon.DictCommonService
+ * Description: 数据字典——数据项 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:29
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Service +public class DictCommonService extends MybatisBaseService { + private QueryWrapper createQueryWrapper(DictCommonQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + return qw; + } + + public PagerVo listPageVo(PagerQuery pq) { + DictCommonQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void saveOrUpdateDto(DictCommonDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(DictCommonDto dto){ + DictCommon entity = new DictCommon(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + } + + public void updateByDto(DictCommonDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + DictCommon entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public DictCommonDetailsVo fetchDetailsVoBySid(String sid){ + DictCommon entity = fetchBySid(sid); + DictCommonDetailsVo vo = new DictCommonDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } + + public DictCommonDetailsVo fetchByKey(String value) { + DictCommonDetailsVo vo = baseMapper.fetchByKey(value); + return vo; + } + + public DictCommonDetailsVo fetchByKeyAndType(String value, String type) { + DictCommonDetailsVo vo = baseMapper.fetchByKeyAndType(value,type); + return vo; + } + + public DictCommonDetailsVo fetchByKeyAndTypeForLimit(String category, String categoryKey) { + DictCommonDetailsVo vo = baseMapper.fetchByKeyAndTypeForLimit(category,categoryKey); + return vo; + } +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/dicttype/DictTypeService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/dicttype/DictTypeService.java new file mode 100644 index 00000000..4e2e6a65 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/dicttype/DictTypeService.java @@ -0,0 +1,102 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.service.dicttype; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.wh.mapper.dicttype.DictTypeMapper; +import com.wh.pojo.dicttype.*; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.vo.PagerVo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: DictTypeService.java
+ * Class: com.supervise.biz.dicttype.DictTypeService
+ * Description: 数据字典——数据类型 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022-11-11 11:40:29
+ * + * @author dongjianzhao + * @version 1.0 + * @since 1.0 + */ +@Service +public class DictTypeService extends MybatisBaseService { + private QueryWrapper createQueryWrapper(DictTypeQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + return qw; + } + + public PagerVo listPageVo(PagerQuery pq) { + DictTypeQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void saveOrUpdateDto(DictTypeDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(DictTypeDto dto){ + DictType entity = new DictType(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + } + + public void updateByDto(DictTypeDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + DictType entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public DictTypeDetailsVo fetchDetailsVoBySid(String sid){ + DictType entity = fetchBySid(sid); + DictTypeDetailsVo vo = new DictTypeDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/entinfo/EntInfoService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/entinfo/EntInfoService.java new file mode 100644 index 00000000..fda1afc0 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/entinfo/EntInfoService.java @@ -0,0 +1,119 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.service.entinfo; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.wh.mapper.entinfo.EntInfoMapper; +import com.wh.pojo.entinfo.*; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.apache.commons.lang3.StringUtils; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; + +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * Project: warehouse(仓储)
+ * File: EntInfoService.java
+ * Class: com.wh.biz.entinfo.EntInfoService
+ * Description: 客户信息 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-13 22:19:45
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class EntInfoService extends MybatisBaseService { +// @Resource +// private WhEnterpriseInformationFeign enterpriseInformationFeign; + + private QueryWrapper createQueryWrapper(EntInfoQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + return qw; + } + + public PagerVo listPageVo(PagerQuery pq) { + EntInfoQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void saveOrUpdateDto(EntInfoDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(EntInfoDto dto){ + EntInfo entity = new EntInfo(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + } + + public void updateByDto(EntInfoDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + EntInfo entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public EntInfoDetailsVo fetchDetailsVoBySid(String sid){ + EntInfo entity = fetchBySid(sid); + EntInfoDetailsVo vo = new EntInfoDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } + +// public List listAll() { +// PagerQuery pq=new PagerQuery<>(); +// pq.setSize(10000); +// ResultBean> pagerVoResultBean = +// enterpriseInformationFeign.listPage(pq); +// return pagerVoResultBean.getData().getRecords(); +// } +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/LocationService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/LocationService.java new file mode 100644 index 00000000..395126af --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/LocationService.java @@ -0,0 +1,29 @@ +package com.wh.service.initial; + +import com.wh.pojo.*; +import com.wh.vo.PageResult; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.vo.PagerVo; + +import java.util.List; + +public interface LocationService { + PageResult getLocationList(PageResult pageResult); + PagerVo getSupplierList(PagerQuery pq); + void addLocation(Location location); + + void updataLocation(Location location); + int deleteById(String id); + void deleteLocation(String name); + Location getLocationById(String id); + List getStorehouse(); + + List getType(); + + List getLocations(); + + List getLocationsByStoreId(String id); + + + List getLocationByLocationId(String locationId); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/LocationServiceImpl.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/LocationServiceImpl.java new file mode 100644 index 00000000..0446bbf5 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/LocationServiceImpl.java @@ -0,0 +1,118 @@ +package com.wh.service.initial; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wh.mapper.initial.LocationMapper; +import com.wh.mapper.initial.LocationTypeMapper; +import com.wh.mapper.initial.StorehouseMapper; +import com.wh.pojo.*; +import com.wh.vo.PageResult; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.List; + +@Service +public class LocationServiceImpl implements LocationService{ + + @Autowired + private LocationTypeMapper locationTypeMapper; + + @Autowired + private StorehouseMapper storehouseMapper; + + @Autowired + private LocationMapper locationMapper; + + @Override + public PageResult getLocationList(PageResult pageResult) { + Page locationPage = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + boolean flag = StringUtils.hasLength(pageResult.getQuery()); + queryWrapper.like(flag,"name",pageResult.getQuery()); + locationPage = locationMapper.selectPage(locationPage,queryWrapper); + pageResult.setTotal((long) locationPage.getRecords().size()).setRows(locationPage.getRecords()); + + return pageResult; + } + + @Override + public PagerVo getSupplierList(PagerQuery pq) { + Page locationPage = new Page<>(pq.getCurrent(),pq.getSize()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + String name = pq.getParams().getName(); + String storehouseid = pq.getParams().getStorehouseid(); + if(!StringUtils.isEmpty(name)){ + queryWrapper.like("name",name); + } + if(!StringUtils.isEmpty(storehouseid)){ + queryWrapper.eq("storehouseid",storehouseid); + } + + locationPage = locationMapper.selectPage(locationPage,queryWrapper); + Integer integer = locationMapper.selectCount(queryWrapper); + PagerVo pv=new PagerVo<>(); + pv.setCurrent(pq.getCurrent()); + pv.setTotal(integer); + pv.setSize(pq.getSize()); + pv.setRecords(locationPage.getRecords()); + return pv; + } + + @Override + public void addLocation(Location location) { + locationMapper.insert(location); + } + + @Override + public void updataLocation(Location location) { + locationMapper.updateById(location); + } + + @Override + public int deleteById(String id) { + return locationMapper.deleteById(id); + } + + @Override + public void deleteLocation(String name) { + locationMapper.deleteById(name); + } + + @Override + public Location getLocationById(String id) { + return locationMapper.selectById(id); + } + + @Override + public List getStorehouse() { + return storehouseMapper.selectList(null); + } + + @Override + public List getType() { + return locationTypeMapper.selectList(null); + } + + @Override + public List getLocations() { + return locationMapper.listAll(); + } + + @Override + public List getLocationsByStoreId(String id) { + return locationMapper.getLocationsByStoreId(id); + } + + @Override + public List getLocationByLocationId(String locationId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("location_id",locationId); + List locations = locationMapper.selectList(queryWrapper); + return locations; + } + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/ProductService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/ProductService.java new file mode 100644 index 00000000..228b65aa --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/ProductService.java @@ -0,0 +1,48 @@ +package com.wh.service.initial; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.wh.pojo.Product; +import com.wh.pojo.ProductQuery; +import com.wh.pojo.Storehouse; +import com.wh.pojo.shstorehouse.ShStorehouseVo; +import com.wh.vo.PageResult; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.util.StringUtils; + +import java.util.List; + +public interface ProductService { + PagerVo getProductList(PagerQuery pq); + + void addProduct(Product product); + + void updataProduct(Product product); + + void deleteProduct(String barCode); + + List getStorehouse(); + + /** + * 根据名称 code去查询商品 + * @param name + * @param code + * @return + */ + public ResultBean> getProductListByNameAndCode(String name, String code) ; + + /** + * 根据名称 去查询商品 + * @param name + * @return + */ + public ResultBean> getProductListByName(String name) ; + + /** + * 根据 code 去查询商品 + * @param code + * @return + */ + public ResultBean> getProductListByCode(String code); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/ProductServiceImpl.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/ProductServiceImpl.java new file mode 100644 index 00000000..8c9f2943 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/ProductServiceImpl.java @@ -0,0 +1,95 @@ +package com.wh.service.initial; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wh.mapper.initial.ProductMapper; +import com.wh.mapper.initial.StorehouseMapper; +import com.wh.pojo.Product; +import com.wh.pojo.ProductQuery; +import com.wh.pojo.Storehouse; +import com.wh.pojo.shstorehouse.ShStorehouseVo; +import com.wh.vo.PageResult; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class ProductServiceImpl implements ProductService{ + + @Autowired + private StorehouseMapper storehouseMapper; + + @Autowired + private ProductMapper productMapper; + + @Override + public PagerVo getProductList(PagerQuery pq) { + Page productPage = new Page<>(pq.getCurrent(),pq.getSize()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + String name = pq.getParams().getName(); + if(!StringUtils.isEmpty(name)){ + queryWrapper.like("name",name); + } + productPage = productMapper.selectPage(productPage,queryWrapper); + Integer integer = productMapper.selectCount(queryWrapper); + // PageResult pageResult=new PageResult(); + // pageResult.setTotal((long) productPage.getRecords().size()).setRows(productPage.getRecords()); + PagerVo pv=new PagerVo<>(); + pv.setCurrent(pq.getCurrent()); + pv.setTotal(integer); + pv.setSize(pq.getSize()); + pv.setRecords(productPage.getRecords()); +// System.out.println(productPage.getRecords().size()); + return pv; + } + public ResultBean> getProductListByNameAndCode(String name,String code) { + ResultBean rb=ResultBean.fireFail(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(StringUtils.isEmpty(name)&&StringUtils.isEmpty(code)){ + return rb.setMsg("参数为空"); + } + if (!StringUtils.isEmpty(name)){ + queryWrapper.eq("name",name); + } + if (!StringUtils.isEmpty(code)){ + queryWrapper.eq("bar_code",code); + } + List products = productMapper.selectList(queryWrapper); + return rb.success().setData(products); + } + public ResultBean> getProductListByName(String name) { + return getProductListByNameAndCode(name,null); + } + public ResultBean> getProductListByCode(String code) { + return getProductListByNameAndCode(null,code); + } + @Override + public void addProduct(Product product) { + productMapper.insert(product); + } + + @Override + public void updataProduct(Product product) { + productMapper.updateById(product); + } + + @Override + public void deleteProduct(String barCode) { + Map map = new HashMap<>(); + map.put("bar_code",barCode); + productMapper.deleteByMap(map); + } + + @Override + public List getStorehouse() { + List storehouses = storehouseMapper.selectList(null); + return storehouses; + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/StorehouseService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/StorehouseService.java new file mode 100644 index 00000000..6b2d5acb --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/StorehouseService.java @@ -0,0 +1,14 @@ +package com.wh.service.initial; + +import com.wh.pojo.Storehouse; +import com.wh.vo.PageResult; + +public interface StorehouseService { + PageResult getStorehouseList(PageResult pageResult); + + void addStorehouse(Storehouse storehouse); + + void updataStorehouse(Storehouse storehouse); + + void deleteStorehouse(String name) throws Exception; +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/StorehouseServiceImpl.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/StorehouseServiceImpl.java new file mode 100644 index 00000000..cab356c8 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/StorehouseServiceImpl.java @@ -0,0 +1,67 @@ +package com.wh.service.initial; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wh.mapper.initial.LocationMapper; +import com.wh.mapper.initial.StorehouseMapper; +import com.wh.pojo.Location; +import com.wh.pojo.Storehouse; +import com.wh.vo.PageResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.List; + +@Service +public class StorehouseServiceImpl implements StorehouseService{ + + @Autowired + private StorehouseMapper storehouseMapper; + + + @Autowired + private LocationMapper locationMapper; + + @Override + public PageResult getStorehouseList(PageResult pageResult) { + Page storehousePage = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + boolean flag = StringUtils.hasLength(pageResult.getQuery()); + String query = pageResult.getQuery(); + String entSid=pageResult.getEntSid(); + if(org.apache.commons.lang3.StringUtils.isNotBlank(query)){ + queryWrapper.like(flag,"name",query); + } + if(org.apache.commons.lang3.StringUtils.isNotBlank(entSid)){ + queryWrapper.eq(flag,"ent_sid",entSid); + } + storehousePage = storehouseMapper.selectPage(storehousePage,queryWrapper); + pageResult.setTotal((long) storehousePage.getRecords().size()).setRows(storehousePage.getRecords()); + + return pageResult; + } + + @Override + public void addStorehouse(Storehouse storehouse) { + storehouseMapper.insert(storehouse); + } + + @Override + public void updataStorehouse(Storehouse storehouse) { + storehouseMapper.updateById(storehouse); + } + + @Override + public void deleteStorehouse(String name) throws Exception { + Storehouse storehouse = storehouseMapper.selectById(name); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("storehouse",name); + List locationList = locationMapper.selectList(queryWrapper); + if (locationList.size() != 0) throw new Exception("出库中有货位"); + + + storehouseMapper.deleteById(name); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/SupplierService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/SupplierService.java new file mode 100644 index 00000000..1aede536 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/SupplierService.java @@ -0,0 +1,22 @@ +package com.wh.service.initial; + + +import com.wh.pojo.Supplier; +import com.wh.pojo.SupplierQuery; +import com.wh.vo.PageResult; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.vo.PagerVo; + +import java.util.List; + +public interface SupplierService { + PageResult getSupplierList(PageResult pageResult); + PagerVo getSupplierList(PagerQuery pq); + void addSupplier(Supplier supplier); + + void updataSupplier(Supplier supplier); + + void deleteSupplier(String name); + + List listAll(); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/SupplierServiceImpl.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/SupplierServiceImpl.java new file mode 100644 index 00000000..838c9106 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/initial/SupplierServiceImpl.java @@ -0,0 +1,78 @@ +package com.wh.service.initial; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wh.mapper.initial.SupplierMapper; +import com.wh.pojo.Product; +import com.wh.pojo.Supplier; +import com.wh.pojo.SupplierQuery; +import com.wh.vo.PageResult; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.vo.PagerVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.List; + +@Service +public class SupplierServiceImpl implements SupplierService{ + + @Autowired + private SupplierMapper supplierMapper; + + @Override + public PageResult getSupplierList(PageResult pageResult) { + Page supplierPage = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + boolean flag = StringUtils.hasLength(pageResult.getQuery()); + queryWrapper.like(flag,"name",pageResult.getQuery()); + supplierPage = supplierMapper.selectPage(supplierPage,queryWrapper); + pageResult.setTotal((long) supplierPage.getRecords().size()).setRows(supplierPage.getRecords()); + + return pageResult; + } + + @Override + public PagerVo getSupplierList(PagerQuery pq) { + Page supplierPage = new Page<>(pq.getCurrent(),pq.getSize()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + String name = pq.getParams().getName(); + String number = pq.getParams().getNumber(); + if(!StringUtils.isEmpty(name)){ + queryWrapper.like("name",name); + } + if(!StringUtils.isEmpty(number)){ + queryWrapper.like("number",number); + } + supplierPage = supplierMapper.selectPage(supplierPage,queryWrapper); + Integer integer = supplierMapper.selectCount(queryWrapper); + // pageResult.setTotal((long) supplierPage.getRecords().size()).setRows(supplierPage.getRecords()); + PagerVo pv=new PagerVo<>(); + pv.setCurrent(pq.getCurrent()); + pv.setTotal(integer); + pv.setSize(pq.getSize()); + pv.setRecords(supplierPage.getRecords()); + return pv; + } + + @Override + public void addSupplier(Supplier supplier) { + supplierMapper.insert(supplier); + } + + @Override + public void updataSupplier(Supplier supplier) { + supplierMapper.updateById(supplier); + } + + @Override + public void deleteSupplier(String name) { + supplierMapper.deleteById(name); + } + + @Override + public List listAll() { + return supplierMapper.listAll(); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PurchaseService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PurchaseService.java new file mode 100644 index 00000000..1fd3963b --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PurchaseService.java @@ -0,0 +1,25 @@ +package com.wh.service.instorehouse; + +import com.wh.pojo.Product; +import com.wh.pojo.Purchase; +import com.wh.pojo.Storehouse; +import com.wh.pojo.Supplier; +import com.wh.vo.PageResult; + +import java.util.List; + +public interface PurchaseService { + PageResult getPurchaseList(PageResult pageResult); + + void addPurchase(Purchase purchase); + + List getProductList(String name); + + List getSupplier(); + + List getStorehouse(); + + void deletePurchase(String purchaseId); + + void updataPurchase(Purchase purchase); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PurchaseServiceImpl.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PurchaseServiceImpl.java new file mode 100644 index 00000000..be004549 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PurchaseServiceImpl.java @@ -0,0 +1,84 @@ +package com.wh.service.instorehouse; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wh.mapper.initial.ProductMapper; +import com.wh.mapper.initial.StorehouseMapper; +import com.wh.mapper.initial.SupplierMapper; +import com.wh.mapper.instorehouse.PurchaseMapper; +import com.wh.pojo.*; +import com.wh.vo.PageResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.List; + +@Service +public class PurchaseServiceImpl implements PurchaseService{ + + @Autowired + private StorehouseMapper storehouseMapper; + + @Autowired + private SupplierMapper supplierMapper; + + @Autowired + private ProductMapper productMapper; + + @Autowired + private PurchaseMapper purchaseMapper; + + @Override + public PageResult getPurchaseList(PageResult pageResult) { + Page purchasePage = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + boolean flag = StringUtils.hasLength(pageResult.getQuery()); + queryWrapper.like(flag,"purchase_id",pageResult.getQuery()); + + purchasePage = purchaseMapper.selectPage(purchasePage,queryWrapper); + pageResult.setTotal((long) purchasePage.getRecords().size()).setRows(purchasePage.getRecords()); +// System.out.println(purchasePage.getRecords().size()); + return pageResult; + } + + @Override + public void addPurchase(Purchase purchase) { + purchaseMapper.insert(purchase); + } + + @Override + public List getProductList(String name) { + boolean flag = StringUtils.hasLength(name); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(flag,"name",name); + List productList = productMapper.selectList(queryWrapper); + return productList; + + } + + @Override + public List getSupplier() { + List supplierList = supplierMapper.selectList(null); + return supplierList; + } + + @Override + public List getStorehouse() { +// QueryWrapper queryWrapper = new QueryWrapper<>(); +// queryWrapper.eq("type","入库区"); +// return storehouseMapper.selectList(queryWrapper); + return storehouseMapper.selectList(null); + } + + @Override + public void deletePurchase(String purchaseId) { + purchaseMapper.deleteById(purchaseId); + } + + @Override + public void updataPurchase(Purchase purchase) { + purchaseMapper.updateById(purchase); + } + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PutInService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PutInService.java new file mode 100644 index 00000000..2b31be4c --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PutInService.java @@ -0,0 +1,20 @@ +package com.wh.service.instorehouse; + +import com.wh.pojo.InStorehouse; +import com.wh.vo.PageResult; + +import java.util.Map; + +public interface PutInService { + Map getQuery(InStorehouse inStorehouse); + + String addInStorehouse(InStorehouse inStorehouse); + + PageResult getInStorehouseList(PageResult pageResult); + + void updataInStorehouse(InStorehouse inStorehouse); + + String deleteInStorehouse(String inStorehouseId, String receivingId); + + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PutInServiceImpl.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PutInServiceImpl.java new file mode 100644 index 00000000..23f26e95 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/PutInServiceImpl.java @@ -0,0 +1,220 @@ +package com.wh.service.instorehouse; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wh.api.Api; +import com.wh.mapper.initial.LocationMapper; +import com.wh.mapper.initial.ProductMapper; +import com.wh.mapper.instorehouse.PurchaseMapper; +import com.wh.mapper.instorehouse.ReceivingMapper; +import com.wh.mapper.stock.StockMapper; +import com.wh.mapper.instorehouse.PutInMapper; +import com.wh.mapper.storehousemanage.RemoveMapper; +import com.wh.pojo.*; + +import com.wh.vo.PageResult; +import org.springframework.beans.factory.annotation.Autowired; + +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class PutInServiceImpl implements PutInService { + + @Autowired + private PutInMapper putInMapper; + + @Autowired + private ReceivingMapper receivingMapper; + + @Autowired + private LocationMapper locationMapper; + + @Autowired + private StockMapper stockMapper; + + @Autowired + private PurchaseMapper purchaseMapper; + + @Autowired + private ProductMapper productMapper; + + @Autowired + private RemoveMapper removeMapper; + + + + + @Override + public Map getQuery(InStorehouse inStorehouse) { + Purchase purchase = new Purchase(); + if (StringUtils.hasLength(inStorehouse.getReceivingId())){ + Receiving receivingAble = receivingMapper.selectById(inStorehouse.getReceivingId()); + purchase = purchaseMapper.selectById(receivingAble.getPurchaseId()); + } + + QueryWrapper receivingQueryWrapper = new QueryWrapper<>(); + receivingQueryWrapper.eq("status","已审核") + .select("receiving_id"); + + + QueryWrapper locationQueryWrapper = new QueryWrapper<>(); + locationQueryWrapper.eq("status","空闲") + .eq("type","入库区") + .eq(StringUtils.hasLength(purchase.getStorehouse()),"storehouse",purchase.getStorehouse()) + .select("location_id"); + + List receivingList = receivingMapper.selectList(receivingQueryWrapper); + List locationList = locationMapper.selectList(locationQueryWrapper); + + List receivingIdList = new ArrayList<>(); + List locationIdList = new ArrayList<>(); + + for (Receiving receiving : receivingList){ + receivingIdList.add(receiving.getReceivingId()); + } + + if (locationList != null){ + for (Location location : locationList){ + locationIdList.add(location); + } + } + + + Map map = new HashMap<>(); + map.put("receivingIdList",receivingIdList); + map.put("locationIdList",locationIdList); + + return map; + } + + @Override + public String addInStorehouse(InStorehouse inStorehouse) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("location_id",inStorehouse.getLocationId()); + if(putInMapper.selectCount(queryWrapper) != 0){ + return "已有记录"; + } + inStorehouse.setStatus("待审核") + .setInStorehouseId("IN" + System.currentTimeMillis()) + .setCreateTime(new Api().getTime()); + putInMapper.insert(inStorehouse); + Receiving receiving = receivingMapper.selectById(inStorehouse.getReceivingId()); + receiving.setStatus("进行中"); + receivingMapper.updateById(receiving); + return "添加成功"; + } + + @Override + public PageResult getInStorehouseList(PageResult pageResult) { + Page page = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); + + boolean flag = StringUtils.hasLength(pageResult.getQuery()); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.like(flag,"in_storehouse_id",pageResult.getQuery()); + + page = putInMapper.selectPage(page,queryWrapper); + + pageResult.setTotal((long) page.getRecords().size()).setRows(page.getRecords()); + + + return pageResult; + } + + + @Override + // + public void updataInStorehouse(InStorehouse inStorehouse) { + //判断订单状态 + if (inStorehouse.getStatus().equals("已审核")){ + //设置审核时间 + inStorehouse.setCheckTime(new Api().getTime()); + check(inStorehouse); + }else if(inStorehouse.getStatus().equals("待审核")){ + inStorehouse.setCheckTime("") + .setCheckPerson(""); + stockMapper.deleteById(inStorehouse.getLocationId()); + + Location location = locationMapper.selectById(inStorehouse.getLocationId()); + location.setStatus("空闲"); + locationMapper.updateById(location); + + } + putInMapper.updateById(inStorehouse); + } + + @Override + public String deleteInStorehouse(String inStorehouseId, String receivingId) { + Receiving receiving = receivingMapper.selectById(receivingId); + receiving.setStatus("已审核"); + receivingMapper.updateById(receiving); + putInMapper.deleteById(inStorehouseId); + return "撤销成功"; + } + + + + public void check(InStorehouse inStorehouse){ + Stock stock = new Stock(); + + //获取货位名称 + Location location = locationMapper.selectById(inStorehouse.getLocationId()); + String locationName = location.getName(); + + //获取商品条码 + String barCode = null; + //获取接货单 + Receiving receiving = receivingMapper.selectById(inStorehouse.getReceivingId()); + if (StringUtils.hasLength(receiving.getPurchaseId())) { + Purchase purchase = purchaseMapper.selectById(receiving.getPurchaseId()); + barCode = purchase.getBarCode(); + stock.setTotalQuantity(purchase.getCount()) + .setAvailableQuantity(purchase.getCount()); + } else { + Remove remove = removeMapper.selectById(receiving.getRemoveId()); + barCode = remove.getBarCode(); + stock.setTotalQuantity(remove.getCount()) + .setAvailableQuantity(remove.getCount()); + } + + //获取商品名称 + Product product = productMapper.selectById(barCode); + String productName = product.getName(); + + //赋值 + stock.setInStorehouseId(inStorehouse.getInStorehouseId()) + .setLocationId(inStorehouse.getLocationId()) + .setLocationName(locationName) + .setBarCode(barCode) + .setProductName(productName) + .setLockedQuantity(0) + .setStatus("待上架"); + + stockMapper.insert(stock); + + //修改移库源货位库存 + if (receiving.getRemoveId() != null){ + Remove remove = removeMapper.selectById(receiving.getRemoveId()); + Stock fromStock = stockMapper.selectById(remove.getFromLocationId()); + fromStock.setLockedQuantity(fromStock.getLockedQuantity() - remove.getCount()) + .setTotalQuantity(fromStock.getTotalQuantity() - remove.getCount()); + stockMapper.updateById(fromStock); + + } + + + location.setStatus(barCode); + locationMapper.updateById(location); + + } + + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/ReceivingService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/ReceivingService.java new file mode 100644 index 00000000..f4641d23 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/ReceivingService.java @@ -0,0 +1,19 @@ +package com.wh.service.instorehouse; + +import com.wh.pojo.Receiving; +import com.wh.vo.Options; +import com.wh.vo.PageResult; + +import java.util.List; + +public interface ReceivingService { + List getOptions(); + + void addReceiving(String id,String user); + + PageResult getReceiving(PageResult pageResult); + + void updataReceiving(Receiving receiving); + + void deleteReceiving(String receivingId,String purchaseId); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/ReceivingServiceImpl.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/ReceivingServiceImpl.java new file mode 100644 index 00000000..28d1ae5a --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/instorehouse/ReceivingServiceImpl.java @@ -0,0 +1,132 @@ +package com.wh.service.instorehouse; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wh.api.Api; +import com.wh.mapper.instorehouse.PurchaseMapper; +import com.wh.mapper.instorehouse.ReceivingMapper; +import com.wh.mapper.storehousemanage.RemoveMapper; +import com.wh.pojo.Purchase; +import com.wh.pojo.Receiving; +import com.wh.pojo.Remove; +import com.wh.vo.Options; +import com.wh.vo.PageResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +public class ReceivingServiceImpl implements ReceivingService{ + + @Autowired + private ReceivingMapper receivingMapper; + + @Autowired + private PurchaseMapper purchaseMapper; + + @Autowired + private RemoveMapper removeMapper; + + @Override + public List getOptions() { + List optionsList = new ArrayList<>(); + List optionsList2 = new ArrayList<>(); + List optionsList3 = new ArrayList<>(); + Options optionsPurchase = new Options(); + Options optionsRemove = new Options(); + QueryWrapper purchaseQueryWrapper = new QueryWrapper<>(); + purchaseQueryWrapper.eq("status","已审核"); + + + List purchaseList = purchaseMapper.selectList(purchaseQueryWrapper); +// System.out.println(purchaseList); +// System.out.println(purchaseList.get(0).getPurchaseId()); + + for(Purchase purchase : purchaseList){ + optionsList2.add(new Options().setLabel(purchase.getPurchaseId()).setValue(purchase.getPurchaseId())); + } + optionsPurchase.setValue("purchase").setLabel("采购订单编号").setChildren(optionsList2); +// System.out.println(optionsList2); + optionsList.add(optionsPurchase); + + QueryWrapper removeQueryWrapper = new QueryWrapper<>(); + removeQueryWrapper.eq("status","已审核"); + List removeList = removeMapper.selectList(removeQueryWrapper); + for(Remove remove : removeList){ + optionsList3.add(new Options().setLabel(remove.getRemoveId()).setValue(remove.getRemoveId())); + } + optionsRemove.setValue("remove").setLabel("移库编号").setChildren(optionsList3); + + + + optionsList.add(optionsRemove); + + System.out.println(optionsList); + return optionsList; + } + + @Override + public void addReceiving(String id,String user) { + + +// System.out.println(purchase); + + Receiving receiving = new Receiving(); + receiving.setReceivingId("IR" + Long.toString(System.currentTimeMillis())) + .setReceivingPerson(user) + .setReceivingTime(new Api().getTime()) + .setStatus("待审核"); + + + if (id.charAt(0) == 'I'){ + Purchase purchase = purchaseMapper.selectById(id); + receiving.setPurchaseId(purchase.getPurchaseId()); + purchase.setStatus("进行中"); + purchaseMapper.updateById(purchase); + }else { + Remove remove = removeMapper.selectById(id); + receiving.setRemoveId(remove.getRemoveId()); + remove.setStatus("进行中"); + removeMapper.updateById(remove); + } + receivingMapper.insert(receiving); + + } + + @Override + public PageResult getReceiving(PageResult pageResult) { + Page receivingPage = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + boolean flag = StringUtils.hasLength(pageResult.getQuery()); + queryWrapper.like(flag,"receiving_id",pageResult.getQuery()); + + receivingPage = receivingMapper.selectPage(receivingPage,queryWrapper); + pageResult.setTotal((long) receivingPage.getRecords().size()).setRows(receivingPage.getRecords()); +// System.out.println(receivingPage.getRecords().size()); + return pageResult; + } + + @Override + public void updataReceiving(Receiving receiving) { + if (StringUtils.hasLength(receiving.getCheckPerson())){ + receiving.setCheckTime(new Api().getTime()); + } + receivingMapper.updateById(receiving); + } + + @Override + public void deleteReceiving(String receivingId,String purchaseId) { + receivingMapper.deleteById(receivingId); + Purchase purchase = purchaseMapper.selectById(purchaseId); + purchase.setStatus("已审核"); + purchaseMapper.updateById(purchase); + + } + + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/OutStorehouseService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/OutStorehouseService.java new file mode 100644 index 00000000..f4ffd7a4 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/OutStorehouseService.java @@ -0,0 +1,20 @@ +package com.wh.service.outstorehouse; + +import com.wh.pojo.OutStorehouse; +import com.wh.vo.PageResult; + +import java.util.Map; + +public interface OutStorehouseService { + Map getQuery(OutStorehouse outStorehouse); + + PageResult getOutStorehouseList(PageResult pageResult); + + void addOutStorehouse(OutStorehouse outStorehouse); + + void updataOutStorehouse(OutStorehouse outStorehouse); + + void deleteOutStorehouse(String id,Integer count , String locationId); + + void out(OutStorehouse outStorehouse); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/OutStorehouseServiceImpl.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/OutStorehouseServiceImpl.java new file mode 100644 index 00000000..602d624f --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/OutStorehouseServiceImpl.java @@ -0,0 +1,157 @@ +package com.wh.service.outstorehouse; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wh.api.Api; +import com.wh.mapper.initial.ProductMapper; +import com.wh.mapper.outstorehouse.OutStorehouseMapper; +import com.wh.mapper.outstorehouse.PickingMapper; +import com.wh.mapper.stock.StockMapper; +import com.wh.pojo.*; +import com.wh.vo.PageResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.*; + +@Service +public class OutStorehouseServiceImpl implements OutStorehouseService { + + @Autowired + private OutStorehouseMapper outStorehouseMapper; + + @Autowired + private StockMapper stockMapper; + + @Autowired + private ProductMapper productMapper; + + @Autowired + private PickingMapper pickingMapper; + + @Override + public Map getQuery(OutStorehouse outStorehouse) { + Map map = new HashMap<>(); + Set barCodeList = new HashSet<>(); + Set locationIdList = new HashSet<>(); + String productName = ""; + Integer availableQuantity = 0; + + + boolean barCodeFlag = StringUtils.hasLength(outStorehouse.getBarCode()); + boolean locationIdFlag = StringUtils.hasLength(outStorehouse.getLocationId()); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(barCodeFlag,"bar_code",outStorehouse.getBarCode()) + .eq(locationIdFlag,"location_id",outStorehouse.getLocationId()) + .eq("status","已上架"); + + List stockList = stockMapper.selectList(queryWrapper); + + if (stockList.size() == 1){ + productName = stockList.get(0).getProductName(); + availableQuantity = stockList.get(0).getAvailableQuantity(); + + } + + for (Stock stock : stockList){ + barCodeList.add(stock.getBarCode()); + locationIdList.add(stock.getLocationId()); + } + + map.put("barCodeList",barCodeList); + map.put("locationIdList",locationIdList); + map.put("availableQuantity",availableQuantity); + map.put("productName",productName); + + + return map; + } + + @Override + public PageResult getOutStorehouseList(PageResult pageResult) { + Page page = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); + boolean flag = StringUtils.hasLength(pageResult.getQuery()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.like(flag,"out_storehouse_id",pageResult.getQuery()); + page = outStorehouseMapper.selectPage(page,queryWrapper); + pageResult.setTotal((long) page.getRecords().size()).setRows(page.getRecords()); + return pageResult; + } + + @Override + public void addOutStorehouse(OutStorehouse outStorehouse) { + outStorehouse.setCreateTime(new Api().getTime()); + /**修改stock*/ + Stock stock = stockMapper.selectById(outStorehouse.getLocationId()); + stock.setAvailableQuantity( + stock.getAvailableQuantity() - outStorehouse.getCount() + ); + stockMapper.updateById(stock); + outStorehouseMapper.insert(outStorehouse); + } + + @Override + public void updataOutStorehouse(OutStorehouse outStorehouse) { + /** 修改stock*/ + Stock stock = stockMapper.selectById(outStorehouse.getLocationId()); + if (outStorehouse.getStatus().equals("已审核")){ + //设置锁定数量 + stock.setLockedQuantity( + stock.getLockedQuantity() + outStorehouse.getCount() + ); + //设置审核时间 + outStorehouse.setCheckTime(new Api().getTime()); + //设置拣货id/添加拣货单 + if (!StringUtils.hasLength(outStorehouse.getPickingId())){ + String pickingId = "PI" + System.currentTimeMillis(); + outStorehouse.setPickingId(pickingId); + Picking picking = new Picking(); + picking.setPickingId(pickingId) + .setOutStorehouseId(outStorehouse.getOutStorehouseId()) + .setCreatePerson(outStorehouse.getCheckPerson()) + .setCreateTime(new Api().getTime()) + .setStatus("待拣货"); + pickingMapper.insert(picking); + } + } else if (outStorehouse.getStatus().equals("待审核")){ + stock.setLockedQuantity( + stock.getLockedQuantity() - outStorehouse.getCount() + ); + if (StringUtils.hasLength(outStorehouse.getPickingId())){ + pickingMapper.deleteById(outStorehouse.getPickingId()); + } + outStorehouse.setPickingId("") + .setCheckPerson("") + .setCheckTime(""); + } + stockMapper.updateById(stock); + outStorehouseMapper.updateById(outStorehouse); + } + + @Override + public void deleteOutStorehouse(String id , Integer count , String locationId) { + + Stock stock = stockMapper.selectById(locationId); + stock.setAvailableQuantity( + stock.getAvailableQuantity() + count + ); + stockMapper.updateById(stock); + + outStorehouseMapper.deleteById(id); + } + + @Override + public void out(OutStorehouse outStorehouse) { + outStorehouse.setOutTime(new Api().getTime()); + outStorehouseMapper.updateById(outStorehouse); + + Stock stock = stockMapper.selectById(outStorehouse.getLocationId()); + stock.setTotalQuantity(stock.getTotalQuantity() - outStorehouse.getCount()) + .setLockedQuantity(stock.getLockedQuantity() - outStorehouse.getCount()); + stockMapper.updateById(stock); + } + + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/PickingService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/PickingService.java new file mode 100644 index 00000000..1c20df71 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/PickingService.java @@ -0,0 +1,20 @@ +package com.wh.service.outstorehouse; + +import com.wh.pojo.Picking; +import com.wh.vo.PageResult; +import com.wh.vo.PickingUser; +import com.yxt.common.core.result.ResultBean; + +import java.util.List; + +public interface PickingService { + List getOptions(); + + void picking(String id,String user); + + PageResult getPickingList(PageResult pageResult); + + void finish(Picking picking); + + ResultBean picking(PickingUser pickingUser); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/PickingServiceImpl.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/PickingServiceImpl.java new file mode 100644 index 00000000..33052445 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/outstorehouse/PickingServiceImpl.java @@ -0,0 +1,108 @@ +package com.wh.service.outstorehouse; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wh.api.Api; +import com.wh.mapper.outstorehouse.OutStorehouseMapper; +import com.wh.mapper.outstorehouse.PickingMapper; +import com.wh.pojo.OutStorehouse; +import com.wh.pojo.Picking; +import com.wh.pojo.api.OutStorehouseListing; +import com.wh.pojo.api.OutStorehouseMain; +import com.wh.service.api.outstorehouse.OutStorehouseListingService; +import com.wh.service.api.outstorehouse.OutStorehouseMainService; +import com.wh.vo.PageResult; +import com.wh.vo.PickingUser; +import com.yxt.common.core.result.ResultBean; +import org.apache.ibatis.annotations.Select; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +@Service +public class PickingServiceImpl implements PickingService{ + + @Autowired + private PickingMapper pickingMapper; + + @Autowired + private OutStorehouseMapper outStorehouseMapper; + @Resource + private OutStorehouseMainService outStorehouseMainService; + @Resource + private OutStorehouseListingService outStorehouseListingService; + @Override + public List getOptions() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("status","待拣货"); + List pickingList = pickingMapper.selectList(queryWrapper); + + List outStorehouseIdList = new ArrayList<>(); + + for (Picking picking : pickingList){ + outStorehouseIdList.add(picking.getPickingId()); + } + return outStorehouseIdList; + } + + @Override + public void picking(String id , String user) { + Picking picking = pickingMapper.selectById(id); + OutStorehouse outStorehouse = outStorehouseMapper.selectById(picking.getOutStorehouseId()); + //更新拣货单 + picking.setStatus("拣货中") + .setRecipientPerson(user) + .setRecipientTime(new Api().getTime()); + pickingMapper.updateById(picking); + + //更新出库单 + outStorehouse.setStatus("拣货中"); + outStorehouseMapper.updateById(outStorehouse); + + } + + @Override + public PageResult getPickingList(PageResult pageResult) { + Page page = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); + + boolean flag = StringUtils.hasLength(pageResult.getQuery()); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.like(flag,"pickingId",pageResult.getQuery()); + page = pickingMapper.selectPage(page,queryWrapper); + + pageResult.setRows(page.getRecords()).setTotal((long) page.getRecords().size()); + return pageResult; + } + + @Override + public void finish(Picking picking) { + pickingMapper.updateById(picking); + OutStorehouse outStorehouse = outStorehouseMapper.selectById(picking.getOutStorehouseId()); + outStorehouse.setStatus("已拣货"); + outStorehouseMapper.updateById(outStorehouse); + } + @Transactional + @Override + public ResultBean picking(PickingUser pickingUser) { + ResultBean rb=ResultBean.fireFail(); + String outStorehouseId = pickingUser.getOutStorehouseId(); + OutStorehouseMain outStorehouseMain = outStorehouseMainService.fetchBySid(outStorehouseId); + List outStorehouseListings = outStorehouseListingService.selectInStorehouseListingsByMainSid(outStorehouseId); + if(outStorehouseMain==null||outStorehouseListings==null||outStorehouseListings.size()==0){ + return rb.setMsg("没有查询相应的出库单信息"); + } + for (OutStorehouseListing outStorehouseListing : outStorehouseListings) { + outStorehouseMainService.saveOrUpdateProdStock(outStorehouseListing,outStorehouseMain); + } + return rb.success(); + } + + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/purchasenew/PurchasenewService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/purchasenew/PurchasenewService.java new file mode 100644 index 00000000..59fe5273 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/purchasenew/PurchasenewService.java @@ -0,0 +1,226 @@ +package com.wh.service.purchasenew; + + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.wh.mapper.purchasenew.PurchasenewMapper; +import com.wh.pojo.api.InStoreHouseMainDto; +import com.wh.pojo.purchasenew.*; +import com.wh.pojo.purchasenewproduct.PurchasenewProduct; +import com.wh.pojo.purchasenewproduct.PurchasenewProductDto; +import com.wh.pojo.purchasenewproduct.PurchasenewProductVo; +import com.wh.service.api.instorehouse.InStorehouseMainService; +import com.wh.service.api.prodstock.ProdStockService; +import com.wh.service.purchasenewproduct.PurchasenewProductService; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.text.SimpleDateFormat; +import java.util.*; + +@Slf4j +@Service +public class PurchasenewService extends MybatisBaseService { + @Autowired + private PurchasenewProductService purchasenewProductService; + @Autowired + private ProdStockService prodStockService; + @Autowired + private InStorehouseMainService inStorehouseMainService; + private QueryWrapper createQueryWrapper(PurchasenewQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + if(org.apache.commons.lang3.StringUtils.isNotBlank(query.getPurchaseDateEnd())){ + qw.le("purchase_date",query.getPurchaseDateEnd()); + } + if(org.apache.commons.lang3.StringUtils.isNotBlank(query.getPurchaseDateStart())){ + qw.ge("purchase_date",query.getPurchaseDateStart()); + } + if(org.apache.commons.lang3.StringUtils.isNotBlank(query.getPurchaseNo())){ + qw.like("purchase_no",query.getPurchaseNo()); + } + if(org.apache.commons.lang3.StringUtils.isNotBlank(query.getCustName())){ + qw.like("cust_name",query.getCustName()); + } + if(org.apache.commons.lang3.StringUtils.isNotBlank(query.getCustId())){ + qw.eq("cust_id",query.getCustId()); + } + if(org.apache.commons.lang3.StringUtils.isNotBlank(query.getState())){ + qw.eq("state",query.getState()); + } + return qw; + } + + public PagerVo listPageVo(PagerQuery pq) { + PurchasenewQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + @Transactional + public ResultBean saveOrUpdateDto(PurchasenewDto dto){ + ResultBean rb = ResultBean.fireFail(); +// String custId = dto.getCustId(); +// ResultBean> listResultBean = whEnterpriseInformationFeign.EnterpriseList(); +// List data = listResultBean.getData(); +// data.forEach(d->{ +// String enterpriseName = d.getEnterpriseName(); +// String sid = d.getSid(); +// if(sid.equals(custId)){ +// dto.setCustName(enterpriseName); +// } +// }); + String dtoSid = dto.getSid(); + List products = dto.getProducts(); + if(products.size()==0){ + return rb.setMsg("商品列表不能为空"); + } + if (StringUtils.isBlank(dtoSid)) { + String purchaseNo= dto.getPurchaseNo(); + if(org.apache.commons.lang3.StringUtils.isBlank(purchaseNo)){ + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + String format = sdf.format(new Date()); + PurchasenewQuery query=new PurchasenewQuery(); + query.setCustId(dto.getCustId()); + query.setPurchaseNo("RK"+format); + QueryWrapper qw = createQueryWrapper(query); + List purchasenews = baseMapper.selectList(qw); + int size = purchasenews.size(); + String no="RK"+format; + if(size==0){ + no=no+"01"; + } + if(size>0&&size<10){ + no=no+"0"+size; + } + if(size>=10){ + no=no+size; + } + dto.setPurchaseNo(no); + } + return this.insertByDto(dto); + } + return this.updateByDto(dto); + } + + public ResultBean insertByDto(PurchasenewDto dto){ + + ResultBean rb = ResultBean.fireFail(); + Purchasenew entity = new Purchasenew(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + return addPurchasenewProduct(dto, rb, entity); + // inStorehouseMainService.saveOrUpdateByPurchaseSid(dto,entity.getSid()); + + } + + public ResultBean updateByDto(PurchasenewDto dto){ + ResultBean rb = ResultBean.fireFail(); + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return rb.setMsg("主键信息不能为空"); + } + Purchasenew entity = fetchBySid(dtoSid); + int state = entity.getState(); + if(2==state){ + return rb.setMsg("采购订单已经入库不允许修改"); + } + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + //dto.setSid(entity.getSid()); + purchasenewProductService.deleteByPurchaseSid(dtoSid); + addPurchasenewProduct(dto, rb, entity); + return rb.success();//inStorehouseMainService.saveOrUpdateByPurchaseSid(dto,entity.getSid());// TODO 当系统调试通后需要做修改 不能再 执行下一行代码了 + } + + private ResultBean addPurchasenewProduct(PurchasenewDto dto, ResultBean rb, Purchasenew entity) { + List l =new ArrayList<>(); + List products = dto.getProducts(); + products.forEach(p->{ + PurchasenewProduct pp=new PurchasenewProduct(); + BeanUtil.copyProperties(p,pp,"id","sid"); + pp.setMainSid(entity.getSid()); + pp.setStoreHouseName(dto.getStorehouseName()); + pp.setStoreHouseSid(dto.getStorehouseId()); + l.add(pp); + }); + boolean b = purchasenewProductService.saveBatch(l); + if (b) + return rb.success(); + return rb; + } + + public PurchasenewDetailsVo fetchDetailsVoBySid(String sid){ + Purchasenew entity = fetchBySid(sid); + if(entity==null){ + return null; + } + PurchasenewDetailsVo vo = new PurchasenewDetailsVo(); + //根据采购订单的sid查询 对应的商品列表 + List purchasenewProductVos = purchasenewProductService.fetchDetailsVoByPurchaseSid(sid); + BeanUtil.copyProperties(entity, vo); + vo.setProducts(purchasenewProductVos); + return vo; + } + @Transactional + public int delByPurchasenewSids(String[] sids) { + for (String sid : sids) { + Purchasenew entity = fetchBySid(sid); + int state = entity.getState(); + if(2==state){ + continue; + } + Map params=new HashMap<>(); + params.put("sid",sid); + baseMapper.deleteByMap(params); + purchasenewProductService.deleteByPurchaseSid(sid); + // inStorehouseMainService.deleteByPurchaseSid(sid); + } + return sids.length; + } + + public ResultBean updatePutInStatus(String sid) { + ResultBean rb = ResultBean.fireFail(); + int i=baseMapper.updatePutInStatus(sid); + return rb.success(); + } + + public List listForInput(PurchasenewQuery pq) { + String custId = pq.getCustId(); + return baseMapper.listForInput(custId); + } + + public void updateStateToInputBySid(String purchaseSid) { + Purchasenew purchasenew = fetchBySid(purchaseSid); + purchasenew.setState(2); + purchasenew.setModifyTime(new Date()); + baseMapper.updateById(purchasenew); + } + + public ResultBean importPurchase(PurchasenewForImportDto dto) { + PurchasenewDto d=new PurchasenewDto(); + BeanUtil.copyProperties(dto,d); + ResultBean resultBean = saveOrUpdateDto(d); + if(!resultBean.getSuccess()){ + return resultBean; + } + InStoreHouseMainDto inStoreHouseMainDto=new InStoreHouseMainDto(); + inStoreHouseMainDto.setLocationId(dto.getLocationId()); + inStoreHouseMainDto.setLocationName(dto.getLocationNumber()); + inStoreHouseMainDto.setNo(dto.getPurchaseNo()); + // inStoreHouseMainDto.setNo(dto.getPurchaseNo()); + return inStorehouseMainService.addInStorehouse(inStoreHouseMainDto); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/purchasenewproduct/PurchasenewProductService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/purchasenewproduct/PurchasenewProductService.java new file mode 100644 index 00000000..d82fb379 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/purchasenewproduct/PurchasenewProductService.java @@ -0,0 +1,138 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.service.purchasenewproduct; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.wh.mapper.purchasenewproduct.PurchasenewProductMapper; +import com.wh.pojo.purchasenewproduct.*; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.apache.commons.lang3.StringUtils; +import com.yxt.common.base.utils.PagerUtil; + +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Project: warehouse(仓储)
+ * File: PurchasenewProductService.java
+ * Class: com.wh..biz.purchasenewproduct.PurchasenewProductService
+ * Description: purchasenew_product 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-10 18:09:57
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class PurchasenewProductService extends MybatisBaseService { + private QueryWrapper createQueryWrapper(PurchasenewProductQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + if(StringUtils.isNotBlank(query.getMainSid())){ + qw.eq("main_sid",query.getMainSid()); + } + return qw; + } + + public PagerVo listPageVo(PagerQuery pq) { + PurchasenewProductQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void saveOrUpdateDto(PurchasenewProductDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(PurchasenewProductDto dto){ + PurchasenewProduct entity = new PurchasenewProduct(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + } + + public void updateByDto(PurchasenewProductDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + PurchasenewProduct entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public PurchasenewProductDetailsVo fetchDetailsVoBySid(String sid){ + PurchasenewProduct entity = fetchBySid(sid); + PurchasenewProductDetailsVo vo = new PurchasenewProductDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } + + /** + * 根据采购订单的sid删除采购订单的商品信息 + * @param dtoSid + */ + public ResultBean deleteByPurchaseSid(String dtoSid) { + ResultBean rb = ResultBean.fireFail(); + if(StringUtils.isBlank(dtoSid)){ + return rb; + } + PurchasenewProductQuery query=new PurchasenewProductQuery(); + query.setMainSid(dtoSid); + QueryWrapper qw = createQueryWrapper(query); + int delete = baseMapper.delete(qw); + if (delete>0) + return rb.success(); + return rb; + + } + + /** + * 根据采购订单的sid查询 对应的商品列表 + * @param sid + * @return + */ + + public List fetchDetailsVoByPurchaseSid(String sid) { + return baseMapper.fetchDetailsVoByPurchaseSid(sid); + } +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/shstorehouse/ShStorehouseService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/shstorehouse/ShStorehouseService.java new file mode 100644 index 00000000..11960d84 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/shstorehouse/ShStorehouseService.java @@ -0,0 +1,244 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.service.shstorehouse; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +//import com.wh.feign.crm.ProjectInformationFeign; +import com.wh.mapper.shstorehouse.ShStorehouseMapper; +import com.wh.pojo.shstorehouse.*; +import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentDetailsVo; +import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentDto; +import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentVo; +import com.wh.pojo.storehouseproject.StoreHouseProject; +import com.wh.pojo.storehouseproject.StoreHouseProjectDto; +import com.wh.service.shstorehouseattachment.ShStorehouseAttachmentService; +import com.wh.service.storehouseproject.StoreHouseProjectService; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.core.result.FileUploadResult; +import org.apache.commons.lang3.StringUtils; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.util.*; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: ShStorehouseService.java
+ * Class: com.wh.biz.shstorehouse.ShStorehouseService
+ * Description: 库房信息表 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-14 23:18:54
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class ShStorehouseService extends MybatisBaseService { + @Autowired + private FileUploadComponent fileUploadComponent; + @Autowired + private ShStorehouseAttachmentService shStorehouseAttachmentService; + @Autowired + private StoreHouseProjectService storeHouseProjectService; +// @Autowired +// private ProjectInformationFeign projectInformationFeign; + private QueryWrapper createQueryWrapper(ShStorehouseQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + if(StringUtils.isNotBlank(query.getCusterName())){ + qw.like("custerName",query.getCusterName()); + } + if(StringUtils.isNotBlank(query.getName())){ + qw.like("name",query.getName()); + } + if(StringUtils.isNotBlank(query.getCusterSid())){ + qw.eq("custerSid",query.getCusterSid()); + } + return qw; + } + + public PagerVo listPageVo(PagerQuery pq) { + ShStorehouseQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public List selectStoreHouse(List list) { + List pagging = baseMapper.selectSh(list); + return pagging; + } + public ShStorehouseVo selectStoreBySid(String shSid) { + ShStorehouseVo pagging = baseMapper.selectStoreBySid(shSid); + return pagging; + } + public List getStorehouseBySid(String sid) { + List pagging = baseMapper.getStorehouseBySid(sid); + return pagging; + } + + public List listAllBycusterSid(String custerSid) { + ShStorehouseQuery query = new ShStorehouseQuery(); + query.setCusterSid(custerSid); + QueryWrapper qw = createQueryWrapper(query); + List shStorehouseVos = baseMapper.selectListAllVo(qw); + + return shStorehouseVos; + } + @Transactional + public void saveOrUpdateDto(ShStorehouseDto dto){ + String dtoSid = dto.getSid(); + + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(ShStorehouseDto dto){ + ShStorehouse entity = new ShStorehouse(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + String provinceName = dto.getProvinceName(); + String cityName = dto.getCityName(); + String countyName = dto.getCountyName(); + String regionName=provinceName+","+cityName+","+countyName; + entity.setRegionName(regionName); + List pics = dto.getPics(); + for (String pic : pics) { + ShStorehouseAttachmentDetailsVo shStorehouseAttachmentDetailsVo = shStorehouseAttachmentService.fetchDetailsVoBySid(pic); + shStorehouseAttachmentDetailsVo.setStorehouseSid(entity.getSid()); + shStorehouseAttachmentDetailsVo.setStorehouseName(entity.getName()); + ShStorehouseAttachmentDto picdto=new ShStorehouseAttachmentDto(); + BeanUtil.copyProperties(shStorehouseAttachmentDetailsVo,picdto); + shStorehouseAttachmentService.updateByDto(picdto); + } +// StoreHouseProjectDto dto1=new StoreHouseProjectDto(); +// dto1.setShSid(entity.getSid()); +// dto1.setProjectSid(dto.getProjectSid()); +// //绑定项目 +// storeHouseProjectService.saveOrUpdateDto(dto1); + baseMapper.insert(entity); + } + + public void updateByDto(ShStorehouseDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + List shStorehouseAttachmentVos=new ArrayList<>(); + if (StringUtils.isNotBlank(dtoSid)) { + shStorehouseAttachmentVos= shStorehouseAttachmentService.fetchDetailsVoByShSid(dtoSid); + } + Map picsmap2=new HashMap<>(); + for (ShStorehouseAttachmentVo shStorehouseAttachmentVo : shStorehouseAttachmentVos) { + picsmap2.put(shStorehouseAttachmentVo.getSid(),shStorehouseAttachmentVo.getSid()); + } + + ShStorehouse entity = fetchBySid(dtoSid); + String provinceName = dto.getProvinceName(); + String cityName = dto.getCityName(); + String countyName = dto.getCountyName(); + String regionName=provinceName+","+cityName+","+countyName; + entity.setRegionName(regionName); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + List pics = dto.getPics(); + Map picsmap=new HashMap<>(); + for (String pic : pics) { + picsmap.put(pic,pic); + } + + Set> entries = picsmap2.entrySet(); + for (Map.Entry entry : entries) { + String key = entry.getKey(); + if(picsmap.get(key)==null){ + shStorehouseAttachmentService.deleteBySid(key); + } + } + for (String pic : pics) { + + ShStorehouseAttachmentDetailsVo shStorehouseAttachmentDetailsVo = shStorehouseAttachmentService.fetchDetailsVoBySid(pic); + shStorehouseAttachmentDetailsVo.setStorehouseSid(entity.getSid()); + shStorehouseAttachmentDetailsVo.setStorehouseName(entity.getName()); + ShStorehouseAttachmentDto picdto=new ShStorehouseAttachmentDto(); + BeanUtil.copyProperties(shStorehouseAttachmentDetailsVo,picdto); + shStorehouseAttachmentService.updateByDto(picdto); + } + //修改项目 +// StoreHouseProject storeHouseProject=storeHouseProjectService.getOne(new QueryWrapper().eq("sh_sid",dto.getSid())); +// StoreHouseProjectDto dto1=new StoreHouseProjectDto(); +// if(null==storeHouseProject){ +// dto1.setShSid(entity.getSid()); +// dto1.setProjectSid(dto.getProjectSid()); +// }else{ +// BeanUtil.copyProperties(dto1, storeHouseProject, "id", "sid"); +// } +// storeHouseProjectService.saveOrUpdateDto(dto1); + baseMapper.updateById(entity); + } + + public ShStorehouseDetailsVo fetchDetailsVoBySid(String sid){ + ShStorehouse entity = fetchBySid(sid); + ShStorehouseDetailsVo vo = new ShStorehouseDetailsVo(); + if (entity==null) + return null; + List pics=shStorehouseAttachmentService.fetchDetailsVoByShSid(sid); + BeanUtil.copyProperties(entity, vo); + StoreHouseProject s=storeHouseProjectService.getOne(new QueryWrapper().eq("sh_sid",sid)); + if(null==s){ + + }else{ + vo.setProjectSid(s.getProjectSid()); + String r="";//projectInformationFeign.getProjectNameBySid(s.getProjectSid()); + vo.setProjectName(r); + } + vo.setPics(pics); + return vo; + } + + public ResultBean updateFile(MultipartFile file ) { + ResultBean fub = fileUploadComponent.uploadFile(file, "shstorehouse"); + if(!fub.getSuccess()){ + return fub; + } + return new ResultBean().success().setData(fub); + } +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/shstorehouseattachment/ShStorehouseAttachmentService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/shstorehouseattachment/ShStorehouseAttachmentService.java new file mode 100644 index 00000000..11c7310c --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/shstorehouseattachment/ShStorehouseAttachmentService.java @@ -0,0 +1,120 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.service.shstorehouseattachment; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.wh.mapper.shstorehouseattachment.ShStorehouseAttachmentMapper; +import com.wh.pojo.shstorehouseattachment.*; +import org.apache.commons.lang3.StringUtils; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; + +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: ShStorehouseAttachmentService.java
+ * Class: com.wh.biz.shstorehouseattachment.ShStorehouseAttachmentService
+ * Description: 库房附件,如合同,图片等 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-14 23:18:54
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class ShStorehouseAttachmentService extends MybatisBaseService { + private QueryWrapper createQueryWrapper(ShStorehouseAttachmentQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + return qw; + } + + public PagerVo listPageVo(PagerQuery pq) { + ShStorehouseAttachmentQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void saveOrUpdateDto(ShStorehouseAttachmentDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(ShStorehouseAttachmentDto dto){ + ShStorehouseAttachment entity = new ShStorehouseAttachment(); + BeanUtil.copyProperties(dto, entity, "id"); + baseMapper.insert(entity); + } + + public void updateByDto(ShStorehouseAttachmentDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + ShStorehouseAttachment entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public ShStorehouseAttachmentDetailsVo fetchDetailsVoBySid(String sid){ + ShStorehouseAttachment entity = fetchBySid(sid); + ShStorehouseAttachmentDetailsVo vo = new ShStorehouseAttachmentDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } + + public void deleteByHouseSid(String dtoSid) { + baseMapper.deleteByHouseSid(dtoSid); + } + + public List fetchDetailsVoByShSid(String sid) { + QueryWrapper qw =new QueryWrapper<>(); + if (StringUtils.isBlank(sid)){ + return new ArrayList<>(); + } + qw.eq("storehouse_sid",sid); + return baseMapper.selectListAllVo(qw); + } +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/shstorehouseattribute/ShStorehouseAttributeService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/shstorehouseattribute/ShStorehouseAttributeService.java new file mode 100644 index 00000000..16ef83ee --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/shstorehouseattribute/ShStorehouseAttributeService.java @@ -0,0 +1,106 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.wh.service.shstorehouseattribute; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.wh.mapper.shstorehouseattribute.ShStorehouseAttributeMapper; +import com.wh.pojo.shstorehouseattribute.*; +import org.apache.commons.lang3.StringUtils; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; + +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Project: yxt_supervise(宇信通监管)
+ * File: ShStorehouseAttributeService.java
+ * Class: com.wh.biz.shstorehouseattribute.ShStorehouseAttributeService
+ * Description: 库房性质 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2023-06-14 23:18:54
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class ShStorehouseAttributeService extends MybatisBaseService { + private QueryWrapper createQueryWrapper(ShStorehouseAttributeQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + return qw; + } + + public PagerVo listPageVo(PagerQuery pq) { + ShStorehouseAttributeQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void saveOrUpdateDto(ShStorehouseAttributeDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(ShStorehouseAttributeDto dto){ + ShStorehouseAttribute entity = new ShStorehouseAttribute(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + } + + public void updateByDto(ShStorehouseAttributeDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + ShStorehouseAttribute entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public ShStorehouseAttributeDetailsVo fetchDetailsVoBySid(String sid){ + ShStorehouseAttribute entity = fetchBySid(sid); + ShStorehouseAttributeDetailsVo vo = new ShStorehouseAttributeDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/stock/StockService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/stock/StockService.java new file mode 100644 index 00000000..708b7050 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/stock/StockService.java @@ -0,0 +1,8 @@ +package com.wh.service.stock; + +import com.wh.vo.PageResult; + +public interface StockService { + + PageResult getStockList(PageResult pageResult); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/stock/StockServiceImpl.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/stock/StockServiceImpl.java new file mode 100644 index 00000000..71175ed1 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/stock/StockServiceImpl.java @@ -0,0 +1,29 @@ +package com.wh.service.stock; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wh.mapper.stock.StockMapper; +import com.wh.pojo.Stock; +import com.wh.vo.PageResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +@Service +public class StockServiceImpl implements StockService{ + + @Autowired + private StockMapper stockMapper; + + + @Override + public PageResult getStockList(PageResult pageResult) { + Page page = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); + boolean flag = StringUtils.hasLength(pageResult.getQuery()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.like(flag,"product_name",pageResult.getQuery()); + page = stockMapper.selectPage(page,queryWrapper); + pageResult.setTotal((long) page.getRecords().size()).setRows(page.getRecords()); + return pageResult; + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/RemoveService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/RemoveService.java new file mode 100644 index 00000000..c976efcc --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/RemoveService.java @@ -0,0 +1,17 @@ +package com.wh.service.storehousemanage; + +import com.wh.pojo.Remove; +import com.wh.vo.PageResult; + +import java.util.Map; + +public interface RemoveService { + Map getQuery(Remove remove); + + void addRemove(Remove remove); + + + PageResult getRemoveList(PageResult pageResult); + + void updataRemove(Remove remove); +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/RemoveServiceImpl.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/RemoveServiceImpl.java new file mode 100644 index 00000000..2313e784 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/RemoveServiceImpl.java @@ -0,0 +1,119 @@ +package com.wh.service.storehousemanage; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wh.api.Api; +import com.wh.mapper.initial.LocationMapper; +import com.wh.mapper.initial.ProductMapper; +import com.wh.mapper.stock.StockMapper; +import com.wh.mapper.storehousemanage.RemoveMapper; +import com.wh.pojo.Location; +import com.wh.pojo.Product; +import com.wh.pojo.Remove; +import com.wh.pojo.Stock; +import com.wh.vo.PageResult; +import net.sf.jsqlparser.statement.select.Select; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.*; + +@Service +public class RemoveServiceImpl implements RemoveService{ + + @Autowired + private RemoveMapper removeMapper; + + @Autowired + private StockMapper stockMapper; + + @Autowired + private LocationMapper locationMapper; + + @Autowired + private ProductMapper productMapper; + + //获取可用的库存 + @Override + public Map getQuery(Remove remove) { + + boolean barCodeFlag = StringUtils.hasLength(remove.getBarCode()); + boolean fromLocationIdFlag = StringUtils.hasLength(remove.getFromLocationId()); + + //获取传入条件下的商品 + QueryWrapper stockQueryWrapper = new QueryWrapper<>(); + stockQueryWrapper.eq(barCodeFlag,"bar_code",remove.getBarCode()) + .eq(fromLocationIdFlag,"location_id",remove.getFromLocationId()); + List stocks = stockMapper.selectList(stockQueryWrapper); + + + + Set barCodeList = new HashSet<>(); + Set fromLocationIdList = new HashSet<>(); + Integer availableQuantity = 0; + + Map map = new HashMap<>(); + + + + + for (Stock stock : stocks){ + barCodeList.add(stock.getBarCode()); + fromLocationIdList.add(stock.getLocationId()); + } + + if (stocks.size() == 1){ + availableQuantity = stocks.get(0).getAvailableQuantity(); + } + + map.put("barCodeList",barCodeList); + map.put("fromLocationIdList",fromLocationIdList); + map.put("availableQuantity",availableQuantity); + + + return map; + } + + @Override + public void addRemove(Remove remove) { + //设置商品名 + Product product = productMapper.selectById(remove.getBarCode()); + remove.setProductName(product.getName()); + + //设置创建时间 + remove.setCreateTime(new Api().getTime()); + + //修改库存 + Stock fromStock = stockMapper.selectById(remove.getFromLocationId()); + fromStock.setLockedQuantity(fromStock.getLockedQuantity()+remove.getCount()) + .setAvailableQuantity(fromStock.getAvailableQuantity() - remove.getCount()); + stockMapper.updateById(fromStock); + + + //添加记录 + removeMapper.insert(remove); + + } + + @Override + public PageResult getRemoveList(PageResult pageResult) { + Page page = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); + boolean flag = StringUtils.hasLength(pageResult.getQuery()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.like(flag,"remove_id",pageResult.getQuery()); + page = removeMapper.selectPage(page,queryWrapper); + pageResult.setTotal((long) page.getRecords().size()).setRows(page.getRecords()); + return pageResult; + } + + @Override + public void updataRemove(Remove remove) { + if (remove.getStatus().equals("已审核")) { + remove.setCheckTime(new Api().getTime()); + }else if (remove.getStatus().equals("待审核")){ + remove.setCheckTime("").setCheckPerson(""); + } + removeMapper.updateById(remove); + } +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/ShelvesService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/ShelvesService.java new file mode 100644 index 00000000..a0f823c3 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/ShelvesService.java @@ -0,0 +1,19 @@ +package com.wh.service.storehousemanage; + +import com.wh.pojo.OnShelves; +import com.wh.vo.PageResult; +import com.wh.vo.QueryInfo; + +import java.util.Map; + +public interface ShelvesService { + Map getQuery(QueryInfo queryInfo); + + void addShelves(OnShelves onShelves); + + PageResult getShelves(PageResult pageResult); + + void deleteShelves(String id); + + void updataShelves(OnShelves onShelves) throws Exception; +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/ShelvesServiceImpl.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/ShelvesServiceImpl.java new file mode 100644 index 00000000..663e8b41 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehousemanage/ShelvesServiceImpl.java @@ -0,0 +1,295 @@ +package com.wh.service.storehousemanage; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.wh.api.Api; +import com.wh.mapper.initial.LocationMapper; +import com.wh.mapper.initial.ProductMapper; +import com.wh.mapper.instorehouse.PurchaseMapper; +import com.wh.mapper.instorehouse.ReceivingMapper; +import com.wh.mapper.stock.StockMapper; +import com.wh.mapper.instorehouse.PutInMapper; +import com.wh.mapper.storehousemanage.ShelvesMapper; +import com.wh.pojo.*; +import com.wh.vo.PageResult; +import com.wh.vo.QueryInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.*; + +@Service +public class ShelvesServiceImpl implements ShelvesService{ + @Autowired + private ShelvesMapper shelvesMapper; + + @Autowired + private StockMapper stockMapper; + + @Autowired + private LocationMapper locationMapper; + + @Autowired + private ProductMapper productMapper; + + @Autowired + private PutInMapper putInMapper; + + @Autowired + private PurchaseMapper purchaseMapper; + + @Autowired + private ReceivingMapper receivingMapper; + + + @Override + public Map getQuery(QueryInfo queryInfo) { + + QueryWrapper stockQueryWrapper = new QueryWrapper<>(); + stockQueryWrapper.eq(StringUtils.hasLength(queryInfo.getBarCode()),"bar_code",queryInfo.getBarCode()) + .eq(StringUtils.hasLength(queryInfo.getFromLocationId()),"Location_id",queryInfo.getFromLocationId()) + .eq("status","待上架") + .select("bar_code","location_id","available_quantity"); + List stockList = stockMapper.selectList(stockQueryWrapper); + + QueryWrapper locationQueryWrapper = new QueryWrapper<>(); + locationQueryWrapper.eq("status","空闲").ne("type","入库区").or().eq("status",queryInfo.getBarCode()); + + List locationList = locationMapper.selectList(locationQueryWrapper); + + Map map = new HashMap<>(); + Set barCodeSet = new HashSet<>(); + Set locationIdSet = new HashSet<>(); + Set fromLocationIdSet = new HashSet<>(); + for (Stock stock : stockList){ + barCodeSet.add(stock.getBarCode()); + fromLocationIdSet.add(stock.getLocationId()); + } + + for (Location location : locationList){ + locationIdSet.add(location.getLocationId()); + } + + locationIdSet.remove(queryInfo.getFromLocationId()); + fromLocationIdSet.remove(queryInfo.getLocationId()); + + map.put("barCode",barCodeSet); + map.put("locationId",locationIdSet); + map.put("fromLocationId",fromLocationIdSet); + map.put("availableQuantity",0); + + + + if (stockList.size()==1 && queryInfo.getCount()!=null && queryInfo.getCount()>stockList.get(0).getAvailableQuantity()){ + return new HashMap<>(); + }if (stockList.size()==1){ + map.replace("availableQuantity",stockList.get(0).getAvailableQuantity()); + return map; + }else{ + return map; + } + } + + @Override + public void addShelves(OnShelves onShelves) { + QueryWrapper locationQueryWrapper = new QueryWrapper<>(); + String locationName = locationMapper.selectById(onShelves.getLocationId()).getName(); + String fromLocationName = locationMapper.selectById(onShelves.getFromLocationId()).getName(); + String productName = productMapper.selectById(onShelves.getBarCode()).getName(); + String createTime = new Api().getTime(); + + onShelves.setFromLocationName(fromLocationName) + .setLocationName(locationName) + .setProductName(productName) + .setCreateTime(createTime) + .setStatus("待审核") + .setCreateTime(new Api().getTime()); + + shelvesMapper.insert(onShelves); + + Stock stock = stockMapper.selectById(onShelves.getFromLocationId()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("location_id",onShelves.getFromLocationId()); + InStorehouse inStorehouse = putInMapper.selectOne(queryWrapper); + inStorehouse.setStatus("进行中"); + putInMapper.updateById(inStorehouse); + + stock.setAvailableQuantity( + stock.getAvailableQuantity()-onShelves.getCount() + ).setLockedQuantity( + stock.getLockedQuantity()+onShelves.getCount() + ); + + stockMapper.updateById(stock); + + Location location = locationMapper.selectById(onShelves.getLocationId()); + location.setStatus(onShelves.getBarCode()); + locationMapper.updateById(location); + + + } + + @Override + public PageResult getShelves(PageResult pageResult) { + Page page = new Page<>(pageResult.getPageNum(),pageResult.getPageSize()); + boolean flag = StringUtils.hasLength(pageResult.getQuery()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.like(flag,"shelves_id",pageResult.getQuery()); + + page = shelvesMapper.selectPage(page,queryWrapper); + + pageResult.setTotal((long) page.getRecords().size()).setRows(page.getRecords()); + return pageResult; + } + + @Override + public void deleteShelves(String id) { + OnShelves onShelves = shelvesMapper.selectById(id); + + //判断库位是否空闲,修改状态 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("location_id",onShelves.getLocationId()); + List list = shelvesMapper.selectList(queryWrapper); + if (list.size() == 1){ + Location location = locationMapper.selectById(onShelves.getLocationId()); + location.setStatus("空闲"); + locationMapper.updateById(location); + } + + //更新源货位数据 + Stock stock = stockMapper.selectById(onShelves.getFromLocationId()); + stock.setAvailableQuantity(stock.getAvailableQuantity() + onShelves.getCount()) + .setLockedQuantity(stock.getLockedQuantity() - onShelves.getCount()); + stockMapper.updateById(stock); + + shelvesMapper.deleteById(id); + } + + @Override + public void updataShelves(OnShelves onShelves) throws Exception { + + + if (onShelves.getStatus().equals("已审核")){ + check(onShelves); + onShelves.setCheckTime(new Api().getTime()); + }else if (onShelves.getStatus().equals("待审核")){ + cancelCheck(onShelves); + onShelves.setCheckTime("").setCheckPerson(""); + } + shelvesMapper.updateById(onShelves); + + Stock stock = stockMapper.selectById(onShelves.getFromLocationId()); + if (stock == null) return; + QueryWrapper onShelvesQueryWrapper = new QueryWrapper<>(); + onShelvesQueryWrapper.eq("from_location_id",onShelves.getFromLocationId()).eq("status","已审核"); + List onShelvesList = shelvesMapper.selectList(onShelvesQueryWrapper); + Integer lockedQuantity = 0; + for (OnShelves onShelves1 : onShelvesList){ + lockedQuantity += onShelves1.getCount(); + } + + if (stock.getAvailableQuantity()==0 && stock.getLockedQuantity() == lockedQuantity){ + deleteStock(onShelves.getFromLocationId()); + } + } + + public void deleteStock(String locationId){ + Stock stock = stockMapper.selectById(locationId); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("location_id",locationId); + InStorehouse inStorehouse = putInMapper.selectOne(queryWrapper); + if (stock.getLockedQuantity() == 0){ + inStorehouse.setStatus("已审核"); + } + stockMapper.deleteById(locationId); + + Location location = locationMapper.selectById(locationId); + location.setStatus("空闲"); + locationMapper.updateById(location); + + } + + public void check(OnShelves onShelves){ + Stock stock = stockMapper.selectById(onShelves.getFromLocationId()); + + + QueryWrapper stockQueryWrapper = new QueryWrapper<>(); + stockQueryWrapper.eq("location_id",onShelves.getLocationId()); + Integer num = stockMapper.selectCount(stockQueryWrapper); + System.out.println(num); + Stock newStock; + if (num == 0) { + newStock = new Stock(); + newStock.setAvailableQuantity(onShelves.getCount()) + .setTotalQuantity(onShelves.getCount()) + .setBarCode(onShelves.getBarCode()) + .setLockedQuantity(0) + .setInStorehouseId(stock.getInStorehouseId()) + .setLocationId(onShelves.getLocationId()) + .setLocationName(onShelves.getLocationName()) + .setProductName(onShelves.getProductName()) + .setStatus("已上架"); + stockMapper.insert(newStock); + + + Location location = locationMapper.selectById(onShelves.getLocationId()); + location.setStatus(onShelves.getBarCode()); + locationMapper.updateById(location); + + }else { + newStock = stockMapper.selectById(onShelves.getLocationId()); + newStock.setTotalQuantity(onShelves.getCount()+newStock.getAvailableQuantity()) + .setAvailableQuantity(onShelves.getCount()+newStock.getAvailableQuantity()); + stockMapper.updateById(newStock); + } + + + + } + + public void cancelCheck(OnShelves onShelves) throws Exception { + //获取商品库存 + Stock stock2 = stockMapper.selectById(onShelves.getLocationId()); + //可用数量 + Integer availableQuantity = stock2.getAvailableQuantity()-onShelves.getCount(); + + if (stock2.getAvailableQuantity() stockQueryWrapper = new QueryWrapper<>(); + stockQueryWrapper.eq("location_id",onShelves.getFromLocationId()); + Stock stock = new Stock(); + Integer c = stockMapper.selectCount(stockQueryWrapper); + if (stockMapper.selectCount(stockQueryWrapper) == 0) { + InStorehouse inStorehouse = putInMapper.selectById(stock2.getInStorehouseId()); + Receiving receiving = receivingMapper.selectById(inStorehouse.getReceivingId()); + Purchase purchase = purchaseMapper.selectById(receiving.getPurchaseId()); + + stock.setInStorehouseId(stock2.getInStorehouseId()) + .setLocationId(onShelves.getFromLocationId()) + .setLocationName(onShelves.getFromLocationName()) + .setBarCode(stock2.getBarCode()) + .setProductName(stock2.getProductName()) + .setTotalQuantity(purchase.getCount()) + .setAvailableQuantity(0) + .setLockedQuantity(purchase.getCount()) + .setStatus("待上架"); + stockMapper.insert(stock); + } + + if ( availableQuantity == 0){ + stockMapper.deleteById(onShelves.getLocationId()); + Location location = locationMapper.selectById(onShelves.getLocationId()); + location.setStatus("空闲"); + locationMapper.updateById(location); + }else { + stock2.setTotalQuantity(stock2.getTotalQuantity()-stock2.getAvailableQuantity()+availableQuantity) + .setAvailableQuantity(availableQuantity); + stockMapper.updateById(stock2); + } + + } + + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehouseproject/StoreHouseProjectService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehouseproject/StoreHouseProjectService.java new file mode 100644 index 00000000..f19f8cee --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/storehouseproject/StoreHouseProjectService.java @@ -0,0 +1,65 @@ +package com.wh.service.storehouseproject; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.wh.mapper.storehouseproject.StoreHouseProjectMapper; +import com.wh.pojo.shstorehouse.ShStorehouse; +import com.wh.pojo.shstorehouse.ShStorehouseDto; +import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentDetailsVo; +import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentDto; +import com.wh.pojo.shstorehouseattachment.ShStorehouseAttachmentVo; +import com.wh.pojo.storehouseproject.StoreHouseProject; +import com.wh.pojo.storehouseproject.StoreHouseProjectDto; +import com.yxt.common.base.service.MybatisBaseService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * @author wangpengfei + * @date 2023/7/19 15:44 + */ +@Service +public class StoreHouseProjectService extends MybatisBaseService { + @Transactional + public void saveOrUpdateDto(StoreHouseProjectDto dto) { + String dtoSid = dto.getSid(); + + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + + public void insertByDto(StoreHouseProjectDto dto) { + StoreHouseProject entity = new StoreHouseProject(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + //删除之前选择的仓库信息 + baseMapper.delete(new QueryWrapper().eq("project_sid",dto.getProjectSid())); + + for(String shSid:dto.getShSids()){ + entity.setShSid(shSid); + baseMapper.insert(entity); + } + } + public void updateByDto(StoreHouseProjectDto dto) { + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + //删除之前选择的仓库信息 + baseMapper.delete(new QueryWrapper().eq("project_sid",dto.getProjectSid())); + //重新新增 + StoreHouseProject entity = new StoreHouseProject(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + for(String shSid:dto.getShSids()){ + entity.setShSid(shSid); + baseMapper.insert(entity); + } + } + +} diff --git a/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/sysuser/SysUserService.java b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/sysuser/SysUserService.java new file mode 100644 index 00000000..a3a12c77 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/java/com/wh/service/sysuser/SysUserService.java @@ -0,0 +1,830 @@ +package com.wh.service.sysuser; + +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +//import com.wh.feign.crm.ProjectInformationFeign; +import com.wh.mapper.sysuser.SysUserMapper; +import com.wh.pojo.sysuser.*; +import com.wh.pojo.sysuser.wx.*; +import com.yxt.common.base.config.RedisUtil; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.config.component.ImageUploadUtil; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.*; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.web.client.RestTemplate; + +import java.util.*; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +import static java.util.concurrent.Executors.newScheduledThreadPool; + +/** + * Project: anrui_portal(门户建设)
+ * File: SysUserService.java
+ * Class: SysUserService
+ * Description: 用户表 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2021-08-03 00:24:30
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class SysUserService extends MybatisBaseService { + + /** + * 设置redis的过期时间为4小时 + */ + public static final long USERS_REDIS_SESSION_TL_PC = 4 * 3600; + public static final long USERS_REDIS_SESSION_TL_App = 24 * 15 * 3600; + /** + * 验证码长度 + */ + static final int LENGTH_OF_CODE = 4; + /** + * 调用发送短信接口返回值 + */ + static final String RESULT_CODE = "1"; + /** + * 手机短信登录验证码时效(秒) + */ + static final long APP_LOGIN_CODE_TIME_LIMIT = 300L; + String APP_ID = "wx05604ce2a8bede05"; + String SECRET = "3d36e8a61212cf773a2fa4e6c9a83334"; + private static final String WX_URL_LOGIN = "https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code "; + private static final String WX_EMPOWER_URL_LOGIN = "https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code"; + @Autowired + private RedisUtil redisUtil; + @Autowired + private FileUploadComponent fileUploadComponent; + + @Autowired + private ImageUploadUtil imageUploadUtil; + + + public PagerVo listPage(PagerQuery pq) { + SysUserQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public List listAll(SysUserQuery query) { + QueryWrapper qw = createQueryWrapper(query); + return baseMapper.selectList(qw); + } + + private QueryWrapper createQueryWrapper(SysUserQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotBlank(query.getRoleSid())) { + qw.eq("role.sid", query.getRoleSid()); + } + if (StringUtils.isNotBlank(query.getName())) { + qw.like("staff.name", query.getName()); + } +// qw.ne("staff.personTypeKey","01"); + return qw; + } + + public PagerVo listPageVo(PagerQuery pq) { + SysUserQuery query = pq.getParams(); + QueryWrapper qw = createQueryWrapper(query); + IPage page = PagerUtil.queryToPage(pq); + String deptName = ""; + String userName = ""; + if (StringUtils.isNotBlank(query.getOrgName())) { + deptName = query.getOrgName().trim(); + } + if (StringUtils.isNotBlank(query.getUserName())) { + userName = query.getUserName().trim(); + } + IPage pagging = baseMapper.selectPageVo(page, qw, deptName, userName); + List records = pagging.getRecords(); + for (SysUserVo record : records) { + String departmentSid = record.getDepartmentSid(); + String orgName = ""; + if (StringUtils.isNotBlank(departmentSid)) { + String[] split = departmentSid.split(","); + for (String s : split) { + } + orgName = orgName.substring(0, orgName.length() - 1); + record.setDepartmentName(orgName); + } + } + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public List listAllVo(SysUserQuery query) { + QueryWrapper qw = createQueryWrapper(query); + return baseMapper.selectListAllVo(qw); + } + + public List listVo() { + return baseMapper.selectListVo(); + } + + public void saveOrUpdateDto(SysUserDto dto) { + SysUser entity = new SysUser(); + dto.fillEntity(entity); + this.saveOrUpdate(entity); + } + + public SysUserVo fetchByIdVo(String id) { + SysUser entity = this.fetchById(id); + SysUserVo vo = new SysUserVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } + + public SysUserVo fetchBySidVo(String sid) { + SysUser entity = this.fetchBySid(sid); + String staffSid = entity.getStaffSid(); + SysUserVo vo = new SysUserVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } + public SysUser getUserBySid(String sid) { + SysUser entity = this.fetchBySid(sid); + + return entity; + } + /** + * 初始化密码,给用户发送手机短信 + * + * @param sid 用户sid + * @return ResultBean + */ + public Boolean initPwd(String sid) { + SysUser user = this.fetchBySid(sid); + if (null == user) { + return false; + } + String mobile = user.getMobile(); + + String substring = mobile.substring(5, 11); + // 1.生成新密码 + /*String newPwd = StringRandom.getRandomString(8);*/ + // 2.加密密码,更新用户密码 + if (0 == updatePassword(user.getSid(), Encodes.md5(substring))) { + return false; + } + redisUtil.remove(user.getUserName()); + // 3.给用户发送手机短信 +// MsgWs.SendWaitWorkMsg(mobile, user.getUserName() + SmsFeign.MSG_NEWPWD + substring); + return true; + } + + public int updatePassword(String sid, String password) { + return baseMapper.updatePassword(sid, password); + } + + public ResultBean updatePasswordApp(SysUser user, String oldPassword, String newPassword, String token) { + ResultBean rb = ResultBean.fireFail(); + String oldPasswordMd5 = Encodes.md5(oldPassword); + if (!oldPasswordMd5.equals(user.getPassword())) { + return rb.setMsg("原始密码输入错误"); + } + if (!newPassword.matches("^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])[a-zA-Z0-9]{8,16}$")) { + return rb.setMsg("密码格式错误,必须为8至16位大小写字母和数字的组合"); + } + int i = baseMapper.updatePasswordApp(user.getSid(), Encodes.md5(newPassword)); + SysUserVo sysUserVo = selectUserOne(user); + if (sysUserVo == null) { + sysUserVo = new SysUserVo(); + } else { + //查询是否需要更换密码 + boolean isTrue = false; + String mobile = user.getMobile(); + if (StringUtils.isNotBlank(mobile)) { + String password = mobile.substring(5, 11); + String md5 = Encodes.md5(password); + if (user.getPassword().equals(md5)) { + isTrue = true; + } + } + sysUserVo.setNeedResetPsd(isTrue); + } + if (i == 1) { +// redisUtil.remove(token); + return rb.success().setData(sysUserVo); + } else { + return rb.setMsg("修改失败"); + } + } + + public SysUser selectByUserName(String userName) { + return baseMapper.selectByUserName(userName); + } + + public SysUser selectByUserNameApp(String userName) { + return baseMapper.selectByUserNameApp(userName); + } + + public SysUser selectByAppId(String appId) { + return baseMapper.selectByAppId(appId); + } + + public int updateAppId(String sid, String appId) { + return baseMapper.updateAppId(sid, appId); + } + + public int updateToken(String sid, String token) { + return baseMapper.updateToken(sid, token); + } + + public SysUserVo setUserRedisSessionToken(SysUser user) { + // 生成token + String uniqueToken = JWTUtil.create(user.getSid() + ""); + // redis中缓存token + redisUtil.set(uniqueToken, user.getUserName(), + USERS_REDIS_SESSION_TL_PC); + SysUserVo userInfoOneVo = selectUserOne(user); + if (userInfoOneVo == null) { + return userInfoOneVo; + } else { + userInfoOneVo.setToken(uniqueToken); + return userInfoOneVo; + } + + } + + //公共的方法 + public SysUserVo selectUserOne(SysUser user) { + // 根据用户信息查询用户的角色信息 + SysUserVo userInfoOneVo = new SysUserVo(); + userInfoOneVo.setToken(user.getToken()); + userInfoOneVo.setId(user.getId()); + userInfoOneVo.setSid(user.getSid()); + userInfoOneVo.setUserName(user.getUserName()); + userInfoOneVo.setIsAdmin(user.getIsAdmin()); + return userInfoOneVo; + } + + /** + * 手机端登录后设置token + * + * @param user + * @return + */ + public SysUserVo selectUser(SysUser user) { + String oldToken = user.getToken(); + if (StringUtils.isNotBlank(oldToken)) { + redisUtil.remove(oldToken); + } + String uniqueToken = JWTUtil.create(user.getSid() + ""); + String newToken = "App" + uniqueToken; + redisUtil.set(newToken, user.getUserName(), USERS_REDIS_SESSION_TL_App); + SysUserVo sysUserVo = selectUserOne(user); + if (sysUserVo == null) { + return null; + } else { + sysUserVo.setToken(newToken); + // 更新用户中的token + updateToken(user.getSid(), newToken); + //查询是否需要更换密码 + boolean isTrue = false; + String mobile = user.getMobile(); + if (StringUtils.isNotBlank(mobile)) { + String password = mobile.substring(5, 11); + String md5 = Encodes.md5(password); + if (user.getPassword().equals(md5)) { + isTrue = true; + } + } + sysUserVo.setNeedResetPsd(isTrue); + return sysUserVo; + } + + } + + /** + * 获取用户的角色s + * + * @return + */ + public List getUserRoleSids(String userSid) { + return null; + } + + public SysUser fetchByUserName(String mobile) { + SysUser sysUsers = baseMapper.fetchByUserName(mobile); + return sysUsers; + } + + public void delBySid(String sid) { + baseMapper.delBySid(sid); + } + + /** + * 发送短信验证码 + * + * @param mobile 手机号 + * @param verificationCode 验证码 + * @return ResultBean + */ + public ResultBean getVerificationCode(String mobile, String verificationCode) { + for (int i = 0; i < LENGTH_OF_CODE; i++) { + // 定义随机类 + Random random = new Random(); + // 返回[0,10)集合中的整数,注意不包括10 + int result = random.nextInt(10); + // +1后,[0,10)集合变为[1,11)集合,满足要求 + int num = result; + verificationCode = verificationCode + num; + } + String verificationCode1 = "个人注册验证码:" + verificationCode + ",有效期5分钟,如非本人操作,请忽略该短信。"; + try { + //============ + //当前时间秒数 + Long timemili = System.currentTimeMillis() / 1000; + System.out.println("当前的秒数" + timemili); + /*在这里写一个定时的for循环,用来取redis的手机号码信息,然后查询手机号码开始的时间,若是大于等于五分钟就给删除这个键值*/ + //创建多线程定时任务,延迟1s启动,每隔1s执行一次,是前一个任务开始时就开始计算时间间隔,但是会等上一个任务结束在开始下一个 + ScheduledExecutorService scheduledExecutorService = newScheduledThreadPool(10); + scheduledExecutorService.scheduleAtFixedRate(new Runnable() { + @Override + public void run() { + //判断这个键的值是不是超过五分钟,是的话就删除掉这个键 + if (System.currentTimeMillis() / 1000 - Long.parseLong(redisUtil.get(mobile).substring(4)) > 300) { + redisUtil.remove(mobile); + } + } + }, 1, 2, TimeUnit.SECONDS); + + //设置键值的时候先查询是否存在这个键值对,存在的话查看时长,不存在的话直接发送短信 + boolean str = redisUtil.exists(mobile); + if (!str) { + redisUtil.set(mobile, (verificationCode + timemili)); + String result = MsgWs.SendWaitWorkMsg(mobile, verificationCode1); + if (!RESULT_CODE.equals(result)) { + return ResultBean.fireFail().setMsg("发送短信验证码失败"); + } + } else { + String strT = redisUtil.get(mobile); + //查看请求间隔,默认是一分钟,小于一分钟继续等待,超过一分钟发送短信 + if (timemili - Long.parseLong(strT.substring(4)) < 60) { + return ResultBean.fireFail().setMsg("请等待一分钟后再次重试!"); + } else { + //发送短信 + redisUtil.set(mobile, (verificationCode + timemili)); + String result = MsgWs.SendWaitWorkMsg(mobile, verificationCode1); + if (!RESULT_CODE.equals(result)) { + return ResultBean.fireFail().setMsg("发送短信验证码失败"); + } + + } + } + } catch (Exception e) { + return ResultBean.fireFail().setMsg("发送短信验证码失败"); + } + //============= + return ResultBean.fireSuccess().setMsg("发送短信验证码成功"); + } + + /** + * 验证手机号和验证码是否正确及匹配 + * + * @param mobile 手机号 + * @param verificationCode 验证码 + * @return map + */ + public Map mobileValidateRegister(String mobile, String verificationCode) { + String code = redisUtil.get(mobile).substring(0, 4); + // 判断验证码是否失效 + if (StringUtils.isEmpty(code)) { + return Tools.setRetCode(Tools.CODE_FAIL, "验证码失效"); + } else if (!"".equals(code) && !verificationCode.equals(code)) { + return Tools.setRetCode(Tools.CODE_FAIL, "验证码错误"); + } + return Tools.setRetCode(Tools.CODE_SUCCESS, ""); + } + + + + /** + * @param mobile 手机号 + * @param verificationCode 验证码 + * @param type 验证码类型 + * @description: 绑定微信验证验证码是否正确 + * @return: + * @Author: dimengzhe + * @Date: 2021/10/6 11:02 + */ + public Map mobileValidateWxRegister(String mobile, String verificationCode,String type) { + String key = ""; + if (type.equals("1")) { + key = "loginCode"+ mobile; + } else if (type.equals("2")) { + key = "updatePwdCode"+mobile; + } else if (type.equals("3")) { + key = "resetPwdCode"+mobile; + }else if(type.equals("4")){ + key = "binding"+mobile; + } + String code = redisUtil.get(key); + if (StringUtils.isNotBlank(code)) { + code = code.substring(0, 4); + } + // 判断验证码是否失效 + if (StringUtils.isEmpty(code)) { + return Tools.setRetCode(Tools.CODE_FAIL, "验证码失效"); + } else if (!"".equals(code) && !verificationCode.equals(code)) { + return Tools.setRetCode(Tools.CODE_FAIL, "验证码错误"); + } + return Tools.setRetCode(Tools.CODE_SUCCESS, ""); + } + + /** + * @param userName 用户名 + * @description: 根据用户名获取登录信息 + * @return: + * @Author: dimengzhe + * @Date: 2021/10/6 15:09 + */ + public WxSysUserVo selectByWxUserName(String userName, int userType) { + WxSysUserVo wxSysUserVo =new WxSysUserVo();// baseMapper.selectByWxUserName(userName, userType); + //根据客户sid查询姓名 + String staffSid = wxSysUserVo.getStaffSid(); + // 生成token + String uniqueToken = JWTUtil.create(wxSysUserVo.getUserSid() + ""); + String token = "WX" + uniqueToken; + //查询是否有旧token,存在的话清除掉redis中的该token + if (StringUtils.isNotBlank(wxSysUserVo.getToken())) { + //查询是否过期 + String values = redisUtil.get(wxSysUserVo.getToken()); + if (StringUtils.isNotBlank(values)) { + redisUtil.remove(wxSysUserVo.getToken()); + } + } + // redis中缓存token + redisUtil.set(token, wxSysUserVo.getUserName(), + USERS_REDIS_SESSION_TL_PC); + wxSysUserVo.setToken(token); + wxSysUserVo.setNum("1"); + // 更新用户中的token + updateToken(wxSysUserVo.getUserSid(), token); + return wxSysUserVo; + } + + public ResultBean resetPwdWx(String mobile, String newPwd) { + if (!newPwd.matches("^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])[a-zA-Z0-9]{8,10}$")) { + return ResultBean.fireFail().setMsg("密码格式错误,必须为8至10位大小写字母和数字的组合"); + } + SysUser user = baseMapper.selectByMobileAndType(mobile, 2); + if (null == user) { + return ResultBean.fireFail().setMsg("该手机号暂时还未注册,请先注册"); + } + String newPwdMd5 = Encodes.md5(newPwd); + if (newPwdMd5.equals(user.getPassword())) { + return ResultBean.fireFail().setMsg("新密码不能与旧密码相同"); + } + int i = baseMapper.updatePassword(user.getSid(), newPwdMd5); + if (i == 1) { + return ResultBean.fireSuccess().setMsg("修改成功"); + } else { + return ResultBean.fireFail().setMsg("修改失败"); + } + } + + public SysUserVo selectByStaffsid(@Param("staffSid") String staffSid) { + return baseMapper.selectByStaffsid(staffSid); + } + + public int delSysUserByMobile(String mobile) { + return baseMapper.delSysUserByMobile(mobile); + } + + /** + * 查询所有用户的sid + * + * @return + */ + public List selectAllUserSid() { + return baseMapper.selectAllUserSid(); + } + + + + + /** + * 根据用户sid获取用户的组织信息 + * + * @param userSid 用户的sid + * @return + */ + public SysUserInfoVo selectUserInfoByUserSid(String userSid) { + return baseMapper.selectUserInfoByUserSid(userSid); + } + + /** + * 根据用户sid获取用户的组织信息 + * + * @param userSid 用户的sid + * @return + */ + public SysUserInfoVo selectUserInfoByUserSid(String userSid, String orgSid) { + return baseMapper.selectUserInfoByUserSidOne(userSid, orgSid); + } + + /** + * 根据员工sid更新用户信息 + * + * @param mobile 手机号 + * @param sid 员工sid + * @return + */ +// public int updateByStaffSid(String jobNumber, String mobile, String sid) { +// return baseMapper.updateByStaffSid(jobNumber, mobile, sid); +// } + public int updateByStaffSid(String mobile, String sid) { + return baseMapper.updateByStaffSid( mobile, sid); + } + /** + * 根据员工sid更新用户的员工编号 + * + * @param jobNumber 员工编号 + * @param sid 用户sid + * @return + */ + public int updateByStaSid(String jobNumber, String sid) { + return baseMapper.updateByStaSid(jobNumber, sid); + } + + /** + * 根据手机号查询用户是否存在 + * + * @param mobile + * @return + */ + public SysUser selectByMobile(String mobile) { + return baseMapper.selectByMobile(mobile); + } + + public ResultBean reGetPwd(String userName, String userPhone,String verificationCode) { + ResultBean rb = ResultBean.fireFail(); + String userSid = baseMapper.fetchByUserNameAndUserPhone(userName, userPhone); + + if (StringUtils.isNotBlank(userSid)) { + Mapvali=mobileValidateWxRegister(userPhone,verificationCode,"3"); + if(!vali.get("code").equals("200")){ + return rb.setMsg(vali.get("details").toString()); + } + Boolean aBoolean = initPwd(userSid); + if (!aBoolean) { + return ResultBean.fireFail().setMsg("初始化密码失败"); + } + return ResultBean.fireSuccess().setMsg("初始化密码成功"); + } + return rb.setMsg("姓名或手机号填写不正确"); + } + + public int updateIsEnable(String sid, String isEnable) { + return baseMapper.updateIsEnable(sid, isEnable); + } + + public ResultBean getUsersByRoleSid(String roleSid) { + List users = baseMapper.getUsersByRoleSid(roleSid); + List l = new ArrayList<>(); + for (SysUserVo s : users) { + l.add(s.getDepartmentName() == null ? "" : s.getDepartmentName()); + } + HashSet set = new HashSet(l); + //把List集合所有元素清空 + l.clear(); + //把HashSet对象添加至List集合 + l.addAll(set); + List> r = new ArrayList<>(); +// for (String s : l) { +// if (StringUtils.isNotBlank(s)) { + Map m = new HashMap<>(); + List us = new ArrayList<>(); + for (SysUserVo su : users) { + // if (s != null && s.equals(su.getDepartmentName())) { + us.add(su); + // } + } + // m.put("dept", s); + m.put("users", us); + r.add(m); +// } +// } + ResultBean objectResultBean = ResultBean.fireSuccess().setData(r); + return objectResultBean; + } + + public ResultBean> getUserByRole(UserQuery query) { + ResultBean> rb = ResultBean.fireFail(); + List sysUserVoList = new ArrayList<>(); + if (StringUtils.isBlank(query.getRoleSid())) { + return rb.setMsg("角色sid不能为空"); + } + if (StringUtils.isBlank(query.getOrgSidPath())) { + return rb.setMsg("机构全路径不能为空"); + } + //根据角色sid获取角色的层级 + String levelTypeKey ="1";// sysRoleService.getLevelType(query.getRoleSid()); + if (StringUtils.isNotBlank(levelTypeKey)) { + if (query.getOrgSidPath().split("/").length >= Integer.parseInt(levelTypeKey) - 1) { + String levelOrgSid = query.getOrgSidPath().split("/")[Integer.parseInt(levelTypeKey) - 1]; + sysUserVoList = baseMapper.getUserByRole(query.getRoleSid(), levelOrgSid); + if(sysUserVoList.size()>1){ + List stringList = sysUserVoList.stream().map(v->v.getSid()).collect(Collectors.toList()); + List sysUserVoList1 = baseMapper.getUserMessageByRole(query.getRoleSid(), levelOrgSid,stringList); + sysUserVoList1.removeAll(Collections.singleton(null)); + if(sysUserVoList1.size()>0){ + sysUserVoList = sysUserVoList1; + } + } + } + sysUserVoList.removeAll(Collections.singleton(null)); + sysUserVoList.forEach(t -> { + t.setOrgSidPath(query.getOrgSidPath()); + }); + } else { + return rb.setMsg("该角色层级未设置"); + } + + return rb.success().setData(sysUserVoList); + + + } + + public ResultBean>> getUserByOrgSid(String orgSid, String userSid) { + ResultBean rb = ResultBean.fireFail(); + List> user = baseMapper.getUserByOrgSid(orgSid, userSid); + for (Map map : user) { + StringBuilder namePath = new StringBuilder(); + String name = map.get("name"); + String orgName = map.get("orgName"); + String postName = map.get("postName"); + namePath.append(name).append("(").append(orgName).append(" ").append(postName).append(")"); + map.put("namePath", namePath.toString()); + } + /*List> user = new ArrayList<>(); + for (Map map : userByOrgSid) { + String s = map.get("sid"); + ResultBean pathSidByUserSid = sysStaffOrgService.getPathSidByUserSid(s); + String data = pathSidByUserSid.getData(); + if (data.equals(orgSid)){ + user.add(map); + } + }*/ + return rb.success().setData(user); + } + + public List fetchBySidSVo(String sids) { + List list = Arrays.asList(sids.split(",")); + List entity = baseMapper.fetchBySids(list); + return entity; + } + + public ResultBean updateAppIdByMobile(String mobile) { + ResultBean rb = ResultBean.fireFail(); + if (StringUtils.isNotBlank(mobile)) { + baseMapper.updateAppIdByMobile(mobile); + } else { + baseMapper.updateAppIdAll(); + } + return rb.success().setMsg("解绑成功"); + } + + public ResultBean selectIdBySid(List stringList) { + ResultBean rb = ResultBean.fireFail(); + String ids = baseMapper.selectIdBySid(stringList); + return rb.success().setData(ids); + } + + public ResultBean> getUserByOrgRole(UserRoleQuery query) { + ResultBean> rb = ResultBean.fireFail(); + List sysUserVoList = new ArrayList<>(); + //根据当前用户角色查询该角色的上一级角色 + String userRoleSid = query.getRoleSid(); + if (StringUtils.isBlank(userRoleSid)) { + return rb.setMsg("角色不能为空"); + } + if (StringUtils.isBlank(query.getOrgSid())) { + return rb.setMsg("部门sid不能为空"); + } + String upRoleSid ="";// sysRoleService.selectRoleSid(userRoleSid); + sysUserVoList = baseMapper.getUserByRole(upRoleSid, query.getOrgSid()); + return rb.success().setData(sysUserVoList); + } + + public ResultBean> getOtherOrgRoleUser(UserRoleQuery query) { + ResultBean> rb = ResultBean.fireFail(); + List sysUserVoList = new ArrayList<>(); + String roleSid = query.getRoleSid(); + if (StringUtils.isBlank(roleSid)) { + return rb.setMsg("角色不能为空"); + } + if (StringUtils.isNotBlank(query.getOrgSid())) { + sysUserVoList = baseMapper.getUserByRole(roleSid, query.getOrgSid()); + } else { + sysUserVoList = baseMapper.getUserByRoleSid(query.getRoleSid()); + } + return rb.success().setData(sysUserVoList); + } + + public ResultBean> selectSysUserList(String userSid) { + ResultBean> rb = ResultBean.fireFail(); + + return rb.success().setData(new ArrayList<>()); + } + + public ResultBean selectPasswordByUserSid(String userSid) { + ResultBean rb = ResultBean.fireFail(); + boolean isTrue = false; + //查询手机号 + SysUser sysUser = fetchBySid(userSid); + if (sysUser != null) { + String mobile = sysUser.getMobile(); + if (StringUtils.isNotBlank(mobile)) { + String password = mobile.substring(5, 11); + String md5 = Encodes.md5(password); + if (sysUser.getPassword().equals(md5)) { + isTrue = true; + } + } + } + return rb.success().setData(isTrue); + } + + public ResultBean wxLogin( String jsCode,String appid, String secret) { + ResultBean rb=new ResultBean(); + String url = WX_URL_LOGIN.replace("APPID", appid).replace("SECRET", secret).replace("JSCODE",jsCode).replace("authorization_code","authorization_code"); + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity forEntity = restTemplate.getForEntity(url,String.class); + JSONObject jsonObject = JSONObject.parseObject(forEntity.getBody()); + System.out.println(jsonObject); + return rb.success().setData(jsonObject); + } + public ResultBean wxAuthLogin( String code,String appid, String secret) { + ResultBean rb=new ResultBean(); + String url = WX_EMPOWER_URL_LOGIN.replace("APPID", appid).replace("SECRET", secret).replace("CODE",code).replace("authorization_code","authorization_code"); + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity forEntity = restTemplate.getForEntity(url,String.class); + JSONObject jsonObject = JSONObject.parseObject(forEntity.getBody()); + System.out.println(jsonObject); + return rb.success().setData(jsonObject); + } + + public ResultBean getUserByType(String userType){ + ResultBean rb=new ResultBean(); + List list=baseMapper.getUserByType(userType); + return rb.success().setData(list); + } + public ResultBean getUserOrgBySid(String sid){ + ResultBean rb=new ResultBean(); + List list=baseMapper.getUserOrgBySid(sid); + return rb.success().setData(list); + } + + public ResultBean updateSysUserImage(Map map){ + String userSid = map.get("userSid"); + String headImage = map.get("headImage"); + ResultBean rb = ResultBean.fireFail(); + SysUser sysUser = fetchBySid(userSid); + sysUser.setHeadImage(headImage); + int sid = baseMapper.update(sysUser, new QueryWrapper().eq("sid", sysUser.getSid())); + return rb.success().setMsg("上传成功"); + } + public ResultBean> getUsersBySid(List list){ + ResultBean rb = ResultBean.fireFail(); + Listusers=baseMapper.selectList(new QueryWrapper().in("sid",list)); + + return rb.success().setData(users); + } + + public ResultBean> getUserByRoleNoOrgPath(UserQuery query) { + ResultBean> rb = ResultBean.fireFail(); + List sysUserVoList = new ArrayList<>(); + if (StringUtils.isBlank(query.getRoleSid())) { + return rb.setMsg("角色sid不能为空"); + } + //根据角色sid获取角色的层级 + sysUserVoList = baseMapper.getUserByRoleNoOrgPath(query.getRoleSid()); + return rb.success().setData(sysUserVoList); + } + + public SysUser selectByUserNameAndPassword(String userName, String md5) { + return baseMapper.selectByUserNameAndPassword(userName,md5); + } +} \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/application-devv.yml b/warehousing-system/project/wh-manage-xxs/src/main/resources/application-devv.yml new file mode 100644 index 00000000..4a4292aa --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/application-devv.yml @@ -0,0 +1,24 @@ +spring: + resources: + static-locations: file:D://supervise + cloud: + nacos: + discovery: + server-addr: 127.0.0.1:8848 + datasource: + url: jdbc:mysql://127.0.0.1:3306/warehouse2?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true + username: root + #password: 1LAiGz$t1*Iw + password: root + redis: + database: 3 # Redis数据库索引(默认为0) + host: 127.0.0.1 + jedis: + pool: + max-active: -1 #连接池最大连接数(使用负值表示没有限制) + max-idle: 8 #连接池中的最大空闲连接 + max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + password: 123456 + port: 6379 + timeout: 0 # 连接超时时间(毫秒) \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/application-pro.yml b/warehousing-system/project/wh-manage-xxs/src/main/resources/application-pro.yml new file mode 100644 index 00000000..6c9039d5 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/application-pro.yml @@ -0,0 +1,25 @@ +spring: + resources: + static-locations: file:D://supervise + cloud: + nacos: + discovery: + server-addr: 127.0.0.1:8848 + datasource: + url: jdbc:mysql://127.0.0.1:3306/warehouse2?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true + username: root + password: 1LAiGz$t1*Iw + #password: root + + redis: + database: 3 # Redis数据库索引(默认为0) + host: 127.0.0.1 + jedis: + pool: + max-active: -1 #连接池最大连接数(使用负值表示没有限制) + max-idle: 8 #连接池中的最大空闲连接 + max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + password: 123456 + port: 6379 + timeout: 0 # 连接超时时间(毫秒) \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/application-test.yml b/warehousing-system/project/wh-manage-xxs/src/main/resources/application-test.yml new file mode 100644 index 00000000..3ec2daa7 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/application-test.yml @@ -0,0 +1,22 @@ +spring: + resources: + static-locations: file:D://supervise + + datasource: + url: jdbc:mysql://39.104.100.138:3306/warehouse2?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true + username: root + password: yxt_mysql_138 + #password: root + + redis: + database: 3 # Redis数据库索引(默认为0) + host: 39.104.100.138 + jedis: + pool: + max-active: -1 #连接池最大连接数(使用负值表示没有限制) + max-idle: 8 #连接池中的最大空闲连接 + max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + password: + port: 6379 + timeout: 0 # 连接超时时间(毫秒) \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/application.yml b/warehousing-system/project/wh-manage-xxs/src/main/resources/application.yml new file mode 100644 index 00000000..c4144f07 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/application.yml @@ -0,0 +1,57 @@ +server: + port: 9050 + servlet: + context-path: / + multipart: + enabled: true + max-file-size: 50MB + max-request-size: 200MB +spring: + application: + name: supervise-wm + profiles: + active: test + #active: pro + messages: + basename: i18n/messages + +#mybatis-plush配置 +mybatis-plus: + type-aliases-package: com.wh.pojo + mapper-locations: classpath:/mappers/*.xml + global-config: + refresh: true + db-config: + id-type: 0 + db-type: mysql + configuration: + map-underscore-to-camel-case: true + cache-enabled: true + call-setters-on-nulls: true + mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #mybatis-plus配置控制台打印完整带参数SQL语句log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #mybatis-plus配置控制台打印完整带参数SQL语句 + mybatis: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl +yuan: + file: + root: + path: D:\image\ +logging: + level: + main: + blog: + mapper: debug + com: + baomidou: + mybatisplus: DEBUG + #项目mapper目录 + dragonsoft: + demojar: + mapper: DEBUG + org: + springframework: + boot: + autoconfigure: + logging: info \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/logback-spring.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/logback-spring.xml new file mode 100644 index 00000000..62a203f2 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/logback-spring.xml @@ -0,0 +1,37 @@ + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + ${log.base}.log + + ${log.base}.%d{yyyyMMdd}.%i.log.zip + + + + 1MB + + + + %date [%thread] %-5level %logger{35} - %msg%n + + + + + + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/BrandInfoMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/BrandInfoMapper.xml new file mode 100644 index 00000000..a49f7ae2 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/BrandInfoMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/DictCommonMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/DictCommonMapper.xml new file mode 100644 index 00000000..93305695 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/DictCommonMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/DictTypeMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/DictTypeMapper.xml new file mode 100644 index 00000000..91389617 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/DictTypeMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/EntInfoMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/EntInfoMapper.xml new file mode 100644 index 00000000..c220b2e7 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/EntInfoMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/InStorehouseMainMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/InStorehouseMainMapper.xml new file mode 100644 index 00000000..46a4a136 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/InStorehouseMainMapper.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/OutStorehouseMainMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/OutStorehouseMainMapper.xml new file mode 100644 index 00000000..09d38930 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/OutStorehouseMainMapper.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/PurchasenewMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/PurchasenewMapper.xml new file mode 100644 index 00000000..764bd3a9 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/PurchasenewMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/PurchasenewProductMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/PurchasenewProductMapper.xml new file mode 100644 index 00000000..6f4dcc54 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/PurchasenewProductMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/ShStorehouseAttachmentMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/ShStorehouseAttachmentMapper.xml new file mode 100644 index 00000000..3073846a --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/ShStorehouseAttachmentMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/ShStorehouseAttributeMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/ShStorehouseAttributeMapper.xml new file mode 100644 index 00000000..1a93120b --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/ShStorehouseAttributeMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/ShStorehouseMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/ShStorehouseMapper.xml new file mode 100644 index 00000000..e790fd44 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/ShStorehouseMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/StoreHouseProjectMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/StoreHouseProjectMapper.xml new file mode 100644 index 00000000..2ad15ead --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/StoreHouseProjectMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/SysUserMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/SysUserMapper.xml new file mode 100644 index 00000000..abc99844 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/SysUserMapper.xml @@ -0,0 +1,397 @@ + + + + + + + + + + + + + + + + update sys_user + set password=#{param2} + where sid = #{param1} + + + delete from sys_user + where sid = #{sid} + + + update sys_user + set password=#{param2} + where sid = #{param1} + and userType = 1 + + + delete + from sys_user + where sid = #{param1} + + + + + + + + + + + + + + + + + + + update sys_user + set mobile = #{mobile} + where staffSid = #{sid} + + + + update sys_user + set userName = #{jobNumber} + where staffSid = #{sid} + + + + + + + + + + + + + + UPDATE sys_user + SET isEnable = #{isEnable} + WHERE sid = #{sid} + + + + + + + + + + + + + + + update sys_user + set appId = NULL + where mobile = #{mobile} + + + + update sys_user + set appId = NULL + + + + + + + + + \ No newline at end of file diff --git a/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/UserMapper.xml b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/UserMapper.xml new file mode 100644 index 00000000..9ada7c4a --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/main/resources/mappers/UserMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/warehousing-system/project/wh-manage-xxs/src/test/java/Test01.java b/warehousing-system/project/wh-manage-xxs/src/test/java/Test01.java new file mode 100644 index 00000000..d9c81b07 --- /dev/null +++ b/warehousing-system/project/wh-manage-xxs/src/test/java/Test01.java @@ -0,0 +1,11 @@ +import com.wh.mapper.initial.LocationMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +public class Test01 { + + + + +}