Commit a8f63e36 by yinyong

WMS物流费用接口数据对接

parent 2dc8ab0c
...@@ -23,6 +23,7 @@ import org.apache.commons.beanutils.BeanUtils; ...@@ -23,6 +23,7 @@ import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
...@@ -61,7 +62,7 @@ public class WmsLogisticsJob extends PointJob { ...@@ -61,7 +62,7 @@ public class WmsLogisticsJob extends PointJob {
} }
if (StringUtils.isNotBlank(resultStr)) { if (StringUtils.isNotBlank(resultStr)) {
WmsLogisticsInfo wmsLogisticsInfo = JSON.parseObject(resultStr, WmsLogisticsInfo.class); WmsLogisticsInfo wmsLogisticsInfo = JSON.parseObject(resultStr, WmsLogisticsInfo.class);
if (wmsLogisticsInfo.getSuccess() != null && wmsLogisticsInfo.getSuccess()) { if (wmsLogisticsInfo.getSuccess() != null && wmsLogisticsInfo.getSuccess()) {
WmsLogisticsInfo.Result result = wmsLogisticsInfo.getResult(); WmsLogisticsInfo.Result result = wmsLogisticsInfo.getResult();
List<WmsLogisticsInfo.Result.LogisticsInner> items = result.getResult(); List<WmsLogisticsInfo.Result.LogisticsInner> items = result.getResult();
if (jobPointLog.getPageIndex().equals(0)) { if (jobPointLog.getPageIndex().equals(0)) {
...@@ -75,14 +76,14 @@ public class WmsLogisticsJob extends PointJob { ...@@ -75,14 +76,14 @@ public class WmsLogisticsJob extends PointJob {
items.forEach(wmsStockItem -> { items.forEach(wmsStockItem -> {
try { try {
BeanUtils.copyProperties(dcBaseLogistics, wmsStockItem); BeanUtils.copyProperties(dcBaseLogistics, wmsStockItem);
dcBaseLogistics.setMerchantOutputWeightKg(dcBaseLogistics.getMerchantOutputWeightKg().setScale(4, RoundingMode.HALF_EVEN)); dcBaseLogistics.setMerchantOutputWeightKg(dcBaseLogistics.getMerchantOutputWeightKg() == null ? BigDecimal.ZERO : dcBaseLogistics.getMerchantOutputWeightKg().setScale(4, RoundingMode.HALF_EVEN));
dcBaseLogistics.setMerchantShipmentCostCny(dcBaseLogistics.getMerchantShipmentCostCny().setScale(4, RoundingMode.HALF_EVEN)); dcBaseLogistics.setMerchantShipmentCostCny(dcBaseLogistics.getMerchantShipmentCostCny() == null ? BigDecimal.ZERO : dcBaseLogistics.getMerchantShipmentCostCny().setScale(4, RoundingMode.HALF_EVEN));
dcBaseLogistics.setOutputWeightKg(dcBaseLogistics.getOutputWeightKg().setScale(4, RoundingMode.HALF_EVEN)); dcBaseLogistics.setOutputWeightKg(dcBaseLogistics.getOutputWeightKg() == null ? BigDecimal.ZERO : dcBaseLogistics.getOutputWeightKg().setScale(4, RoundingMode.HALF_EVEN));
dcBaseLogistics.setBailunShipmentCostCny(dcBaseLogistics.getBailunShipmentCostCny().setScale(4, RoundingMode.HALF_EVEN)); dcBaseLogistics.setBailunShipmentCostCny(dcBaseLogistics.getBailunShipmentCostCny() == null ? BigDecimal.ZERO : dcBaseLogistics.getBailunShipmentCostCny().setScale(4, RoundingMode.HALF_EVEN));
dcBaseLogistics.setMerchantOutputWeightKgOriginal(dcBaseLogistics.getMerchantOutputWeightKgOriginal().setScale(4, RoundingMode.HALF_EVEN)); dcBaseLogistics.setMerchantOutputWeightKgOriginal(dcBaseLogistics.getMerchantOutputWeightKgOriginal() == null ? BigDecimal.ZERO : dcBaseLogistics.getMerchantOutputWeightKgOriginal().setScale(4, RoundingMode.HALF_EVEN));
dcBaseLogistics.setMerchantShipmentCostSnyOriginal(dcBaseLogistics.getMerchantShipmentCostSnyOriginal().setScale(4, RoundingMode.HALF_EVEN)); dcBaseLogistics.setMerchantShipmentCostSnyOriginal(dcBaseLogistics.getMerchantShipmentCostSnyOriginal() == null ? BigDecimal.ZERO : dcBaseLogistics.getMerchantShipmentCostSnyOriginal().setScale(4, RoundingMode.HALF_EVEN));
dcBaseLogistics.setCostDiffDecimal(dcBaseLogistics.getCostDiffDecimal().setScale(4, RoundingMode.HALF_EVEN)); dcBaseLogistics.setCostDiffDecimal(dcBaseLogistics.getCostDiffDecimal() == null ? BigDecimal.ZERO : dcBaseLogistics.getCostDiffDecimal().setScale(4, RoundingMode.HALF_EVEN));
dcBaseLogistics.setWeightDiffDecimal(dcBaseLogistics.getWeightDiffDecimal().setScale(4, RoundingMode.HALF_EVEN)); dcBaseLogistics.setWeightDiffDecimal(dcBaseLogistics.getWeightDiffDecimal() == null ? BigDecimal.ZERO : dcBaseLogistics.getWeightDiffDecimal().setScale(4, RoundingMode.HALF_EVEN));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("WMS物流BeanUtils.copyProperties失败"); throw new RuntimeException("WMS物流BeanUtils.copyProperties失败");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment