|
|
@@ -31,12 +31,13 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
- * @desc 物流订单关联商品信息
|
|
|
* @author zk
|
|
|
+ * @desc 物流订单关联商品信息
|
|
|
* @date 2023/12/6 0006
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@@ -56,6 +57,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 物流订单-商品信息
|
|
|
+ *
|
|
|
* @param bo 页面请求数据
|
|
|
* @param lOrderNo 物流订单编号
|
|
|
* @param orderId 物流订单表编号
|
|
|
@@ -89,6 +91,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 分包托运-承运订单-商品信息
|
|
|
+ *
|
|
|
* @param bo
|
|
|
* @param lOrderNo
|
|
|
* @param orderId
|
|
|
@@ -111,7 +114,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
goodsMapper.insert(kwtLogisticsOrderGoods);
|
|
|
|
|
|
//辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN){{
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", logisticsOrder.getId());
|
|
|
}});
|
|
|
if (CollectionUtils.isNotEmpty(assistUnit)) {
|
|
|
@@ -131,6 +134,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 承运订单-页面新增订单-商品信息
|
|
|
+ *
|
|
|
* @param orderDTO 页面参数
|
|
|
* @param lOrderId 订单id
|
|
|
* @param lOrderNo 订单编号
|
|
|
@@ -152,11 +156,12 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 更新物流订单商品辅助单位-装卸货量
|
|
|
+ *
|
|
|
* @param lOrderId 物流订单
|
|
|
*/
|
|
|
public void editLogisticsOrderGoodsLoading(Long lOrderId) {
|
|
|
//辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN){{
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", lOrderId);
|
|
|
}});
|
|
|
if (CollectionUtils.isNotEmpty(assistUnit)) {
|
|
|
@@ -177,11 +182,12 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 更新物流订单商品辅助单位-装卸货量
|
|
|
+ *
|
|
|
* @param lOrderId 物流订单
|
|
|
*/
|
|
|
public void editLogisticsOrderGoodsTotalLoading(Long lOrderId) {
|
|
|
//辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN){{
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", lOrderId);
|
|
|
}});
|
|
|
if (CollectionUtils.isNotEmpty(assistUnit)) {
|
|
|
@@ -208,17 +214,18 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 完结物流订单更新商品辅助单位
|
|
|
+ *
|
|
|
* @param params 完结参数
|
|
|
*/
|
|
|
- public void editLogisticsOrderGoodsTotalLoading(OrderManualCompletionDto params){
|
|
|
+ public void editLogisticsOrderGoodsTotalLoading(OrderManualCompletionDto params) {
|
|
|
//辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN){{
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", params.getId());
|
|
|
}});
|
|
|
List<OrderGoodsLoadingDto> loading = params.getLoading();
|
|
|
if (CollectionUtils.isNotEmpty(assistUnit)) {
|
|
|
assistUnit.forEach(e -> {
|
|
|
- for (OrderGoodsLoadingDto goodsLoading:loading) {
|
|
|
+ for (OrderGoodsLoadingDto goodsLoading : loading) {
|
|
|
if (goodsLoading.getUnit().equals(e.getUnit())) {
|
|
|
//更新物流订单商品辅助单位-总装卸货量
|
|
|
e.setTotalLoadAmount(goodsLoading.getLoadAmount());
|
|
|
@@ -232,8 +239,9 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 物流托运校验贸易订单可派量
|
|
|
+ *
|
|
|
* @param logisticsOrder 派车参数
|
|
|
- * @param tradeOrder 贸易订单
|
|
|
+ * @param tradeOrder 贸易订单
|
|
|
* @return true 校验通过
|
|
|
*/
|
|
|
public boolean chenkAmount(LogisticsConsignmentParam logisticsOrder, OrderDetailRes tradeOrder) {
|
|
|
@@ -250,7 +258,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
return false;
|
|
|
}
|
|
|
//辅助单位
|
|
|
- for (GoodsUnitParam goodsUnit:assistUnit) {
|
|
|
+ for (GoodsUnitParam goodsUnit : assistUnit) {
|
|
|
BigDecimal conversionValue = goodsUnit.getConversionValue();
|
|
|
if (logisticsOrder.getCarryingCapacityUnit().equals(goodsUnit.getFromUnit())) {
|
|
|
BigDecimal value = arryingCapacity.multiply(conversionValue);
|
|
|
@@ -271,13 +279,14 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 获取物流订单辅助单位信息
|
|
|
+ *
|
|
|
* @param lOrderId 物流订单
|
|
|
* @return 辅助单位信息
|
|
|
*/
|
|
|
public List<GoodsUnitVo> assistUnit(Long lOrderId) {
|
|
|
List<GoodsUnitVo> units = new ArrayList<>();
|
|
|
//辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN){{
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", lOrderId);
|
|
|
}});
|
|
|
|
|
|
@@ -291,7 +300,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
|
|
|
Map<String, String> finalUnitMap = unitMap;
|
|
|
units = BeanUtils.copyToList(assistUnit, GoodsUnitVo.class);
|
|
|
- units.forEach(e->{
|
|
|
+ units.forEach(e -> {
|
|
|
e.setFromUnitName(finalUnitMap != null ? finalUnitMap.get(e.getFromUnit()) : null);
|
|
|
e.setToUnitName(finalUnitMap != null ? finalUnitMap.get(e.getToUnit()) : null);
|
|
|
});
|
|
|
@@ -301,12 +310,13 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 获取物流订单辅助单位信息
|
|
|
+ *
|
|
|
* @param lOrderId 物流订单
|
|
|
* @return 辅助单位信息
|
|
|
*/
|
|
|
public List<KwtLogisticsOrderGoodsUnit> findGoodsUnit(Long lOrderId) {
|
|
|
//辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN){{
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", lOrderId);
|
|
|
}});
|
|
|
return assistUnit;
|
|
|
@@ -314,14 +324,15 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 贸易订单参数处理-物流订单完结
|
|
|
+ *
|
|
|
* @param logisticsOrder 物流订单
|
|
|
- * @param loading 装载信息
|
|
|
+ * @param loading 装载信息
|
|
|
* @return 贸易订单
|
|
|
*/
|
|
|
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.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", logisticsOrder.getId());
|
|
|
}});
|
|
|
//数据处理
|
|
|
@@ -352,14 +363,15 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
|
|
|
/**
|
|
|
* 贸易订单参数处理-物流订单撤销/物流委托
|
|
|
+ *
|
|
|
* @param logisticsOrder 物流订单
|
|
|
- * @param operator 运算符正负,贸易订单加减(true 正、false 减)
|
|
|
+ * @param operator 运算符正负,贸易订单加减(true 正、false 减)
|
|
|
* @return 贸易订单
|
|
|
*/
|
|
|
public List<GoodsLoadingParam> goodsLoadingParams(KwtLogisticsOrder logisticsOrder, boolean operator) {
|
|
|
List<GoodsLoadingParam> loadingParams = new ArrayList<>();
|
|
|
//辅助单位
|
|
|
- List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN){{
|
|
|
+ List<KwtLogisticsOrderGoodsUnit> assistUnit = goodsUnitMapper.findGoodsUnit(new HashMap<>(NumberConstant.SIXTEEN) {{
|
|
|
put("lOrderId", logisticsOrder.getId());
|
|
|
}});
|
|
|
//住单位
|
|
|
@@ -369,7 +381,7 @@ public class KwtLogisticsOrderGoodsService {
|
|
|
//数据处理
|
|
|
if (CollectionUtils.isNotEmpty(assistUnit)) {
|
|
|
assistUnit.forEach(ee -> {
|
|
|
- BigDecimal loadAmount = ee.getTotalLoadAmount();
|
|
|
+ BigDecimal loadAmount = ee.getTotalLoadAmount() == null ? new BigDecimal("0.00") : ee.getTotalLoadAmount();
|
|
|
BigDecimal conversionValue = ee.getConversionValue();
|
|
|
if (ee.getUnit().equals(ee.getFromUnit())) {
|
|
|
BigDecimal value = loadAmount.multiply(conversionValue);
|