Explorar o código

商品管理相关字典调整

yzc %!s(int64=2) %!d(string=hai) anos
pai
achega
5d5da4852e

+ 3 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictEnum.java

@@ -22,6 +22,9 @@ public enum DictEnum {
     UNIT_TYPE_2("unit_type","2", "箱"),
     UNIT_TYPE_3("unit_type","3", "件"),
     UNIT_TYPE_4("unit_type","4", "其他"),
+    TAX_RATE_0("tax_rate","13.00", "13%"),
+    TAX_RATE_1("tax_rate","11.00", "11%"),
+    TAX_RATE_2("tax_rate","10.00", "10%"),
     TRADE_TYPE_0("trade_type", "0", "预付款"),
     TRADE_TYPE_1("trade_type", "1", "货到付款"),
     TRADE_TYPE_2("trade_type", "2", "线下付款"),

+ 1 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/common/enums/enums/DictTypeEnum.java

@@ -13,6 +13,7 @@ import lombok.Getter;
 public enum DictTypeEnum {
     INTEGRAL_TYPE("integral_type", "积分类型"),
     UNIT_TYPE("unit_type", "商品单位类型"),
+    TAX_RATE("tax_rate", "商品税率"),
     PRICE_TYPE("price_type", "运价方式"),
     TRADE_TYPE("trade_type", "交易方式"),
     PICKUP_TYPE("pickup_type", "提货方式"),

+ 10 - 0
sckw-modules-api/sckw-product-api/src/main/java/com/sckw/product/api/model/GoodsDetail.java

@@ -76,6 +76,11 @@ public class GoodsDetail {
      */
     private String unit;
 
+    /**
+     * 单位lab
+     */
+    private String unitLabel;
+
     /**
      * 尺寸大小
      */
@@ -86,6 +91,11 @@ public class GoodsDetail {
      */
     private BigDecimal taxRate;
 
+    /**
+     * 发票税率label
+     */
+    private String taxRateLabel;
+
     /**
      * 交易方式(value)(合同采购、直接采购、预付款、货到付款、到款发货)
      */

+ 1 - 1
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/GoodsListExport.java

@@ -33,7 +33,7 @@ public class GoodsListExport implements Serializable {
     private String spec;
 
     @ExcelProperty(value = "增值税", index = 5)
-    private String taxRate;
+    private String taxRateLabel;
 
     @ExcelProperty(value = "库存数量", index = 6)
     private String amount;

+ 5 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/res/GoodsDetail.java

@@ -91,6 +91,11 @@ public class GoodsDetail {
      */
     private BigDecimal taxRate;
 
+    /**
+     * 发票税率label
+     */
+    private String taxRateLabel;
+
     /**
      * 交易方式(value)(合同采购、直接采购、预付款、货到付款、到款发货)
      */

+ 5 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/res/GoodsList.java

@@ -70,6 +70,11 @@ public class GoodsList {
      */
     private BigDecimal taxRate;
 
+    /**
+     * 发票税率label
+     */
+    private String taxRateLabel;
+
     /**
      * 库存数量
      */

+ 5 - 3
sckw-modules/sckw-product/src/main/java/com/sckw/product/service/KwpGoodsService.java

@@ -30,6 +30,7 @@ import com.sckw.system.api.model.dto.res.UserCacheResDto;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
+import org.jetbrains.annotations.NotNull;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -182,6 +183,7 @@ public class KwpGoodsService {
         detail.setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), detail.getGoodsType()))
                 .setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), detail.getTrading()))
                 .setUnitLabel(DictEnum.getLabel(DictTypeEnum.UNIT_TYPE.getType(), detail.getUnit()))
+                .setTaxRateLabel(DictEnum.getLabel(DictTypeEnum.TAX_RATE.getType(), String.valueOf(detail.getTaxRate())))
                 .setStatusLabel(DictEnum.getLabel(DictTypeEnum.GOODS_STATUS.getType(), String.valueOf(detail.getStatus())));
         //商品图片信息
         List<KwpGoodsImage> goodsImages = kwpGoodsImageService.getByGoodsId(id);
@@ -290,7 +292,7 @@ public class KwpGoodsService {
      * @Param param:
      * @return: void
      */
-    private void judgeParameters(UpdateGoodsParam param) {
+    private void judgeParameters(@NotNull UpdateGoodsParam param) {
         if (StringUtils.isBlank(param.getName())) {
             throw new BusinessException("商品名称不能为空!");
         }
@@ -377,6 +379,7 @@ public class KwpGoodsService {
                     .setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), goodsList.getGoodsType()))
                     .setUnitLabel(DictEnum.getLabel(DictTypeEnum.UNIT_TYPE.getType(), goodsList.getUnit()))
                     .setTradingLabel(DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), goodsList.getTrading()))
+                    .setTaxRateLabel(DictEnum.getLabel(DictTypeEnum.TAX_RATE.getType(), String.valueOf(goodsList.getTaxRate())))
                     .setManageName(Objects.nonNull(manager) ? manager.getName() : null)
                     .setPhone(Objects.nonNull(manager) ? manager.getPhone() : null)
                     .setSupplyEnt(Objects.nonNull(entMap.get(e.getSupplyEntId())) ? entMap.get(e.getSupplyEntId()) : null)
@@ -471,8 +474,7 @@ public class KwpGoodsService {
         List<GoodsListExport> list = new ArrayList<>();
         goodsLists.forEach(e -> {
             GoodsListExport export = BeanUtils.copyProperties(e, GoodsListExport.class);
-            export.setTaxRate(String.valueOf(e.getTaxRate())).setAmount(String.valueOf(e.getAmount()))
-                    .setHighestPrice(String.valueOf(e.getHighestPrice())).setLowestPrice(String.valueOf(e.getLowestPrice()))
+            export.setHighestPrice(String.valueOf(e.getHighestPrice())).setLowestPrice(String.valueOf(e.getLowestPrice()))
                     .setAddedTime(Objects.isNull(e.getAddedTime()) ? null : DateUtil.getDateTime(e.getAddedTime()))
                     .setAddedTime(Objects.isNull(e.getShelfTime()) ? null : DateUtil.getDateTime(e.getShelfTime()));
             list.add(export);