Kaynağa Gözat

提货配置表调整

shasha 1 ay önce
ebeveyn
işleme
67a0f3e5fe

+ 4 - 3
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/goodsConf/entity/BizGoodsConf.java

@@ -18,6 +18,7 @@ import lombok.Getter;
 import lombok.Setter;
 import vip.xiaonuo.common.pojo.CommonEntity;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -62,15 +63,15 @@ public class BizGoodsConf extends CommonEntity {
 
     /** 可提重量(KG) */
     @Schema(description = "可提重量(KG)")
-    private Double confWeight;
+    private BigDecimal confWeight;
 
     /** 已提重量(KG) */
     @Schema(description = "已提重量(KG)")
-    private Double usedWeight;
+    private BigDecimal usedWeight;
 
     /** 剩余提货重量(KG) */
     @Schema(description = "剩余提货重量(KG)")
-    private Double lastWeight;
+    private BigDecimal lastWeight;
 
 
 

+ 2 - 1
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/goodsConf/param/BizGoodsConfEditParam.java

@@ -19,6 +19,7 @@ import lombok.Setter;
 import jakarta.validation.constraints.NotBlank;
 import jakarta.validation.constraints.NotNull;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -63,6 +64,6 @@ public class BizGoodsConfEditParam {
     /** 可提重量(KG) */
     @Schema(description = "可提重量", requiredMode = Schema.RequiredMode.REQUIRED)
     @NotNull(message = "可提重量不能为空")
-    private Double confWeight;
+    private BigDecimal confWeight;
 
 }

+ 0 - 4
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/goodsConf/param/BizGoodsConfPageParam.java

@@ -54,10 +54,6 @@ public class BizGoodsConfPageParam {
     @Schema(description = "货品名称")
     private String goodsName;
 
-    /** 重量(KG) */
-    @Schema(description = "重量(KG)")
-    private Double needWeight;
-
     /** 提货开始时间开始 */
     @Schema(description = "提货开始时间开始")
     private String startConfStartTime;

+ 2 - 1
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/goodsConf/service/BizGoodsConfService.java

@@ -20,6 +20,7 @@ import vip.xiaonuo.biz.modular.goodsConf.param.BizGoodsConfEditParam;
 import vip.xiaonuo.biz.modular.goodsConf.param.BizGoodsConfIdParam;
 import vip.xiaonuo.biz.modular.goodsConf.param.BizGoodsConfPageParam;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -94,7 +95,7 @@ public interface BizGoodsConfService extends IService<BizGoodsConf> {
      * @author sandy
      * @date  2025/03/27 17:54
      **/
-    void editUsedWeight(String goodsConfId, Double newUsedWeight);
+    void editUsedWeight(String goodsConfId, BigDecimal newUsedWeight);
 
     /**
      * 根据订单查询提货时间信息

+ 14 - 10
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/goodsConf/service/impl/BizGoodsConfServiceImpl.java

@@ -44,6 +44,7 @@ import vip.xiaonuo.biz.modular.goodsConf.param.BizGoodsConfIdParam;
 import vip.xiaonuo.biz.modular.goodsConf.param.BizGoodsConfPageParam;
 import vip.xiaonuo.biz.modular.goodsConf.service.BizGoodsConfService;
 
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -70,6 +71,9 @@ public class BizGoodsConfServiceImpl extends ServiceImpl<BizGoodsConfMapper, Biz
         if(ObjectUtil.isNotEmpty(goodsConfPageParam.getGoodsName())) {
             queryWrapper.lambda().like(BizGoodsConf::getGoodsName, goodsConfPageParam.getGoodsName());
         }
+        if(ObjectUtil.isNotEmpty(goodsConfPageParam.getGoodsCode())) {
+            queryWrapper.lambda().like(BizGoodsConf::getGoodsCode, goodsConfPageParam.getGoodsCode());
+        }
         if(ObjectUtil.isNotEmpty(goodsConfPageParam.getStartConfStartTime()) && ObjectUtil.isNotEmpty(goodsConfPageParam.getEndConfStartTime())) {
             queryWrapper.lambda().between(BizGoodsConf::getConfStartTime, goodsConfPageParam.getStartConfStartTime(), goodsConfPageParam.getEndConfStartTime());
         }
@@ -118,7 +122,7 @@ public class BizGoodsConfServiceImpl extends ServiceImpl<BizGoodsConfMapper, Biz
             JSONUtil.parseArray(goodsJson).forEach(object -> {
                 JSONObject jsonObject = JSONUtil.parseObj(object);
                 String goodsId = jsonObject.getStr("goodsId");
-                Double confWeight = jsonObject.getDouble("confWeight");
+                BigDecimal confWeight = jsonObject.getBigDecimal("confWeight");
                 if (ObjectUtil.isNotEmpty(goodsId)) {
                     // 查询货品
                     BizGoods bizGoods = this.bizGoodsService.queryEntity(goodsId);
@@ -147,7 +151,7 @@ public class BizGoodsConfServiceImpl extends ServiceImpl<BizGoodsConfMapper, Biz
                             /** 可提重量(KG) */
                             goodsConf.setConfWeight(confWeight);
                             /** 已提重量(KG) */
-                            goodsConf.setUsedWeight(0.0);
+                            goodsConf.setUsedWeight(BigDecimal.ZERO);
                             /** 剩余提货重量(KG) */
                             goodsConf.setLastWeight(goodsConf.getConfWeight());
 
@@ -175,11 +179,11 @@ public class BizGoodsConfServiceImpl extends ServiceImpl<BizGoodsConfMapper, Biz
         }
 
         /** 可提重量(KG) */
-        Double confWeight = goodsConf.getConfWeight();
+        BigDecimal confWeight = goodsConf.getConfWeight();
         /** 已提重量(KG) */
-        Double usedWeight = goodsConf.getUsedWeight();
+        BigDecimal usedWeight = goodsConf.getUsedWeight();
         /** 剩余提货重量(KG) */
-        goodsConf.setLastWeight(confWeight-usedWeight);
+        goodsConf.setLastWeight(confWeight.subtract(usedWeight));
         this.updateById(goodsConf);
     }
 
@@ -223,18 +227,18 @@ public class BizGoodsConfServiceImpl extends ServiceImpl<BizGoodsConfMapper, Biz
 
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public void editUsedWeight(String goodsConfId, Double newUsedWeight) {
+    public void editUsedWeight(String goodsConfId, BigDecimal newUsedWeight) {
         BizGoodsConf goodsConf = this.queryEntity(goodsConfId);
         if(null != goodsConf){
             /** 最大可提货重量(KG) */
-            Double confWeight = goodsConf.getConfWeight();
+            BigDecimal confWeight = goodsConf.getConfWeight();
             /** 原已提重量(KG) */
-            Double usedWeight = goodsConf.getUsedWeight();
-            usedWeight = usedWeight + newUsedWeight;
+            BigDecimal usedWeight = goodsConf.getUsedWeight();
+            usedWeight = usedWeight.add(newUsedWeight);
             // 更新已提货重量
             goodsConf.setUsedWeight(usedWeight);
             /** 剩余提货重量(KG) */
-            goodsConf.setLastWeight(confWeight-usedWeight);
+            goodsConf.setLastWeight(confWeight.subtract(usedWeight));
             this.updateById(goodsConf);
         }
     }

+ 7 - 3
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/supplier/param/BizSupplierPageParam.java

@@ -42,8 +42,12 @@ public class BizSupplierPageParam {
     @Schema(description = "排序方式,升序:ASCEND;降序:DESCEND")
     private String sortOrder;
 
-    /** 关键词 */
-    @Schema(description = "关键词")
-    private String searchKey;
+    /** 供货商名称 */
+    @Schema(description = "供货商名称")
+    private String supplierName;
+
+    /** 联系人 */
+    @Schema(description = "联系人")
+    private String supplierContactName;
 
 }

+ 5 - 2
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/supplier/service/impl/BizSupplierServiceImpl.java

@@ -46,8 +46,11 @@ public class BizSupplierServiceImpl extends ServiceImpl<BizSupplierMapper, BizSu
     @Override
     public Page<BizSupplier> page(BizSupplierPageParam bizSupplierPageParam) {
         QueryWrapper<BizSupplier> queryWrapper = new QueryWrapper<BizSupplier>().checkSqlInjection();
-        if(ObjectUtil.isNotEmpty(bizSupplierPageParam.getSearchKey())){
-            queryWrapper.lambda().like(BizSupplier::getSupplierName,bizSupplierPageParam.getSearchKey());
+        if(ObjectUtil.isNotEmpty(bizSupplierPageParam.getSupplierName())){
+            queryWrapper.lambda().like(BizSupplier::getSupplierName,bizSupplierPageParam.getSupplierName());
+        }
+        if(ObjectUtil.isNotEmpty(bizSupplierPageParam.getSupplierContactName())){
+            queryWrapper.lambda().like(BizSupplier::getSupplierContactName,bizSupplierPageParam.getSupplierContactName());
         }
         queryWrapper.lambda().orderByDesc(BizSupplier::getCreateTime);
         return this.page(CommonPageRequest.defaultPage(), queryWrapper);