|
@@ -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);
|
|
|
}
|
|
|
}
|