From 29546538c363a4cbb97755f5718db32ac3ea242b Mon Sep 17 00:00:00 2001 From: yxt_njy <119782786@qq.com> Date: Wed, 24 Apr 2024 09:09:53 +0800 Subject: [PATCH] =?UTF-8?q?user=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 116 ++++++++ README.md | 0 pom.xml | 133 +++++++++ .../java/com/yxt/user/UserApplication.java | 24 ++ .../com/yxt/user/apiadmin/AdminHomeRest.java | 10 + .../apiadmin/base/BaseCategoryBrandRest.java | 55 ++++ .../apiadmin/base/BaseGoodsBrandRest.java | 60 ++++ .../apiadmin/base/BaseGoodsSkuExtendRest.java | 55 ++++ .../user/apiadmin/base/BaseGoodsSkuRest.java | 72 +++++ .../apiadmin/base/BaseGoodsSpuDetailRest.java | 51 ++++ .../user/apiadmin/base/BaseGoodsSpuRest.java | 58 ++++ .../user/apiadmin/base/BaseGoodsTypeRest.java | 61 ++++ .../user/apiadmin/base/BaseGoodsUnitRest.java | 61 ++++ .../apiadmin/base/BaseManufacturerRest.java | 69 +++++ .../user/apiadmin/base/BaseSpecGroupRest.java | 57 ++++ .../user/apiadmin/base/BaseSpecParamRest.java | 57 ++++ .../apiadmin/base/BaseSupplierBankRest.java | 89 ++++++ .../apiadmin/base/BaseSupplierFileRest.java | 89 ++++++ .../apiadmin/base/BaseSupplierInfoRest.java | 97 ++++++ .../apiadmin/base/BaseSupplierTypeRest.java | 89 ++++++ .../user/apiadmin/base/ShoppingCartRest.java | 56 ++++ .../java/com/yxt/user/apiwx/WxHomeRest.java | 10 + .../biz/base/basebrandinfo/BaseBrandInfo.java | 21 ++ .../base/basebrandinfo/BaseBrandInfoDto.java | 27 ++ .../basebrandinfo/BaseBrandInfoMapper.java | 18 ++ .../basebrandinfo/BaseBrandInfoMapper.xml | 15 + .../basebrandinfo/BaseBrandInfoQuery.java | 13 + .../basebrandinfo/BaseBrandInfoService.java | 127 ++++++++ .../base/basebrandinfo/BaseBrandInfoVo.java | 32 ++ .../basecategorybrand/BaseCategoryBrand.java | 15 + .../BaseCategoryBrandDto.java | 22 ++ .../BaseCategoryBrandMapper.java | 23 ++ .../BaseCategoryBrandMapper.xml | 29 ++ .../BaseCategoryBrandQuery.java | 13 + .../BaseCategoryBrandService.java | 115 ++++++++ .../BaseCategoryBrandVo.java | 24 ++ .../biz/base/basegoodssku/BaseGoodsSku.java | 21 ++ .../basegoodssku/BaseGoodsSkuDetailsVo.java | 69 +++++ .../base/basegoodssku/BaseGoodsSkuDto.java | 31 ++ .../base/basegoodssku/BaseGoodsSkuMapper.java | 26 ++ .../base/basegoodssku/BaseGoodsSkuMapper.xml | 64 ++++ .../BaseGoodsSkuPurSelectList.java | 35 +++ .../BaseGoodsSkuPurSelectQuery.java | 30 ++ .../base/basegoodssku/BaseGoodsSkuQuery.java | 13 + .../basegoodssku/BaseGoodsSkuSelectList.java | 36 +++ .../basegoodssku/BaseGoodsSkuSelectQuery.java | 15 + .../basegoodssku/BaseGoodsSkuService.java | 208 +++++++++++++ .../biz/base/basegoodssku/BaseGoodsSkuVo.java | 38 +++ .../BaseGoodsSkuExtend.java | 34 +++ .../BaseGoodsSkuExtendDto.java | 46 +++ .../BaseGoodsSkuExtendMapper.java | 20 ++ .../BaseGoodsSkuExtendMapper.xml | 28 ++ .../BaseGoodsSkuExtendQuery.java | 13 + .../BaseGoodsSkuExtendService.java | 139 +++++++++ .../BaseGoodsSkuExtendVo.java | 53 ++++ .../biz/base/basegoodsskuextend/UrlsVo.java | 12 + .../biz/base/basegoodsspu/BaseGoodsSpu.java | 32 ++ .../base/basegoodsspu/BaseGoodsSpuDto.java | 47 +++ .../base/basegoodsspu/BaseGoodsSpuMapper.java | 19 ++ .../base/basegoodsspu/BaseGoodsSpuMapper.xml | 27 ++ .../base/basegoodsspu/BaseGoodsSpuQuery.java | 13 + .../basegoodsspu/BaseGoodsSpuService.java | 165 +++++++++++ .../biz/base/basegoodsspu/BaseGoodsSpuVo.java | 51 ++++ .../BaseGoodsSpuDetail.java | 20 ++ .../BaseGoodsSpuDetailDto.java | 29 ++ .../BaseGoodsSpuDetailMapper.java | 20 ++ .../BaseGoodsSpuDetailMapper.xml | 24 ++ .../BaseGoodsSpuDetailQuery.java | 13 + .../BaseGoodsSpuDetailService.java | 105 +++++++ .../BaseGoodsSpuDetailVo.java | 35 +++ .../biz/base/basegoodstype/BaseGoodsType.java | 22 ++ .../base/basegoodstype/BaseGoodsTypeDto.java | 33 +++ .../basegoodstype/BaseGoodsTypeMapper.java | 17 ++ .../basegoodstype/BaseGoodsTypeMapper.xml | 15 + .../basegoodstype/BaseGoodsTypeQuery.java | 13 + .../basegoodstype/BaseGoodsTypeService.java | 120 ++++++++ .../base/basegoodstype/BaseGoodsTypeVo.java | 38 +++ .../biz/base/basegoodsunit/BaseGoodsUnit.java | 14 + .../base/basegoodsunit/BaseGoodsUnitDto.java | 27 ++ .../basegoodsunit/BaseGoodsUnitMapper.java | 17 ++ .../basegoodsunit/BaseGoodsUnitMapper.xml | 15 + .../basegoodsunit/BaseGoodsUnitQuery.java | 13 + .../basegoodsunit/BaseGoodsUnitService.java | 107 +++++++ .../base/basegoodsunit/BaseGoodsUnitVo.java | 27 ++ .../basemanufacturer/BaseManufacturer.java | 20 ++ .../basemanufacturer/BaseManufacturerDto.java | 35 +++ .../BaseManufacturerMapper.java | 21 ++ .../BaseManufacturerMapper.xml | 20 ++ .../BaseManufacturerQuery.java | 13 + .../BaseManufacturerService.java | 111 +++++++ .../basemanufacturer/BaseManufacturerVo.java | 36 +++ .../biz/base/basespecgroup/BaseSpecGroup.java | 15 + .../base/basespecgroup/BaseSpecGroupDto.java | 22 ++ .../basespecgroup/BaseSpecGroupMapper.java | 23 ++ .../basespecgroup/BaseSpecGroupMapper.xml | 27 ++ .../basespecgroup/BaseSpecGroupQuery.java | 13 + .../basespecgroup/BaseSpecGroupService.java | 115 ++++++++ .../base/basespecgroup/BaseSpecGroupVo.java | 23 ++ .../biz/base/basespecparam/BaseSpecParam.java | 22 ++ .../base/basespecparam/BaseSpecParamDto.java | 28 ++ .../basespecparam/BaseSpecParamMapper.java | 23 ++ .../basespecparam/BaseSpecParamMapper.xml | 29 ++ .../basespecparam/BaseSpecParamQuery.java | 13 + .../basespecparam/BaseSpecParamService.java | 117 ++++++++ .../base/basespecparam/BaseSpecParamVo.java | 30 ++ .../basesupplierBank/BaseSupplierBank.java | 76 +++++ .../BaseSupplierBankDetailsVo.java | 76 +++++ .../basesupplierBank/BaseSupplierBankDto.java | 76 +++++ .../BaseSupplierBankMapper.java | 67 +++++ .../BaseSupplierBankMapper.xml | 13 + .../BaseSupplierBankQuery.java | 74 +++++ .../BaseSupplierBankService.java | 104 +++++++ .../basesupplierBank/BaseSupplierBankVo.java | 76 +++++ .../basesupplierfile/BaseSupplierFile.java | 66 +++++ .../BaseSupplierFileDetailsVo.java | 66 +++++ .../basesupplierfile/BaseSupplierFileDto.java | 66 +++++ .../BaseSupplierFileMapper.java | 60 ++++ .../BaseSupplierFileMapper.xml | 13 + .../BaseSupplierFileQuery.java | 64 ++++ .../BaseSupplierFileService.java | 94 ++++++ .../basesupplierfile/BaseSupplierFileVo.java | 66 +++++ .../basesupplierinfo/BaseSupplierInfo.java | 112 +++++++ .../BaseSupplierInfoChoice.java | 54 ++++ .../BaseSupplierInfoDetailsVo.java | 116 ++++++++ .../basesupplierinfo/BaseSupplierInfoDto.java | 116 ++++++++ .../BaseSupplierInfoMapper.java | 67 +++++ .../BaseSupplierInfoMapper.xml | 13 + .../BaseSupplierInfoQuery.java | 62 ++++ .../BaseSupplierInfoService.java | 168 +++++++++++ .../basesupplierinfo/BaseSupplierInfoVo.java | 65 ++++ .../basesuppliertype/BaseSupplierType.java | 62 ++++ .../BaseSupplierTypeDetailsVo.java | 62 ++++ .../basesuppliertype/BaseSupplierTypeDto.java | 62 ++++ .../BaseSupplierTypeMapper.java | 60 ++++ .../BaseSupplierTypeMapper.xml | 13 + .../BaseSupplierTypeQuery.java | 60 ++++ .../BaseSupplierTypeService.java | 94 ++++++ .../basesuppliertype/BaseSupplierTypeVo.java | 62 ++++ .../biz/base/shoppingcart/ShoppingCart.java | 29 ++ .../base/shoppingcart/ShoppingCartDto.java | 28 ++ .../base/shoppingcart/ShoppingCartMapper.java | 18 ++ .../base/shoppingcart/ShoppingCartMapper.xml | 24 ++ .../base/shoppingcart/ShoppingCartQuery.java | 16 + .../shoppingcart/ShoppingCartService.java | 253 ++++++++++++++++ .../biz/base/shoppingcart/ShoppingCartVo.java | 36 +++ .../base/shoppingcart/ShoppingGoodsVo.java | 8 + .../java/com/yxt/user/biz/package-info.java | 4 + .../com/yxt/user/config/SaTokenConfigure.java | 114 +++++++ .../user/config/SaTokenGloableException.java | 67 +++++ .../com/yxt/user/config/package-info.java | 4 + .../java/com/yxt/user/feign/package-info.java | 4 + .../sysorganization/SysOrganizationFeign.java | 35 +++ .../sysorganization/SysOrganizationVo.java | 88 ++++++ .../portal/sysstafforg/SysStaffOrgFeign.java | 25 ++ .../java/com/yxt/user/utils/DoubleUtils.java | 93 ++++++ .../java/com/yxt/user/utils/PinYinUtils.java | 277 ++++++++++++++++++ .../java/com/yxt/user/utils/StyleUtils.java | 89 ++++++ src/main/resources/application-devv.yml | 37 +++ src/main/resources/application-pro.yml | 29 ++ src/main/resources/application-test.yml | 34 +++ src/main/resources/application.yml | 50 ++++ src/main/resources/logback-spring.xml | 50 ++++ .../com/yxt/goods/GoodsApplicationTest.java | 24 ++ 163 files changed, 8369 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 pom.xml create mode 100644 src/main/java/com/yxt/user/UserApplication.java create mode 100644 src/main/java/com/yxt/user/apiadmin/AdminHomeRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseCategoryBrandRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseGoodsBrandRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSkuExtendRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSkuRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSpuDetailRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSpuRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseGoodsTypeRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseGoodsUnitRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseManufacturerRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseSpecGroupRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseSpecParamRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseSupplierBankRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseSupplierFileRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseSupplierInfoRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/BaseSupplierTypeRest.java create mode 100644 src/main/java/com/yxt/user/apiadmin/base/ShoppingCartRest.java create mode 100644 src/main/java/com/yxt/user/apiwx/WxHomeRest.java create mode 100644 src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrand.java create mode 100644 src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSku.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuDetailsVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuPurSelectList.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuPurSelectQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuSelectList.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuSelectQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtend.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsskuextend/UrlsVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpu.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetail.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsType.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnit.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturer.java create mode 100644 src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroup.java create mode 100644 src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParam.java create mode 100644 src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBank.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankDetailsVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFile.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileDetailsVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoChoice.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoDetailsVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierType.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeDetailsVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeService.java create mode 100644 src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCart.java create mode 100644 src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartDto.java create mode 100644 src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartMapper.java create mode 100644 src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartMapper.xml create mode 100644 src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartQuery.java create mode 100644 src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartService.java create mode 100644 src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartVo.java create mode 100644 src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingGoodsVo.java create mode 100644 src/main/java/com/yxt/user/biz/package-info.java create mode 100644 src/main/java/com/yxt/user/config/SaTokenConfigure.java create mode 100644 src/main/java/com/yxt/user/config/SaTokenGloableException.java create mode 100644 src/main/java/com/yxt/user/config/package-info.java create mode 100644 src/main/java/com/yxt/user/feign/package-info.java create mode 100644 src/main/java/com/yxt/user/feign/portal/sysorganization/SysOrganizationFeign.java create mode 100644 src/main/java/com/yxt/user/feign/portal/sysorganization/SysOrganizationVo.java create mode 100644 src/main/java/com/yxt/user/feign/portal/sysstafforg/SysStaffOrgFeign.java create mode 100644 src/main/java/com/yxt/user/utils/DoubleUtils.java create mode 100644 src/main/java/com/yxt/user/utils/PinYinUtils.java create mode 100644 src/main/java/com/yxt/user/utils/StyleUtils.java create mode 100644 src/main/resources/application-devv.yml create mode 100644 src/main/resources/application-pro.yml create mode 100644 src/main/resources/application-test.yml create mode 100644 src/main/resources/application.yml create mode 100644 src/main/resources/logback-spring.xml create mode 100644 src/test/java/com/yxt/goods/GoodsApplicationTest.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a70b169 --- /dev/null +++ b/.gitignore @@ -0,0 +1,116 @@ +# ---> Java +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# ---> Maven +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + +# ---> JetBrains +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +**/.idea/ +**/logs/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..ae052fe --- /dev/null +++ b/pom.xml @@ -0,0 +1,133 @@ + + + + + com.yxt + yxt-parent + 0.0.1 + + + 4.0.0 + + ss-common-user + ss-common-user + 2.0.1 + + + + com.yxt + yxt-common-base + 0.0.1 + + + + org.springframework.boot + spring-boot-starter-web + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + + + mysql + mysql-connector-java + runtime + + + + com.baomidou + mybatis-plus-boot-starter + + + com.baomidou + mybatis-plus-annotation + + + junit + junit + compile + + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + + cn.dev33 + sa-token-spring-boot-starter + 1.37.0 + + + cn.hutool + hutool-all + 5.8.23 + + + cn.hutool + hutool-core + 5.8.23 + + + com.google.zxing + core + 3.5.2 + + + com.alibaba + easyexcel + 3.3.2 + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.5.6 + + + + repackage + + + + + + + + src/main/java + + **/*Mapper.xml + + + + src/main/resources + + **/*.* + + false + + + + + diff --git a/src/main/java/com/yxt/user/UserApplication.java b/src/main/java/com/yxt/user/UserApplication.java new file mode 100644 index 0000000..4299157 --- /dev/null +++ b/src/main/java/com/yxt/user/UserApplication.java @@ -0,0 +1,24 @@ +package com.yxt.goods; + + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.scheduling.annotation.EnableScheduling; + +/** + * @author dimengzhe + */ +@SpringBootApplication(scanBasePackages = { + "com.yxt.goods.config", + "com.yxt.common.base.config", + "com.yxt.goods" +}) +// 启用自带定时任务 +@EnableScheduling +@EnableFeignClients(basePackages = {}) +public class GoodsApplication { + public static void main(String[] args) { + SpringApplication.run(GoodsApplication.class, args); + } +} diff --git a/src/main/java/com/yxt/user/apiadmin/AdminHomeRest.java b/src/main/java/com/yxt/user/apiadmin/AdminHomeRest.java new file mode 100644 index 0000000..12f361d --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/AdminHomeRest.java @@ -0,0 +1,10 @@ +package com.yxt.goods.apiadmin; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController("com.yxt.base.apiadmin.AdminHomeRest") +@RequestMapping("/apiadmin/home") +public class AdminHomeRest { + +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseCategoryBrandRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseCategoryBrandRest.java new file mode 100644 index 0000000..1f1bb7f --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseCategoryBrandRest.java @@ -0,0 +1,55 @@ +package com.yxt.user.apiadmin.base; + +import com.yxt.goods.biz.base.basecategorybrand.BaseCategoryBrandDto; +import com.yxt.goods.biz.base.basecategorybrand.BaseCategoryBrandQuery; +import com.yxt.goods.biz.base.basecategorybrand.BaseCategoryBrandService; +import com.yxt.goods.biz.base.basecategorybrand.BaseCategoryBrandVo; +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.*; + +/** + * @author wangpengfei + * @date 2024/4/10 9:57 + */ +@Api(tags = "品牌与商品类别关联") +@RestController +@RequestMapping("/apiadmin/base/basecategorybrand") +public class BaseCategoryBrandRest { + @Autowired + BaseCategoryBrandService baseCategoryBrandService; + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseCategoryBrandService.listPage(pq); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseCategoryBrandDto dto) { + return baseCategoryBrandService.saveOrUpdate(dto); + } + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseCategoryBrandService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseCategoryBrandService.delete(sid); + } + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid, @PathVariable("isEnable") String isEnable) { + return baseCategoryBrandService.updateIsEnable(sid, isEnable); + } +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsBrandRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsBrandRest.java new file mode 100644 index 0000000..9519d28 --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsBrandRest.java @@ -0,0 +1,60 @@ +package com.yxt.user.apiadmin.base; + +import com.yxt.goods.biz.base.basebrandinfo.*; +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; + +/** + * @author wangpengfei + * @date 2024/2/26 15:49 + */ +@Api(tags = "商品品牌") +@RestController +@RequestMapping("/apiadmin/base/basegoodsbrand") +public class BaseGoodsBrandRest { + + @Autowired + BaseBrandInfoService baseBrandInfoService; + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseBrandInfoService.listPage(pq); + } + @ApiOperation("查询所有的品牌") + @GetMapping("/listAll") + public ResultBean> listAll() { + return baseBrandInfoService.listAll(); + } + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseBrandInfoDto dto) { + return baseBrandInfoService.saveOrUpdate(dto); + } + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseBrandInfoService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseBrandInfoService.delete(sid); + } + + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { + return baseBrandInfoService.updateIsEnable(sid,isEnable); + } +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSkuExtendRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSkuExtendRest.java new file mode 100644 index 0000000..c820b17 --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSkuExtendRest.java @@ -0,0 +1,55 @@ +package com.yxt.user.apiadmin.base; + +import com.yxt.goods.biz.base.basegoodsskuextend.BaseGoodsSkuExtendDto; +import com.yxt.goods.biz.base.basegoodsskuextend.BaseGoodsSkuExtendQuery; +import com.yxt.goods.biz.base.basegoodsskuextend.BaseGoodsSkuExtendService; +import com.yxt.goods.biz.base.basegoodsskuextend.BaseGoodsSkuExtendVo; +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.*; + +/** + * @author wangpengfei + * @date 2024/3/11 15:05 + */ +@Api(tags = "商品sku扩展") +@RestController +@RequestMapping("/apiadmin/base/basegoodsskuextend") +public class BaseGoodsSkuExtendRest { + + @Autowired + BaseGoodsSkuExtendService baseGoodsSkuExtendService; + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseGoodsSkuExtendService.listPage(pq); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseGoodsSkuExtendDto dto) { + return baseGoodsSkuExtendService.saveOrUpdate(dto); + } + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseGoodsSkuExtendService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseGoodsSkuExtendService.delete(sid); + } + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { + return baseGoodsSkuExtendService.updateIsEnable(sid,isEnable); + } +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSkuRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSkuRest.java new file mode 100644 index 0000000..8f02d56 --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSkuRest.java @@ -0,0 +1,72 @@ +package com.yxt.user.apiadmin.base; + +import com.yxt.goods.biz.base.basegoodssku.*; +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.*; + +/** + * @author wangpengfei + * @date 2024/3/11 14:27 + */ +@Api(tags = "商品sku") +@RestController +@RequestMapping("/apiadmin/base/basegoodssku") +public class BaseGoodsSkuRest { + @Autowired + BaseGoodsSkuService baseGoodsSkuService; + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseGoodsSkuService.listPage(pq); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseGoodsSkuDto dto) { + return baseGoodsSkuService.saveOrUpdate(dto); + } + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseGoodsSkuService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseGoodsSkuService.delete(sid); + } + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid, @PathVariable("isEnable") String isEnable) { + return baseGoodsSkuService.updateIsEnable(sid, isEnable); + } + + @ApiOperation("获取商品信息") + @GetMapping("/getDetails") + ResultBean getDetails(@RequestParam("sid") String sid) { + return baseGoodsSkuService.getDetails(sid); + } + + @ApiOperation("入库添加商品列表") + @PostMapping("/getSelectList") + ResultBean> getSelectList(@RequestBody PagerQuery pagerQuery) { + ResultBean> rb = ResultBean.fireFail(); + PagerVo pv = baseGoodsSkuService.getSelectList(pagerQuery); + return rb.success().setData(pv); + } + + @ApiOperation("采购商品分页列表") + @PostMapping("/purGoodsListPage") + public ResultBean> purGoodsListPage(@RequestBody PagerQuery pq) { + return baseGoodsSkuService.purGoodsListPage(pq); + } +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSpuDetailRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSpuDetailRest.java new file mode 100644 index 0000000..c701aca --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSpuDetailRest.java @@ -0,0 +1,51 @@ +package com.yxt.user.apiadmin.base; + +import com.yxt.goods.biz.base.basegoodsspudetail.BaseGoodsSpuDetailDto; +import com.yxt.goods.biz.base.basegoodsspudetail.BaseGoodsSpuDetailQuery; +import com.yxt.goods.biz.base.basegoodsspudetail.BaseGoodsSpuDetailService; +import com.yxt.goods.biz.base.basegoodsspudetail.BaseGoodsSpuDetailVo; +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.*; + +/** + * @author wangpengfei + * @date 2024/3/21 16:58 + */ + +@Api(tags = "商品spu详情") +@RestController +@RequestMapping("/apiadmin/base/basegoodsspudetail") +public class BaseGoodsSpuDetailRest { + + @Autowired + BaseGoodsSpuDetailService baseGoodsSpuDetailService; + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseGoodsSpuDetailService.listPage(pq); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseGoodsSpuDetailDto dto) { + return baseGoodsSpuDetailService.saveOrUpdate(dto); + } + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseGoodsSpuDetailService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseGoodsSpuDetailService.delete(sid); + } +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSpuRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSpuRest.java new file mode 100644 index 0000000..9f55350 --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsSpuRest.java @@ -0,0 +1,58 @@ +package com.yxt.user.apiadmin.base; + +import com.yxt.goods.biz.base.basegoodsspu.BaseGoodsSpuDto; +import com.yxt.goods.biz.base.basegoodsspu.BaseGoodsSpuQuery; +import com.yxt.goods.biz.base.basegoodsspu.BaseGoodsSpuService; +import com.yxt.goods.biz.base.basegoodsspu.BaseGoodsSpuVo; +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.*; + +/** + * @author wangpengfei + * @date 2024/3/7 16:58 + */ +@Api(tags = "商品spu") +@RestController +@RequestMapping("/apiadmin/base/basegoodsspu") +public class BaseGoodsSpuRest { + @Autowired + BaseGoodsSpuService baseGoodsSpuService; + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseGoodsSpuService.listPage(pq); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseGoodsSpuDto dto) { + return baseGoodsSpuService.saveOrUpdate(dto); + } +// @ApiOperation("保存商品信息及sku") +// @PostMapping("/save") +// public ResultBean save(@RequestBody BaseGoodsSpuDto dto) { +// return baseGoodsSpuService.save(dto); +// } + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseGoodsSpuService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseGoodsSpuService.delete(sid); + } + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { + return baseGoodsSpuService.updateIsEnable(sid,isEnable); + } +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsTypeRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsTypeRest.java new file mode 100644 index 0000000..e95fb84 --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsTypeRest.java @@ -0,0 +1,61 @@ +package com.yxt.user.apiadmin.base; + +import com.yxt.goods.biz.base.basegoodstype.*; +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; + +/** + * @author wangpengfei + * @date 2024/2/26 13:44 + */ +@Api(tags = "商品类型") +@RestController +@RequestMapping("/apiadmin/base/basegoodstype") +public class BaseGoodsTypeRest { + @Autowired + BaseGoodsTypeService baseGoodsTypeService; + + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseGoodsTypeService.listPage(pq); + } + @ApiOperation("查询所有的类别") + @GetMapping("/listAll") + public ResultBean> listAll() { + return baseGoodsTypeService.listAll(); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseGoodsTypeDto dto) { + return baseGoodsTypeService.saveOrUpdate(dto); + } + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseGoodsTypeService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseGoodsTypeService.delete(sid); + } + + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { + return baseGoodsTypeService.updateIsEnable(sid,isEnable); + } +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsUnitRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsUnitRest.java new file mode 100644 index 0000000..5f30ee1 --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseGoodsUnitRest.java @@ -0,0 +1,61 @@ +package com.yxt.user.apiadmin.base; + +import com.yxt.goods.biz.base.basegoodsunit.*; +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; + +/** + * @author wangpengfei + * @date 2024/3/8 9:19 + */ +@Api(tags = "商品类型") +@RestController +@RequestMapping("/apiadmin/base/basegoodsunit") +public class BaseGoodsUnitRest { + @Autowired + BaseGoodsUnitService baseGoodsUnitService; + + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseGoodsUnitService.listPage(pq); + } + @ApiOperation("查询所有的类别") + @GetMapping("/listAll") + public ResultBean> listAll() { + return baseGoodsUnitService.listAll(); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseGoodsUnitDto dto) { + return baseGoodsUnitService.saveOrUpdate(dto); + } + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseGoodsUnitService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseGoodsUnitService.delete(sid); + } + + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { + return baseGoodsUnitService.updateIsEnable(sid,isEnable); + } +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseManufacturerRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseManufacturerRest.java new file mode 100644 index 0000000..6e54f77 --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseManufacturerRest.java @@ -0,0 +1,69 @@ +package com.yxt.user.apiadmin.base; + +import com.yxt.goods.biz.base.basemanufacturer.*; +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; + +/** + * @author wangpengfei + * @date 2024/2/27 13:56 + */ +@Api(tags = "厂家信息") +@RestController +@RequestMapping("/apiadmin/base/basemanufacturer") +public class BaseManufacturerRest { + + @Autowired + BaseManufacturerService baseManufacturerService; + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseManufacturerService.listPage(pq); + } + + @ApiOperation("查询所有的厂家") + @GetMapping("/listAll") + public ResultBean> listAll() { + return baseManufacturerService.listAll(); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseManufacturerDto dto) { + return baseManufacturerService.saveOrUpdate(dto); + } + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseManufacturerService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseManufacturerService.delete(sid); + } + + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid, @PathVariable("isEnable") String isEnable) { + return baseManufacturerService.updateIsEnable(sid, isEnable); + } + + @ApiOperation("查询分公司下所有的厂家") + @GetMapping("/getAllTypeByUseOrgSid") + public ResultBean> getAllTypeByUseOrgSid(@RequestParam("useOrgSid") String useOrgSid) { + return baseManufacturerService.getAllTypeByUseOrgSid(useOrgSid); + } + +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseSpecGroupRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseSpecGroupRest.java new file mode 100644 index 0000000..4320c78 --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseSpecGroupRest.java @@ -0,0 +1,57 @@ +package com.yxt.user.apiadmin.base; + + +import com.yxt.goods.biz.base.basespecparam.BaseSpecParamDto; +import com.yxt.goods.biz.base.basespecparam.BaseSpecParamQuery; +import com.yxt.goods.biz.base.basespecparam.BaseSpecParamService; +import com.yxt.goods.biz.base.basespecparam.BaseSpecParamVo; +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.*; + +/** + * @author wangpengfei + * @date 2024/3/11 14:27 + */ +@Api(tags = "规格参数组表") +@RestController +@RequestMapping("/apiadmin/base/basespecgroup") +public class BaseSpecGroupRest { + @Autowired + BaseSpecParamService baseSpecParamService; + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseSpecParamService.listPage(pq); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseSpecParamDto dto) { + return baseSpecParamService.saveOrUpdate(dto); + } + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseSpecParamService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseSpecParamService.delete(sid); + } + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid, @PathVariable("isEnable") String isEnable) { + return baseSpecParamService.updateIsEnable(sid, isEnable); + } + +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseSpecParamRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseSpecParamRest.java new file mode 100644 index 0000000..0c291cb --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseSpecParamRest.java @@ -0,0 +1,57 @@ +package com.yxt.user.apiadmin.base; + + +import com.yxt.goods.biz.base.basespecparam.BaseSpecParamDto; +import com.yxt.goods.biz.base.basespecparam.BaseSpecParamQuery; +import com.yxt.goods.biz.base.basespecparam.BaseSpecParamService; +import com.yxt.goods.biz.base.basespecparam.BaseSpecParamVo; +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.*; + +/** + * @author wangpengfei + * @date 2024/3/11 14:27 + */ +@Api(tags = "规格参数定义表") +@RestController +@RequestMapping("/apiadmin/base/basespecparam") +public class BaseSpecParamRest { + @Autowired + BaseSpecParamService baseSpecParamService; + + @ApiOperation("分页列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + return baseSpecParamService.listPage(pq); + } + + @ApiOperation("保存修改") + @PostMapping("/saveOrUpdate") + public ResultBean saveOrUpdate(@RequestBody BaseSpecParamDto dto) { + return baseSpecParamService.saveOrUpdate(dto); + } + + @ApiOperation("初始化") + @GetMapping("/initialization/{sid}") + public ResultBean initialization(@PathVariable("sid") String sid) { + return baseSpecParamService.initialization(sid); + } + + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable("sid") String sid) { + return baseSpecParamService.delete(sid); + } + + @ApiOperation("更改可用状态") + @GetMapping("/updateIsEnable/{sid}/{isEnable}") + public ResultBean updateIsEnable(@PathVariable("sid") String sid, @PathVariable("isEnable") String isEnable) { + return baseSpecParamService.updateIsEnable(sid, isEnable); + } + +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseSupplierBankRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseSupplierBankRest.java new file mode 100644 index 0000000..0d3e301 --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseSupplierBankRest.java @@ -0,0 +1,89 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.user.apiadmin.base; + +import com.yxt.goods.biz.base.basesupplierBank.*; +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-base(供应商管理)
+ * File: BaseSupplierBankFeignFallback.java
+ * Class: com.yxt.base.biz.basesupplierbank.BaseSupplierBankRest
+ * Description: 供应商开户行信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Api(tags = "供应商开户行信息") +@RestController +@RequestMapping("/apiadmin/base/basesupplierbank") +public class BaseSupplierBankRest { + + @Autowired + private BaseSupplierBankService baseSupplierBankService; + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = baseSupplierBankService.listPageVo(pq); + return rb.success().setData(pv); + } + + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody BaseSupplierBankDto dto){ + ResultBean rb = ResultBean.fireFail(); + baseSupplierBankService.saveOrUpdateDto(dto); + return rb.success(); + } + + @ApiOperation("根据sid批量删除") + @PostMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + baseSupplierBankService.delBySids(sids); + return rb.success(); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + BaseSupplierBankDetailsVo vo = baseSupplierBankService.fetchDetailsVoBySid(sid); + return rb.success().setData(vo); + } +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseSupplierFileRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseSupplierFileRest.java new file mode 100644 index 0000000..da86e4e --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseSupplierFileRest.java @@ -0,0 +1,89 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.user.apiadmin.base; + +import com.yxt.goods.biz.base.basesupplierfile.*; +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-base(仓储基础信息供应商)
+ * File: BaseSupplierFileFeignFallback.java
+ * Class: com.yxt.anrui.as.biz.basesupplierfile.BaseSupplierFileRest
+ * Description: 供应商附件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Api(tags = "供应商附件") +@RestController +@RequestMapping("/apiadmin/base/basesupplierfile") +public class BaseSupplierFileRest { + + @Autowired + private BaseSupplierFileService baseSupplierFileService; + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = baseSupplierFileService.listPageVo(pq); + return rb.success().setData(pv); + } + + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody BaseSupplierFileDto dto){ + ResultBean rb = ResultBean.fireFail(); + baseSupplierFileService.saveOrUpdateDto(dto); + return rb.success(); + } + + @ApiOperation("根据sid批量删除") + @DeleteMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + baseSupplierFileService.delBySids(sids); + return rb.success(); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + BaseSupplierFileDetailsVo vo = baseSupplierFileService.fetchDetailsVoBySid(sid); + return rb.success().setData(vo); + } +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseSupplierInfoRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseSupplierInfoRest.java new file mode 100644 index 0000000..51a9857 --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseSupplierInfoRest.java @@ -0,0 +1,97 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.user.apiadmin.base; + +import com.yxt.goods.biz.base.basesupplierinfo.*; +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-base(仓储基础信息供应商)
+ * File: BaseSupplierInfoFeignFallback.java
+ * Class: com.yxt.anrui.as.biz.basesupplierinfo.BaseSupplierInfoRest
+ * Description: 供应商信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Api(tags = "供应商信息") +@RestController +@RequestMapping("/apiadmin/base/basesupplierinfo") +public class BaseSupplierInfoRest { + + @Autowired + private BaseSupplierInfoService baseSupplierInfoService; + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = baseSupplierInfoService.listPageVo(pq); + return rb.success().setData(pv); + } + + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody BaseSupplierInfoDto dto){ + return baseSupplierInfoService.saveOrUpdateDto(dto); + } + + @ApiOperation("根据sid批量删除") + @DeleteMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + baseSupplierInfoService.delAll(sids); + return rb.success(); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + BaseSupplierInfoDetailsVo vo = baseSupplierInfoService.fetchDetailsVoBySid(sid); + return rb.success().setData(vo); + } + + @ApiOperation("选择供应商") + @PostMapping("/choiceSupplierInfo") + public ResultBean> choiceSupplierInfo(@RequestParam("createOrgSid") String createOrgSid){ + ResultBean rb = ResultBean.fireFail(); + List baseSupplierInfoChoiceList = baseSupplierInfoService.choiceSupplierInfo(createOrgSid); + return rb.success().setData(baseSupplierInfoChoiceList); + } +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/BaseSupplierTypeRest.java b/src/main/java/com/yxt/user/apiadmin/base/BaseSupplierTypeRest.java new file mode 100644 index 0000000..29a5106 --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/BaseSupplierTypeRest.java @@ -0,0 +1,89 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.user.apiadmin.base; + +import com.yxt.goods.biz.base.basesuppliertype.*; +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-base(仓储基础信息供应商)
+ * File: BaseSupplierTypeFeignFallback.java
+ * Class: com.yxt.anrui.as.biz.basesuppliertype.BaseSupplierTypeRest
+ * Description: 供应商类型.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Api(tags = "供应商类型") +@RestController +@RequestMapping("/apiadmin/base/basesuppliertype") +public class BaseSupplierTypeRest { + + @Autowired + private BaseSupplierTypeService baseSupplierTypeService; + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq){ + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = baseSupplierTypeService.listPageVo(pq); + return rb.success().setData(pv); + } + + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody BaseSupplierTypeDto dto){ + ResultBean rb = ResultBean.fireFail(); + baseSupplierTypeService.saveOrUpdateDto(dto); + return rb.success(); + } + + @ApiOperation("根据sid批量删除") + @DeleteMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids){ + ResultBean rb = ResultBean.fireFail(); + baseSupplierTypeService.delBySids(sids); + return rb.success(); + } + + @ApiOperation("根据SID获取一条记录") + @GetMapping("/fetchDetailsBySid/{sid}") + public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ + ResultBean rb = ResultBean.fireFail(); + BaseSupplierTypeDetailsVo vo = baseSupplierTypeService.fetchDetailsVoBySid(sid); + return rb.success().setData(vo); + } +} diff --git a/src/main/java/com/yxt/user/apiadmin/base/ShoppingCartRest.java b/src/main/java/com/yxt/user/apiadmin/base/ShoppingCartRest.java new file mode 100644 index 0000000..e5a45c2 --- /dev/null +++ b/src/main/java/com/yxt/user/apiadmin/base/ShoppingCartRest.java @@ -0,0 +1,56 @@ +package com.yxt.user.apiadmin.base; + + +import com.yxt.common.core.result.ResultBean; +import com.yxt.goods.biz.base.shoppingcart.ShoppingCartDto; +import com.yxt.goods.biz.base.shoppingcart.ShoppingCartQuery; +import com.yxt.goods.biz.base.shoppingcart.ShoppingCartService; +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/12/8 9:19 + */ +@Api(tags = "购物车") +@RestController +@RequestMapping("shoppingcart") +public class ShoppingCartRest { + @Autowired + ShoppingCartService shoppingCartService; + + + @ApiOperation("加入购物车") + @PostMapping("/addShoppingCart") + public ResultBean save(@RequestBody ShoppingCartDto dto) { + return shoppingCartService.save(dto); + } + @ApiOperation("减购物车") + @PostMapping("/minusShoppingCart") + public ResultBean minusShoppingCart(@RequestBody ShoppingCartDto dto) { + return shoppingCartService.minusShoppingCart(dto); + } + @ApiOperation("修改购物车数量") + @PostMapping("/updateShoppingCart") + public ResultBean updateShoppingCart(@RequestBody ShoppingCartDto dto) { + return shoppingCartService.updateShoppingCart(dto); + } + @ApiOperation("购物车列表") + @PostMapping("/shoppingCartList") + public ResultBean shoppingCartList(@RequestBody ShoppingCartQuery query) { + return shoppingCartService.shoppingCartList(query); + } + + @ApiOperation("删除购物车商品") + @PostMapping("/delShoppingCart/{sid}") + public ResultBean delShoppingCart(@PathVariable("sid") String sid) { + return shoppingCartService.delShoppingCart(sid); + } + @ApiOperation("计算购物车价格和重量") + @PostMapping("/getGoodsWeight") + public ResultBean getGoodsWeight(@RequestBody ShoppingCartQuery query) { + return shoppingCartService.getGoodsWeight(query); + } +} diff --git a/src/main/java/com/yxt/user/apiwx/WxHomeRest.java b/src/main/java/com/yxt/user/apiwx/WxHomeRest.java new file mode 100644 index 0000000..35e8be8 --- /dev/null +++ b/src/main/java/com/yxt/user/apiwx/WxHomeRest.java @@ -0,0 +1,10 @@ +package com.yxt.goods.apiwx; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController("com.yxt.base.apiwx.WxHomeRest") +@RequestMapping("/apiwx/home") +public class WxHomeRest { + +} diff --git a/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfo.java b/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfo.java new file mode 100644 index 0000000..9cf396f --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfo.java @@ -0,0 +1,21 @@ +package com.yxt.goods.biz.base.basebrandinfo; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseBrandInfo extends BaseEntity { + + private String brandName;//品牌代码 + private String brandCode;//品牌名称 + private String image;//品牌图片url地址 + private String letter;//品牌的首字母大写 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid + + +} diff --git a/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoDto.java b/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoDto.java new file mode 100644 index 0000000..250c12c --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoDto.java @@ -0,0 +1,27 @@ +package com.yxt.goods.biz.base.basebrandinfo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseBrandInfoDto implements Dto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String brandName;//品牌代码 + private String brandCode;//品牌名称 + private String image;//品牌图片url地址 + private String letter;//品牌的首字母大写 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid +} diff --git a/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoMapper.java b/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoMapper.java new file mode 100644 index 0000000..37330ac --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoMapper.java @@ -0,0 +1,18 @@ +package com.yxt.goods.biz.base.basebrandinfo; + +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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseBrandInfoMapper extends BaseMapper { + + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); +} diff --git a/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoMapper.xml b/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoMapper.xml new file mode 100644 index 0000000..53b13f0 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoQuery.java b/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoQuery.java new file mode 100644 index 0000000..3f607c4 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoQuery.java @@ -0,0 +1,13 @@ +package com.yxt.goods.biz.base.basebrandinfo; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseBrandInfoQuery implements Query { + private String name; +} diff --git a/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoService.java b/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoService.java new file mode 100644 index 0000000..0830b66 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoService.java @@ -0,0 +1,127 @@ +package com.yxt.goods.biz.base.basebrandinfo; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +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 org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseBrandInfoService extends MybatisBaseService { + @Autowired + private FileUploadComponent fileUploadComponent; + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseBrandInfoQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + + if(StringUtils.isNotBlank(query.getName())){ + qw.like("brandName",query.getName()); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.listPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + List records = pagging.getRecords(); + records.removeAll(Collections.singleton(null)); +// if (!records.isEmpty()) { +// for (BaseBrandInfoVo record : records) { +// if (StringUtils.isNotBlank(record.getBigPic())) { +// record.setBigPic(fileUploadComponent.getUrlPrefix() + record.getBigPic()); +// } +// } +// } + return rb.success().setData(p); + } + public ResultBean> listAll() { + ResultBean rb = ResultBean.fireFail(); + List pagging = baseMapper.selectList(new QueryWrapper().eq("isEnable",1)); + return rb.success().setData(pagging); +} + public ResultBean saveOrUpdate(BaseBrandInfoDto dto) { + ResultBean rb = ResultBean.fireFail(); + String sid = ""; + if (StringUtils.isNotBlank(dto.getSid())) { + sid = dto.getSid(); + BaseBrandInfo wmsGoodsBrand = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoodsBrand, "id", "sid"); +// if (StringUtils.isNotBlank(dto.getBigPic())) { +// String urlPrefix = fileUploadComponent.getUrlPrefix(); +// String path = dto.getBigPic().substring(urlPrefix.length()); +// wmsGoodsBrand.setBigPic(path); +// } + wmsGoodsBrand.setModifyTime(new Date()); + baseMapper.updateById(wmsGoodsBrand); + } else { + BaseBrandInfo goods=baseMapper.selectOne(new QueryWrapper().eq("name",dto.getBrandName())); + if(null!=goods){ + return rb.setMsg("商品名不能重复"); + } + BaseBrandInfo wmsGoodsBrand = new BaseBrandInfo(); + sid = wmsGoodsBrand.getSid(); + BeanUtil.copyProperties(dto, wmsGoodsBrand, "id", "sid"); + wmsGoodsBrand.setCreateTime(new DateTime()); +// if (StringUtils.isNotBlank(dto.getBigPic())) { +// String urlPrefix = fileUploadComponent.getUrlPrefix(); +// String path = dto.getBigPic().substring(urlPrefix.length()); +// wmsGoodsBrand.setBigPic(path); +// } + baseMapper.insert(wmsGoodsBrand); + } + return rb.success().setMsg("成功"); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseBrandInfoVo vo = new BaseBrandInfoVo(); + BaseBrandInfo wmsGoodsBrand = fetchBySid(sid); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + BeanUtil.copyProperties(wmsGoodsBrand, vo); +// if (null != wmsGoodsBrand) { +// +// if (StringUtils.isNotBlank(wmsGoodsBrand.getBigPic())) { +// vo.setBigPic(fileUploadComponent.getUrlPrefix() + wmsGoodsBrand.getBigPic()); +// } +//// vo.setCreateTime(sdf.format(lpkGoods.getCreateTime())); +// } + return rb.success().setData(vo); + } + + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseBrandInfo wmsGoodsBrand = fetchBySid(sid); + if (null != wmsGoodsBrand) { + baseMapper.deleteById(wmsGoodsBrand.getId()); + } + return rb.success().setMsg("成功"); + } + public ResultBean updateIsEnable(String sid,String isEnable) { + ResultBean rb = ResultBean.fireFail(); + BaseBrandInfo wmsGoodsBrand = fetchBySid(sid); + if (null != wmsGoodsBrand) { + wmsGoodsBrand.setIsEnable(Integer.parseInt(isEnable)); + baseMapper.updateById(wmsGoodsBrand); + } + return rb.success().setMsg("成功"); + } + +} diff --git a/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoVo.java b/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoVo.java new file mode 100644 index 0000000..a211845 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basebrandinfo/BaseBrandInfoVo.java @@ -0,0 +1,32 @@ +package com.yxt.goods.biz.base.basebrandinfo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseBrandInfoVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String brandName;//品牌代码 + private String brandCode;//品牌名称 + private String image;//品牌图片url地址 + private String letter;//品牌的首字母大写 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid +} diff --git a/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrand.java b/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrand.java new file mode 100644 index 0000000..98f65fe --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrand.java @@ -0,0 +1,15 @@ +package com.yxt.goods.biz.base.basecategorybrand; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/4/8 9:34 + */ +@Data +public class BaseCategoryBrand extends BaseEntity { + private String categorySid;//商品分类sid + private String brandSid;//品牌sid + +} diff --git a/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandDto.java b/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandDto.java new file mode 100644 index 0000000..1b43086 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandDto.java @@ -0,0 +1,22 @@ +package com.yxt.goods.biz.base.basecategorybrand; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/4/8 9:34 + */ +@Data +public class BaseCategoryBrandDto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String categorySid;//商品分类sid + private String brandSid;//品牌sid +} diff --git a/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandMapper.java b/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandMapper.java new file mode 100644 index 0000000..e688995 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandMapper.java @@ -0,0 +1,23 @@ +package com.yxt.goods.biz.base.basecategorybrand; + +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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseCategoryBrandMapper extends BaseMapper { + + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + List getSkusBySpuSid(@Param("spuSid")String spuSid); + BaseCategoryBrandVo getVoBySid(@Param("sid")String sid); + +} diff --git a/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandMapper.xml b/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandMapper.xml new file mode 100644 index 0000000..09033d9 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandMapper.xml @@ -0,0 +1,29 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandQuery.java b/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandQuery.java new file mode 100644 index 0000000..77c83a9 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandQuery.java @@ -0,0 +1,13 @@ +package com.yxt.goods.biz.base.basecategorybrand; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/4/8 9:34 + */ +@Data +public class BaseCategoryBrandQuery implements Query { + private String name; +} diff --git a/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandService.java b/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandService.java new file mode 100644 index 0000000..f251d36 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandService.java @@ -0,0 +1,115 @@ +package com.yxt.goods.biz.base.basecategorybrand; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +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 org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseCategoryBrandService extends MybatisBaseService { + @Autowired + private FileUploadComponent fileUploadComponent; + + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseCategoryBrandQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotBlank(query.getName())) { + qw.like("goodsName", query.getName()); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.listPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return rb.success().setData(p); + } + @Transactional + public ResultBean saveOrUpdate(BaseCategoryBrandDto dto) { + ResultBean rb = ResultBean.fireFail(); + String sid = ""; + if (StringUtils.isNotBlank(dto.getSid())) { + sid = dto.getSid(); + BaseCategoryBrand wmsGoods = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoods, "id", "sid"); + wmsGoods.setModifyTime(new Date()); + baseMapper.updateById(wmsGoods); + } else { + BaseCategoryBrand wmsGoods = new BaseCategoryBrand(); + BeanUtil.copyProperties(dto, wmsGoods, "id", "sid"); + wmsGoods.setCreateTime(new DateTime()); + baseMapper.insert(wmsGoods); + } + return rb.success().setMsg("成功"); + } + @Transactional + public ResultBean saveOrUpdate(List dtos) { + ResultBean rb = ResultBean.fireFail(); + for (BaseCategoryBrandDto dto : dtos) { + BaseCategoryBrand sku=baseMapper.selectOne(new QueryWrapper().eq("sid",dto.getSid())); + String sid = ""; + if (null!=sku) { + sid = dto.getSid(); + BaseCategoryBrand wmsGoods = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setModifyTime(new Date()); + baseMapper.updateById(wmsGoods); + } else { + BaseCategoryBrand wmsGoods = new BaseCategoryBrand(); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setCreateTime(new DateTime()); + baseMapper.insert(wmsGoods); + } + } + + return rb.success().setMsg("成功"); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseCategoryBrandVo vo = baseMapper.getVoBySid(sid); + return rb.success().setData(vo); + } + + public ResultBean> getSkusBySpuSid(String sid) { + ResultBean rb = ResultBean.fireFail(); + List vo = baseMapper.getSkusBySpuSid(sid); + return rb.success().setData(vo); + } + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseCategoryBrand wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + baseMapper.deleteById(wmsGoods.getId()); + } + return rb.success(); + } + + public ResultBean updateIsEnable(String sid, String isEnable) { + ResultBean rb = ResultBean.fireFail(); + BaseCategoryBrand wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + wmsGoods.setIsEnable(Integer.parseInt(isEnable)); + baseMapper.updateById(wmsGoods); + } + return rb.success().setMsg("成功"); + } +} diff --git a/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandVo.java b/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandVo.java new file mode 100644 index 0000000..b15e116 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basecategorybrand/BaseCategoryBrandVo.java @@ -0,0 +1,24 @@ +package com.yxt.goods.biz.base.basecategorybrand; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/4/8 9:34 + */ +@Data +public class BaseCategoryBrandVo { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String categorySid;//商品分类sid + private String brandSid;//品牌sid + private String categoryName;//分类名 + private String brandName;//品牌名 +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSku.java b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSku.java new file mode 100644 index 0000000..2f8ffec --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSku.java @@ -0,0 +1,21 @@ +package com.yxt.goods.biz.base.basegoodssku; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseGoodsSku extends BaseEntity { + private String goodsSkuCode;//商品Sku代码 + private String title;//商品标题 + private String goodsSpuSid;//商品基础信息Sid + private String externalCode;//外部编码 + private String indexes;//特有规格属性在spu表中special_spec字段对应每个参数值数组下标的组合,如0_0_0,1_0_0,相当于SKU这条记录的编码。 + @TableField(value = "own_spec") + private String ownSpec;//sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序 + +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuDetailsVo.java b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuDetailsVo.java new file mode 100644 index 0000000..5217aeb --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuDetailsVo.java @@ -0,0 +1,69 @@ +package com.yxt.goods.biz.base.basegoodssku; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/19 + **/ +@Data +public class BaseGoodsSkuDetailsVo { + + @ApiModelProperty("商品代码") + private String goodsCode; + @ApiModelProperty("条形码") + private String barCode; + @ApiModelProperty("商品名称") + private String goodsName; + @ApiModelProperty("副标题") + private String subTitle; + @ApiModelProperty("拼音缩写") + private String goodsPY; + @ApiModelProperty("商品简称") + private String goodsShortName; + @ApiModelProperty("商品分类sid") + private String goodsTypeSid; + @ApiModelProperty("品牌sid") + private String brandSid; + @ApiModelProperty("厂家sid") + private String manufacturersid; + @ApiModelProperty("商品单位sid") + private String goodsUnitSid; + @ApiModelProperty("商品单位名称") + private String goodsUnitName; + + @ApiModelProperty("商品Sku代码") + private String goodsSkuCode; + @ApiModelProperty("商品标题") + private String title; + @ApiModelProperty("是否一品一码(goodID),0否,1是") + @JsonProperty("isGoodsID") + private int isGoodsID; + + //================================= + + //商品名称 + //零件号 + //拼音 + //条形码 + //计量单位 + //商品类别 + private String goodsTypeName;//商品类别名称 + //厂家 + //规格 + //品牌 + //车型 + //原厂标志 + //产地 + //锁定售价 + //备注 + //上限数量 + //下限数量 + //积分商品 + //所需积分 + + +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuDto.java b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuDto.java new file mode 100644 index 0000000..4bf00c8 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuDto.java @@ -0,0 +1,31 @@ +package com.yxt.goods.biz.base.basegoodssku; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.goods.biz.base.basegoodsskuextend.BaseGoodsSkuExtendDto; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseGoodsSkuDto implements Dto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String goodsSkuCode;//商品Sku代码 + private String title;//商品标题 + private String goodsSpuSid;//商品基础信息Sid + private String externalCode;//外部编码 + private String indexes;//特有规格属性在spu表中special_spec字段对应每个参数值数组下标的组合,如0_0_0,1_0_0,相当于SKU这条记录的编码。 + @TableField(value = "own_spec") + private String ownSpec;//sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序 + private BaseGoodsSkuExtendDto baseGoodsSkuExtend;//sku扩展 +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuMapper.java b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuMapper.java new file mode 100644 index 0000000..8f6e02b --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuMapper.java @@ -0,0 +1,26 @@ +package com.yxt.goods.biz.base.basegoodssku; + +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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseGoodsSkuMapper extends BaseMapper { + + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + List getSkusBySpuSid(@Param("spuSid")String spuSid); + BaseGoodsSkuVo getSkuBySid(@Param("sid")String sid); + + IPage getSelectList(IPage page, @Param(Constants.WRAPPER)QueryWrapper qw); + + IPage purGoodsListPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuMapper.xml b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuMapper.xml new file mode 100644 index 0000000..d8ce8e4 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuMapper.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuPurSelectList.java b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuPurSelectList.java new file mode 100644 index 0000000..ca465ef --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuPurSelectList.java @@ -0,0 +1,35 @@ +package com.yxt.goods.biz.base.basegoodssku; + +import lombok.Data; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/21 + **/ +@Data +public class BaseGoodsSkuPurSelectList { + + //sid + private String sid; + //零件号 + private String goodsSkuCode; + //规格 + private String title; + //商品名称 + private String goodsName; + //商品拼音 + private String goodsPY; + //商品简称 + private String goodsShortName; + //商品类别sid + private String goodsTypeSid; + //品牌sid + private String brandSid; + //厂家sid + private String manufacturerSid; + //商品单位名称 + private String goodsUnitName; + //sku特有规格参数键值对 + private String ownSpec; +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuPurSelectQuery.java b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuPurSelectQuery.java new file mode 100644 index 0000000..adbae98 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuPurSelectQuery.java @@ -0,0 +1,30 @@ +package com.yxt.goods.biz.base.basegoodssku; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/21 + **/ +@Data +public class BaseGoodsSkuPurSelectQuery implements Query { + + //组织sid + private String orgSid; + //商品名称 + private String goodsName; + //商品类别sid + private String goodsTypeSid; + //商品拼音 + private String goodsPY; + //品牌sid + private String brandSid; + //零件号 + private String goodsSkuCode; + //规格 + private String title; + //其他查询条件 + private String otherQuery; +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuQuery.java b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuQuery.java new file mode 100644 index 0000000..455f291 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuQuery.java @@ -0,0 +1,13 @@ +package com.yxt.goods.biz.base.basegoodssku; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSkuQuery implements Query { + private String name; +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuSelectList.java b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuSelectList.java new file mode 100644 index 0000000..c438eba --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuSelectList.java @@ -0,0 +1,36 @@ +package com.yxt.goods.biz.base.basegoodssku; + +import lombok.Data; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/21 + **/ +@Data +public class BaseGoodsSkuSelectList { + + //商品名称 + private String goodsSpuSid; + private String goodsSpuName; + //商品sid + private String goodsSkuSid; + //商品编码 + private String goodsSkuCode; + //规格/型号 + private String goodsSkuTitle; + //计量单位 + private String goodsUnitSid; + private String goodsUnitName; + //仓库名称 + //货位 + //单位成本(进货价) + //数量 + //税额 + //含税价 + //金额 + //销售价1 + //销售价2 + //操作时间 + //操作人 +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuSelectQuery.java b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuSelectQuery.java new file mode 100644 index 0000000..513efa7 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuSelectQuery.java @@ -0,0 +1,15 @@ +package com.yxt.goods.biz.base.basegoodssku; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @description: + * @author: dimengzhe + * @date: 2024/3/21 + **/ +@Data +public class BaseGoodsSkuSelectQuery implements Query { + + private String goodsSkuCode; +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuService.java b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuService.java new file mode 100644 index 0000000..7e54fc2 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuService.java @@ -0,0 +1,208 @@ +package com.yxt.goods.biz.base.basegoodssku; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.goods.biz.base.basegoodsskuextend.BaseGoodsSkuExtendService; +import com.yxt.goods.biz.base.basegoodsskuextend.BaseGoodsSkuExtendVo; +import com.yxt.goods.biz.base.basegoodsspu.BaseGoodsSpu; +import com.yxt.goods.biz.base.basegoodsspu.BaseGoodsSpuService; +import com.yxt.goods.biz.base.basegoodsspudetail.BaseGoodsSpuDetailService; +import com.yxt.goods.biz.base.basegoodstype.BaseGoodsType; +import com.yxt.goods.biz.base.basegoodstype.BaseGoodsTypeService; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +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 org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseGoodsSkuService extends MybatisBaseService { + @Autowired + private FileUploadComponent fileUploadComponent; + @Autowired + BaseGoodsSpuDetailService baseGoodsSpuDetailService; + @Autowired + BaseGoodsSkuExtendService baseGoodsSkuExtendService; + @Autowired + private BaseGoodsSpuService baseGoodsSpuService; + @Autowired + BaseGoodsTypeService baseGoodsTypeService; + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotBlank(query.getName())) { + qw.like("goodsName", query.getName()); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.listPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return rb.success().setData(p); + } + @Transactional + public ResultBean saveOrUpdate(BaseGoodsSkuDto dto) { + ResultBean rb = ResultBean.fireFail(); + String sid = ""; + if (StringUtils.isNotBlank(dto.getSid())) { + sid = dto.getSid(); + BaseGoodsSku wmsGoods = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoods, "id", "sid"); + wmsGoods.setModifyTime(new Date()); + baseMapper.updateById(wmsGoods); + dto.getBaseGoodsSkuExtend().setGoodsSkuSid(wmsGoods.getSid()); + baseGoodsSkuExtendService.saveOrUpdate(dto.getBaseGoodsSkuExtend()); + } else { + BaseGoodsSku wmsGoods = new BaseGoodsSku(); + BeanUtil.copyProperties(dto, wmsGoods, "id", "sid"); + wmsGoods.setCreateTime(new DateTime()); + baseMapper.insert(wmsGoods); + dto.getBaseGoodsSkuExtend().setGoodsSkuSid(wmsGoods.getSid()); + baseGoodsSkuExtendService.saveOrUpdate(dto.getBaseGoodsSkuExtend()); + } + return rb.success().setMsg("成功"); + } + @Transactional + public ResultBean saveOrUpdate(List dtos) { + ResultBean rb = ResultBean.fireFail(); + for (BaseGoodsSkuDto dto : dtos) { + BaseGoodsSku sku=baseMapper.selectOne(new QueryWrapper().eq("sid",dto.getSid())); + String sid = ""; + if (null!=sku) { + sid = dto.getSid(); + BaseGoodsSku wmsGoods = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setModifyTime(new Date()); + baseMapper.updateById(wmsGoods); + dto.getBaseGoodsSkuExtend().setGoodsSkuSid(wmsGoods.getSid()); + baseGoodsSkuExtendService.saveOrUpdate(dto.getBaseGoodsSkuExtend()); + } else { + BaseGoodsSku wmsGoods = new BaseGoodsSku(); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setCreateTime(new DateTime()); + baseMapper.insert(wmsGoods); + dto.getBaseGoodsSkuExtend().setGoodsSkuSid(wmsGoods.getSid()); + baseGoodsSkuExtendService.saveOrUpdate(dto.getBaseGoodsSkuExtend()); + } + } + + return rb.success().setMsg("成功"); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuVo vo = baseMapper.getSkuBySid(sid); + BaseGoodsSkuExtendVo vo1=baseGoodsSkuExtendService.getExtendBySkuSid(vo.getSid()).getData(); + if(vo1==null){ + vo.setBaseGoodsSkuExtend(new BaseGoodsSkuExtendVo()); + } + vo.setBaseGoodsSkuExtend(vo1); + return rb.success().setData(vo); + } + + public ResultBean> getSkusBySpuSid(String sid) { + ResultBean rb = ResultBean.fireFail(); + List vo = baseMapper.getSkusBySpuSid(sid); + return rb.success().setData(vo); + } + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSku wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + baseMapper.deleteById(wmsGoods.getId()); + } + return rb.success(); + } + + public ResultBean updateIsEnable(String sid, String isEnable) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSku wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + wmsGoods.setIsEnable(Integer.parseInt(isEnable)); + baseMapper.updateById(wmsGoods); + } + return rb.success().setMsg("成功"); + } + + public ResultBean getDetails(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuDetailsVo baseGoodsSkuDetailsVo = new BaseGoodsSkuDetailsVo(); + BaseGoodsSku baseGoodsSku = fetchBySid(sid); + BaseGoodsSpu baseGoodsSpu = baseGoodsSpuService.fetchBySid(baseGoodsSku.getGoodsSpuSid()); + BeanUtil.copyProperties(baseGoodsSku, baseGoodsSkuDetailsVo); + BeanUtil.copyProperties(baseGoodsSpu, baseGoodsSkuDetailsVo); + BaseGoodsType baseGoodsType = baseGoodsTypeService.fetchBySid(baseGoodsSpu.getGoodsTypeSid()); + if (baseGoodsType != null && StringUtils.isNotBlank(baseGoodsType.getIsGoodsID())) { + baseGoodsSkuDetailsVo.setIsGoodsID(Integer.parseInt(baseGoodsType.getIsGoodsID())); + baseGoodsSkuDetailsVo.setGoodsTypeName(baseGoodsType.getGoodsTypeName()); + } else { + baseGoodsSkuDetailsVo.setIsGoodsID(0); + } + return rb.success().setData(baseGoodsSkuDetailsVo); + } + + public PagerVo getSelectList(PagerQuery pagerQuery) { + BaseGoodsSkuSelectQuery query = pagerQuery.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if (query != null) { + //商品编码 + if (StringUtils.isNotBlank(query.getGoodsSkuCode())) { + qw.like("sku.goodsSkuCode", query.getGoodsSkuCode()); + } + } + IPage page = PagerUtil.queryToPage(pagerQuery); + IPage pagging = baseMapper.getSelectList(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public ResultBean> purGoodsListPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuPurSelectQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotBlank(query.getOrgSid())){ + qw.eq("s.createOrgSid",query.getOrgSid()); + } + if (StringUtils.isNotBlank(query.getGoodsName())) { + qw.like("a.goodsName", query.getGoodsName()); + } + if (StringUtils.isNotBlank(query.getGoodsTypeSid())) { + qw.eq("a.goodsTypeSid", query.getGoodsTypeSid()); + } + if (StringUtils.isNotBlank(query.getGoodsPY())) { + qw.like("a.goodsPY", query.getGoodsPY()); + } + if (StringUtils.isNotBlank(query.getBrandSid())) { + qw.like("a.brandSid", query.getBrandSid()); + } + if (StringUtils.isNotBlank(query.getGoodsSkuCode())) { + qw.like("s.goodsSkuCode", query.getGoodsSkuCode()); + } + if (StringUtils.isNotBlank(query.getTitle())) { + qw.like("s.title", query.getTitle()); + } + if (org.apache.commons.lang3.StringUtils.isNotBlank(query.getOtherQuery())){ + qw.and(wrapper -> wrapper.like("a.goodsName", query.getOtherQuery()).or().like("s.goodsSkuCode", query.getOtherQuery()).or().like("a.goodsPY",query.getOtherQuery())); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.purGoodsListPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return rb.success().setData(p); + } +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuVo.java b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuVo.java new file mode 100644 index 0000000..92efb31 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodssku/BaseGoodsSkuVo.java @@ -0,0 +1,38 @@ +package com.yxt.goods.biz.base.basegoodssku; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.goods.biz.base.basegoodsskuextend.BaseGoodsSkuExtendVo; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSkuVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String goodsSkuCode;//商品Sku代码 + private String title;//商品标题 + private String goodsSpuSid;//商品基础信息Sid + private String externalCode;//外部编码 + private String indexes;//特有规格属性在spu表中special_spec字段对应每个参数值数组下标的组合,如0_0_0,1_0_0,相当于SKU这条记录的编码。 + @TableField(value = "own_spec") + private String ownSpec;//sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序 + private String goodsName; + private BaseGoodsSkuExtendVo baseGoodsSkuExtend; + +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtend.java b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtend.java new file mode 100644 index 0000000..c768b21 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtend.java @@ -0,0 +1,34 @@ +package com.yxt.goods.biz.base.basegoodsskuextend; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseGoodsSkuExtend extends BaseEntity { + private String goodsSkuSid;//商品Sku代码 + private String finalPurchasePrice;//最后采购价 + private String safetyStockDays;//安全库存天数 + private String isOriginalFactory;//是否原厂 + private String isInventoryAlert;//是否库存警戒 + @TableField(value = "InventoryAlertUpperLimit") + private String inventoryAlertUpperLimit;//库存警戒上线 + @TableField(value = "InventoryAlertLowerLimit") + private String inventoryAlertLowerLimit;//库存警戒下线 + private String costPrice;//成本价 + private String tagPrice;//吊牌价 + private String salesPrice;//销售单价 + private String standardPurchasePrice;//标准进价 + private String agencyPrice;//代理价 + private String discount;//折扣 + private String minimumSalesPrice;//最低零售价 + private String isLockingSalesPrice;//是否锁定销售价 + private String isIntegralExchange;//是否可以积分兑换 + private String integralAmount;//积分数量 + private String sortNo;//排序 + private String picUrl;//商品的图片,多个图片以‘,’分割 +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendDto.java b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendDto.java new file mode 100644 index 0000000..8cae2a1 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendDto.java @@ -0,0 +1,46 @@ +package com.yxt.goods.biz.base.basegoodsskuextend; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseGoodsSkuExtendDto implements Dto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String goodsSkuSid;//商品Sku代码 + private String finalPurchasePrice;//最后采购价 + private String safetyStockDays;//安全库存天数 + private String isOriginalFactory;//是否原厂 + private String isInventoryAlert;//是否库存警戒 + @TableField(value = "InventoryAlertUpperLimit") + private String inventoryAlertUpperLimit;//库存警戒上线 + @TableField(value = "InventoryAlertLowerLimit") + private String inventoryAlertLowerLimit;//库存警戒下线 + private String costPrice;//成本价 + private String tagPrice;//吊牌价 + private String salesPrice;//销售单价 + private String standardPurchasePrice;//标准进价 + private String agencyPrice;//代理价 + private String discount;//折扣 + private String minimumSalesPrice;//最低零售价 + private String isLockingSalesPrice;//是否锁定销售价 + private String isIntegralExchange;//是否可以积分兑换 + private String integralAmount;//积分数量 + private String sortNo;//排序 + private String picUrl;//商品的图片,多个图片以‘,’分割 +// private String [] Urls={};//图片数组 + private List urls;//图片数组 +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendMapper.java b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendMapper.java new file mode 100644 index 0000000..9db05ab --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendMapper.java @@ -0,0 +1,20 @@ +package com.yxt.goods.biz.base.basegoodsskuextend; + +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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseGoodsSkuExtendMapper extends BaseMapper { + + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + BaseGoodsSkuExtendVo getExtendBySkuSid(@Param("skuSid")String skuSid); + BaseGoodsSkuExtendVo getExtendBySid(@Param("sid")String sid); +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendMapper.xml b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendMapper.xml new file mode 100644 index 0000000..41c9db6 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendQuery.java b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendQuery.java new file mode 100644 index 0000000..435f217 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendQuery.java @@ -0,0 +1,13 @@ +package com.yxt.goods.biz.base.basegoodsskuextend; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSkuExtendQuery implements Query { + private String name; +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendService.java b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendService.java new file mode 100644 index 0000000..1a9c270 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendService.java @@ -0,0 +1,139 @@ +package com.yxt.goods.biz.base.basegoodsskuextend; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.goods.biz.base.basebrandinfo.BaseBrandInfoService; +import com.yxt.goods.biz.base.basegoodsspudetail.BaseGoodsSpuDetailService; +import com.yxt.goods.biz.base.basegoodstype.BaseGoodsTypeService; +import com.yxt.goods.biz.base.basemanufacturer.BaseManufacturerService; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +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 org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Collections; +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseGoodsSkuExtendService extends MybatisBaseService { + @Autowired + private FileUploadComponent fileUploadComponent; + @Autowired + private BaseBrandInfoService baseBrandInfoService; + @Autowired + private BaseGoodsTypeService baseGoodsTypeService; + @Autowired + private BaseManufacturerService baseManufacturerService; + @Autowired + BaseGoodsSpuDetailService baseGoodsSpuDetailService; + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuExtendQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if(StringUtils.isNotBlank(query.getName())){ + qw.like("goodsName",query.getName()); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.listPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + List records = pagging.getRecords(); + records.removeAll(Collections.singleton(null)); +// if (!records.isEmpty()) { +// for (BaseGoodsSpuVo record : records) { +// if (StringUtils.isNotBlank(record.getPicUrl())) { +// record.setPicUrl(fileUploadComponent.getUrlPrefix() + record.getPicUrl()); +// } +// } +// } + return rb.success().setData(p); + } + @Transactional + public ResultBean saveOrUpdate(BaseGoodsSkuExtendDto dto) { + ResultBean rb = ResultBean.fireFail(); + String sid = ""; + BaseGoodsSkuExtend extend=baseMapper.selectOne(new QueryWrapper().eq("sid",dto.getSid())); + if (null!=extend) { + sid = dto.getSid(); + BaseGoodsSkuExtend wmsGoods = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setModifyTime(new Date()); + for (UrlsVo url : dto.getUrls()) { + String urlPrefix = fileUploadComponent.getUrlPrefix(); + String path = url.getUrl().substring(urlPrefix.length()); + if(StringUtils.isBlank(dto.getPicUrl())){ + wmsGoods.setPicUrl(path); + }else{ + wmsGoods.setPicUrl(wmsGoods.getPicUrl()+","+path); + } + } + if (StringUtils.isNotBlank(dto.getPicUrl())) { + String urlPrefix = fileUploadComponent.getUrlPrefix(); + String path = dto.getPicUrl().substring(urlPrefix.length()); + wmsGoods.setPicUrl(path); + } + baseMapper.updateById(wmsGoods); + + } else { + BaseGoodsSkuExtend wmsGoods = new BaseGoodsSkuExtend(); + sid = wmsGoods.getSid(); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setCreateTime(new DateTime()); + for (UrlsVo url : dto.getUrls()) { + String urlPrefix = fileUploadComponent.getUrlPrefix(); + String path = url.getUrl().substring(urlPrefix.length()); + if(StringUtils.isBlank(dto.getPicUrl())){ + wmsGoods.setPicUrl(path); + }else{ + wmsGoods.setPicUrl(wmsGoods.getPicUrl()+","+path); + } + } + baseMapper.insert(wmsGoods); + } + return rb.success().setMsg("成功"); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuExtendVo vo = baseMapper.getExtendBySid(sid); + return rb.success().setData(vo); + } + + public ResultBean getExtendBySkuSid(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuExtendVo vo = baseMapper.getExtendBySkuSid(sid); + return rb.success().setData(vo); + } + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuExtend wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + baseMapper.deleteById(wmsGoods.getId()); + } + return rb.success(); + } + + public ResultBean updateIsEnable(String sid,String isEnable) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSkuExtend wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + wmsGoods.setIsEnable(Integer.parseInt(isEnable)); + baseMapper.updateById(wmsGoods); + } + return rb.success().setMsg("成功"); + } +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendVo.java b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendVo.java new file mode 100644 index 0000000..347ce66 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/BaseGoodsSkuExtendVo.java @@ -0,0 +1,53 @@ +package com.yxt.goods.biz.base.basegoodsskuextend; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSkuExtendVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String goodsSkuSid;//商品Skusid + private String finalPurchasePrice;//最后采购价 + private String safetyStockDays;//安全库存天数 + private String isOriginalFactory;//是否原厂 + private String isInventoryAlert;//是否库存警戒 + @TableField(value = "InventoryAlertUpperLimit") + private String inventoryAlertUpperLimit;//库存警戒上线 + @TableField(value = "InventoryAlertLowerLimit") + private String inventoryAlertLowerLimit;//库存警戒下线 + private String costPrice;//成本价 + private String tagPrice;//吊牌价 + private String salesPrice;//销售单价 + private String standardPurchasePrice;//标准进价 + private String agencyPrice;//代理价 + private String discount;//折扣 + private String minimumSalesPrice;//最低零售价 + private String isLockingSalesPrice;//是否锁定销售价 + private String isIntegralExchange;//是否可以积分兑换 + private String integralAmount;//积分数量 + private String sortNo;//排序 + private String picUrl;//商品的图片,多个图片以‘,’分割 +// private String [] Urls={};//图片数组 + private List urls;//图片数组 + private String title;//sku标题 + +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/UrlsVo.java b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/UrlsVo.java new file mode 100644 index 0000000..24ff8b4 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsskuextend/UrlsVo.java @@ -0,0 +1,12 @@ +package com.yxt.goods.biz.base.basegoodsskuextend; + +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/3/22 10:20 + */ +@Data +public class UrlsVo { + private String url; +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpu.java b/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpu.java new file mode 100644 index 0000000..1b54ce9 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpu.java @@ -0,0 +1,32 @@ +package com.yxt.goods.biz.base.basegoodsspu; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseGoodsSpu extends BaseEntity { + private String goodsCode;//商品代码 + private String barCode;//条形码 + private String goodsName;//商品名称 + private String subTitle;//商品名称 + private String goodsPY;//拼音缩写 + private String goodsShortName;//商品简称 + private String goodsTypeSid;//商品分类sid + private String brandSid;//品牌sid + private String manufacturerSid;//厂家sid + private String goodsUnitSid;//商品单位sid + private String goodsUnitName;//商品单位名称 + private String taxRate;//税率 + private String shelfLife;//保质期天 + private String nationalStandardCode;//国标码 + private String sortNo;//排序 + private String externalCode;//外部编码 + private String factoryCode;//厂家货号 + private String isListed;//是否上架 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuDto.java b/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuDto.java new file mode 100644 index 0000000..f9ac0b9 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuDto.java @@ -0,0 +1,47 @@ +package com.yxt.goods.biz.base.basegoodsspu; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.goods.biz.base.basegoodssku.BaseGoodsSkuDto; +import com.yxt.goods.biz.base.basegoodsspudetail.BaseGoodsSpuDetailDto; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseGoodsSpuDto implements Dto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String goodsCode;//商品代码 + private String barCode;//条形码 + private String goodsName;//商品名称 + private String subTitle;//副标题 + private String goodsPY;//拼音缩写 + private String goodsShortName;//商品简称 + private String goodsTypeSid;//商品分类sid + private String brandSid;//品牌sid + private String manufacturerSid;//厂家sid + private String goodsUnitSid;//商品单位sid + private String goodsUnitName;//商品单位名称 + private String taxRate;//税率 + private String shelfLife;//保质期天 + private String nationalStandardCode;//国标码 + private String sortNo;//排序 + private String externalCode;//外部编码 + private String factoryCode;//厂家货号 + private String isListed;//是否上架 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid + private BaseGoodsSpuDetailDto baseGoodsSpuDetail;//商品spu详情 + private List baseGoodsSkus;//商品sku + +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuMapper.java b/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuMapper.java new file mode 100644 index 0000000..24f7a44 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuMapper.java @@ -0,0 +1,19 @@ +package com.yxt.goods.biz.base.basegoodsspu; + +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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseGoodsSpuMapper extends BaseMapper { + + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + BaseGoodsSpuVo initialization(@Param("sid")String sid); +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuMapper.xml b/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuMapper.xml new file mode 100644 index 0000000..3f59686 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuQuery.java b/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuQuery.java new file mode 100644 index 0000000..4b2b959 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuQuery.java @@ -0,0 +1,13 @@ +package com.yxt.goods.biz.base.basegoodsspu; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSpuQuery implements Query { + private String name; +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuService.java b/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuService.java new file mode 100644 index 0000000..7a058c0 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuService.java @@ -0,0 +1,165 @@ +package com.yxt.goods.biz.base.basegoodsspu; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.goods.biz.base.basegoodssku.BaseGoodsSkuService; +import com.yxt.goods.biz.base.basegoodssku.BaseGoodsSkuVo; +import com.yxt.goods.biz.base.basegoodsskuextend.BaseGoodsSkuExtendService; +import com.yxt.goods.biz.base.basegoodsskuextend.BaseGoodsSkuExtendVo; +import com.yxt.goods.biz.base.basegoodsskuextend.UrlsVo; +import com.yxt.goods.biz.base.basegoodsspudetail.BaseGoodsSpuDetailService; +import com.yxt.goods.biz.base.basegoodsspudetail.BaseGoodsSpuDetailVo; +import com.yxt.goods.biz.base.basegoodsunit.BaseGoodsUnit; +import com.yxt.goods.biz.base.basegoodsunit.BaseGoodsUnitService; +import com.yxt.goods.utils.PinYinUtils; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +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 org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseGoodsSpuService extends MybatisBaseService { + @Autowired + private FileUploadComponent fileUploadComponent; + @Autowired + BaseGoodsSpuDetailService baseGoodsSpuDetailService; + @Autowired + BaseGoodsSkuService baseGoodsSkuService; + @Autowired + BaseGoodsUnitService baseGoodsUnitService; + @Autowired + BaseGoodsSkuExtendService baseGoodsSkuExtendService; + + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpuQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if(StringUtils.isNotBlank(query.getName())){ + qw.like("goodsName",query.getName()); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.listPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + List records = pagging.getRecords(); + records.removeAll(Collections.singleton(null)); +// if (!records.isEmpty()) { +// for (BaseGoodsSpuVo record : records) { +// if (StringUtils.isNotBlank(record.getPicUrl())) { +// record.setPicUrl(fileUploadComponent.getUrlPrefix() + record.getPicUrl()); +// } +// } +// } + return rb.success().setData(p); + } + @Transactional + public ResultBean saveOrUpdate(BaseGoodsSpuDto dto) { + ResultBean rb = ResultBean.fireFail(); + String sid = ""; + BaseGoodsSpu spun= baseMapper.selectOne(new QueryWrapper().eq("sid",dto.getSid())); + BaseGoodsUnit baseGoodsUnit=baseGoodsUnitService.getOne(new QueryWrapper().eq("sid",dto.getGoodsUnitSid())); + if(null!=baseGoodsUnit){ + dto.setGoodsUnitName(baseGoodsUnit.getUnitName()); + } + + if (spun!=null) { + if(!spun.getSid().equals(dto.getSid())){ + return rb.setMsg("商品编码重复"); + } + sid = dto.getSid(); + BaseGoodsSpu wmsGoods = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setModifyTime(new Date()); + wmsGoods.setGoodsPY(PinYinUtils.getPinYinName(wmsGoods.getGoodsName()));; + baseMapper.updateById(wmsGoods); + //spu详情 + dto.getBaseGoodsSpuDetail().setGoodSpuSid(wmsGoods.getSid()); + baseGoodsSpuDetailService.saveOrUpdate(dto.getBaseGoodsSpuDetail()); + //商品sku + dto.getBaseGoodsSkus().forEach(s->{ + s.setGoodsSpuSid(wmsGoods.getSid()); + }); + baseGoodsSkuService.saveOrUpdate(dto.getBaseGoodsSkus()); + } else { + BaseGoodsSpu spu=baseMapper.selectOne(new QueryWrapper().eq("goodsCode",dto.getGoodsCode())); + if(spu!=null){ + return rb.setMsg("商品编码重复"); + } + BaseGoodsSpu wmsGoods = new BaseGoodsSpu(); + sid = wmsGoods.getSid(); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setCreateTime(new DateTime()); + baseMapper.insert(wmsGoods); + //spu详情 + dto.getBaseGoodsSpuDetail().setGoodSpuSid(wmsGoods.getSid()); + baseGoodsSpuDetailService.saveOrUpdate(dto.getBaseGoodsSpuDetail()); + //商品sku + dto.getBaseGoodsSkus().forEach(s->{ + s.setGoodsSpuSid(wmsGoods.getSid()); + }); + baseGoodsSkuService.saveOrUpdate(dto.getBaseGoodsSkus()); + } + return rb.success().setMsg("成功"); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpuVo vo = baseMapper.initialization(sid); + BaseGoodsSpuDetailVo vo1=baseGoodsSpuDetailService.getSpuDetailsBySpuSid(vo.getSid()).getData(); + vo.setBaseGoodsSpuDetail(vo1); + List vos=baseGoodsSkuService.getSkusBySpuSid(vo.getSid()).getData(); + for (BaseGoodsSkuVo baseGoodsSkuVo : vos) { + List ur=new ArrayList<>(); + BaseGoodsSkuExtendVo vo2=baseGoodsSkuExtendService.getExtendBySkuSid(baseGoodsSkuVo.getSid()).getData(); + if(StringUtils.isNotBlank(vo2.getPicUrl())){ + for (String url : vo2.getPicUrl().split(",")) { + url=fileUploadComponent.getUrlPrefix()+url; + UrlsVo vo3=new UrlsVo();vo3.setUrl(url); + ur.add(vo3); + } + } + vo2.setUrls(ur); + baseGoodsSkuVo.setBaseGoodsSkuExtend(vo2); + } + vo.setBaseGoodsSkus(vos); + return rb.success().setData(vo); + } + + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpu wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + baseMapper.deleteById(wmsGoods.getId()); + } + return rb.success(); + } + + public ResultBean updateIsEnable(String sid,String isEnable) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpu wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + wmsGoods.setIsEnable(Integer.parseInt(isEnable)); + baseMapper.updateById(wmsGoods); + } + return rb.success().setMsg("成功"); + } +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuVo.java b/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuVo.java new file mode 100644 index 0000000..be99e8c --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsspu/BaseGoodsSpuVo.java @@ -0,0 +1,51 @@ +package com.yxt.goods.biz.base.basegoodsspu; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.goods.biz.base.basegoodssku.BaseGoodsSkuVo; +import com.yxt.goods.biz.base.basegoodsspudetail.BaseGoodsSpuDetailVo; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSpuVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String goodsCode;//商品代码 + private String barCode;//条形码 + private String goodsName;//商品名称 + private String subTitle;//商品名称 + private String goodsPY;//拼音缩写 + private String goodsShortName;//商品简称 + private String goodsTypeSid;//商品分类sid + private String brandSid;//品牌sid + private String manufacturerSid;//厂家sid + private String goodsUnitSid;//商品单位sid + private String goodsUnitName;//商品单位名称 + private String taxRate;//税率 + private String shelfLife;//保质期天 + private String nationalStandardCode;//国标码 + private String sortNo;//排序 + private String externalCode;//外部编码 + private String factoryCode;//厂家货号 + private String isListed;//是否上架 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid + private BaseGoodsSpuDetailVo baseGoodsSpuDetail; + private List baseGoodsSkus; +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetail.java b/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetail.java new file mode 100644 index 0000000..51a15b0 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetail.java @@ -0,0 +1,20 @@ +package com.yxt.goods.biz.base.basegoodsspudetail; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseGoodsSpuDetail extends BaseEntity { + private String goodSpuSid;//商品基础信息Sid + private String goodsExplain;//商品详细说明 + private String goodsDescription;//商品描述 + @TableField(value = "generic_spec") + private String genericSpec;//通用规格参数及数据,json格式(规格参数id,规格参数值的键值对) + @TableField(value = "special_spec") + private String specialSpec;//特有规格参数及可选值信息,json格式(特有规格参数id,[可选参数值]) +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailDto.java b/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailDto.java new file mode 100644 index 0000000..be06414 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailDto.java @@ -0,0 +1,29 @@ +package com.yxt.goods.biz.base.basegoodsspudetail; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseGoodsSpuDetailDto implements Dto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String goodSpuSid;//商品基础信息Sid + private String goodsExplain;//商品详细说明 + private String goodsDescription;//商品描述 + @TableField(value = "generic_spec") + private String genericSpec;//通用规格参数及数据,json格式(规格参数id,规格参数值的键值对) + @TableField(value = "special_spec") + private String specialSpec;//特有规格参数及可选值信息,json格式(特有规格参数id,[可选参数值]) +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailMapper.java b/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailMapper.java new file mode 100644 index 0000000..12ce544 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailMapper.java @@ -0,0 +1,20 @@ +package com.yxt.goods.biz.base.basegoodsspudetail; + +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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseGoodsSpuDetailMapper extends BaseMapper { + + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + BaseGoodsSpuDetailVo getSpuDetailsBySpuSid (@Param("skuSid")String skuSid); +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailMapper.xml b/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailMapper.xml new file mode 100644 index 0000000..69b2042 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailQuery.java b/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailQuery.java new file mode 100644 index 0000000..5b3f188 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailQuery.java @@ -0,0 +1,13 @@ +package com.yxt.goods.biz.base.basegoodsspudetail; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSpuDetailQuery implements Query { + private String name; +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailService.java b/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailService.java new file mode 100644 index 0000000..8689e15 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailService.java @@ -0,0 +1,105 @@ +package com.yxt.goods.biz.base.basegoodsspudetail; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.goods.biz.base.basebrandinfo.BaseBrandInfoService; +import com.yxt.goods.biz.base.basegoodstype.BaseGoodsTypeService; +import com.yxt.goods.biz.base.basemanufacturer.BaseManufacturerService; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +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 org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseGoodsSpuDetailService extends MybatisBaseService { + @Autowired + private FileUploadComponent fileUploadComponent; + @Autowired + private BaseBrandInfoService baseBrandInfoService; + @Autowired + private BaseGoodsTypeService baseGoodsTypeService; + @Autowired + private BaseManufacturerService wmsManufacturerService; + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpuDetailQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if(StringUtils.isNotBlank(query.getName())){ + qw.like("goodsName",query.getName()); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.listPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return rb.success().setData(p); + } + + public ResultBean saveOrUpdate(BaseGoodsSpuDetailDto dto) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpuDetail detail=baseMapper.selectOne(new QueryWrapper().eq("sid",dto.getSid())); + String sid = ""; + if (null!=detail) { + sid = dto.getSid(); + BaseGoodsSpuDetail baseGoodsSpuDetail = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, baseGoodsSpuDetail); + baseGoodsSpuDetail.setModifyTime(new Date()); + baseMapper.updateById(baseGoodsSpuDetail); + } else { + + BaseGoodsSpuDetail baseGoodsSpuDetail = new BaseGoodsSpuDetail(); + sid = baseGoodsSpuDetail.getSid(); + BeanUtil.copyProperties(dto, baseGoodsSpuDetail); + baseGoodsSpuDetail.setCreateTime(new DateTime()); + + baseMapper.insert(baseGoodsSpuDetail); + } + return rb.success().setMsg("成功"); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpuDetailVo vo = new BaseGoodsSpuDetailVo(); + BaseGoodsSpuDetail wmsGoods = fetchBySid(sid); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + BeanUtil.copyProperties(wmsGoods, vo); + return rb.success().setData(vo); + } + public ResultBean getSpuDetailsBySpuSid(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpuDetailVo vo = baseMapper.getSpuDetailsBySpuSid(sid); + return rb.success().setData(vo); + } + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpuDetail wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + baseMapper.deleteById(wmsGoods.getId()); + } + return rb.success(); + } + + public ResultBean updateIsEnable(String sid,String isEnable) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsSpuDetail wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + wmsGoods.setIsEnable(Integer.parseInt(isEnable)); + baseMapper.updateById(wmsGoods); + } + return rb.success().setMsg("成功"); + } +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailVo.java b/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailVo.java new file mode 100644 index 0000000..4fc1419 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsspudetail/BaseGoodsSpuDetailVo.java @@ -0,0 +1,35 @@ +package com.yxt.goods.biz.base.basegoodsspudetail; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsSpuDetailVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String goodSpuSid;//商品基础信息Sid + private String goodsExplain;//商品详细说明 + private String goodsDescription;//商品描述 + @TableField(value = "generic_spec") + private String genericSpec;//通用规格参数及数据,json格式(规格参数id,规格参数值的键值对) + @TableField(value = "special_spec") + private String specialSpec;//特有规格参数及可选值信息,json格式(特有规格参数id,[可选参数值]) + private String goodsName; +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsType.java b/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsType.java new file mode 100644 index 0000000..301f73e --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsType.java @@ -0,0 +1,22 @@ +package com.yxt.goods.biz.base.basegoodstype; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseGoodsType extends BaseEntity { + private String goodsTypeName;//商品类别名称 + private String goodsTypeCode;//类别编码 + private String percentageRate;//提成比例 + private String percentageAmount;//提成金额 + private String pSid;//父级sid + private String isParent;//是否为父节点,0为否,1为是,0标识为叶子节点 + private String isGoodsID;//是否一品一码 0 否 1是 + private String sortNo;//排序 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeDto.java b/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeDto.java new file mode 100644 index 0000000..efcd862 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeDto.java @@ -0,0 +1,33 @@ +package com.yxt.goods.biz.base.basegoodstype; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseGoodsTypeDto implements Dto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String goodsTypeName;//商品类别名称 + private String goodsTypeCode;//类别编码 + private String percentageRate;//提成比例 + private String percentageAmount;//提成金额 + private String pSid;//父级sid + private String isParent;//是否为父节点,0为否,1为是,0标识为叶子节点 + private String isGoodsID;//是否一品一码 0 否 1是 + private String sortNo;//排序 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid + private String pName;//创建组织sid + private String sids;//父级sid +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeMapper.java b/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeMapper.java new file mode 100644 index 0000000..0e636cc --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeMapper.java @@ -0,0 +1,17 @@ +package com.yxt.goods.biz.base.basegoodstype; + +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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseGoodsTypeMapper extends BaseMapper { + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeMapper.xml b/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeMapper.xml new file mode 100644 index 0000000..8cf55d1 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeQuery.java b/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeQuery.java new file mode 100644 index 0000000..fa45143 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeQuery.java @@ -0,0 +1,13 @@ +package com.yxt.goods.biz.base.basegoodstype; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsTypeQuery implements Query { + private String name; +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeService.java b/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeService.java new file mode 100644 index 0000000..2ca0bb3 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeService.java @@ -0,0 +1,120 @@ +package com.yxt.goods.biz.base.basegoodstype; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +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 org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseGoodsTypeService extends MybatisBaseService { + + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsTypeQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if(StringUtils.isNotBlank(query.getName())){ + qw.like("goodsTypeName",query.getName()); + } + + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.listPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + List records = pagging.getRecords(); + for (BaseGoodsTypeVo record : records) { + if(StringUtils.isNotBlank(record.getPSid())){ + BaseGoodsType wmsGoodsType1 = fetchBySid(record.getPSid()); + record.setPName(wmsGoodsType1.getGoodsTypeName()); + record.setSids(record.getPSid()); + } + } + return rb.success().setData(p); + } public ResultBean> listAll() { + ResultBean rb = ResultBean.fireFail(); + List pagging = baseMapper.selectList(new QueryWrapper().eq("isEnable",1)); + return rb.success().setData(pagging); + } + + public ResultBean saveOrUpdate(BaseGoodsTypeDto dto) { + ResultBean rb = ResultBean.fireFail(); + String sid = ""; + dto.setPSid(dto.getSids()); + if (StringUtils.isNotBlank(dto.getSid())) { + sid = dto.getSid(); + BaseGoodsType wmsGoodsType = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoodsType, "id", "sid"); + wmsGoodsType.setModifyTime(new Date()); + wmsGoodsType.setIsParent("0"); + if(StringUtils.isBlank(wmsGoodsType.getPSid())){ + wmsGoodsType.setIsParent("1"); + } + baseMapper.updateById(wmsGoodsType); + } else { + BaseGoodsType wmsGoods = new BaseGoodsType(); + sid = wmsGoods.getSid(); + BeanUtil.copyProperties(dto, wmsGoods, "id", "sid"); + wmsGoods.setCreateTime(new DateTime()); + wmsGoods.setIsParent("0"); + if(StringUtils.isBlank(wmsGoods.getPSid())){ + wmsGoods.setIsParent("1"); + } + baseMapper.insert(wmsGoods); + } + return rb.success().setMsg("成功"); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsTypeVo vo = new BaseGoodsTypeVo(); + BaseGoodsType wmsGoodsType = fetchBySid(sid); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if (null != wmsGoodsType) { + BeanUtil.copyProperties(wmsGoodsType, vo); +// if (StringUtils.isNotBlank(wmsGoods.getPicUrl())) { +// vo.setPicUrl(fileUploadComponent.getUrlPrefix() + wmsGoods.getPicUrl()); +// } +// vo.setCreateTime(sdf.format(lpkGoods.getCreateTime())); + if(StringUtils.isNotBlank(wmsGoodsType.getPSid())){ + BaseGoodsType wmsGoodsType1 = fetchBySid(wmsGoodsType.getPSid()); + vo.setPName(wmsGoodsType1.getGoodsTypeName()); + } + vo.setSids(wmsGoodsType.getPSid()); + } + return rb.success().setData(vo); + } + + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsType wmsGoodsType = fetchBySid(sid); + if (null != wmsGoodsType) { + baseMapper.deleteById(wmsGoodsType.getId()); + } + return rb.success(); + } + public ResultBean updateIsEnable(String sid,String isEnable) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsType wmsGoodsType = fetchBySid(sid); + if (null != wmsGoodsType) { + wmsGoodsType.setIsEnable(Integer.parseInt(isEnable)); + baseMapper.updateById(wmsGoodsType); + } + return rb.success().setMsg("成功"); + } +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeVo.java b/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeVo.java new file mode 100644 index 0000000..08d9644 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodstype/BaseGoodsTypeVo.java @@ -0,0 +1,38 @@ +package com.yxt.goods.biz.base.basegoodstype; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsTypeVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String goodsTypeName;//商品类别名称 + private String goodsTypeCode;//类别编码 + private String percentageRate;//提成比例 + private String percentageAmount;//提成金额 + private String pSid;//父级sid + private String pName;//父级sid + private String isParent;//是否为父节点,0为否,1为是,0标识为叶子节点 + private String isGoodsID;//是否一品一码 0 否 1是 + private String sortNo;//排序 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid + private String sids;//创建组织sid +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnit.java b/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnit.java new file mode 100644 index 0000000..639239a --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnit.java @@ -0,0 +1,14 @@ +package com.yxt.goods.biz.base.basegoodsunit; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseGoodsUnit extends BaseEntity { + + private String unitName;//单位名称 +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitDto.java b/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitDto.java new file mode 100644 index 0000000..4cc71eb --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitDto.java @@ -0,0 +1,27 @@ +package com.yxt.goods.biz.base.basegoodsunit; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseGoodsUnitDto implements Dto { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String unitName;//单位名称 +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitMapper.java b/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitMapper.java new file mode 100644 index 0000000..737a308 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitMapper.java @@ -0,0 +1,17 @@ +package com.yxt.goods.biz.base.basegoodsunit; + +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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseGoodsUnitMapper extends BaseMapper { + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitMapper.xml b/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitMapper.xml new file mode 100644 index 0000000..09c8848 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitQuery.java b/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitQuery.java new file mode 100644 index 0000000..8db9151 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitQuery.java @@ -0,0 +1,13 @@ +package com.yxt.goods.biz.base.basegoodsunit; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsUnitQuery implements Query { + private String name; +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitService.java b/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitService.java new file mode 100644 index 0000000..f298d68 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitService.java @@ -0,0 +1,107 @@ +package com.yxt.goods.biz.base.basegoodsunit; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +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 org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseGoodsUnitService extends MybatisBaseService { + + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsUnitQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if(StringUtils.isNotBlank(query.getName())){ + qw.like("unitName",query.getName()); + } + + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.listPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + List records = pagging.getRecords(); + return rb.success().setData(p); + } public ResultBean> listAll() { + ResultBean rb = ResultBean.fireFail(); + List pagging = baseMapper.selectList(new QueryWrapper().eq("isEnable",1)); + return rb.success().setData(pagging); + } + + public ResultBean saveOrUpdate(BaseGoodsUnitDto dto) { + ResultBean rb = ResultBean.fireFail(); + String sid = ""; + if (StringUtils.isNotBlank(dto.getSid())) { + sid = dto.getSid(); + BaseGoodsUnit wmsGoodsType = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoodsType, "id", "sid"); + wmsGoodsType.setModifyTime(new Date()); + baseMapper.updateById(wmsGoodsType); + } else { + BaseGoodsUnit wmsGoods = new BaseGoodsUnit(); + sid = wmsGoods.getSid(); + BeanUtil.copyProperties(dto, wmsGoods, "id", "sid"); + wmsGoods.setCreateTime(new DateTime()); +// if (StringUtils.isNotBlank(dto.getPicUrl())) { +// String urlPrefix = fileUploadComponent.getUrlPrefix(); +// String path = dto.getPicUrl().substring(urlPrefix.length()); +// lpkGoods.setPicUrl(path); +// } + baseMapper.insert(wmsGoods); + } + return rb.success().setMsg("成功"); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsUnitVo vo = new BaseGoodsUnitVo(); + BaseGoodsUnit wmsGoodsType = fetchBySid(sid); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + BeanUtil.copyProperties(wmsGoodsType, vo); + if (null != wmsGoodsType) { +// BeanUtil.copyProperties(wmsGoodsType, vo); +// if (StringUtils.isNotBlank(wmsGoods.getPicUrl())) { +// vo.setPicUrl(fileUploadComponent.getUrlPrefix() + wmsGoods.getPicUrl()); +// } +// vo.setCreateTime(sdf.format(lpkGoods.getCreateTime())); +// BaseGoodsUnit wmsGoodsType1 = fetchBySid(wmsGoodsType.getPSid()); +// vo.setPName(wmsGoodsType1.getGoodsTypeName()); + } + return rb.success().setData(vo); + } + + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsUnit wmsGoodsType = fetchBySid(sid); + if (null != wmsGoodsType) { + baseMapper.deleteById(wmsGoodsType.getId()); + } + return rb.success(); + } + public ResultBean updateIsEnable(String sid,String isEnable) { + ResultBean rb = ResultBean.fireFail(); + BaseGoodsUnit wmsGoodsType = fetchBySid(sid); + if (null != wmsGoodsType) { + wmsGoodsType.setIsEnable(Integer.parseInt(isEnable)); + baseMapper.updateById(wmsGoodsType); + } + return rb.success().setMsg("成功"); + } +} diff --git a/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitVo.java b/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitVo.java new file mode 100644 index 0000000..bc062b8 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basegoodsunit/BaseGoodsUnitVo.java @@ -0,0 +1,27 @@ +package com.yxt.goods.biz.base.basegoodsunit; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseGoodsUnitVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String unitName;//单位名称 +} diff --git a/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturer.java b/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturer.java new file mode 100644 index 0000000..2eda4ee --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturer.java @@ -0,0 +1,20 @@ +package com.yxt.goods.biz.base.basemanufacturer; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:36 + */ +@Data +public class BaseManufacturer extends BaseEntity { + private String manufacturerName;//厂家名称 + private String manufacturerCode;//厂家编码 + private String address;//地址 + private String telephone;//电话 + private String contacts;//联系人 + private String sortNo;//排序 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid +} diff --git a/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerDto.java b/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerDto.java new file mode 100644 index 0000000..97c6608 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerDto.java @@ -0,0 +1,35 @@ +package com.yxt.goods.biz.base.basemanufacturer; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:38 + */ +@Data +public class BaseManufacturerDto implements Dto { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + + private String manufacturerName;//厂家名称 + private String manufacturerCode;//厂家编码 + private String address;//地址 + private String telephone;//电话 + private String contacts;//联系人 + private String sortNo;//排序 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid +} diff --git a/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerMapper.java b/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerMapper.java new file mode 100644 index 0000000..fd27fab --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerMapper.java @@ -0,0 +1,21 @@ +package com.yxt.goods.biz.base.basemanufacturer; + +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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseManufacturerMapper extends BaseMapper { + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + + List getAllTypeByUseOrgSid(@Param("useOrgSid") String useOrgSid); +} diff --git a/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerMapper.xml b/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerMapper.xml new file mode 100644 index 0000000..d5ea849 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerQuery.java b/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerQuery.java new file mode 100644 index 0000000..91a686d --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerQuery.java @@ -0,0 +1,13 @@ +package com.yxt.goods.biz.base.basemanufacturer; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseManufacturerQuery implements Query { + private String name; +} diff --git a/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerService.java b/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerService.java new file mode 100644 index 0000000..e05fa4c --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerService.java @@ -0,0 +1,111 @@ +package com.yxt.goods.biz.base.basemanufacturer; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +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 org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseManufacturerService extends MybatisBaseService { + + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseManufacturerQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if(StringUtils.isNotBlank(query.getName())){ + qw.like("goodsTypeName",query.getName()); + } + + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.listPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + List records = pagging.getRecords(); + return rb.success().setData(p); + } + public ResultBean> listAll() { + ResultBean rb = ResultBean.fireFail(); + List pagging = baseMapper.selectList(new QueryWrapper().eq("isEnable",1)); + return rb.success().setData(pagging); + } + + public ResultBean saveOrUpdate(BaseManufacturerDto dto) { + ResultBean rb = ResultBean.fireFail(); + String sid = ""; + if (StringUtils.isNotBlank(dto.getSid())) { + sid = dto.getSid(); + BaseManufacturer wmsManufacturer = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsManufacturer, "id", "sid"); + wmsManufacturer.setModifyTime(new Date()); + baseMapper.updateById(wmsManufacturer); + } else { + BaseManufacturer wmsManufacturer = new BaseManufacturer(); + sid = wmsManufacturer.getSid(); + BeanUtil.copyProperties(dto, wmsManufacturer, "id", "sid"); + wmsManufacturer.setCreateTime(new DateTime()); +// if (StringUtils.isNotBlank(dto.getPicUrl())) { +// String urlPrefix = fileUploadComponent.getUrlPrefix(); +// String path = dto.getPicUrl().substring(urlPrefix.length()); +// lpkGoods.setPicUrl(path); +// } + baseMapper.insert(wmsManufacturer); + } + return rb.success().setMsg("成功"); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseManufacturerVo vo = new BaseManufacturerVo(); + BaseManufacturer wmsManufacturer = fetchBySid(sid); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if (null != wmsManufacturer) { + BeanUtil.copyProperties(wmsManufacturer, vo); +// if (StringUtils.isNotBlank(wmsGoods.getPicUrl())) { +// vo.setPicUrl(fileUploadComponent.getUrlPrefix() + wmsGoods.getPicUrl()); +// } +// vo.setCreateTime(sdf.format(lpkGoods.getCreateTime())); + } + return rb.success().setData(vo); + } + + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseManufacturer wmsManufacturer = fetchBySid(sid); + if (null != wmsManufacturer) { + baseMapper.deleteById(wmsManufacturer.getId()); + } + return rb.success(); + } + public ResultBean updateIsEnable(String sid,String isEnable) { + ResultBean rb = ResultBean.fireFail(); + BaseManufacturer wmsManufacturer = fetchBySid(sid); + if (null != wmsManufacturer) { + wmsManufacturer.setIsEnable(Integer.parseInt(isEnable)); + baseMapper.updateById(wmsManufacturer); + } + return rb.success().setMsg("成功"); + } + + public ResultBean> getAllTypeByUseOrgSid(String useOrgSid) { + ResultBean rb = ResultBean.fireFail(); + List list = baseMapper.getAllTypeByUseOrgSid(useOrgSid); + return rb.success().setData(list); + } +} diff --git a/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerVo.java b/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerVo.java new file mode 100644 index 0000000..d1428dd --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basemanufacturer/BaseManufacturerVo.java @@ -0,0 +1,36 @@ +package com.yxt.goods.biz.base.basemanufacturer; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/2/26 13:37 + */ +@Data +public class BaseManufacturerVo implements Vo { + private String id; + private String sid; + private String lockVersion; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date modifyTime; + private String remarks; + private String isEnable; + private String state; + private String isDelete; + private String createBySid; + private String updateBySid; + private String manufacturerName;//厂家名称 + private String manufacturerCode;//厂家编码 + private String address;//地址 + private String telephone;//电话 + private String contacts;//联系人 + private String sortNo;//排序 + private String useOrgSid;//使用组织sid + private String createOrgSid;//创建组织sid +} diff --git a/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroup.java b/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroup.java new file mode 100644 index 0000000..e39d87a --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroup.java @@ -0,0 +1,15 @@ +package com.yxt.goods.biz.base.basespecgroup; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/4/8 9:34 + */ +@Data +public class BaseSpecGroup extends BaseEntity { + private String categorySid;//商品分类sid + private String groupName;//组名 + +} diff --git a/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupDto.java b/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupDto.java new file mode 100644 index 0000000..8bbb9ad --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupDto.java @@ -0,0 +1,22 @@ +package com.yxt.goods.biz.base.basespecgroup; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/4/8 9:34 + */ +@Data +public class BaseSpecGroupDto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String categorySid;//商品分类sid + private String groupName;//组名 +} diff --git a/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupMapper.java b/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupMapper.java new file mode 100644 index 0000000..ad166e6 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupMapper.java @@ -0,0 +1,23 @@ +package com.yxt.goods.biz.base.basespecgroup; + +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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseSpecGroupMapper extends BaseMapper { + + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + List getSkusBySpuSid(@Param("spuSid")String spuSid); + BaseSpecGroupVo getVoBySid(@Param("sid")String sid); + +} diff --git a/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupMapper.xml b/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupMapper.xml new file mode 100644 index 0000000..9077f7b --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupMapper.xml @@ -0,0 +1,27 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupQuery.java b/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupQuery.java new file mode 100644 index 0000000..39c0bb1 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupQuery.java @@ -0,0 +1,13 @@ +package com.yxt.goods.biz.base.basespecgroup; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/4/8 9:34 + */ +@Data +public class BaseSpecGroupQuery implements Query { + private String name; +} diff --git a/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupService.java b/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupService.java new file mode 100644 index 0000000..3e9a0d1 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupService.java @@ -0,0 +1,115 @@ +package com.yxt.goods.biz.base.basespecgroup; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +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 org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseSpecGroupService extends MybatisBaseService { + @Autowired + private FileUploadComponent fileUploadComponent; + + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseSpecGroupQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotBlank(query.getName())) { + qw.like("goodsName", query.getName()); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.listPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return rb.success().setData(p); + } + @Transactional + public ResultBean saveOrUpdate(BaseSpecGroupDto dto) { + ResultBean rb = ResultBean.fireFail(); + String sid = ""; + if (StringUtils.isNotBlank(dto.getSid())) { + sid = dto.getSid(); + BaseSpecGroup wmsGoods = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoods, "id", "sid"); + wmsGoods.setModifyTime(new Date()); + baseMapper.updateById(wmsGoods); + } else { + BaseSpecGroup wmsGoods = new BaseSpecGroup(); + BeanUtil.copyProperties(dto, wmsGoods, "id", "sid"); + wmsGoods.setCreateTime(new DateTime()); + baseMapper.insert(wmsGoods); + } + return rb.success().setMsg("成功"); + } + @Transactional + public ResultBean saveOrUpdate(List dtos) { + ResultBean rb = ResultBean.fireFail(); + for (BaseSpecGroupDto dto : dtos) { + BaseSpecGroup sku=baseMapper.selectOne(new QueryWrapper().eq("sid",dto.getSid())); + String sid = ""; + if (null!=sku) { + sid = dto.getSid(); + BaseSpecGroup wmsGoods = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setModifyTime(new Date()); + baseMapper.updateById(wmsGoods); + } else { + BaseSpecGroup wmsGoods = new BaseSpecGroup(); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setCreateTime(new DateTime()); + baseMapper.insert(wmsGoods); + } + } + + return rb.success().setMsg("成功"); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseSpecGroupVo vo = baseMapper.getVoBySid(sid); + return rb.success().setData(vo); + } + + public ResultBean> getSkusBySpuSid(String sid) { + ResultBean rb = ResultBean.fireFail(); + List vo = baseMapper.getSkusBySpuSid(sid); + return rb.success().setData(vo); + } + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseSpecGroup wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + baseMapper.deleteById(wmsGoods.getId()); + } + return rb.success(); + } + + public ResultBean updateIsEnable(String sid, String isEnable) { + ResultBean rb = ResultBean.fireFail(); + BaseSpecGroup wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + wmsGoods.setIsEnable(Integer.parseInt(isEnable)); + baseMapper.updateById(wmsGoods); + } + return rb.success().setMsg("成功"); + } +} diff --git a/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupVo.java b/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupVo.java new file mode 100644 index 0000000..6cac4c5 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basespecgroup/BaseSpecGroupVo.java @@ -0,0 +1,23 @@ +package com.yxt.goods.biz.base.basespecgroup; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/4/8 9:34 + */ +@Data +public class BaseSpecGroupVo { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String categorySid;//商品分类sid + private String categoryName;//商品分类名 + private String groupName;//组名 +} diff --git a/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParam.java b/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParam.java new file mode 100644 index 0000000..fd1174e --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParam.java @@ -0,0 +1,22 @@ +package com.yxt.goods.biz.base.basespecparam; + +import com.yxt.common.core.domain.BaseEntity; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/4/8 9:34 + */ +@Data +public class BaseSpecParam extends BaseEntity { + private String categorySid;//商品分类sid + private String groupSid;//参数组sid + private String paramName;//参数名 + private String numeric;//是否数字类型 1 true 2false + private String unit;//数字类型的单位 非数字行可为空 + private String generic;//是否sku通用属性1true 2 false + private String searching;//是否用于搜索过滤 1true 2 false + private String segments;//数值类型参数,如果需要搜索。则添加分段间隔值 + + +} diff --git a/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamDto.java b/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamDto.java new file mode 100644 index 0000000..1191592 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamDto.java @@ -0,0 +1,28 @@ +package com.yxt.goods.biz.base.basespecparam; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/4/8 9:34 + */ +@Data +public class BaseSpecParamDto { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String categorySid;//商品分类sid + private String groupSid;//参数组sid + private String paramName;//参数名 + private String numeric;//是否数字类型 1 true 2false + private String unit;//数字类型的单位 非数字行可为空 + private String generic;//是否sku通用属性1true 2 false + private String searching;//是否用于搜索过滤 1true 2 false + private String segments;//数值类型参数,如果需要搜索。则添加分段间隔值 +} diff --git a/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamMapper.java b/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamMapper.java new file mode 100644 index 0000000..ef91b64 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamMapper.java @@ -0,0 +1,23 @@ +package com.yxt.goods.biz.base.basespecparam; + +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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Mapper +public interface BaseSpecParamMapper extends BaseMapper { + + IPage listPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw); + List getSkusBySpuSid(@Param("spuSid")String spuSid); + BaseSpecParamVo getVoBySid(@Param("sid")String sid); + +} diff --git a/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamMapper.xml b/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamMapper.xml new file mode 100644 index 0000000..a9b51e8 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamMapper.xml @@ -0,0 +1,29 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamQuery.java b/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamQuery.java new file mode 100644 index 0000000..74f753a --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamQuery.java @@ -0,0 +1,13 @@ +package com.yxt.goods.biz.base.basespecparam; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2024/4/8 9:34 + */ +@Data +public class BaseSpecParamQuery implements Query { + private String name; +} diff --git a/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamService.java b/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamService.java new file mode 100644 index 0000000..da1b926 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamService.java @@ -0,0 +1,117 @@ +package com.yxt.goods.biz.base.basespecparam; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +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 org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2024/2/26 13:40 + */ +@Service +public class BaseSpecParamService extends MybatisBaseService { + @Autowired + private FileUploadComponent fileUploadComponent; + + + public ResultBean> listPage(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + BaseSpecParamQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotBlank(query.getName())) { + qw.like("goodsName", query.getName()); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.listPage(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return rb.success().setData(p); + } + @Transactional + public ResultBean saveOrUpdate(BaseSpecParamDto dto) { + ResultBean rb = ResultBean.fireFail(); + String sid = ""; + if (StringUtils.isNotBlank(dto.getSid())) { + sid = dto.getSid(); + BaseSpecParam wmsGoods = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setModifyTime(new Date()); + baseMapper.updateById(wmsGoods); + } else { + BaseSpecParam wmsGoods = new BaseSpecParam(); + BeanUtil.copyProperties(dto, wmsGoods, "id", "sid"); + wmsGoods.setCreateTime(new DateTime()); + baseMapper.insert(wmsGoods); + } + return rb.success().setMsg("成功"); + } + + + @Transactional + public ResultBean saveOrUpdate(List dtos) { + ResultBean rb = ResultBean.fireFail(); + for (BaseSpecParamDto dto : dtos) { + BaseSpecParam sku=baseMapper.selectOne(new QueryWrapper().eq("sid",dto.getSid())); + String sid = ""; + if (null!=sku) { + sid = dto.getSid(); + BaseSpecParam wmsGoods = fetchBySid(dto.getSid()); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setModifyTime(new Date()); + baseMapper.updateById(wmsGoods); + } else { + BaseSpecParam wmsGoods = new BaseSpecParam(); + BeanUtil.copyProperties(dto, wmsGoods); + wmsGoods.setCreateTime(new DateTime()); + baseMapper.insert(wmsGoods); + } + } + + return rb.success().setMsg("成功"); + } + + public ResultBean initialization(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseSpecParamVo vo = baseMapper.getVoBySid(sid); + return rb.success().setData(vo); + } + + public ResultBean> getSkusBySpuSid(String sid) { + ResultBean rb = ResultBean.fireFail(); + List vo = baseMapper.getSkusBySpuSid(sid); + return rb.success().setData(vo); + } + + + public ResultBean delete(String sid) { + ResultBean rb = ResultBean.fireFail(); + BaseSpecParam wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + baseMapper.deleteById(wmsGoods.getId()); + } + return rb.success(); + } + + public ResultBean updateIsEnable(String sid, String isEnable) { + ResultBean rb = ResultBean.fireFail(); + BaseSpecParam wmsGoods = fetchBySid(sid); + if (null != wmsGoods) { + wmsGoods.setIsEnable(Integer.parseInt(isEnable)); + baseMapper.updateById(wmsGoods); + } + return rb.success().setMsg("成功"); + } +} diff --git a/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamVo.java b/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamVo.java new file mode 100644 index 0000000..4d0acc4 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basespecparam/BaseSpecParamVo.java @@ -0,0 +1,30 @@ +package com.yxt.goods.biz.base.basespecparam; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @author wangpengfei + * @date 2024/4/8 9:34 + */ +@Data +public class BaseSpecParamVo { + private String id; + private String sid; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String remarks; + private String isEnable; + private String categorySid;//商品分类sid + private String groupSid;//参数组sid + private String paramName;//参数名 + private String numeric;//是否数字类型 1 true 2false + private String unit;//数字类型的单位 非数字行可为空 + private String generic;//是否sku通用属性1true 2 false + private String searching;//是否用于搜索过滤 1true 2 false + private String segments;//数值类型参数,如果需要搜索。则添加分段间隔值 + private String groupName;//参数组名 + private String categoryName;//分类名 +} diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBank.java b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBank.java new file mode 100644 index 0000000..041d855 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBank.java @@ -0,0 +1,76 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierBank; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierBank.java
+ * Class: com.yxt.base.api.basesupplierbank.BaseSupplierBank
+ * Description: 供应商开户行信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商开户行信息", description = "供应商开户行信息") +@TableName("base_supplier_bank") +public class BaseSupplierBank extends BaseEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("供应商sid") + private String supplierSid; // 供应商sid + @ApiModelProperty("开户行") + private String bankName; // 开户行 + @ApiModelProperty("开户行帐号") + private String bankAccount; // 开户行帐号 + @ApiModelProperty("账户名称") + private String accountName; // 账户名称 + @ApiModelProperty("账户类型key") + private String dueBankKey; // 账户类型key + @ApiModelProperty("账户类型value") + private String dueBankValue; // 账户类型value + @ApiModelProperty("银行网点") + private String bankingOutlets; // 银行网点 + @ApiModelProperty("开户行地址") + private String bankAddress; // 开户行地址 + @ApiModelProperty("联行号") + private String paymentLines; // 联行号 + @ApiModelProperty("银行代码") + private String swiftCode; // 银行代码 + @ApiModelProperty("币种") + private String currency; // 币种 + +} diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankDetailsVo.java b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankDetailsVo.java new file mode 100644 index 0000000..3141dad --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankDetailsVo.java @@ -0,0 +1,76 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierBank; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierBankVo.java
+ * Class: com.yxt.base.api.basesupplierbank.BaseSupplierBankVo
+ * Description: 供应商开户行信息 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商开户行信息 视图数据详情", description = "供应商开户行信息 视图数据详情") +public class BaseSupplierBankDetailsVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("供应商sid") + private String supplierSid; // 供应商sid + @ApiModelProperty("开户行") + private String bankName; // 开户行 + @ApiModelProperty("开户行帐号") + private String bankAccount; // 开户行帐号 + @ApiModelProperty("账户名称") + private String accountName; // 账户名称 + @ApiModelProperty("账户类型key") + private String dueBankKey; // 账户类型key + @ApiModelProperty("账户类型value") + private String dueBankValue; // 账户类型value + @ApiModelProperty("银行网点") + private String bankingOutlets; // 银行网点 + @ApiModelProperty("开户行地址") + private String bankAddress; // 开户行地址 + @ApiModelProperty("联行号") + private String paymentLines; // 联行号 + @ApiModelProperty("银行代码") + private String swiftCode; // 银行代码 + @ApiModelProperty("币种") + private String currency; // 币种 + +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankDto.java b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankDto.java new file mode 100644 index 0000000..eb321cc --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankDto.java @@ -0,0 +1,76 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierBank; + + +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierBankDto.java
+ * Class: com.yxt.base.api.basesupplierbank.BaseSupplierBankDto
+ * Description: 供应商开户行信息 数据传输对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商开户行信息 数据传输对象", description = "供应商开户行信息 数据传输对象") +public class BaseSupplierBankDto implements Dto { + + private String sid; // sid + + @ApiModelProperty("供应商sid") + private String supplierSid; // 供应商sid + @ApiModelProperty("开户行") + private String bankName; // 开户行 + @ApiModelProperty("开户行帐号") + private String bankAccount; // 开户行帐号 + @ApiModelProperty("账户名称") + private String accountName; // 账户名称 + @ApiModelProperty("账户类型key") + private String dueBankKey; // 账户类型key + @ApiModelProperty("账户类型value") + private String dueBankValue; // 账户类型value + @ApiModelProperty("银行网点") + private String bankingOutlets; // 银行网点 + @ApiModelProperty("开户行地址") + private String bankAddress; // 开户行地址 + @ApiModelProperty("联行号") + private String paymentLines; // 联行号 + @ApiModelProperty("银行代码") + private String swiftCode; // 银行代码 + @ApiModelProperty("币种") + private String currency; // 币种 + +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankMapper.java b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankMapper.java new file mode 100644 index 0000000..92dd389 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankMapper.java @@ -0,0 +1,67 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierBank; + +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 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-base(供应商管理)
+ * File: BaseSupplierBankMapper.java
+ * Class: com.yxt.base.biz.basesupplierbank.BaseSupplierBankMapper
+ * Description: 供应商开户行信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface BaseSupplierBankMapper extends BaseMapper { + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from base_supplier_bank") + List selectListVo(); + + @Delete("delete from base_supplier_bank where supplierSid = #{supplierSid}") + int deleteBySupplierSid(String supplierSid); + + @Select("select * from base_supplier_bank where supplierSid = #{supplierSid}") + List selectBySupplierSid(String supplierSid); +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankMapper.xml b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankMapper.xml new file mode 100644 index 0000000..cf4cbab --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankQuery.java b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankQuery.java new file mode 100644 index 0000000..49ab190 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankQuery.java @@ -0,0 +1,74 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierBank; + + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierBankQuery.java
+ * Class: com.yxt.base.api.basesupplierbank.BaseSupplierBankQuery
+ * Description: 供应商开户行信息 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商开户行信息 查询条件", description = "供应商开户行信息 查询条件") +public class BaseSupplierBankQuery implements Query { + + @ApiModelProperty("供应商sid") + private String supplierSid; // 供应商sid + @ApiModelProperty("开户行") + private String bankName; // 开户行 + @ApiModelProperty("开户行帐号") + private String bankAccount; // 开户行帐号 + @ApiModelProperty("账户名称") + private String accountName; // 账户名称 + @ApiModelProperty("账户类型key") + private String dueBankKey; // 账户类型key + @ApiModelProperty("账户类型value") + private String dueBankValue; // 账户类型value + @ApiModelProperty("银行网点") + private String bankingOutlets; // 银行网点 + @ApiModelProperty("开户行地址") + private String bankAddress; // 开户行地址 + @ApiModelProperty("联行号") + private String paymentLines; // 联行号 + @ApiModelProperty("银行代码") + private String swiftCode; // 银行代码 + @ApiModelProperty("币种") + private String currency; // 币种 + +} diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankService.java b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankService.java new file mode 100644 index 0000000..b94c87a --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankService.java @@ -0,0 +1,104 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierBank; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +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; + +import java.util.List; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierBankService.java
+ * Class: com.yxt.base.biz.basesupplierbank.BaseSupplierBankService
+ * Description: 供应商开户行信息 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class BaseSupplierBankService extends MybatisBaseService { + + public PagerVo listPageVo(PagerQuery pq) { + BaseSupplierBankQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void saveOrUpdateDto(BaseSupplierBankDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(BaseSupplierBankDto dto){ + BaseSupplierBank entity = new BaseSupplierBank(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + } + + public void updateByDto(BaseSupplierBankDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + BaseSupplierBank entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public BaseSupplierBankDetailsVo fetchDetailsVoBySid(String sid){ + BaseSupplierBank entity = fetchBySid(sid); + BaseSupplierBankDetailsVo vo = new BaseSupplierBankDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } + + public int deleteBySupplierSid(String supplierSid) { + return baseMapper.deleteBySupplierSid(supplierSid); + } + + public List selectBySupplierSid(String supplierSid) { + return baseMapper.selectBySupplierSid(supplierSid); + } +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankVo.java b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankVo.java new file mode 100644 index 0000000..c7f4a6b --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierBank/BaseSupplierBankVo.java @@ -0,0 +1,76 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierBank; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierBankVo.java
+ * Class: com.yxt.base.api.basesupplierbank.BaseSupplierBankVo
+ * Description: 供应商开户行信息 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商开户行信息 视图数据对象", description = "供应商开户行信息 视图数据对象") +public class BaseSupplierBankVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("供应商sid") + private String supplierSid; // 供应商sid + @ApiModelProperty("开户行") + private String bankName; // 开户行 + @ApiModelProperty("开户行帐号") + private String bankAccount; // 开户行帐号 + @ApiModelProperty("账户名称") + private String accountName; // 账户名称 + @ApiModelProperty("账户类型key") + private String dueBankKey; // 账户类型key + @ApiModelProperty("账户类型value") + private String dueBankValue; // 账户类型value + @ApiModelProperty("银行网点") + private String bankingOutlets; // 银行网点 + @ApiModelProperty("开户行地址") + private String bankAddress; // 开户行地址 + @ApiModelProperty("联行号") + private String paymentLines; // 联行号 + @ApiModelProperty("银行代码") + private String swiftCode; // 银行代码 + @ApiModelProperty("币种") + private String currency; // 币种 + +} diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFile.java b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFile.java new file mode 100644 index 0000000..2de0646 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFile.java @@ -0,0 +1,66 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierfile; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierFile.java
+ * Class: com.yxt.anrui.as.api.basesupplierfile.BaseSupplierFile
+ * Description: 供应商附件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商附件", description = "供应商附件") +@TableName("base_supplier_file") +public class BaseSupplierFile extends BaseEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("文件名") + private String fileName; // 文件名 + @ApiModelProperty("文件类型") + private String fileType; // 文件类型 + @ApiModelProperty("关联业务对象sid") + private String linkSid; // 关联业务对象sid + @ApiModelProperty("附件类型") + private String attachType; // 附件类型 + @ApiModelProperty("文件大小") + private String fileSize; // 文件大小 + @ApiModelProperty("文件的路径") + private String filePath; // 文件的路径 + +} diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileDetailsVo.java b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileDetailsVo.java new file mode 100644 index 0000000..06b33ab --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileDetailsVo.java @@ -0,0 +1,66 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierfile; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierFileVo.java
+ * Class: com.yxt.anrui.as.api.basesupplierfile.BaseSupplierFileVo
+ * Description: 供应商附件 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商附件 视图数据详情", description = "供应商附件 视图数据详情") +public class BaseSupplierFileDetailsVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("文件名") + private String fileName; // 文件名 + @ApiModelProperty("文件类型") + private String fileType; // 文件类型 + @ApiModelProperty("关联业务对象sid") + private String linkSid; // 关联业务对象sid + @ApiModelProperty("附件类型") + private String attachType; // 附件类型 + @ApiModelProperty("文件大小") + private String fileSize; // 文件大小 + @ApiModelProperty("文件的路径") + private String filePath; // 文件的路径 + +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileDto.java b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileDto.java new file mode 100644 index 0000000..0e4926c --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileDto.java @@ -0,0 +1,66 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierfile; + + +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierFileDto.java
+ * Class: com.yxt.anrui.as.api.basesupplierfile.BaseSupplierFileDto
+ * Description: 供应商附件 数据传输对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商附件 数据传输对象", description = "供应商附件 数据传输对象") +public class BaseSupplierFileDto implements Dto { + + private String sid; // sid + + @ApiModelProperty("文件名") + private String fileName; // 文件名 + @ApiModelProperty("文件类型") + private String fileType; // 文件类型 + @ApiModelProperty("关联业务对象sid") + private String linkSid; // 关联业务对象sid + @ApiModelProperty("附件类型") + private String attachType; // 附件类型 + @ApiModelProperty("文件大小") + private String fileSize; // 文件大小 + @ApiModelProperty("文件的路径") + private String filePath; // 文件的路径 + +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileMapper.java b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileMapper.java new file mode 100644 index 0000000..d707216 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileMapper.java @@ -0,0 +1,60 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierfile; + +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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierFileMapper.java
+ * Class: com.yxt.anrui.as.biz.basesupplierfile.BaseSupplierFileMapper
+ * Description: 供应商附件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface BaseSupplierFileMapper extends BaseMapper { + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from base_supplier_file") + List selectListVo(); +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileMapper.xml b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileMapper.xml new file mode 100644 index 0000000..832de50 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileQuery.java b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileQuery.java new file mode 100644 index 0000000..b53b30e --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileQuery.java @@ -0,0 +1,64 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierfile; + + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierFileQuery.java
+ * Class: com.yxt.anrui.as.api.basesupplierfile.BaseSupplierFileQuery
+ * Description: 供应商附件 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商附件 查询条件", description = "供应商附件 查询条件") +public class BaseSupplierFileQuery implements Query { + + @ApiModelProperty("文件名") + private String fileName; // 文件名 + @ApiModelProperty("文件类型") + private String fileType; // 文件类型 + @ApiModelProperty("关联业务对象sid") + private String linkSid; // 关联业务对象sid + @ApiModelProperty("附件类型") + private String attachType; // 附件类型 + @ApiModelProperty("文件大小") + private String fileSize; // 文件大小 + @ApiModelProperty("文件的路径") + private String filePath; // 文件的路径 + +} diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileService.java b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileService.java new file mode 100644 index 0000000..9dd7826 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileService.java @@ -0,0 +1,94 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierfile; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +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-base(仓储基础信息供应商)
+ * File: BaseSupplierFileService.java
+ * Class: com.yxt.anrui.as.biz.basesupplierfile.BaseSupplierFileService
+ * Description: 供应商附件 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class BaseSupplierFileService extends MybatisBaseService { + + public PagerVo listPageVo(PagerQuery pq) { + BaseSupplierFileQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void saveOrUpdateDto(BaseSupplierFileDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(BaseSupplierFileDto dto){ + BaseSupplierFile entity = new BaseSupplierFile(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + } + + public void updateByDto(BaseSupplierFileDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + BaseSupplierFile entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public BaseSupplierFileDetailsVo fetchDetailsVoBySid(String sid){ + BaseSupplierFile entity = fetchBySid(sid); + BaseSupplierFileDetailsVo vo = new BaseSupplierFileDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileVo.java b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileVo.java new file mode 100644 index 0000000..f65497a --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierfile/BaseSupplierFileVo.java @@ -0,0 +1,66 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierfile; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierFileVo.java
+ * Class: com.yxt.anrui.as.api.basesupplierfile.BaseSupplierFileVo
+ * Description: 供应商附件 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商附件 视图数据对象", description = "供应商附件 视图数据对象") +public class BaseSupplierFileVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("文件名") + private String fileName; // 文件名 + @ApiModelProperty("文件类型") + private String fileType; // 文件类型 + @ApiModelProperty("关联业务对象sid") + private String linkSid; // 关联业务对象sid + @ApiModelProperty("附件类型") + private String attachType; // 附件类型 + @ApiModelProperty("文件大小") + private String fileSize; // 文件大小 + @ApiModelProperty("文件的路径") + private String filePath; // 文件的路径 + +} diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfo.java b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfo.java new file mode 100644 index 0000000..4710296 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfo.java @@ -0,0 +1,112 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierinfo; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierInfo.java
+ * Class: com.yxt.base.api.basesupplierinfo.BaseSupplierInfo
+ * Description: 供应商信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商信息", description = "供应商信息") +@TableName("base_supplier_info") +public class BaseSupplierInfo extends BaseEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("编码") + private String supplierCode; // 编码 + @ApiModelProperty("供应商名称") + private String supplierName; // 供应商名称 + @ApiModelProperty("供应商名称拼音") + private String supplierPY; // 供应商名称拼音 + @ApiModelProperty("供应商类型sid") + private String supplierTypeSid; // 供应商类型sid + @ApiModelProperty("供应商类型") + private String supplierTypeName; // 供应商类型 + @ApiModelProperty("省sid") + private String provinceSid; // 省sid + @ApiModelProperty("province") + private String province; // + @ApiModelProperty("市sid") + private String citySid; // 市sid + @ApiModelProperty("city") + private String city; // + @ApiModelProperty("收货县区sid") + private String countySid; // 收货县区sid + @ApiModelProperty("county") + private String county; // + @ApiModelProperty("详细地址") + private String address; // 详细地址 + @ApiModelProperty("手机") + private String contactMobile; // 手机 + @ApiModelProperty("电话") + private String contactTelePhone; // 电话 + @ApiModelProperty("联系人") + private String contactName; // 联系人 + @ApiModelProperty("传真") + private String fax; // 传真 + @ApiModelProperty("邮编") + private String zipCode; // 邮编 + @ApiModelProperty("电子邮件") + private String email; // 电子邮件 + @ApiModelProperty("网址") + private String website; // 网址 + @ApiModelProperty("开票公司名称") + private String billingCompanyName; // 开票公司名称 + @ApiModelProperty("税号") + private String registNum; // 税号 + @ApiModelProperty("法人") + private String legalName; // 法人 + @ApiModelProperty("采购员") + private String purchaser; // 采购员 + @ApiModelProperty("排序") + private Integer sortNo; // 排序 + @ApiModelProperty("开票类型key") + private String billingTypeKey; // 开票类型key + @ApiModelProperty("开票类型value") + private String billingTypeValue; // 开票类型value + @ApiModelProperty("使用组织sid") + private String useOrgSid; // 使用组织sid + @ApiModelProperty("创建组织名称") + private String createOrgName; // 创建组织名称 + @ApiModelProperty("创建组织sid") + private String createOrgSid; // 创建组织sid + +} diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoChoice.java b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoChoice.java new file mode 100644 index 0000000..eab7096 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoChoice.java @@ -0,0 +1,54 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierinfo; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierInfoVo.java
+ * Class: com.yxt.base.api.basesupplierinfo.BaseSupplierInfoVo
+ * Description: 供应商信息 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商信息 视图数据对象", description = "供应商信息 视图数据对象") +public class BaseSupplierInfoChoice implements Vo { + + private String sid; + @ApiModelProperty("供应商名称") + private String supplierName; +} diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoDetailsVo.java b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoDetailsVo.java new file mode 100644 index 0000000..006ecaf --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoDetailsVo.java @@ -0,0 +1,116 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierinfo; + + +import com.yxt.goods.biz.base.basesupplierBank.BaseSupplierBankDetailsVo; +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierInfoVo.java
+ * Class: com.yxt.base.api.basesupplierinfo.BaseSupplierInfoVo
+ * Description: 供应商信息 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商信息 视图数据详情", description = "供应商信息 视图数据详情") +public class BaseSupplierInfoDetailsVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("编码") + private String supplierCode; // 编码 + @ApiModelProperty("供应商名称") + private String supplierName; // 供应商名称 + @ApiModelProperty("供应商名称拼音") + private String supplierPY; // 供应商名称拼音 + @ApiModelProperty("供应商类型sid") + private String supplierTypeSid; // 供应商类型sid + @ApiModelProperty("供应商类型") + private String supplierTypeName; // 供应商类型 + @ApiModelProperty("省sid") + private String provinceSid; // 省sid + @ApiModelProperty("province") + private String province; // + @ApiModelProperty("市sid") + private String citySid; // 市sid + @ApiModelProperty("city") + private String city; // + @ApiModelProperty("收货县区sid") + private String countySid; // 收货县区sid + @ApiModelProperty("county") + private String county; // + @ApiModelProperty("详细地址") + private String address; // 详细地址 + @ApiModelProperty("手机") + private String contactMobile; // 手机 + @ApiModelProperty("电话") + private String contactTelePhone; // 电话 + @ApiModelProperty("联系人") + private String contactName; // 联系人 + @ApiModelProperty("传真") + private String fax; // 传真 + @ApiModelProperty("邮编") + private String zipCode; // 邮编 + @ApiModelProperty("电子邮件") + private String email; // 电子邮件 + @ApiModelProperty("网址") + private String website; // 网址 + @ApiModelProperty("开票公司名称") + private String billingCompanyName; // 开票公司名称 + @ApiModelProperty("税号") + private String registNum; // 税号 + @ApiModelProperty("法人") + private String legalName; // 法人 + @ApiModelProperty("采购员") + private String purchaser; // 采购员 + @ApiModelProperty("排序") + private Integer sortNo; // 排序 + @ApiModelProperty("开票类型key") + private String billingTypeKey; // 开票类型key + @ApiModelProperty("开票类型value") + private String billingTypeValue; // 开票类型value + @ApiModelProperty("使用组织sid") + private String useOrgSid; // 使用组织sid + @ApiModelProperty("创建组织名称") + private String createOrgName; // 创建组织名称 + @ApiModelProperty("创建组织sid") + private String createOrgSid; // 创建组织sid + @ApiModelProperty("供应商开户行") + private List baseSupplierBankList; +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoDto.java b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoDto.java new file mode 100644 index 0000000..c103986 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoDto.java @@ -0,0 +1,116 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierinfo; + + +import com.yxt.goods.biz.base.basesupplierBank.BaseSupplierBankDto; +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierInfoDto.java
+ * Class: com.yxt.base.api.basesupplierinfo.BaseSupplierInfoDto
+ * Description: 供应商信息 数据传输对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商信息 数据传输对象", description = "供应商信息 数据传输对象") +public class BaseSupplierInfoDto implements Dto { + + private String sid; // sid + + @ApiModelProperty("编码") + private String supplierCode; // 编码 + @ApiModelProperty("供应商名称") + private String supplierName; // 供应商名称 + @ApiModelProperty("供应商名称拼音") + private String supplierPY; // 供应商名称拼音 + @ApiModelProperty("供应商类型sid") + private String supplierTypeSid; // 供应商类型sid + @ApiModelProperty("供应商类型") + private String supplierTypeName; // 供应商类型 + @ApiModelProperty("省sid") + private String provinceSid; // 省sid + @ApiModelProperty("province") + private String province; // + @ApiModelProperty("市sid") + private String citySid; // 市sid + @ApiModelProperty("city") + private String city; // + @ApiModelProperty("收货县区sid") + private String countySid; // 收货县区sid + @ApiModelProperty("county") + private String county; // + @ApiModelProperty("详细地址") + private String address; // 详细地址 + @ApiModelProperty("手机") + private String contactMobile; // 手机 + @ApiModelProperty("电话") + private String contactTelePhone; // 电话 + @ApiModelProperty("联系人") + private String contactName; // 联系人 + @ApiModelProperty("传真") + private String fax; // 传真 + @ApiModelProperty("邮编") + private String zipCode; // 邮编 + @ApiModelProperty("电子邮件") + private String email; // 电子邮件 + @ApiModelProperty("网址") + private String website; // 网址 + @ApiModelProperty("开票公司名称") + private String billingCompanyName; // 开票公司名称 + @ApiModelProperty("税号") + private String registNum; // 税号 + @ApiModelProperty("法人") + private String legalName; // 法人 + @ApiModelProperty("采购员") + private String purchaser; // 采购员 + @ApiModelProperty("排序") + private Integer sortNo; // 排序 + @ApiModelProperty("开票类型key") + private String billingTypeKey; // 开票类型key + @ApiModelProperty("开票类型value") + private String billingTypeValue; // 开票类型value + @ApiModelProperty("使用组织sid") + private String useOrgSid; // 使用组织sid + @ApiModelProperty("创建组织名称") + private String createOrgName; // 创建组织名称 + @ApiModelProperty("创建组织sid") + private String createOrgSid; // 创建组织sid + @ApiModelProperty("开户行信息") + private List baseSupplierBankList; +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoMapper.java b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoMapper.java new file mode 100644 index 0000000..277a5ca --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoMapper.java @@ -0,0 +1,67 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierinfo; + +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 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-base(仓储基础信息供应商)
+ * File: BaseSupplierInfoMapper.java
+ * Class: com.yxt.anrui.as.biz.basesupplierinfo.BaseSupplierInfoMapper
+ * Description: 供应商信息.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface BaseSupplierInfoMapper extends BaseMapper { + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from base_supplier_info") + List selectListVo(); + + @Update("update base_supplier_info set isDelete = '1' where sid = #{sid}") + int updateBySidIsDelete(String sid); + + @Select("select * from base_supplier_info") + List choiceSupplierInfo(String createOrgSid); +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoMapper.xml b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoMapper.xml new file mode 100644 index 0000000..6c3550c --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoQuery.java b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoQuery.java new file mode 100644 index 0000000..ad495fb --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoQuery.java @@ -0,0 +1,62 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierinfo; + + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierInfoQuery.java
+ * Class: com.yxt.base.api.basesupplierinfo.BaseSupplierInfoQuery
+ * Description: 供应商信息 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商信息 查询条件", description = "供应商信息 查询条件") +public class BaseSupplierInfoQuery implements Query { + + @ApiModelProperty("供应商名称") + private String supplierName; + @ApiModelProperty("供应商类型") + private String supplierTypeName; + @ApiModelProperty("电话") + private String contactTelePhone; + @ApiModelProperty("联系人") + private String contactName; + + @ApiModelProperty("其他查询条件") + private String otherQuery; +} diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoService.java b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoService.java new file mode 100644 index 0000000..77c7570 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoService.java @@ -0,0 +1,168 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierinfo; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.goods.biz.base.basesupplierBank.BaseSupplierBank; +import com.yxt.goods.biz.base.basesupplierBank.BaseSupplierBankDetailsVo; +import com.yxt.goods.biz.base.basesupplierBank.BaseSupplierBankDto; +import com.yxt.goods.biz.base.basesupplierBank.BaseSupplierBankService; +import com.yxt.goods.feign.portal.sysorganization.SysOrganizationFeign; +import com.yxt.goods.feign.portal.sysstafforg.SysStaffOrgFeign; +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.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierInfoService.java
+ * Class: com.yxt.anrui.as.biz.basesupplierinfo.BaseSupplierInfoService
+ * Description: 供应商信息 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class BaseSupplierInfoService extends MybatisBaseService { + + @Autowired + private SysStaffOrgFeign sysStaffOrgFeign; + @Autowired + private SysOrganizationFeign sysOrganizationFeign; + @Autowired + private BaseSupplierBankService baseSupplierBankService; + + public PagerVo listPageVo(PagerQuery pq) { + BaseSupplierInfoQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper(); + if (StringUtils.isNotBlank(query.getSupplierName())){ + qw.like("supplierName",query.getSupplierName()); + } + if (StringUtils.isNotBlank(query.getSupplierTypeName())){ + qw.like("supplierTypeName",query.getSupplierTypeName()); + } + if (StringUtils.isNotBlank(query.getContactTelePhone())){ + qw.like("contactTelePhone",query.getContactTelePhone()); + } + if (StringUtils.isNotBlank(query.getContactName())){ + qw.like("contactName",query.getContactName()); + } + if (StringUtils.isNotBlank(query.getOtherQuery())){ + qw.and(wrapper -> wrapper.like("supplierName", query.getOtherQuery()).or().like("supplierPY", query.getOtherQuery()).or().like("contactTelePhone",query.getOtherQuery())); + } + qw.eq("isDelete",0); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public ResultBean saveOrUpdateDto(BaseSupplierInfoDto dto){ + ResultBean rb = ResultBean.fireFail(); + String dtoSid = dto.getSid(); + List baseSupplierBankDtoList = dto.getBaseSupplierBankList(); + if (baseSupplierBankDtoList == null || baseSupplierBankDtoList.size() == 0){ + return rb.setMsg("开户行信息不能为空"); + } + if (StringUtils.isBlank(dtoSid)) { + String sid = this.insertByDto(dto); + for (BaseSupplierBankDto baseSupplierBankDto : baseSupplierBankDtoList) { + baseSupplierBankDto.setSupplierSid(sid); + baseSupplierBankService.saveOrUpdateDto(baseSupplierBankDto); + } + return rb.success(); + } + this.updateByDto(dto); + for (BaseSupplierBankDto baseSupplierBankDto : baseSupplierBankDtoList) { + String bankSid = baseSupplierBankDto.getSid(); + if(StringUtils.isNotBlank(bankSid)){ + BaseSupplierBank baseSupplierBank = baseSupplierBankService.fetchBySid(bankSid); + BeanUtil.copyProperties(baseSupplierBankDto,baseSupplierBank,"sid"); + baseSupplierBank.setSupplierSid(dtoSid); + baseSupplierBankService.updateById(baseSupplierBank); + }else{ + BaseSupplierBank baseSupplierBank = new BaseSupplierBank(); + BeanUtil.copyProperties(baseSupplierBankDto,baseSupplierBank,"sid"); + baseSupplierBank.setSupplierSid(dtoSid); + baseSupplierBankService.insert(baseSupplierBank); + } + } + return rb.success(); + } + + public String insertByDto(BaseSupplierInfoDto dto){ + BaseSupplierInfo entity = new BaseSupplierInfo(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + return entity.getSid(); + } + + public void updateByDto(BaseSupplierInfoDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + BaseSupplierInfo entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public BaseSupplierInfoDetailsVo fetchDetailsVoBySid(String sid){ + BaseSupplierInfo entity = fetchBySid(sid); + BaseSupplierInfoDetailsVo vo = new BaseSupplierInfoDetailsVo(); + BeanUtil.copyProperties(entity, vo); + List baseSupplierBankDetailsVos = baseSupplierBankService.selectBySupplierSid(sid); + vo.setBaseSupplierBankList(baseSupplierBankDetailsVos); + return vo; + } + + public void delAll(String[] sids) { + for (String sid : sids) { + //删除厂商基础信息 + int count = baseMapper.updateBySidIsDelete(sid); + //删除厂商开户行信息 + int i = baseSupplierBankService.deleteBySupplierSid(sid); + } + } + + public List choiceSupplierInfo(String createOrgSid) { + List baseSupplierInfoChoiceList = baseMapper.choiceSupplierInfo(createOrgSid); + return baseSupplierInfoChoiceList; + } +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoVo.java b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoVo.java new file mode 100644 index 0000000..6ae8783 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesupplierinfo/BaseSupplierInfoVo.java @@ -0,0 +1,65 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesupplierinfo; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(供应商管理)
+ * File: BaseSupplierInfoVo.java
+ * Class: com.yxt.base.api.basesupplierinfo.BaseSupplierInfoVo
+ * Description: 供应商信息 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-18 13:33:13
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商信息 视图数据对象", description = "供应商信息 视图数据对象") +public class BaseSupplierInfoVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("供应商名称") + private String supplierName; + @ApiModelProperty("供应商类型") + private String supplierTypeName; + @ApiModelProperty("详细地址") + private String address; + @ApiModelProperty("电话") + private String contactTelePhone; + @ApiModelProperty("联系人") + private String contactName; + @ApiModelProperty("手机") + private String contactMobile; +} diff --git a/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierType.java b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierType.java new file mode 100644 index 0000000..b1bf3dc --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierType.java @@ -0,0 +1,62 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesuppliertype; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierType.java
+ * Class: com.yxt.anrui.as.api.basesuppliertype.BaseSupplierType
+ * Description: 供应商类型.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商类型", description = "供应商类型") +@TableName("base_supplier_type") +public class BaseSupplierType extends BaseEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("供应商类型名称") + private String supplierTypeName; // 供应商类型名称 + @ApiModelProperty("使用组织sid") + private String useOrgSid; // 使用组织sid + @ApiModelProperty("创建组织名称") + private String createOrgName; // 创建组织名称 + @ApiModelProperty("创建组织sid") + private String createOrgSid; // 创建组织sid + +} diff --git a/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeDetailsVo.java b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeDetailsVo.java new file mode 100644 index 0000000..322a9c4 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeDetailsVo.java @@ -0,0 +1,62 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesuppliertype; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierTypeVo.java
+ * Class: com.yxt.anrui.as.api.basesuppliertype.BaseSupplierTypeVo
+ * Description: 供应商类型 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商类型 视图数据详情", description = "供应商类型 视图数据详情") +public class BaseSupplierTypeDetailsVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("供应商类型名称") + private String supplierTypeName; // 供应商类型名称 + @ApiModelProperty("使用组织sid") + private String useOrgSid; // 使用组织sid + @ApiModelProperty("创建组织名称") + private String createOrgName; // 创建组织名称 + @ApiModelProperty("创建组织sid") + private String createOrgSid; // 创建组织sid + +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeDto.java b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeDto.java new file mode 100644 index 0000000..1b74e6d --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeDto.java @@ -0,0 +1,62 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesuppliertype; + + +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierTypeDto.java
+ * Class: com.yxt.anrui.as.api.basesuppliertype.BaseSupplierTypeDto
+ * Description: 供应商类型 数据传输对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商类型 数据传输对象", description = "供应商类型 数据传输对象") +public class BaseSupplierTypeDto implements Dto { + + private String sid; // sid + + @ApiModelProperty("供应商类型名称") + private String supplierTypeName; // 供应商类型名称 + @ApiModelProperty("使用组织sid") + private String useOrgSid; // 使用组织sid + @ApiModelProperty("创建组织名称") + private String createOrgName; // 创建组织名称 + @ApiModelProperty("创建组织sid") + private String createOrgSid; // 创建组织sid + +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeMapper.java b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeMapper.java new file mode 100644 index 0000000..823612e --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeMapper.java @@ -0,0 +1,60 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesuppliertype; + +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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierTypeMapper.java
+ * Class: com.yxt.anrui.as.biz.basesuppliertype.BaseSupplierTypeMapper
+ * Description: 供应商类型.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface BaseSupplierTypeMapper extends BaseMapper { + + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + + List selectListAllVo(@Param(Constants.WRAPPER) Wrapper qw); + + @Select("select * from base_supplier_type") + List selectListVo(); +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeMapper.xml b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeMapper.xml new file mode 100644 index 0000000..769f010 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeMapper.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeQuery.java b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeQuery.java new file mode 100644 index 0000000..e908a60 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeQuery.java @@ -0,0 +1,60 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesuppliertype; + + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierTypeQuery.java
+ * Class: com.yxt.anrui.as.api.basesuppliertype.BaseSupplierTypeQuery
+ * Description: 供应商类型 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商类型 查询条件", description = "供应商类型 查询条件") +public class BaseSupplierTypeQuery implements Query { + + @ApiModelProperty("供应商类型名称") + private String supplierTypeName; // 供应商类型名称 + @ApiModelProperty("使用组织sid") + private String useOrgSid; // 使用组织sid + @ApiModelProperty("创建组织名称") + private String createOrgName; // 创建组织名称 + @ApiModelProperty("创建组织sid") + private String createOrgSid; // 创建组织sid + +} diff --git a/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeService.java b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeService.java new file mode 100644 index 0000000..8518f66 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeService.java @@ -0,0 +1,94 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesuppliertype; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +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-base(仓储基础信息供应商)
+ * File: BaseSupplierTypeService.java
+ * Class: com.yxt.anrui.as.biz.basesuppliertype.BaseSupplierTypeService
+ * Description: 供应商类型 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class BaseSupplierTypeService extends MybatisBaseService { + + public PagerVo listPageVo(PagerQuery pq) { + BaseSupplierTypeQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void saveOrUpdateDto(BaseSupplierTypeDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(BaseSupplierTypeDto dto){ + BaseSupplierType entity = new BaseSupplierType(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + } + + public void updateByDto(BaseSupplierTypeDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + BaseSupplierType entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public BaseSupplierTypeDetailsVo fetchDetailsVoBySid(String sid){ + BaseSupplierType entity = fetchBySid(sid); + BaseSupplierTypeDetailsVo vo = new BaseSupplierTypeDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeVo.java b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeVo.java new file mode 100644 index 0000000..3ae2dea --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/basesuppliertype/BaseSupplierTypeVo.java @@ -0,0 +1,62 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.goods.biz.base.basesuppliertype; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * Project: yxt-base(仓储基础信息供应商)
+ * File: BaseSupplierTypeVo.java
+ * Class: com.yxt.anrui.as.api.basesuppliertype.BaseSupplierTypeVo
+ * Description: 供应商类型 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-13 16:51:56
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "供应商类型 视图数据对象", description = "供应商类型 视图数据对象") +public class BaseSupplierTypeVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("供应商类型名称") + private String supplierTypeName; // 供应商类型名称 + @ApiModelProperty("使用组织sid") + private String useOrgSid; // 使用组织sid + @ApiModelProperty("创建组织名称") + private String createOrgName; // 创建组织名称 + @ApiModelProperty("创建组织sid") + private String createOrgSid; // 创建组织sid + +} diff --git a/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCart.java b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCart.java new file mode 100644 index 0000000..af72f31 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCart.java @@ -0,0 +1,29 @@ +package com.yxt.goods.biz.base.shoppingcart; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; +import java.util.UUID; + +/** + * @author wangpengfei + * @date 2023/12/8 9:10 + */ +@Data +public class ShoppingCart { + private String id; + private String sid= UUID.randomUUID().toString(); + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + private String isEnable; + private String goodsSid; + private String goodsName; + private String goodsNumber; + private String affiliation; + private String price; + private String customerSid; + private String weight; //每份重量 + + +} diff --git a/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartDto.java b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartDto.java new file mode 100644 index 0000000..38dd430 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartDto.java @@ -0,0 +1,28 @@ +package com.yxt.goods.biz.base.shoppingcart; + +import com.yxt.common.core.dto.Dto; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/12/8 9:11 + */ +@Data +public class ShoppingCartDto implements Dto { + + + + private String id; + private String sid; + private String createTime; + private String remarks; + private String isEnable; + private String goodsSid;//商品sid + private String goodsName;//商品名称 + private String goodsNumber;//商品数量 + private String affiliation;//所属菜窖 1百姓菜窖 2 精品菜窖 3企业菜窖 + private String price;//价格 + private String customerSid; //客户sid + private String weight; //每份重量 + +} diff --git a/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartMapper.java b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartMapper.java new file mode 100644 index 0000000..d5878bd --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartMapper.java @@ -0,0 +1,18 @@ +package com.yxt.goods.biz.base.shoppingcart; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2023/12/8 9:19 + */ +@Mapper +public interface ShoppingCartMapper extends BaseMapper { + List ShoppingCartList(@Param("customerSid")String customerSid, + @Param("brandId")String brandId, + @Param("periodValidity")String periodValidity); +} diff --git a/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartMapper.xml b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartMapper.xml new file mode 100644 index 0000000..a20a439 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartQuery.java b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartQuery.java new file mode 100644 index 0000000..bc3be86 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartQuery.java @@ -0,0 +1,16 @@ +package com.yxt.goods.biz.base.shoppingcart; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/12/8 9:11 + */ +@Data +public class ShoppingCartQuery implements Query { + private String customerSid; //客户 + private String affiliation; //类型 + private String brandId; + private String periodValidity; +} diff --git a/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartService.java b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartService.java new file mode 100644 index 0000000..44ebe17 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartService.java @@ -0,0 +1,253 @@ +package com.yxt.goods.biz.base.shoppingcart; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.result.ResultBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2023/12/8 9:19 + */ +@Service +public class ShoppingCartService extends MybatisBaseService { + @Autowired + private FileUploadComponent fileUploadComponent; + + public ResultBean save(ShoppingCartDto dto) { + ResultBean rb = ResultBean.fireFail(); + ShoppingCart entity = new ShoppingCart(); + if(StringUtils.isBlank(dto.getCustomerSid())){ + return rb.setMsg("参数不全"); + } + if(StringUtils.isBlank(dto.getGoodsSid())){ + return rb.setMsg("参数不全"); + } + List list = baseMapper.selectList(new QueryWrapper().eq("customerSid", dto.getCustomerSid()) + .eq("goodsSid", dto.getGoodsSid()) + .eq("affiliation", dto.getAffiliation())); + if (list.size() > 0) { +// list.get(0).setGoodsNumber(String.valueOf(Double.valueOf(dto.getGoodsNumber())+Double.valueOf(list.get(0).getGoodsNumber()))); + if (dto.getGoodsNumber().equals("0")) { + baseMapper.delete(new QueryWrapper().eq("customerSid", dto.getCustomerSid()) + .eq("goodsSid", dto.getGoodsSid()) + .eq("affiliation", dto.getAffiliation())); + } else { + list.get(0).setGoodsNumber(dto.getGoodsNumber()); + baseMapper.updateById(list.get(0)); + } + return rb.success().setMsg("成功"); + } + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + return rb.success().setMsg("成功"); + } + + public ResultBean> shoppingCartList(ShoppingCartQuery query) { + ResultBean rb = ResultBean.fireFail(); + ShoppingCart entity = new ShoppingCart(); + if(StringUtils.isBlank(query.getCustomerSid())){ + return rb.setMsg("参数不全"); + } + if(StringUtils.isBlank(query.getBrandId())){ + return rb.setMsg("参数不全"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Date date=new Date(); + String periodValidity=sdf.format(date); + List list = baseMapper.ShoppingCartList(query.getCustomerSid(), query.getBrandId(),periodValidity); + list.forEach(s -> { + s.setTotalPrice(removeZeros(String.valueOf((Double.valueOf(s.getJPrice()) * Double.valueOf(s.getGoodsNumber()))))); + s.setIconUrl(fileUploadComponent.getUrlPrefix() + s.getIconUrl()); + }); + + return rb.success().setData(list).setMsg("成功"); + } + + public ResultBean minusShoppingCart(ShoppingCartDto dto) { + ResultBean rb = ResultBean.fireFail(); + ShoppingCart entity = new ShoppingCart(); +// List list= baseMapper.selectList(new QueryWrapper().eq("sid",dto.getSid())); + List list = baseMapper.selectList(new QueryWrapper().eq("customerSid", dto.getCustomerSid()) + .eq("goodsSid", dto.getGoodsSid()) + .eq("affiliation", dto.getAffiliation())); + if (list.size() > 0) { + list.get(0).setGoodsNumber(String.valueOf(Double.valueOf(list.get(0).getGoodsNumber()) - Double.valueOf(dto.getGoodsNumber()))); + baseMapper.updateById(list.get(0)); + return rb.success().setMsg("成功"); + } +// BeanUtil.copyProperties(dto, entity, "id", "sid"); +// baseMapper.insert(entity); + return rb.success().setMsg("成功"); + } + public ResultBean updateShoppingCart(ShoppingCartDto dto) { + ResultBean rb = ResultBean.fireFail(); + ShoppingCart entity = new ShoppingCart(); +// List list= baseMapper.selectList(new QueryWrapper().eq("sid",dto.getSid())); + List list = baseMapper.selectList(new QueryWrapper().eq("customerSid", dto.getCustomerSid()) + .eq("goodsSid", dto.getGoodsSid()) + .eq("affiliation", dto.getAffiliation())); + if (list.size() > 0) { + list.get(0).setGoodsNumber(dto.getGoodsNumber()); + baseMapper.updateById(list.get(0)); + return rb.success().setMsg("成功"); + } + return rb.success().setMsg("成功"); + } + + public ResultBean delShoppingCart(String sid) { + ResultBean rb = ResultBean.fireFail(); + ShoppingCart entity = new ShoppingCart(); + baseMapper.delete(new QueryWrapper().eq("sid ", sid)); + return rb.success().setMsg("成功"); + } + + public ResultBean getGoodsWeight(ShoppingCartQuery query) { + ResultBean rb = new ResultBean().fail(); + if(StringUtils.isBlank(query.getCustomerSid())){ + return rb.setMsg("参数不全"); + } + if(StringUtils.isBlank(query.getBrandId())){ + return rb.setMsg("参数不全"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Date date=new Date(); + String periodValidity=sdf.format(date); + List list = baseMapper.ShoppingCartList(query.getCustomerSid(), query.getBrandId(),periodValidity); + double price = 0; + double standbyPrice =0; + double weight = 0; +// for (ShoppingCartVo vo : list) { +// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(vo.getGoodsSid()); +// String stepWeight = lpkGoods.getStepWeight(); +// String stepPrice = lpkGoods.getStepPrice(); +// String a =DoubleUtils.removeZeros(String.valueOf(Double.valueOf(vo.getWeight())*Double.valueOf(vo.getGoodsNumber()))); +// BigDecimal weightW = new BigDecimal(a); +// if(StringUtils.isNotBlank(stepPrice)){ +// System.out.println(weightW.compareTo(new BigDecimal(stepWeight))); +// if(weightW.compareTo(new BigDecimal(stepWeight)) == -1){ +// stepPrice = DoubleUtils.removeZeros(String.valueOf(Double.valueOf(vo.getJPrice())*Double.valueOf(vo.getWeight()))); ///份价格 +// }else{ +// stepPrice = DoubleUtils.removeZeros(String.valueOf(Double.valueOf(stepPrice)*Double.valueOf(vo.getWeight()))); ///份价格 +// } +// }else{ +// stepPrice = DoubleUtils.removeZeros(String.valueOf(Double.valueOf(vo.getJPrice())*Double.valueOf(vo.getWeight()))); +// } +// +// if ("北京3号白菜".equals(vo.getGoodsName()) +// || "玲珑黄白菜".equals(vo.getGoodsName()) +// || "V7土豆".equals(vo.getGoodsName()) +// || "黄金薯土豆".equals(vo.getGoodsName())) { +// +// price = Double.valueOf(stepPrice)* Double.valueOf(vo.getGoodsNumber()) + price; +// standbyPrice=Double.valueOf(vo.getPrice())*Double.valueOf(vo.getGoodsNumber())+standbyPrice; +// weight = Double.valueOf(vo.getWeight()) * Double.valueOf(vo.getGoodsNumber()) + weight; +//// } +// } else { +// price = Double.valueOf(vo.getPrice()) * Double.valueOf(vo.getGoodsNumber()) + price; +// standbyPrice=Double.valueOf(vo.getPrice())*Double.valueOf(vo.getGoodsNumber())+standbyPrice; +// weight = Double.valueOf(vo.getWeight()) * Double.valueOf(vo.getGoodsNumber()) + weight; +// } +// } + ShoppingCartVo vo = new ShoppingCartVo(); +// 1.20斤起订量。 +// 2.0-99斤加10%附加额。 +// 3.100斤-199斤加5%附加额。 + vo.setCustomerSid(query.getCustomerSid()); + vo.setTotalPrice(removeZeros(String.valueOf(aa(price)))); + vo.setStandbyPrice(removeZeros(String.valueOf(aa(standbyPrice)))); + vo.setTotalWeight(removeZeros(String.valueOf(aa(weight)))); + vo.setAffiliation(query.getBrandId()); +// vo = price(vo); + return rb.success().setData(vo); + } + +// private ShoppingCartVo price(ShoppingCartVo vo) { +// double weight = Double.valueOf(vo.getTotalWeight()); +// LpkCustomer lpkCustomer = lpkCustomerService.getOne(new QueryWrapper().eq("sid", vo.getCustomerSid())); +// PmsBrand one=pmsBrandService.getOne(new QueryWrapper().eq("id",vo.getAffiliation())); +// if(vo.getAffiliation().equals("1001045")){ +// if (weight < one.getQssl()) { +// vo.setRemarks("不足"+one.getQssl()+"斤"); +// }else { +// String c = String.valueOf(Double.valueOf(vo.getStandbyPrice())-Double.valueOf(vo.getTotalPrice())); +// if(DoubleUtils.removeZeros(c).equals("0")){ +// vo.setRemarks(""); +// }else{ +// vo.setRemarks("已优惠" + removeZeros(c) + "元"); +// } +// } +// return vo; +// }else if(vo.getAffiliation().equals("1001020")){ +// return vo; +// }; +// vo.setRemarks("已减免附加额"); +// if (weight <= 99) { +// if (weight < one.getQssl()) { +// double a = 1.1; +// double d = Double.valueOf(vo.getTotalPrice()); +// double t = Double.valueOf(vo.getTotalPrice()) * a; +// BigDecimal bg = new BigDecimal(t); +// vo.setTotalPrice(removeZeros(String.valueOf(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()))); +//// String c =String.valueOf(Double.valueOf(vo.getTotalPrice())-d); +// double f = Double.valueOf(vo.getTotalPrice()) - d; +// BigDecimal bgd = new BigDecimal(f); +// String c = String.valueOf(bgd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); +// vo.setRemarks("不足"+one.getQssl()+"斤"); +// } else { +// double a = 1.1; +// double d = Double.valueOf(vo.getTotalPrice()); +// double t = Double.valueOf(vo.getTotalPrice()) * a; +// BigDecimal bg = new BigDecimal(t); +// vo.setTotalPrice(removeZeros(String.valueOf(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()))); +//// String c =String.valueOf(Double.valueOf(vo.getTotalPrice())-d); +// double f = Double.valueOf(vo.getTotalPrice()) - d; +// BigDecimal bgd = new BigDecimal(f); +// String c = String.valueOf(bgd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); +// vo.setRemarks("含附加额" + removeZeros(c) + "元"); +// } +// } else if (weight >= 100 && weight <= 199) { +// double a = 1.05; +// double d = Double.valueOf(vo.getTotalPrice()); +// double t = Double.valueOf(vo.getTotalPrice()) * a; +// BigDecimal bg = new BigDecimal(t); +// vo.setTotalPrice(removeZeros(String.valueOf(bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()))); +//// String c =String.valueOf(Double.valueOf(vo.getTotalPrice())-d); +// double f = Double.valueOf(vo.getTotalPrice()) - d; +// BigDecimal bgd = new BigDecimal(f); +// String c = String.valueOf(bgd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()); +// vo.setRemarks("含附加额" + removeZeros(c) + "元"); +// } +// return vo; +// } + + /** + * 去除多余.0 + * + * @param num + * @return + */ + public static String removeZeros(String num) { + if (num.indexOf(".") > 0) { + // 去掉多余的0 + num = num.replaceAll("0+?$", ""); + // 如果最后一位是. 则去掉 + num = num.replaceAll("[.]$", ""); + } + return num; + } + public String aa(double a){ + BigDecimal d=new BigDecimal(a); + double c= d.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue(); + return String.valueOf(c); + } +} diff --git a/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartVo.java b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartVo.java new file mode 100644 index 0000000..b6d1969 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingCartVo.java @@ -0,0 +1,36 @@ +package com.yxt.goods.biz.base.shoppingcart; + +import com.yxt.common.core.vo.Vo; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2023/12/8 9:11 + */ +@Data +public class ShoppingCartVo implements Vo { + private String id; + private String sid; + private String createTime; + private String remarks; + private String isEnable; + private String goodsSid;//商品sid + private String goodsName;//商品名称 + private String goodsNumber;//商品数量 + private String affiliation;//所属菜窖 1百姓菜窖 2 精品菜窖 3企业菜窖 + private String price;//价格 + private String jPrice;//价格 + private String customerSid; //客户sid + + private String weight; //每份重量 + private String totalPrice; + private String standbyPrice;//没有折扣的总价格 + private String totalWeight; + + private String unitName; + private String iconUrl; + private String specificationUnit; +// private String text; + + +} diff --git a/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingGoodsVo.java b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingGoodsVo.java new file mode 100644 index 0000000..778f7a4 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/base/shoppingcart/ShoppingGoodsVo.java @@ -0,0 +1,8 @@ +package com.yxt.goods.biz.base.shoppingcart; + +/** + * @author wangpengfei + * @date 2024/1/17 14:03 + */ +public class ShoppingGoodsVo { +} diff --git a/src/main/java/com/yxt/user/biz/package-info.java b/src/main/java/com/yxt/user/biz/package-info.java new file mode 100644 index 0000000..3692c43 --- /dev/null +++ b/src/main/java/com/yxt/user/biz/package-info.java @@ -0,0 +1,4 @@ +/** + * 宇信通 仓库管理 项目后台逻辑和接口 + */ +package com.yxt.goods.biz; \ No newline at end of file diff --git a/src/main/java/com/yxt/user/config/SaTokenConfigure.java b/src/main/java/com/yxt/user/config/SaTokenConfigure.java new file mode 100644 index 0000000..16b7b6d --- /dev/null +++ b/src/main/java/com/yxt/user/config/SaTokenConfigure.java @@ -0,0 +1,114 @@ +package com.yxt.goods.config;//package com.yxt.base.config; +// +//import cn.dev33.satoken.interceptor.SaInterceptor; +//import cn.dev33.satoken.stp.StpUtil; +//import org.springframework.beans.factory.annotation.Value; +//import org.springframework.context.annotation.Configuration; +//import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +// +///** +// * @author wangpengfei +// * @date 2023/5/16 14:43 +// */ +//@Configuration +//public class SaTokenConfigure implements WebMvcConfigurer { +// @Value("${image.url.prefix:http://127.0.0.1:8080/upload/}") +// private String urlPrefix; +// // 注册 Sa-Token 拦截器 +// @Override +// public void addInterceptors(InterceptorRegistry registry) { +// // 注册 Sa-Token 拦截器,校验规则为 StpUtil.checkLogin() 登录校验。 +// +// registry.addInterceptor(new SaInterceptor(handler -> StpUtil.checkLogin())) +// .addPathPatterns("/**") +// .excludePathPatterns("/sysuser/doLogin") +// .excludePathPatterns("/lpkgiftcard/gifCardByCustomerSid") +// .excludePathPatterns("/empcardgift/gifCardByCustomerSid") +// .excludePathPatterns("/empcard/getEmpCardByCustomerSid") +// .excludePathPatterns("/lpkgiftcard/getGifCardBySid/**") +// .excludePathPatterns("/empcardgift/getGifCardBySid/**") +// .excludePathPatterns("/empcard/getEmpCardBySid/**") +// .excludePathPatterns("/lpkgiftcard/isSaturAndSun/**") +// .excludePathPatterns("/empcardgift/isSaturAndSun/**") +// .excludePathPatterns("/empcard/isSaturAndSun/**") +// .excludePathPatterns("/lpkgiftcard/getReservationBySid/**") +// .excludePathPatterns("/lpksreservoorder/submission") +// .excludePathPatterns("/lpksreservoorder/exportExcelByStore") +// .excludePathPatterns("/empsreservoorder/createNewUserBagOrder") +// .excludePathPatterns("/lpksreservoorders/submission") +// .excludePathPatterns("/empsreservoorder/ordersList") +// .excludePathPatterns("/empsreservoorder/submission") +// .excludePathPatterns("/empsreservoorder/submissionEmp") +// .excludePathPatterns("/empcardgift/generateCard") +// .excludePathPatterns("/lpkgiftcard/bindCard") +// .excludePathPatterns("/empcard/bindCard") +// .excludePathPatterns("/lpksreservoorder/orderByCardSid/**") +// .excludePathPatterns("/lpksreservoorder/orderListByUserSid/**") +// .excludePathPatterns("/lpksreservoorder/orderDetails/**") +// .excludePathPatterns("/newcomerrecorecord/recommendNewUsers") +// .excludePathPatterns("/newcomerrecorecord/recommendedAssistance") +// .excludePathPatterns("/newcomerrecorecord/recordList/**") +// .excludePathPatterns("/transferrecords/transferRecordsList") +// .excludePathPatterns("/empsreservoorder/createVegeOrder") +// .excludePathPatterns("/empsreservoorder/OrderDetails/**") +// .excludePathPatterns("/empsreservoorder/changePayState/**") +// .excludePathPatterns("/lpkgoods/goodsDetails/**") +// .excludePathPatterns("/lpkstore/getAllStoreByQuery") +// .excludePathPatterns("/vegetablecellar/receiveTransferGoods") +// .excludePathPatterns("/transferrecords/submission") +// .excludePathPatterns("/lpkgiftcard/getCardByBank") +// .excludePathPatterns("/empcard/getEmpCard") +// .excludePathPatterns("/empcardgift/shareEmpCard/**") +// .excludePathPatterns("/empcardgift/generateEmpCardGift") +// .excludePathPatterns("/empcardgift/generateEmpCard") +// .excludePathPatterns("/lpkcustomer/wxSilentLogin") +// .excludePathPatterns("/lpkgiftcard/gifCardsByCustomerSid") +// .excludePathPatterns("/lpkgoods/getAllGiftBag") +// .excludePathPatterns("/appletgiftbag/getGiftBagBySid/**") +// .excludePathPatterns("/appletgiftbag/appletGiftBagList") +// .excludePathPatterns("/lpkgiftcard/cardShareDetail/**") +// .excludePathPatterns("/lpkgiftcard/cardShareGoodsDetail/**") +// .excludePathPatterns("/empcardgift/generateTopEmpCard/**") +// .excludePathPatterns("/empsreservoorder/createOrder") +// .excludePathPatterns("/appletgiftbag/recommendRecord/**") +// //2024-01-17 +// .excludePathPatterns("/lpkgiftcard/getAllGoodsType/**") +// .excludePathPatterns("/appletnotice/getNotice") +// .excludePathPatterns("/empsreservoorder/getPreOrder") +// .excludePathPatterns("/lpkgoods/getAllGoodsType/**") +// .excludePathPatterns("/transferrecords/submission") +// .excludePathPatterns("/vegetablecellar/receiveTransferGoods") +// .excludePathPatterns("/customerstore/isSaturAndSun") +// .excludePathPatterns("/lpkgiftcard/getGoodsByType/**") +// .excludePathPatterns("/lpkgoods/getGoodsTypeAndBrand") +// .excludePathPatterns("/lpkgoods/getGoodsByType") +// .excludePathPatterns("/lpksreservoorders/orderListByUserSid") +// .excludePathPatterns("/appletgiftbag/newUserQuota") +// .excludePathPatterns("/shoppingcart/addShoppingCart") +// .excludePathPatterns("/shoppingcart/getGoodsWeight") +// .excludePathPatterns("/shoppingcart/shoppingCartList") +// .excludePathPatterns("/shoppingcart/delShoppingCart/**") +// .excludePathPatterns("/lpkgoods/vegeCellarTypeList") +// .excludePathPatterns("/vegetablecellar/addGoods/**") +// .excludePathPatterns("/lpkgoods/vegeCellarList") +// .excludePathPatterns("/customerstore/getStoreBySid/**") +// .excludePathPatterns("/lpkgiftcard/bindAllCard") +// .excludePathPatterns("/lpkcustomer/customerInfo/**") +// .excludePathPatterns("/vegetablecellar/saveGoods") +// .excludePathPatterns("/transferrecords/getTransferByCode/**") +// //2024-01-18 +// .excludePathPatterns("/lpkcustomer/getCustomerInfo/**") +// .excludePathPatterns("/lpkcustomer/modifyUserNickName") +// .excludePathPatterns("/lpkcustomer/modifyHeadImage") +// .excludePathPatterns("/upload/**") +// .excludePathPatterns("/lpkcustomer/getPhoneNumber") +// .excludePathPatterns("/lpkcustomer/getRealInfo/**") +// .excludePathPatterns("/lpkcustomer/saveRealInfo") +// .excludePathPatterns("/pms/PmsBrand/getList") +// .excludePathPatterns("/LpkCustomerBank/getBankList") +// .excludePathPatterns("/lpkcustomer/updateCustomerBank") +// .excludePathPatterns("//wxapi/**") +// ; +// } +//} diff --git a/src/main/java/com/yxt/user/config/SaTokenGloableException.java b/src/main/java/com/yxt/user/config/SaTokenGloableException.java new file mode 100644 index 0000000..21e3172 --- /dev/null +++ b/src/main/java/com/yxt/user/config/SaTokenGloableException.java @@ -0,0 +1,67 @@ +package com.yxt.goods.config; + +import com.yxt.common.base.config.handler.GlobalExceptionHandler; +import com.yxt.common.core.result.ResultBean; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.validation.BindException; +import org.springframework.validation.ObjectError; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.servlet.NoHandlerFoundException; + +/** + * @author dimengzhe + * @date 2020/9/12 3:23 + * @description 全局异常处理 + */ +@RestControllerAdvice +public class SaTokenGloableException extends GlobalExceptionHandler { + + private static final Logger L = LoggerFactory.getLogger(GlobalExceptionHandler.class); + + public SaTokenGloableException() { + } + @ExceptionHandler({Exception.class}) + public ResultBean handleException(Exception e) { + if(null !=e.getMessage()){ + if(e.getMessage().contains("token 无效:")){ + L.error(e.getMessage(), e); + return ResultBean.fireFail().setCode("5000").setMsg("系统异常::" + e.getMessage()); + } + if(e.getMessage().contains("未能读取到有效 token")){ +// L.error(e.getMessage(), e); + return ResultBean.fireFail().setMsg("系统异常::" + e.getMessage()); + } + } + + L.error(e.getMessage(), e); + return ResultBean.fireFail().setMsg("系统异常::" + e.getMessage()); + } + @ExceptionHandler({NoHandlerFoundException.class}) + public ResultBean handlerNoFoundException(Exception e) { + L.error(e.getMessage(), e); + return ResultBean.fireFail().setCode("404").setMsg("路径不存在,请检查路径是否正确"); + } + +// @ExceptionHandler({Exception.class}) +// public ResultBean handleException(Exception e) { +// L.error(e.getMessage(), e); +// return ResultBean.fireFail().setMsg("系统异常::" + e.getMessage()); +// } + + @ExceptionHandler({BindException.class}) + public ResultBean validatedBindException(BindException e) { + L.error(e.getMessage(), e); + String message = ((ObjectError)e.getAllErrors().get(0)).getDefaultMessage(); + return ResultBean.fireFail().setCode("405").setMsg(message); + } + + @ExceptionHandler({MethodArgumentNotValidException.class}) + public ResultBean validExceptionHandler(MethodArgumentNotValidException e) { + L.error(e.getMessage(), e); + String message = e.getBindingResult().getFieldError().getDefaultMessage(); + return ResultBean.fireFail().setCode("405").setMsg(message); + } +} diff --git a/src/main/java/com/yxt/user/config/package-info.java b/src/main/java/com/yxt/user/config/package-info.java new file mode 100644 index 0000000..1ba1490 --- /dev/null +++ b/src/main/java/com/yxt/user/config/package-info.java @@ -0,0 +1,4 @@ +/** + * 宇信通监管项目-光伏(山海新能源)项目后台逻辑和接口-接口声明 + */ +package com.yxt.goods.config; \ No newline at end of file diff --git a/src/main/java/com/yxt/user/feign/package-info.java b/src/main/java/com/yxt/user/feign/package-info.java new file mode 100644 index 0000000..0bb9b53 --- /dev/null +++ b/src/main/java/com/yxt/user/feign/package-info.java @@ -0,0 +1,4 @@ +/** + * 宇信通监管项目-光伏(山海新能源)项目后台逻辑和接口-接口声明 + */ +package com.yxt.goods.feign; \ No newline at end of file diff --git a/src/main/java/com/yxt/user/feign/portal/sysorganization/SysOrganizationFeign.java b/src/main/java/com/yxt/user/feign/portal/sysorganization/SysOrganizationFeign.java new file mode 100644 index 0000000..fe6a8d7 --- /dev/null +++ b/src/main/java/com/yxt/user/feign/portal/sysorganization/SysOrganizationFeign.java @@ -0,0 +1,35 @@ +package com.yxt.goods.feign.portal.sysorganization; + +import com.yxt.common.core.result.ResultBean; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * Project: anrui_portal(门户建设)
+ * File: SysOrganizationFeign.java
+ * Class: com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign
+ * Description: 组织机构表.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2021-08-03 00:24:28
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Api(tags = "组织机构表") +@FeignClient( + contextId = "anrui-portal-SysOrganization", + name = "anrui-portal", + path = "v1/sysorganization") +public interface SysOrganizationFeign { + + @ApiOperation("获取一条记录 根据sid") + @ResponseBody + @GetMapping("/fetchBySid/{sid}") + public ResultBean fetchBySid(@PathVariable("sid") String sid); +} \ No newline at end of file diff --git a/src/main/java/com/yxt/user/feign/portal/sysorganization/SysOrganizationVo.java b/src/main/java/com/yxt/user/feign/portal/sysorganization/SysOrganizationVo.java new file mode 100644 index 0000000..d066ab6 --- /dev/null +++ b/src/main/java/com/yxt/user/feign/portal/sysorganization/SysOrganizationVo.java @@ -0,0 +1,88 @@ +package com.yxt.goods.feign.portal.sysorganization; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * Project: anrui_portal(门户建设)
+ * File: SysOrganizationVo.java
+ * Class: com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo
+ * Description: 组织机构表 视图数据对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2021-08-03 00:24:28
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@ApiModel(value = "组织机构表 视图数据对象", description = "组织机构表 视图数据对象") +@Data +public class SysOrganizationVo implements Vo { + @ApiModelProperty("部门/组织名称") + private String name; + + @ApiModelProperty("父(部门/组织) sid") + private String psid; + + @ApiModelProperty("联系电话") + private String linkPhone; + + @ApiModelProperty("联系人") + private String linkPerson; + + @ApiModelProperty("部门sid全路径") + private String orgSidPath; + + @ApiModelProperty("排序") + private Integer sort; + + @ApiModelProperty("地址") + private String addrs; + + @ApiModelProperty("地理位置经纬度") + private String jwd; + + @ApiModelProperty("二维码") + private String qrText; + + @ApiModelProperty("限制本部门成员查看通讯录:限制开启后,本部门成员只能看到限定范围内的通讯录不能看到所有通讯录,仅可见自己") + private Integer limitOrgMember; + + @ApiModelProperty("部门编码") + private String orgCode; + @ApiModelProperty("sid") + private String sid; + @ApiModelProperty("子集") + private List children = new ArrayList<>(); + @ApiModelProperty("主管人员名称") + private String zgNames; + @ApiModelProperty("分管人员名称") + private String fgNames; + @ApiModelProperty("主管人员sid") + private String zgStaffSid; + @ApiModelProperty("分管人员sid") + private String fgStaffSid; + @ApiModelProperty("组织简称") + private String orgAbbre; + @ApiModelProperty("是否是部门(0否,1是)") + private Integer isDept; + @ApiModelProperty("组织属性key") + private String orgAttributeKey; + @ApiModelProperty("组织属性value") + private String orgAttributeValue; + @ApiModelProperty("管理层级key") + private String orgLevelKey; + @ApiModelProperty("管理层级value") + private String orgLevelValue; + @ApiModelProperty("其他编码") + private String otherCode; + @ApiModelProperty("主管用户sid") + private String managerSid; +} diff --git a/src/main/java/com/yxt/user/feign/portal/sysstafforg/SysStaffOrgFeign.java b/src/main/java/com/yxt/user/feign/portal/sysstafforg/SysStaffOrgFeign.java new file mode 100644 index 0000000..4926334 --- /dev/null +++ b/src/main/java/com/yxt/user/feign/portal/sysstafforg/SysStaffOrgFeign.java @@ -0,0 +1,25 @@ +package com.yxt.goods.feign.portal.sysstafforg; + +import com.yxt.common.core.result.ResultBean; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * @description: 人员与机构 + * @author: dimengzhe + * @date: 2024/3/6 + **/ +@FeignClient( + contextId = "anrui-portal-SysStaffOrg", + name = "anrui-portal", + path = "v1/sysstafforg") +public interface SysStaffOrgFeign { + + @GetMapping("/getOrgSidByPath") + @ResponseBody + @ApiOperation("根据用户组织全路径获取用户的分公司sid") + ResultBean getOrgSidByPath(@RequestParam("orgPath") String orgPath); +} diff --git a/src/main/java/com/yxt/user/utils/DoubleUtils.java b/src/main/java/com/yxt/user/utils/DoubleUtils.java new file mode 100644 index 0000000..12db7cd --- /dev/null +++ b/src/main/java/com/yxt/user/utils/DoubleUtils.java @@ -0,0 +1,93 @@ +package com.yxt.goods.utils; + +import java.math.BigDecimal; + +/** + * @author wangpengfei + * @date 2024/1/24 8:53 + */ +public class DoubleUtils { + + /** + * 对double数据进行取精度. + * @param value double数据. + * @param scale 精度位数(保留的小数位数). + * @param roundingMode 精度取值方式. + * @return 精度计算后的数据. + */ + public static double round(double value, int scale, + int roundingMode) { + BigDecimal bd = BigDecimal.valueOf(value); + bd = bd.setScale(scale, roundingMode); + double d = bd.doubleValue(); + bd = null; + return d; + } + + + /** + * double 相加 + * @param d1 + * @param d2 + * @return + */ + public static double sum(double d1,double d2){ + BigDecimal bd1 = BigDecimal.valueOf(d1); + BigDecimal bd2 = BigDecimal.valueOf(d2); + return bd1.add(bd2).doubleValue(); + } + + + /** + * double 相减 + * @param d1 + * @param d2 + * @return + */ + public static double sub(double d1,double d2){ + BigDecimal bd1 = BigDecimal.valueOf(d1); + BigDecimal bd2 = BigDecimal.valueOf(d2); + return bd1.subtract(bd2).doubleValue(); + } + + /** + * double 乘法 + * @param d1 + * @param d2 + * @return + */ + public static double mul(double d1, double d2){ + BigDecimal bd1 = BigDecimal.valueOf(d1); + BigDecimal bd2 = BigDecimal.valueOf(d2); + return bd1.multiply(bd2).doubleValue(); + } + + + /** + * double 除法 + * @param d1 + * @param d2 + * @param scale 四舍五入 小数点位数 + * @return + */ + public static double div(double d1,double d2,int scale){ + BigDecimal bd1 = BigDecimal.valueOf(d1); + BigDecimal bd2 = BigDecimal.valueOf(d2); + return bd1.divide + (bd2,scale,BigDecimal.ROUND_HALF_UP).doubleValue(); + } + /** + * 去除多余.0 + * @param num + * @return + */ + public static String removeZeros(String num) { + if (num.indexOf(".") > 0) { + // 去掉多余的0 + num = num.replaceAll("0+?$", ""); + // 如果最后一位是. 则去掉 + num = num.replaceAll("[.]$", ""); + } + return num; + } +} diff --git a/src/main/java/com/yxt/user/utils/PinYinUtils.java b/src/main/java/com/yxt/user/utils/PinYinUtils.java new file mode 100644 index 0000000..76f8f92 --- /dev/null +++ b/src/main/java/com/yxt/user/utils/PinYinUtils.java @@ -0,0 +1,277 @@ +package com.yxt.goods.utils; + +import net.sourceforge.pinyin4j.PinyinHelper; +import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; +import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; +import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; +import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; +import org.apache.commons.lang3.StringUtils; + +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * @Description + * @Author liuguohui + * @Date 2021/9/16 + */ +public class PinYinUtils { + + private static HanyuPinyinOutputFormat format = null; + + static { + format = new HanyuPinyinOutputFormat(); + //拼音小写 + format.setCaseType(HanyuPinyinCaseType.LOWERCASE); + //无音标方式;WITH_TONE_NUMBER:1-4数字表示英标;WITH_TONE_MARK:直接用音标符(必须WITH_U_UNICODE否则异常 + format.setToneType(HanyuPinyinToneType.WITHOUT_TONE); + //用v表示ü + format.setVCharType(HanyuPinyinVCharType.WITH_V); + } + + // 多音字 + private static final Map DYZMAP = setDYZMap(); + + private static Map setDYZMap(){ + Map map = new HashMap<>(); + map.put("仇","QIU"); + map.put("柏", "BO"); + map.put("牟", "MU"); + map.put("颉", "XIE"); + map.put("解", "XIE"); + map.put("尉", "YU"); + map.put("奇", "JI"); + map.put("单", "SHAN"); + map.put("谌", "SHEN"); + map.put("乐", "YUE"); + map.put("召", "SHAO"); + map.put("朴", "PIAO"); + map.put("区", "OU"); + map.put("查", "ZHA"); + map.put("曾", "ZENG"); + map.put("缪", "MIAO"); + map.put("晟", "CHENG"); + map.put("员", "YUN"); + map.put("贠", "YUN"); + map.put("黑", "HE"); + map.put("重", "CHONG"); + map.put("秘", "BI"); + map.put("冼", "XIAN"); + map.put("折", "SHE"); + map.put("翟", "ZHAI"); + map.put("盖", "GE"); + map.put("万俟", "MOQI"); + map.put("尉迟", "YUCHI"); + return map; + } + + + + /** + * 返回字符串的拼音 + * @param str + * @return + */ + public static String[] getCharPinYinString(String str) { + if (str == null || str.length() < 1) { + return null; + } + List result = new ArrayList(); + //对字符串中的记录逐个分析 + for (int i = 0; i < str.length(); i++) { + result = getCharPinYinString(str.charAt(i), result); + } + return result.toArray(new String[result.size()]); + } + + /** + * 将字符c的拼音拼接到list中的记录中 + * @param c + * @param list + * @return + */ + private static List getCharPinYinString(char c, List list) { + String[] strs = getCharPinYinString(c); + List result = new ArrayList(); + // strs去重(多音字) + strs = disdinctStr(strs); + + //如果解析出的拼音为空,判断字符C是否为英文字母,如果是英文字母则添加值拼音结果中 + if (strs == null) { + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) { + c = c <= 91 ? (char)(c + 32) : c; + if (list == null || list.size() == 0) { + result.add(c + ""); + } else { + for (String s : list) { + result.add(s + c); + } + } + return result; + } + return list; + } + //将字符C的拼音首和已存在的拼音首组合成新的记录 + for (String str : strs) { + if (list == null || list.size() == 0) { + result.add(str); + } else { + for (String s : list) { + result.add(s + str); + } + } + } + return result; + } + + /** + * 返回汉字的拼音 + * @param c + * @return + */ + public static String[] getCharPinYinString(char c) { + try { + //返回字符C的拼音 + return PinyinHelper.toHanyuPinyinStringArray(c, format); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + /** + * 返回字符串的拼音的首字母 + * @param str + * @return + */ + public static String[] getCharPinYinChar(String str) { + if (str == null || str.length() < 1) { + return null; + } + List result = new ArrayList(); + //对字符串中的记录逐个分析 + for (int i = 0; i < str.length(); i++) { + result = getCharPinYinChar(str.charAt(i), result); + } + return result.toArray(new String[result.size()]); + } + + /** + * 将字符c的拼音首字母拼接到list中的记录中 + * @param c + * @param list + * @return + */ + private static List getCharPinYinChar(char c, List list) { + char[] chars = getCharPinYinChar(c); + List result = new ArrayList(); + //如果解析出的拼音为空,判断字符C是否为英文字母,如果是英文字母则添加值拼音结果中 + if (chars == null) { + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) { + c = c < 91 ? (char)(c + 32) : c; + if (list == null || list.size() == 0) { + result.add(c + ""); + } else { + for (String s : list) { + result.add(s + c); + } + } + return result; + } + return list; + } + //将字符C的拼音首字母和已存在的拼音首字母组合成新的记录 + for (char ch : chars) { + if (list == null || list.size() == 0) { + result.add(ch + ""); + } else { + for (String s : list) { + result.add(s + ch); + } + } + } + return result; + } + + /** + * 返回汉字拼音首字母 + * @param c + * @return + */ + public static char[] getCharPinYinChar(char c) { + //字符C的拼音 + String[] strs = getCharPinYinString(c); + if (strs != null) { + //截取拼音的首字母 + char[] chars = new char[strs.length]; + for(int i = 0; i arrStream = Arrays.stream(str); + List arrList = arrStream.distinct().collect(Collectors.toList()); + str = new String[arrList.size()]; + arrList.toArray(str); + return str; + } + + /** + * 判断传入的字符串是否为中文,将中文的转换为拼音 + * @param name + * @return + */ + public static String getPinYinName(String name){ + char[] nameArray = name.toCharArray(); + String newName = ""; + for (int i = 0; i < nameArray.length; i++) { + if (Character.toString(nameArray[i]).matches("^[\u4e00-\u9fa5]+$")) { // 如果字符是中文,则将中文转为汉语拼音 + String[] pinYinString = PinYinUtils.getCharPinYinString(nameArray[i]); + // strs去重(多音字) + pinYinString = disdinctStr(pinYinString); + String pinYinStr = StringUtils.join(pinYinString); + newName = newName + pinYinStr; + }else { + newName = newName + Character.toString(nameArray[i]); + } + } + return newName; + } + + /** + * 返回字符串的拼音的首字母(包括多音字) + * @param str + * @return + */ + public static String getCharDuoPinYinChar(String str) { + if (str == null || str.length() < 1) { + return null; + } + char firstChar = str.toCharArray()[0]; + if(Character.toString(firstChar).matches("^[\u4e00-\u9fa5]+$")){ // 为中文 + char[] charPinYinChar = getCharPinYinChar(firstChar); + String result = ""; + if (DYZMAP.containsKey(Character.toString(firstChar))) { + result = DYZMAP.get(Character.toString(firstChar)).toString().substring(0, 1); + }else { + result = StringUtils.join(charPinYinChar[0]); + } + return result.toUpperCase(); + }else if(Character.toString(firstChar).matches("^[a-zA-Z]")){ // 为英文字母 + return Character.toString(firstChar).toUpperCase(); + }else { // 特殊符号 + return "#"; + } + } + +} diff --git a/src/main/java/com/yxt/user/utils/StyleUtils.java b/src/main/java/com/yxt/user/utils/StyleUtils.java new file mode 100644 index 0000000..62de4fb --- /dev/null +++ b/src/main/java/com/yxt/user/utils/StyleUtils.java @@ -0,0 +1,89 @@ +package com.yxt.goods.utils; + +import com.alibaba.excel.write.metadata.style.WriteCellStyle; +import com.alibaba.excel.write.metadata.style.WriteFont; +import org.apache.poi.ss.usermodel.BorderStyle; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.usermodel.VerticalAlignment; + +/** + * @author wangpengfei + * @date 2023/12/16 22:14 + */ +public class StyleUtils { /** + * 标题样式 + * @return + */ +public static WriteCellStyle getHeadStyle(){ + // 头的策略 + WriteCellStyle headWriteCellStyle = new WriteCellStyle(); + // 背景颜色 +// headWriteCellStyle.setFillForegroundColor(IndexedColors.LIGHT_TURQUOISE1.getIndex()); +// headWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); + + // 字体 + WriteFont headWriteFont = new WriteFont(); + headWriteFont.setFontName("宋体");//设置字体名字 + headWriteFont.setFontHeightInPoints((short)14);//设置字体大小 + headWriteFont.setBold(true);//字体加粗 + headWriteCellStyle.setWriteFont(headWriteFont); //在样式用应用设置的字体; + + // 样式 + headWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置底边框; + headWriteCellStyle.setBottomBorderColor((short) 0);//设置底边框颜色; + headWriteCellStyle.setBorderLeft(BorderStyle.THIN); //设置左边框; + headWriteCellStyle.setLeftBorderColor((short) 0);//设置左边框颜色; + headWriteCellStyle.setBorderRight(BorderStyle.THIN);//设置右边框; + headWriteCellStyle.setRightBorderColor((short) 0);//设置右边框颜色; + headWriteCellStyle.setBorderTop(BorderStyle.THIN);//设置顶边框; + headWriteCellStyle.setTopBorderColor((short) 0); //设置顶边框颜色; + + headWriteCellStyle.setWrapped(true); //设置自动换行; + + headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);//设置水平对齐的样式为居中对齐; + headWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); //设置垂直对齐的样式为居中对齐; + headWriteCellStyle.setShrinkToFit(true);//设置文本收缩至合适 + + return headWriteCellStyle; +} + + + /** + * 内容样式 + * @return + */ + public static WriteCellStyle getContentStyle(){ + // 内容的策略 + WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); + + // 背景绿色 + // 这里需要指定 FillPatternType 为FillPatternType.SOLID_FOREGROUND 不然无法显示背景颜色.头默认了 FillPatternType所以可以不指定 +// contentWriteCellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); +// contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); + + // 设置字体 + WriteFont contentWriteFont = new WriteFont(); + contentWriteFont.setFontHeightInPoints((short) 12);//设置字体大小 + contentWriteFont.setFontName("宋体"); //设置字体名字 + contentWriteCellStyle.setWriteFont(contentWriteFont);//在样式用应用设置的字体; + + //设置样式; + contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置底边框; + contentWriteCellStyle.setBottomBorderColor((short) 0);//设置底边框颜色; + contentWriteCellStyle.setBorderLeft(BorderStyle.THIN); //设置左边框; + contentWriteCellStyle.setLeftBorderColor((short) 0);//设置左边框颜色; + contentWriteCellStyle.setBorderRight(BorderStyle.THIN);//设置右边框; + contentWriteCellStyle.setRightBorderColor((short) 0);//设置右边框颜色; + contentWriteCellStyle.setBorderTop(BorderStyle.THIN);//设置顶边框; + contentWriteCellStyle.setTopBorderColor((short) 0); ///设置顶边框颜色; + + contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);// 水平居中 + contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);// 垂直居中 + contentWriteCellStyle.setWrapped(true); //设置自动换行; + +// contentWriteCellStyle.setShrinkToFit(true);//设置文本收缩至合适 + + return contentWriteCellStyle; + } + +} diff --git a/src/main/resources/application-devv.yml b/src/main/resources/application-devv.yml new file mode 100644 index 0000000..30fab1d --- /dev/null +++ b/src/main/resources/application-devv.yml @@ -0,0 +1,37 @@ +spring: + datasource: + hikari: + max-lifetime: 500000 + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://39.104.100.138:3306/yxt_base?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true +# url: jdbc:mysql://8.130.39.13:3306/yxt_lpk_yythmall?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true + username: root +# password: 1LAiGz$t1*Iw + password: yxt_mysql_138 + cloud: + nacos: + discovery: + namespace: common + server-addr: 39.104.100.138:8848 + register-enabled: false + 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 # 连接超时时间(毫秒) + +image: +# xlsxtmpl: E:/code/yxt-yyth/target/classes/static/upload/ + xlsxtmpl: D:/works/projects/yxt/yxtgit/lipinka/yxt-yyth-biz/target/classes/static/upload/ + upload: +# path: E:/code/yxt-yyth/target/classes/static/upload/ + path: D:/works/projects/yxt/yxtgit/lipinka/yxt-yythmall-biz/target/classes/static/upload/ + url: + prefix: https://supervise.yxtsoft.com/lpk/upload/ diff --git a/src/main/resources/application-pro.yml b/src/main/resources/application-pro.yml new file mode 100644 index 0000000..cb9c87d --- /dev/null +++ b/src/main/resources/application-pro.yml @@ -0,0 +1,29 @@ +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://127.0.0.1:3306/yxt_base?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true + username: root + password: 1LAiGz$t1*Iw + cloud: + nacos: + discovery: + server-addr: 127.0.0.1:8848 + 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 # 连接超时时间(毫秒) +image: + upload: + path: D:/webapps/lipinka/yythmall-ui/upload/ + url: + prefix: https://supervise.yxtsoft.com/lpk/upload/ +import: + filePath: D:/yxt-supervise-gf/upload/ diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml new file mode 100644 index 0000000..fc2e84f --- /dev/null +++ b/src/main/resources/application-test.yml @@ -0,0 +1,34 @@ +server: + port: 17211 + +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.18.0.4:3306/yxt_base?serverTimezone=GMT%2B8&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true + username: root + password: yxt_mysql_138 + cloud: + nacos: + discovery: + namespace: lipinka + server-addr: 172.18.0.5:8848 + ip: 39.104.100.138 + redis: + database: 3 # Redis数据库索引(默认为0) + host: 172.18.0.7 + jedis: + pool: + max-active: -1 #连接池最大连接数(使用负值表示没有限制) + max-idle: 8 #连接池中的最大空闲连接 + max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) + min-idle: 0 # 连接池中的最小空闲连接 + password: + port: 6379 + timeout: 0 # 连接超时时间(毫秒) + + +image: + upload: + path: /home/lzh/docker_data/nginx/html/lipinka/yythmall-ui/upload/ + url: + prefix: https://lpk.yyundong.com/upload/ diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..c277bc7 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,50 @@ +spring: + application: + name: ss-common-user + profiles: + active: devv +# active: test +# active: pro + messages: + # 国际化资源文件路径 + basename: i18n/messages + servlet: + #上传文件 + multipart: + max-file-size: 50MB + max-request-size: 100MB + devtools: + restart: + # 热部署开关 + enabled: true + +server: + port: 6211 + max-http-header-size: 102400 + undertow: + max-http-post-size: -1 + +#mybatis +mybatis-plus: + # 配置mapper的扫描,找到所有的mapper.xml映射文件 + mapper-locations: classpath*:**Mapper.xml + global-config: + refresh: true + db-config: + #定义生成ID的类型 + id-type: Auto + db-type: mysql + configuration: + map-underscore-to-camel-case: false + cache-enabled: true + call-setters-on-nulls: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + +#rocketmq: +# producer: +# group: yxt-supervise-gf +# name-server: 127.0.0.1:9876 + + + + diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..ea76604 --- /dev/null +++ b/src/main/resources/logback-spring.xml @@ -0,0 +1,50 @@ + + + + + + + + + + %yellow(%date{yyyy-MM-dd HH:mm:ss}) |%highlight(%-5level) |%green(%logger:%line) |%blue(%msg%n) + + + + + + + + + + + + + + + ${log.base}.log + + ${log.base}.%d{yyyyMMdd}.%i.log.zip + + + + 1MB + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} + -%msg%n + + + + + + + + + + \ No newline at end of file diff --git a/src/test/java/com/yxt/goods/GoodsApplicationTest.java b/src/test/java/com/yxt/goods/GoodsApplicationTest.java new file mode 100644 index 0000000..a1d4ff0 --- /dev/null +++ b/src/test/java/com/yxt/goods/GoodsApplicationTest.java @@ -0,0 +1,24 @@ +package com.yxt.goods; + +import cn.hutool.core.util.IdUtil; +import org.junit.Test; + +import java.util.UUID; + +public class GoodsApplicationTest { + + @Test + public void test() { + System.out.println(IdUtil.nanoId()); + System.out.println(IdUtil.getSnowflakeNextId()); + + UUID uuid = UUID.randomUUID(); + String uniqueID = uuid.toString().replaceAll("-", "").substring(0, 16).replaceAll("\\D", ""); + System.out.println(uniqueID); + } +} + +//do3KW8XIUSyu4vg_zTXdm +// 1727231267909320704 +//uw0AotdmQTlIxKlA2V8_O +// 1727231437887668224