|
|
@@ -33,10 +33,7 @@ import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
|
import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
|
import com.sckw.transport.dao.*;
|
|
|
import com.sckw.transport.model.*;
|
|
|
-import com.sckw.transport.model.dto.OrderFinishDTO;
|
|
|
-import com.sckw.transport.model.dto.OrderTakingDTO;
|
|
|
-import com.sckw.transport.model.dto.StopOrderTakingDTO;
|
|
|
-import com.sckw.transport.model.dto.SubcontractConsignmentDTO;
|
|
|
+import com.sckw.transport.model.dto.*;
|
|
|
import com.sckw.transport.model.param.DriverParam;
|
|
|
import com.sckw.transport.model.vo.*;
|
|
|
import jakarta.annotation.Resource;
|
|
|
@@ -50,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.text.ParseException;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -204,7 +202,7 @@ public class AcceptCarriageOrderService {
|
|
|
throw new RuntimeException("生成物流托运合同异常");
|
|
|
}
|
|
|
insertSubcontractLogisticsGoods(bo, lOrderNo, orderId);
|
|
|
- insertSubcontractLogisticsOrder(bo, lOrderNo, order, orderId, pids, orderStatus,logisticsOrder);
|
|
|
+ insertSubcontractLogisticsOrder(bo, lOrderNo, order, orderId, pids, orderStatus, logisticsOrder);
|
|
|
insertSubcontractLogisticsOrderContract(bo, orderId);
|
|
|
insertSubcontractLogisticsOrderUnit(bo, orderId);
|
|
|
insertSubcontractLogisticsOrderAddress(bo, orderId, logisticsOrder);
|
|
|
@@ -273,7 +271,7 @@ public class AcceptCarriageOrderService {
|
|
|
logisticsOrder.setRemark(bo.getRemark());
|
|
|
logisticsOrder.setEntId(LoginUserHolder.getEntId());
|
|
|
logisticsOrder.setFirmName(remoteSystemService.queryEntCacheById(LoginUserHolder.getEntId()).getFirmName());
|
|
|
- logisticsOrder.setGoodsId(Integer.parseInt(bo.getGoodsId()));
|
|
|
+ logisticsOrder.setGoodsId(Long.parseLong(bo.getGoodsId()));
|
|
|
KwpGoods goods = goodsInfoService.getGoodsById(Long.parseLong(bo.getGoodsId()));
|
|
|
logisticsOrder.setGoodsType(goods == null ? null : goods.getGoodsType());
|
|
|
logisticsOrder.setGoodsSpec(goods == null ? null : goods.getSpec());
|
|
|
@@ -468,17 +466,18 @@ public class AcceptCarriageOrderService {
|
|
|
|
|
|
/**
|
|
|
* 分包托运-承运订单-主体
|
|
|
- * @param bo 页面填写分包数据
|
|
|
- * @param lOrderNo 当前分包物流订单编号
|
|
|
- * @param order 当前物流订单数据
|
|
|
- * @param orderId 当前订单主键id
|
|
|
- * @param pids 组装的pids
|
|
|
- * @param orderStatus 当前单据状态
|
|
|
- * @param logisticsOrder 父级物流订单
|
|
|
+ *
|
|
|
+ * @param bo 页面填写分包数据
|
|
|
+ * @param lOrderNo 当前分包物流订单编号
|
|
|
+ * @param order 当前物流订单数据
|
|
|
+ * @param orderId 当前订单主键id
|
|
|
+ * @param pids 组装的pids
|
|
|
+ * @param orderStatus 当前单据状态
|
|
|
+ * @param logisticsOrder 父级物流订单
|
|
|
*/
|
|
|
private void insertSubcontractLogisticsOrder(SubcontractConsignmentDTO bo, String lOrderNo,
|
|
|
KwtLogisticsOrder order,
|
|
|
- Long orderId, String pids, Integer orderStatus,KwtLogisticsOrder logisticsOrder) {
|
|
|
+ Long orderId, String pids, Integer orderStatus, KwtLogisticsOrder logisticsOrder) {
|
|
|
order.setId(orderId);
|
|
|
order.setEntId(LoginUserHolder.getEntId());
|
|
|
order.setType(logisticsOrder.getType());
|
|
|
@@ -1077,11 +1076,341 @@ public class AcceptCarriageOrderService {
|
|
|
|
|
|
/**
|
|
|
* 承运订单-完结订单-数据查询展示
|
|
|
- * @param orderId 物流订单id
|
|
|
+ *
|
|
|
+ * @param orderId 物流订单id
|
|
|
* @return
|
|
|
*/
|
|
|
public HttpResult acceptCarriageOrderFinishDetail(String orderId) {
|
|
|
OrderFinishVO orderFinishVO = kwtLogisticsOrderMapper.selectOrderFinishData(orderId);
|
|
|
return HttpResult.ok(orderFinishVO);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 承运订单-页面新建订单
|
|
|
+ *
|
|
|
+ * @param orderDTO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public HttpResult addOrder(AddOrderDTO orderDTO) throws ParseException {
|
|
|
+ /**保存新建数据*/
|
|
|
+ Long lOrderId = new IdWorker(NumberConstant.ONE).nextId();
|
|
|
+ /**生成订单编号*/
|
|
|
+ String lOrderNo = com.sckw.transport.utils.StringUtils.getLOrderNo();
|
|
|
+ /**根据合同计算当前单据状态*/
|
|
|
+ /**判断生成物流订单应生成哪一种单据状态*/
|
|
|
+ List<Long> contractList = new ArrayList<>();
|
|
|
+ contractList.add(Long.parseLong(orderDTO.getContractId()));
|
|
|
+ Map<Long, ContractCommonInfoResDto> longContractCommonInfoResDtoMap = remoteContractService.queryContractBaseInfo(contractList);
|
|
|
+ if (CollectionUtils.isEmpty(longContractCommonInfoResDtoMap)) {
|
|
|
+ throw new RuntimeException("承运订单新建订单-并未有对应合同,应先签约合同");
|
|
|
+ }
|
|
|
+ if (longContractCommonInfoResDtoMap.get(Long.parseLong(orderDTO.getContractId())) == null) {
|
|
|
+ throw new RuntimeException("承运订单新建订单-并未有对应合同,应先签约合同");
|
|
|
+ }
|
|
|
+ ContractCommonInfoResDto infoResDto = longContractCommonInfoResDtoMap.get(Long.parseLong(orderDTO.getContractId()));
|
|
|
+ /**状态判断
|
|
|
+ * 是否是已签约合同
|
|
|
+ * */
|
|
|
+ // 0 已签约 1待签约
|
|
|
+ Integer status = infoResDto.getStatus();
|
|
|
+ Integer orderStatus = LogisticsOrderEnum.PENDING_ORDER.getCode();
|
|
|
+ if (NumberConstant.ONE == status) {
|
|
|
+ orderStatus = LogisticsOrderEnum.TO_BE_PLANNED.getCode();
|
|
|
+ } else if (NumberConstant.ZERO == status) {
|
|
|
+ orderStatus = LogisticsOrderEnum.PENDING_ORDER.getCode();
|
|
|
+ } else {
|
|
|
+ log.info("承运订单创建订单异常");
|
|
|
+ throw new RuntimeException("自建订单异常");
|
|
|
+ }
|
|
|
+ saveLogisticsOrder(orderDTO, lOrderId, orderStatus, lOrderNo);
|
|
|
+ saveLogisticsOrderAddress(orderDTO, lOrderId);
|
|
|
+ saveLogisticsOrderContract(orderDTO, lOrderId, status);
|
|
|
+ saveLogisticsOrderTrack(lOrderId, orderStatus);
|
|
|
+ saveLogisticsOrderUnit(orderDTO, lOrderId);
|
|
|
+ saveMongoDb(orderDTO, orderStatus, lOrderId, lOrderNo, infoResDto);
|
|
|
+ return HttpResult.ok();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 承运订单-新建订单-保存mongodb
|
|
|
+ *
|
|
|
+ * @param orderDTO 页面请求参数
|
|
|
+ * @param orderStatus 主体单据状态
|
|
|
+ * @param lOrderId 主体订单id
|
|
|
+ * @param lOrderNo 主体订单编号
|
|
|
+ * @param infoResDto 合同信息
|
|
|
+ */
|
|
|
+ private void saveMongoDb(AddOrderDTO orderDTO, Integer orderStatus, Long lOrderId, String lOrderNo, ContractCommonInfoResDto infoResDto) {
|
|
|
+ SckwLogisticsOrder order = new SckwLogisticsOrder();
|
|
|
+ order.set_id(lOrderId);
|
|
|
+ order.setLOrderId(lOrderId);
|
|
|
+ order.setLOrderNo(lOrderNo);
|
|
|
+ order.setLOrderPid(null);
|
|
|
+ order.setLOrderPids(String.valueOf(lOrderId));
|
|
|
+ order.setType(NumberConstant.TWO);
|
|
|
+ order.setSettlementCycle(Long.parseLong(orderDTO.getSettlementCycle()));
|
|
|
+ order.setPrice(orderDTO.getPrice());
|
|
|
+ order.setPriceType(order.getPriceType());
|
|
|
+ order.setAmount(orderDTO.getAmount());
|
|
|
+ order.setUnit(orderDTO.getAmountUnit());
|
|
|
+ order.setLoss(orderDTO.getLoss());
|
|
|
+ order.setLossUnit(orderDTO.getLossUnit());
|
|
|
+ order.setGoodsPrice(orderDTO.getGoodsPrice() == null ? null : new BigDecimal(orderDTO.getGoodsPrice()));
|
|
|
+ order.setGoodsPriceUnit(orderDTO.getGoodsPriceUnit());
|
|
|
+ BigDecimal decimal = new BigDecimal(NumberConstant.ZERO);
|
|
|
+ order.setSubcontractAmount(decimal);
|
|
|
+ order.setEntrustAmount(decimal);
|
|
|
+ order.setUnloadAmount(decimal);
|
|
|
+ order.setLoadAmount(decimal);
|
|
|
+ order.setIgnoreAmount(decimal);
|
|
|
+ order.setDeficitAmount(decimal);
|
|
|
+ order.setDeficitPrice(decimal);
|
|
|
+ order.setPayment(StringUtils.isBlank(orderDTO.getPayment()) ? null : Long.parseLong(orderDTO.getPayment()));
|
|
|
+ order.setTaxRate(orderDTO.getTaxRate());
|
|
|
+ order.setRemark(orderDTO.getRemark());
|
|
|
+ order.setStatus(String.valueOf(orderStatus));
|
|
|
+ order.setEntId(LoginUserHolder.getEntId());
|
|
|
+ order.setFirmName(LoginUserHolder.getEntName());
|
|
|
+ order.setGoodsId(Long.parseLong(orderDTO.getGoodsId()));
|
|
|
+ KwpGoods goods = goodsInfoService.getGoodsById(Long.parseLong(orderDTO.getGoodsId()));
|
|
|
+ order.setGoodsCode(goods == null ? null : goods.getCode());
|
|
|
+ order.setGoodsName(goods == null ? null : goods.getName());
|
|
|
+ order.setGoodsType(goods == null ? null : goods.getGoodsType());
|
|
|
+// order.setGoodsIndustry(goods == null ? null : goods.get);
|
|
|
+ order.setGoodsSpec(goods == null ? null : goods.getSpec());
|
|
|
+ order.setContractId(orderDTO.getContractId());
|
|
|
+ order.setContractNo(infoResDto.getContractCode());
|
|
|
+ order.setContractName(infoResDto.getContactName());
|
|
|
+ order.setContractSigningWay(String.valueOf(infoResDto.getSigningWay()));
|
|
|
+ order.setCheckEntId(Long.parseLong(orderDTO.getConsignCompanyId()));
|
|
|
+ order.setCheckFirmName(orderDTO.getConsignCompany());
|
|
|
+ order.setCheckContacts(orderDTO.getConsignContacts());
|
|
|
+ order.setCheckPhone(orderDTO.getConsignContactPhone());
|
|
|
+ order.setCarrierEntId(Long.parseLong(orderDTO.getAcceptCompanyId()));
|
|
|
+ order.setCarrierFirmName(orderDTO.getAcceptCompany());
|
|
|
+ order.setCarrierContacts(orderDTO.getAcceptContacts());
|
|
|
+ order.setCarrierPhone(orderDTO.getAcceptContactPhone());
|
|
|
+// order.setLoadType();
|
|
|
+// order.setLoadContacts();
|
|
|
+// order.setLoadPhone();
|
|
|
+// order.setLoadCityCode();
|
|
|
+// order.setLoadCityName();
|
|
|
+// order.setLoadDetailAddress();
|
|
|
+// order.setLoadLat();
|
|
|
+// order.setLoadLng();
|
|
|
+// order.setUnloadType();
|
|
|
+// order.setUnloadContacts();
|
|
|
+// order.setUnloadPhone();
|
|
|
+// order.setUnloadCityCode();
|
|
|
+// order.setUnloadCityName();
|
|
|
+// order.setUnloadDetailAddress();
|
|
|
+// order.setUnloadLat();
|
|
|
+// order.setUnloadLng();
|
|
|
+ order.setCreateBy(LoginUserHolder.getUserId());
|
|
|
+ order.setCreateByName(LoginUserHolder.getUserName());
|
|
|
+ order.setCreateTime(new Date());
|
|
|
+ order.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ order.setUpdateByName(LoginUserHolder.getUserName());
|
|
|
+ order.setUpdateTime(new Date());
|
|
|
+ order.setWOrderNo(lOrderNo);
|
|
|
+ order.setCarryingCapacity(orderDTO.getAmount().longValue());
|
|
|
+ order.setBillingMode(orderDTO.getBillingMode());
|
|
|
+ SckwBusSum busSum = new SckwBusSum();
|
|
|
+ busSum.setBusSumType(BusinessTypeEnum.LOGISTICS_ORDER_TYPE.getName());
|
|
|
+ busSum.setMethod(NumberConstant.ONE);
|
|
|
+ busSum.setObject(order);
|
|
|
+ streamBridge.send("sckw-busSum", com.alibaba.fastjson2.JSON.toJSONString(busSum));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 承运订单-页面新增订单-订单对应企业单位
|
|
|
+ *
|
|
|
+ * @param orderDTO 页面请求参数
|
|
|
+ * @param lOrderId 主体id
|
|
|
+ */
|
|
|
+ private void saveLogisticsOrderUnit(AddOrderDTO orderDTO, Long lOrderId) {
|
|
|
+ //托运
|
|
|
+ KwtLogisticsOrderUnit consignUnit = new KwtLogisticsOrderUnit();
|
|
|
+ consignUnit.setId(new IdWorker(NumberConstant.ONE).nextId());
|
|
|
+ consignUnit.setLOrderId(lOrderId);
|
|
|
+ consignUnit.setUnitType(NumberConstant.ONE);
|
|
|
+ consignUnit.setEntId(Long.parseLong(orderDTO.getConsignCompanyId()));
|
|
|
+ consignUnit.setFirmName(orderDTO.getConsignCompany());
|
|
|
+ consignUnit.setContacts(orderDTO.getConsignContacts());
|
|
|
+ consignUnit.setPhone(orderDTO.getConsignContactPhone());
|
|
|
+ consignUnit.setRemark(orderDTO.getRemark());
|
|
|
+ consignUnit.setStatus(NumberConstant.ZERO);
|
|
|
+ consignUnit.setCreateBy(LoginUserHolder.getUserId());
|
|
|
+ consignUnit.setCreateTime(new Date());
|
|
|
+ consignUnit.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ consignUnit.setUpdateTime(new Date());
|
|
|
+ //承运
|
|
|
+ KwtLogisticsOrderUnit unit = new KwtLogisticsOrderUnit();
|
|
|
+ unit.setId(new IdWorker(NumberConstant.TWO).nextId());
|
|
|
+ unit.setLOrderId(lOrderId);
|
|
|
+ unit.setUnitType(NumberConstant.TWO);
|
|
|
+ unit.setEntId(Long.parseLong(orderDTO.getAcceptCompanyId()));
|
|
|
+ unit.setFirmName(orderDTO.getAcceptCompany());
|
|
|
+ unit.setContacts(orderDTO.getAcceptContacts());
|
|
|
+ unit.setPhone(orderDTO.getAcceptContactPhone());
|
|
|
+ unit.setRemark(orderDTO.getRemark());
|
|
|
+ unit.setStatus(NumberConstant.ZERO);
|
|
|
+ unit.setCreateBy(LoginUserHolder.getUserId());
|
|
|
+ unit.setCreateTime(new Date());
|
|
|
+ unit.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ unit.setUpdateTime(new Date());
|
|
|
+ logisticsOrderUnitMapper.insert(consignUnit);
|
|
|
+ logisticsOrderUnitMapper.insert(unit);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 承运订单-页面新增订单-订单状态
|
|
|
+ *
|
|
|
+ * @param lOrderId 主体id
|
|
|
+ * @param orderStatus 主体单据状态
|
|
|
+ */
|
|
|
+ private void saveLogisticsOrderTrack(Long lOrderId, Integer orderStatus) {
|
|
|
+ KwtLogisticsOrderTrack track = new KwtLogisticsOrderTrack();
|
|
|
+ track.setId(new IdWorker(NumberConstant.ONE).nextId());
|
|
|
+ track.setLOrderId(lOrderId);
|
|
|
+ track.setStatus(orderStatus);
|
|
|
+ track.setCreateBy(LoginUserHolder.getUserId());
|
|
|
+ track.setCreateTime(new Date());
|
|
|
+ track.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ track.setUpdateTime(new Date());
|
|
|
+ logisticsOrderTrackMapper.insert(track);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 承运订单-新建订单-地址信息保存
|
|
|
+ *
|
|
|
+ * @param orderDTO 页面请求参数
|
|
|
+ * @param lOrderId 主体id
|
|
|
+ */
|
|
|
+ private void saveLogisticsOrderAddress(AddOrderDTO orderDTO, Long lOrderId) {
|
|
|
+ KwtLogisticsOrderAddress loadAddress = new KwtLogisticsOrderAddress();
|
|
|
+ loadAddress.setId(new IdWorker(NumberConstant.ONE).nextId());
|
|
|
+ loadAddress.setLOrderId(lOrderId);
|
|
|
+ loadAddress.setAddressType(NumberConstant.ONE);
|
|
|
+// loadAddress.setName();
|
|
|
+// loadAddress.setType();
|
|
|
+// loadAddress.setContacts();
|
|
|
+// loadAddress.setPhone();
|
|
|
+ loadAddress.setCityCode(Integer.valueOf(orderDTO.getLoadCityCode()));
|
|
|
+ loadAddress.setCityName(orderDTO.getLoadCityName());
|
|
|
+ loadAddress.setDetailAddress(orderDTO.getLoadDetailAddress());
|
|
|
+ loadAddress.setLat(orderDTO.getLoadLat());
|
|
|
+ loadAddress.setLng(orderDTO.getLoadLng());
|
|
|
+ loadAddress.setEntryType(NumberConstant.FOUR);
|
|
|
+ loadAddress.setStatus(NumberConstant.ZERO);
|
|
|
+ loadAddress.setCreateBy(LoginUserHolder.getUserId());
|
|
|
+ Date date = new Date();
|
|
|
+ loadAddress.setCreateTime(date);
|
|
|
+ loadAddress.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ loadAddress.setUpdateTime(date);
|
|
|
+
|
|
|
+ KwtLogisticsOrderAddress unloadAddress = new KwtLogisticsOrderAddress();
|
|
|
+ unloadAddress.setId(new IdWorker(NumberConstant.TWO).nextId());
|
|
|
+ unloadAddress.setLOrderId(lOrderId);
|
|
|
+ unloadAddress.setAddressType(NumberConstant.TWO);
|
|
|
+// unloadAddress.setName();
|
|
|
+// unloadAddress.setType();
|
|
|
+// unloadAddress.setContacts();
|
|
|
+// unloadAddress.setPhone();
|
|
|
+ unloadAddress.setCityCode(Integer.valueOf(orderDTO.getUnloadCityCode()));
|
|
|
+ unloadAddress.setCityName(orderDTO.getUnloadCityName());
|
|
|
+ unloadAddress.setDetailAddress(orderDTO.getUnloadDetailAddress());
|
|
|
+ unloadAddress.setLat(orderDTO.getUnloadLat());
|
|
|
+ unloadAddress.setLng(orderDTO.getUnloadLng());
|
|
|
+ unloadAddress.setEntryType(NumberConstant.FOUR);
|
|
|
+ unloadAddress.setStatus(NumberConstant.ZERO);
|
|
|
+ unloadAddress.setCreateBy(LoginUserHolder.getUserId());
|
|
|
+ unloadAddress.setCreateTime(date);
|
|
|
+ unloadAddress.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ unloadAddress.setUpdateTime(date);
|
|
|
+ logisticsOrderAddressMapper.insert(loadAddress);
|
|
|
+ logisticsOrderAddressMapper.insert(unloadAddress);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 承运订单-新建订单-合体主体
|
|
|
+ *
|
|
|
+ * @param orderDTO 页面请求参数
|
|
|
+ * @param lOrderId 主体id
|
|
|
+ * @param status 合同状态
|
|
|
+ */
|
|
|
+ private void saveLogisticsOrderContract(AddOrderDTO orderDTO, Long lOrderId, Integer status) {
|
|
|
+ //托运
|
|
|
+ KwtLogisticsOrderContract consignContract = new KwtLogisticsOrderContract();
|
|
|
+ consignContract.setId(new IdWorker(NumberConstant.ONE).nextId());
|
|
|
+ consignContract.setContractId(Long.parseLong(orderDTO.getContractId()));
|
|
|
+ consignContract.setLOrderId(lOrderId);
|
|
|
+ consignContract.setStatus(status);
|
|
|
+ consignContract.setCreateBy(LoginUserHolder.getUserId());
|
|
|
+ consignContract.setCreateTime(new Date());
|
|
|
+ consignContract.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ consignContract.setUpdateTime(new Date());
|
|
|
+ //承运
|
|
|
+ KwtLogisticsOrderContract acceptContract = new KwtLogisticsOrderContract();
|
|
|
+ acceptContract.setId(new IdWorker(NumberConstant.TWO).nextId());
|
|
|
+ acceptContract.setContractId(Long.parseLong(orderDTO.getContractId()));
|
|
|
+ acceptContract.setLOrderId(lOrderId);
|
|
|
+ acceptContract.setStatus(status);
|
|
|
+ acceptContract.setCreateBy(LoginUserHolder.getUserId());
|
|
|
+ acceptContract.setCreateTime(new Date());
|
|
|
+ acceptContract.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ acceptContract.setUpdateTime(new Date());
|
|
|
+ kwtLogisticsOrderContractMapper.insert(consignContract);
|
|
|
+ kwtLogisticsOrderContractMapper.insert(acceptContract);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 承运订单-页面新增订单-订单主体
|
|
|
+ *
|
|
|
+ * @param orderDTO 页面请求参数
|
|
|
+ * @param lOrderId 主体id
|
|
|
+ * @param orderStatus 订单状态
|
|
|
+ * @param lOrderNo 主体订单编号
|
|
|
+ */
|
|
|
+ private void saveLogisticsOrder(AddOrderDTO orderDTO, Long lOrderId, Integer orderStatus, String lOrderNo) throws ParseException {
|
|
|
+ KwtLogisticsOrder order = new KwtLogisticsOrder();
|
|
|
+ order.setId(lOrderId);
|
|
|
+ order.setEntId(LoginUserHolder.getEntId());
|
|
|
+ order.setType(String.valueOf(NumberConstant.TWO));
|
|
|
+ order.setLOrderNo(lOrderNo);
|
|
|
+ order.setPids(lOrderId.toString());
|
|
|
+ order.setSettlementCycle(Long.parseLong(orderDTO.getSettlementCycle()));
|
|
|
+ order.setBillingMode(orderDTO.getBillingMode());
|
|
|
+ order.setPrice(orderDTO.getPrice());
|
|
|
+ order.setPriceType(Long.parseLong(orderDTO.getPriceType()));
|
|
|
+ order.setAmount(orderDTO.getAmount());
|
|
|
+ order.setUnit(orderDTO.getAmountUnit());
|
|
|
+ order.setLoss(orderDTO.getLossUnit() == null ? null : new BigDecimal((orderDTO.getLossUnit())));
|
|
|
+ order.setLossUnit(orderDTO.getLossUnit());
|
|
|
+ order.setGoodsPrice(orderDTO.getGoodsPrice() == null ? null : new BigDecimal((orderDTO.getGoodsPrice())));
|
|
|
+ order.setGoodsPriceUnit(orderDTO.getGoodsPriceUnit());
|
|
|
+ order.setStartTime(org.apache.commons.lang3.StringUtils.isBlank(orderDTO.getStartTime()) ?
|
|
|
+ null : DateUtil.strToDate(StringTimeUtil.fillStart(orderDTO.getStartTime()), StringConstant.DEFAULT_DATE_PATTERN));
|
|
|
+ order.setEndTime(org.apache.commons.lang3.StringUtils.isBlank(orderDTO.getEndTime()) ?
|
|
|
+ null : DateUtil.strToDate(StringTimeUtil.fillStart(orderDTO.getEndTime()), StringConstant.DEFAULT_DATE_PATTERN));
|
|
|
+ BigDecimal decimal = new BigDecimal(NumberConstant.ZERO);
|
|
|
+ order.setSubcontractAmount(decimal);
|
|
|
+ order.setEntrustAmount(decimal);
|
|
|
+ order.setUnloadAmount(decimal);
|
|
|
+ order.setLoadAmount(decimal);
|
|
|
+ order.setIgnoreAmount(decimal);
|
|
|
+ order.setDeficitAmount(decimal);
|
|
|
+ order.setDeficitPrice(decimal);
|
|
|
+ order.setTaxRate(orderDTO.getTaxRate());
|
|
|
+ order.setRemark(orderDTO.getRemark());
|
|
|
+ order.setStatus(orderStatus);
|
|
|
+ order.setCreateBy(LoginUserHolder.getUserId());
|
|
|
+ order.setCreateTime(new Date());
|
|
|
+ order.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ order.setUpdateTime(new Date());
|
|
|
+ logisticsOrderMapper.insert(order);
|
|
|
+ }
|
|
|
}
|