|
|
@@ -113,7 +113,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
goodsMapper.insert(kwtLogisticsOrderGoods);
|
|
|
|
|
|
//辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findList(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", logisticsOrder.getId());
|
|
|
}});
|
|
|
if (CollectionUtils.isNotEmpty(assistUnit)) {
|
|
|
@@ -160,7 +160,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
*/
|
|
|
public void editLogisticsOrderGoodsLoading(Long lOrderId) {
|
|
|
//辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findList(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", lOrderId);
|
|
|
}});
|
|
|
if (CollectionUtils.isNotEmpty(assistUnit)) {
|
|
|
@@ -196,7 +196,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
*/
|
|
|
public void editLogisticsOrderGoodsTotalLoading(Long lOrderId) {
|
|
|
//辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findList(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", lOrderId);
|
|
|
}});
|
|
|
if (CollectionUtils.isNotEmpty(assistUnit)) {
|
|
|
@@ -222,7 +222,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
*/
|
|
|
public void editLogisticsOrderGoodsTotalLoading(OrderManualCompletionDto params) {
|
|
|
//辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findList(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", params.getId());
|
|
|
}});
|
|
|
List<OrderGoodsLoadingDto> loading = params.getLoading();
|
|
|
@@ -289,7 +289,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
public List<GoodsUnitVo> assistUnit(Long lOrderId) {
|
|
|
List<GoodsUnitVo> units = new ArrayList<>();
|
|
|
//辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findList(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", lOrderId);
|
|
|
}});
|
|
|
|
|
|
@@ -319,7 +319,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
*/
|
|
|
public List<KwtLogisticsOrderGoodsUnit> findGoodsUnit(Long lOrderId) {
|
|
|
//辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findList(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", lOrderId);
|
|
|
}});
|
|
|
return assistUnit;
|
|
|
@@ -335,7 +335,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
public List<GoodsLoadingParam> goodsLoadingParams(KwtLogisticsOrder logisticsOrder, List<OrderGoodsLoadingDto> loading) {
|
|
|
List<GoodsLoadingParam> loadingParams = new ArrayList<>();
|
|
|
//辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findList(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", logisticsOrder.getId());
|
|
|
}});
|
|
|
//数据处理
|
|
|
@@ -373,18 +373,18 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
*/
|
|
|
public List<GoodsLoadingParam> goodsLoadingParams(KwtLogisticsOrder logisticsOrder, boolean operator) {
|
|
|
List<GoodsLoadingParam> loadingParams = new ArrayList<>();
|
|
|
- //辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
- put("lOrderId", logisticsOrder.getId());
|
|
|
- }});
|
|
|
- log.info("assistUnit:{}", JSONObject.toJSONString(assistUnit));
|
|
|
//住单位
|
|
|
BigDecimal amount = logisticsOrder.getAmount();
|
|
|
loadingParams.add(new GoodsLoadingParam(logisticsOrder.getUnit(), operator ? amount : amount.negate(), logisticsOrder.getTotalLoadAmount()));
|
|
|
|
|
|
+ //辅助单位
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findList(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
+ put("lOrderId", logisticsOrder.getId());
|
|
|
+ }});
|
|
|
+ log.info("assistUnit:{}", JSONObject.toJSONString(assistUnit));
|
|
|
//数据处理
|
|
|
if (CollectionUtils.isNotEmpty(assistUnit) && (assistUnit.size() > 0)) {
|
|
|
- assistUnit.forEach(ee -> {
|
|
|
+ for (KwtLogisticsOrderGoodsUnit ee:assistUnit) {
|
|
|
BigDecimal loadAmount = ee.getTotalLoadAmount() == null ? new BigDecimal("0.00") : ee.getTotalLoadAmount();
|
|
|
BigDecimal conversionValue = ee.getConversionValue();
|
|
|
if (ee.getUnit().equals(ee.getFromUnit())) {
|
|
|
@@ -395,7 +395,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
BigDecimal value = loadAmount.divide(conversionValue);
|
|
|
loadingParams.add(new GoodsLoadingParam(ee.getUnit(), operator ? value : value.negate(), loadAmount));
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
return loadingParams;
|
|
|
}
|