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