From bf630b0d8736242ac7ecabad2c0023f4e3367336 Mon Sep 17 00:00:00 2001 From: qiaohui <924337501@qq.com> Date: Thu, 19 Sep 2024 23:08:45 +0800 Subject: [PATCH] =?UTF-8?q?app/sale/buyNew=20=20=20=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E5=89=8D=E5=8F=B0=E4=BC=A0=E4=BA=86=20createTime=EF=BC=8C?= =?UTF-8?q?=E5=B0=B1=E4=B8=8D=E8=A6=81=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E7=94=A8=E5=89=8D=E5=8F=B0=E4=BC=A0=E7=9A=84=20app/pr?= =?UTF-8?q?oductCategory/list=20=20=E6=8E=A5=E5=8F=A3=E7=9A=84sql=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E5=90=8C=E6=97=B6=E5=8A=A0=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=8F=82=E6=95=B0=20count=20=20stockCount?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProductCategoryController.java | 5 +- .../dao/mapper/ProductCategoryMapper.java | 3 ++ .../cc/hiver/mall/entity/ProductCategory.java | 6 +++ .../mybatis/ProductCategoryService.java | 3 ++ .../SalesAndDetailsServiceImpl.java | 5 +- .../mybatis/ProductCategoryServiceImpl.java | 5 ++ .../mapper/ProductCategoryMapper.xml | 46 +++++++++++++++++++ 7 files changed, 70 insertions(+), 3 deletions(-) diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductCategoryController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductCategoryController.java index 62ebff20..6d290842 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductCategoryController.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductCategoryController.java @@ -85,8 +85,9 @@ public class ProductCategoryController { QueryWrapper queryWrapper = new QueryWrapper<>(); // shopId从缓存中设置 final String shopId = securityUtil.getShopId(); - queryWrapper.eq("shop_id", shopId); - List list = productCategoryService.list(queryWrapper); +// final String shopId = "1759768115375378438"; +// queryWrapper.eq("shop_id", shopId); + List list = productCategoryService.getCategoryListByShopId(shopId); return new ResultUtil>().setData(list); } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ProductCategoryMapper.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ProductCategoryMapper.java index e0322dea..f8af8eed 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ProductCategoryMapper.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/dao/mapper/ProductCategoryMapper.java @@ -39,4 +39,7 @@ public interface ProductCategoryMapper extends BaseMapper { void insertBatch(List addProductCategory); ProductCategoryVo getDefaultCategory(String shopId); + + + List getCategoryListByShopId(@Param("shopId") String shopId); } \ No newline at end of file diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/ProductCategory.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/ProductCategory.java index e629cde7..13b842a6 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/ProductCategory.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/ProductCategory.java @@ -17,5 +17,11 @@ public class ProductCategory extends HiverBaseEntity { @ApiModelProperty(value = "店铺id") private String shopId; + @ApiModelProperty(value = "数量") + private int count; + + @ApiModelProperty(value = "盘点数量") + private int stockCount; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductCategoryService.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductCategoryService.java index 6755bfed..11a7fd70 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductCategoryService.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/service/mybatis/ProductCategoryService.java @@ -56,4 +56,7 @@ public interface ProductCategoryService extends IService { void batchSaveCategoryOfShop(ProductCategoryVo productCategoryVo); ProductCategoryVo getCategoryOfshop(); + + + List getCategoryListByShopId(String shopId); } diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesAndDetailsServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesAndDetailsServiceImpl.java index 479bec78..0d75401c 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesAndDetailsServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/SalesAndDetailsServiceImpl.java @@ -266,7 +266,10 @@ public class SalesAndDetailsServiceImpl implements SalesAndDetailsService { // 获取销售员的手机号 final User user = securityUtil.getCurrUser(); sale.setCreateByPhone(user.getMobile()); - sale.setCreateTime(new Date()); + // 前台没传时间的话,创建当前时间 + if(sale.getCreateTime() == null) { + sale.setCreateTime(new Date()); + } sale.setDelFlag(CommonConstant.DEL_FLAG_FALSE); // 客户id // sale.setUserId(); diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductCategoryServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductCategoryServiceImpl.java index f7870830..8cf3e1c3 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductCategoryServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductCategoryServiceImpl.java @@ -498,4 +498,9 @@ public class ProductCategoryServiceImpl extends ServiceImpl getCategoryListByShopId(String shopId){ + return productCategoryMapper.getCategoryListByShopId(shopId); + } } diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/ProductCategoryMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/ProductCategoryMapper.xml index 1716ed9d..09fddd33 100644 --- a/hiver-modules/hiver-mall/src/main/resources/mapper/ProductCategoryMapper.xml +++ b/hiver-modules/hiver-mall/src/main/resources/mapper/ProductCategoryMapper.xml @@ -280,4 +280,50 @@ where shop_id = #{shopId,jdbcType=VARCHAR} and category_name = '默认分类' + + + \ No newline at end of file