|
|
@@ -40,7 +40,6 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.util.*;
|
|
|
@@ -734,7 +733,7 @@ public class KwtWaybillOrderService {
|
|
|
order.setGoodsId(goods.getGoodsId());
|
|
|
order.setGoodsCode(null);
|
|
|
order.setGoodsName(goods.getGoodsName());
|
|
|
- order.setGoodsType(null);
|
|
|
+ order.setGoodsType(goods.getGoodsType());
|
|
|
order.setGoodsType(null);
|
|
|
order.setGoodsIndustry(null);
|
|
|
order.setGoodsSpec(null);
|
|
|
@@ -781,6 +780,45 @@ public class KwtWaybillOrderService {
|
|
|
return order;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param circulate 循环派车信息
|
|
|
+ * @desc mongodb车辆运单对象赋值(运单卸货mongodb重新生成一条数据)
|
|
|
+ * @author zk
|
|
|
+ * @date 2023/8/30
|
|
|
+ **/
|
|
|
+ public SckwWaybillOrder setSckwWaybillOrder(KwtLogisticsOrderCirculate circulate) {
|
|
|
+ //基础信息
|
|
|
+ SckwWaybillOrder order = new SckwWaybillOrder();
|
|
|
+ order.set_id(circulate.getId());
|
|
|
+ order.setWOrderId(null);
|
|
|
+ order.setWOrderNo(null);
|
|
|
+
|
|
|
+ //运输信息
|
|
|
+ order.setLoadTime(circulate.getStartTime());
|
|
|
+ order.setUnloadTime(circulate.getEndTime());
|
|
|
+ order.setLoadAmount(new BigDecimal(Global.AMOUNT));
|
|
|
+ order.setLoadTareAmount(new BigDecimal(Global.AMOUNT));
|
|
|
+ order.setLoadGrossAmount(new BigDecimal(Global.AMOUNT));
|
|
|
+ order.setLoadUrls(Global.EMPTY_STRING);
|
|
|
+ order.setUnloadAmount(new BigDecimal(Global.AMOUNT));
|
|
|
+ order.setUnloadTareAmount(new BigDecimal(Global.AMOUNT));
|
|
|
+ order.setUnloadGrossAmount(new BigDecimal(Global.AMOUNT));
|
|
|
+ order.setUnloadUrls(Global.EMPTY_STRING);
|
|
|
+ order.setDeficitAmount(new BigDecimal(Global.AMOUNT));
|
|
|
+ order.setDeficitPrice(new BigDecimal(Global.AMOUNT));
|
|
|
+
|
|
|
+ //操作人信息
|
|
|
+ order.setStatus(CarWaybillEnum.PENDING_ORDER.getCode());
|
|
|
+ order.setCreateBy(LoginUserHolder.getUserId());
|
|
|
+ order.setCreateByName(LoginUserHolder.getUserName());
|
|
|
+ order.setCreateTime(circulate.getUpdateTime());
|
|
|
+ order.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ order.setUpdateByName(LoginUserHolder.getUserName());
|
|
|
+ order.setUpdateTime(circulate.getUpdateTime());
|
|
|
+ order.setDelFlag(Global.NO);
|
|
|
+ return order;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param lOrderId 承运订单ID
|
|
|
* @description 派车更新承运订单信息
|
|
|
@@ -989,10 +1027,10 @@ public class KwtWaybillOrderService {
|
|
|
* @date 2023/7/26
|
|
|
**/
|
|
|
public void editSckwWaybillOrder(SckwWaybillOrder wOrder, KwtWaybillOrder order, int method) {
|
|
|
- wOrder.setWOrderId(order.getId());
|
|
|
- wOrder.setStatus(order.getStatus());
|
|
|
- wOrder.setUpdateTime(order.getUpdateTime());
|
|
|
- wOrder.setUpdateBy(order.getUpdateBy());
|
|
|
+ wOrder.setWOrderId(order != null ? order.getId() : wOrder.getWOrderId());
|
|
|
+ wOrder.setStatus(order != null ? order.getStatus() : wOrder.getStatus());
|
|
|
+ wOrder.setUpdateTime(order != null ? order.getUpdateTime() : wOrder.getUpdateTime());
|
|
|
+ wOrder.setUpdateBy(order != null ? order.getUpdateBy() : wOrder.getUpdateBy());
|
|
|
//rabbitMq业务汇总数据发送/消费对象
|
|
|
SckwBusSum busSum = new SckwBusSum();
|
|
|
//业务汇总类型
|
|
|
@@ -1012,12 +1050,12 @@ public class KwtWaybillOrderService {
|
|
|
* @date 2023/7/26
|
|
|
**/
|
|
|
public void editSckwLogisticsOrder(SckwLogisticsOrder lOrder, KwtLogisticsOrder order) {
|
|
|
- lOrder.set_id(order.getId());
|
|
|
- lOrder.setLOrderId(order.getId());
|
|
|
- lOrder.setEntrustAmount(order.getEntrustAmount());
|
|
|
- lOrder.setStatus(String.valueOf(order.getStatus()));
|
|
|
- lOrder.setUpdateTime(order.getUpdateTime());
|
|
|
- lOrder.setUpdateBy(order.getUpdateBy());
|
|
|
+ lOrder.set_id(order != null ? order.getId() : lOrder.get_id());
|
|
|
+ lOrder.setLOrderId(order != null ? order.getId() : lOrder.getLOrderId());
|
|
|
+ lOrder.setEntrustAmount(order != null ? order.getEntrustAmount() : lOrder.getEntrustAmount());
|
|
|
+ lOrder.setStatus(order != null ? String.valueOf(order.getStatus()) : lOrder.getStatus());
|
|
|
+ lOrder.setUpdateTime(order != null ? order.getUpdateTime() : lOrder.getUpdateTime());
|
|
|
+ lOrder.setUpdateBy(order != null ? order.getUpdateBy() : lOrder.getUpdateBy());
|
|
|
//rabbitMq业务汇总数据发送/消费对象
|
|
|
SckwBusSum busSum = new SckwBusSum();
|
|
|
//业务汇总类型
|
|
|
@@ -1508,8 +1546,14 @@ public class KwtWaybillOrderService {
|
|
|
waybillOrder.getTruckId(), waybillOrder.getDriverId(), 0);
|
|
|
/*circulate.setWOrderId(null);
|
|
|
logisticsOrderCirculateDao.updateById(circulate);*/
|
|
|
- Long wOrderId = new IdWorker(Global.NUMERICAL_ONE).nextId();
|
|
|
- logisticsOrderCirculateDao.updateIdByKey(wOrderId, null, circulate.getId(), waybillOrder.getUpdateBy(), waybillOrder.getUpdateTime());
|
|
|
+ Long newId = new IdWorker(Global.NUMERICAL_ONE).nextId();
|
|
|
+ logisticsOrderCirculateDao.updateIdByKey(newId, null, circulate.getId(), waybillOrder.getUpdateBy(), waybillOrder.getUpdateTime());
|
|
|
+
|
|
|
+ circulate = logisticsOrderCirculateDao.selectById(newId);
|
|
|
+ //Mongodb 重新生成一条运单数据
|
|
|
+ SckwWaybillOrder wOrder = setSckwWaybillOrder(circulate);
|
|
|
+ wOrder.setWOrderId(waybillOrder.getId());
|
|
|
+ editSckwWaybillOrder(wOrder, null, 3);
|
|
|
}
|
|
|
|
|
|
/**6跟新司机/车辆数据
|