|
|
|
@ -93,89 +93,13 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
|
|
|
|
|
log.warn("##############waybillDataHandler: 老系统中未找到对应运单waybillNo={}", waybillNo); |
|
|
|
|
throw new CustomerException("老系统中未找到对应运单"); |
|
|
|
|
} |
|
|
|
|
String startSite = wayBillEntity.getStartSite();//始发仓名称
|
|
|
|
|
BasicdataWarehouseEntity starthouse = basicdataWarehouseClient.findByName(startSite); |
|
|
|
|
String warehouseName = wayBillEntity.getWarehouseName();//目的仓
|
|
|
|
|
BasicdataWarehouseEntity endhouse = basicdataWarehouseClient.findByName(warehouseName); |
|
|
|
|
Integer number = wayBillEntity.getNumber();//运单总数量
|
|
|
|
|
String packname = wayBillEntity.getPackname(); |
|
|
|
|
String agent = wayBillEntity.getAgent(); |
|
|
|
|
if (allNum.compareTo(number) > 0) { |
|
|
|
|
log.warn("##############waybillDataHandler: 运单的总数量异常 allNum={} number={}", allNum, number); |
|
|
|
|
throw new CustomerException("运单的总数量异常"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
warehouseWaybill = new WarehouseWaybillEntity(); |
|
|
|
|
warehouseWaybill.setWaybillNo(waybillNo); |
|
|
|
|
warehouseWaybill.setDestinationWarehouseName(warehouseName); |
|
|
|
|
warehouseWaybill.setDestinationWarehouseId(Objects.isNull(endhouse) ? null : endhouse.getId()); |
|
|
|
|
warehouseWaybill.setDepartureWarehouseName(startSite); |
|
|
|
|
warehouseWaybill.setDepartureWarehouseId(Objects.isNull(starthouse) ? null : starthouse.getId()); |
|
|
|
|
warehouseWaybill.setCustomerTrain(wayBillEntity.getCarNo()); |
|
|
|
|
warehouseWaybill.setBrand(wayBillEntity.getBrand()); |
|
|
|
|
String sendCompany = wayBillEntity.getSendCompany();//发货单位
|
|
|
|
|
String takeCompany = wayBillEntity.getTakeCompany();//收货单位
|
|
|
|
|
BasicdataClientEntity sendClient = basicdataClientClient.findByName(sendCompany); |
|
|
|
|
BasicdataClientEntity takeClient = basicdataClientClient.findByName(takeCompany); |
|
|
|
|
if (!Objects.isNull(sendClient)) { |
|
|
|
|
Long clientEntityId = sendClient.getId();//基础客户
|
|
|
|
|
warehouseWaybill.setShipperId(clientEntityId); |
|
|
|
|
} |
|
|
|
|
if (!Objects.isNull(takeClient)) { |
|
|
|
|
Long clientEntityId = takeClient.getId();//基础客户
|
|
|
|
|
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(clientEntityId, 3); |
|
|
|
|
if (!Objects.isNull(basicdataStoreBusinessEntity)) { |
|
|
|
|
warehouseWaybill.setServiceType(Integer.parseInt(basicdataStoreBusinessEntity.getMold())); |
|
|
|
|
} |
|
|
|
|
warehouseWaybill.setConsigneeId(clientEntityId); |
|
|
|
|
} |
|
|
|
|
warehouseWaybill.setShipper(sendCompany); |
|
|
|
|
warehouseWaybill.setShipperName(wayBillEntity.getSendPerson()); |
|
|
|
|
warehouseWaybill.setShipperMobile(wayBillEntity.getSendMobile()); |
|
|
|
|
warehouseWaybill.setShipperAddress(wayBillEntity.getSendAddress()); |
|
|
|
|
warehouseWaybill.setConsignee(takeCompany); |
|
|
|
|
warehouseWaybill.setConsigneeName(wayBillEntity.getTakePerson()); |
|
|
|
|
warehouseWaybill.setConsigneeMobile(wayBillEntity.getTakeMobile()); |
|
|
|
|
warehouseWaybill.setConsigneeAddress(wayBillEntity.getTakeAddress()); |
|
|
|
|
warehouseWaybill.setDestination(wayBillEntity.getArriveSite()); |
|
|
|
|
warehouseWaybill.setGoodsName(packname); |
|
|
|
|
warehouseWaybill.setTotalCount(number); |
|
|
|
|
warehouseWaybill.setStockCount(allNum); |
|
|
|
|
warehouseWaybill.setTotalWeight(wayBillEntity.getWeight()); |
|
|
|
|
warehouseWaybill.setTotalVolume(wayBillEntity.getVolume()); |
|
|
|
|
warehouseWaybill.setDeliveryMethod(wayBillEntity.getSendType()); |
|
|
|
|
warehouseWaybill.setUrgency(wayBillEntity.getUrgency()); |
|
|
|
|
warehouseWaybill.setReceiptCount(wayBillEntity.getReceiptNum()); |
|
|
|
|
warehouseWaybill.setReceiptRequirement(wayBillEntity.getReceiptAsk()); |
|
|
|
|
//--------------2023-07-28-------------
|
|
|
|
|
warehouseWaybill.setCollectPay(wayBillEntity.getDPay()); |
|
|
|
|
warehouseWaybill.setReceivedCollectPay(BigDecimal.ZERO); |
|
|
|
|
warehouseWaybill.setReplacePrice(wayBillEntity.getReplacePrice()); |
|
|
|
|
warehouseWaybill.setReceivedReplacePrice(BigDecimal.ZERO); |
|
|
|
|
warehouseWaybill.setReceivedTotalPrice(BigDecimal.ZERO); |
|
|
|
|
warehouseWaybill.setWaybillType(2); |
|
|
|
|
warehouseWaybill.setReceivedStatus(0); |
|
|
|
|
|
|
|
|
|
BasicdataClientEntity agentClient = basicdataClientClient.findByName(agent); |
|
|
|
|
if (!Objects.isNull(agentClient)) { |
|
|
|
|
Long clientEntityId = agentClient.getId();//基础客户
|
|
|
|
|
warehouseWaybill.setAgentId(clientEntityId); |
|
|
|
|
} |
|
|
|
|
warehouseWaybill.setAgent(agent); |
|
|
|
|
warehouseWaybill.setDocumentMakingTime(wayBillEntity.getPreparationTime()); |
|
|
|
|
warehouseWaybill.setRemark(wayBillEntity.getMsg()); |
|
|
|
|
warehouseWaybill.setBatchNo(wayBillEntity.getStartCarsNo()); |
|
|
|
|
warehouseWaybill.setFreezeStatus(0); |
|
|
|
|
warehouseWaybill.setStatus(0); |
|
|
|
|
warehouseWaybill.setIsDeleted(0); |
|
|
|
|
warehouseWaybill.setCreateTime(date); |
|
|
|
|
warehouseWaybill.setUpdateTime(date); |
|
|
|
|
warehouseWaybillMapper.insert(warehouseWaybill); |
|
|
|
|
warehouseWaybill = saveWayBillData(wayBillEntity, allNum); |
|
|
|
|
waybillId = warehouseWaybill.getId(); |
|
|
|
|
|
|
|
|
|
//新增的时候存入所有的订单详情
|
|
|
|
|
List<WaybillDesEntity> des = waybillDesClient.getDesList(waybillNo); |
|
|
|
|
List<WarehouseWayBillDetail> ls = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
for (WaybillDesEntity waybillDesEntity : des) { |
|
|
|
|
WarehouseWayBillDetail warehouseWayBillDetail = new WarehouseWayBillDetail(); |
|
|
|
|
warehouseWayBillDetail.setWaybillId(waybillId); |
|
|
|
@ -189,7 +113,6 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
|
|
|
|
|
ls.add(warehouseWayBillDetail); |
|
|
|
|
} |
|
|
|
|
warehouseWayBillDetailService.addList(ls); |
|
|
|
|
|
|
|
|
|
//创建在库订单
|
|
|
|
|
createStockArticle(warehouseWaybill); |
|
|
|
|
|
|
|
|
@ -205,36 +128,10 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
|
|
|
|
|
warehouseWaybillMapper.updateById(warehouseWaybill); |
|
|
|
|
//修改在库订单的在库数量
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findByOrderSelfNum(waybillNo); |
|
|
|
|
distributionStockArticleClient.addHandQuantity(stockArticleEntity.getId(),allNum); |
|
|
|
|
distributionStockArticleClient.addHandQuantity(stockArticleEntity.getId(), allNum); |
|
|
|
|
waybillId = warehouseWaybill.getId(); |
|
|
|
|
//判断是否需要创建在库订单
|
|
|
|
|
} |
|
|
|
|
// String goodsName = warehouseWaybill.getGoodsName();
|
|
|
|
|
// //处理运单明细
|
|
|
|
|
// WarehouseWayBillDetail warehouseWayBillDetail = warehouseWayBillDetailService.findByWaybillIdAndGoodsName(waybillId,goodsName);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// for (ProductDTO productDTO : productList) {
|
|
|
|
|
// String productName = productDTO.getProductName();
|
|
|
|
|
// Integer num = productDTO.getNum();
|
|
|
|
|
//
|
|
|
|
|
// if (Objects.isNull(warehouseWayBillDetail)) {
|
|
|
|
|
// warehouseWayBillDetail = new WarehouseWayBillDetail();
|
|
|
|
|
// warehouseWayBillDetail.setWaybillId(waybillId);
|
|
|
|
|
// warehouseWayBillDetail.setWaybillNo(waybillNo);
|
|
|
|
|
// warehouseWayBillDetail.setProductName(productName);
|
|
|
|
|
// warehouseWayBillDetail.setNum(num);
|
|
|
|
|
// warehouseWayBillDetail.setStatus(1);
|
|
|
|
|
// warehouseWayBillDetail.setIsDeleted(0);
|
|
|
|
|
// warehouseWayBillDetail.setCreateTime(date);
|
|
|
|
|
// warehouseWayBillDetail.setUpdateTime(date);
|
|
|
|
|
// warehouseWayBillDetailService.save(warehouseWayBillDetail);
|
|
|
|
|
// } else {
|
|
|
|
|
// warehouseWayBillDetail.setNum(warehouseWayBillDetail.getNum() + num);
|
|
|
|
|
// warehouseWayBillDetail.setUpdateTime(date);
|
|
|
|
|
// warehouseWayBillDetailService.update(warehouseWayBillDetail);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (isOrder) { |
|
|
|
|
//创建在库订单
|
|
|
|
|
createStockArticle(warehouseWaybill); |
|
|
|
@ -273,7 +170,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
|
|
|
|
|
distributionStockArticleEntity.setBrand(warehouseWaybill.getBrand()); |
|
|
|
|
distributionStockArticleEntity.setResource("零担"); |
|
|
|
|
if (!Objects.isNull(basicdataWarehouseEntity)) { |
|
|
|
|
distributionStockArticleEntity.setCreateDept(Objects.isNull(basicdataWarehouseEntity.getDepartment())?null:basicdataWarehouseEntity.getDepartment()); |
|
|
|
|
distributionStockArticleEntity.setCreateDept(Objects.isNull(basicdataWarehouseEntity.getDepartment()) ? null : basicdataWarehouseEntity.getDepartment()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String customerName = warehouseWaybill.getConsignee();//客户名称
|
|
|
|
@ -342,11 +239,11 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
|
|
|
|
|
List<ProductDTO> submitList = new ArrayList<>(); |
|
|
|
|
List<DistributionStockArticleEntity> articleList = distributionStockArticleClient.likeOrderSelfNumbering(orderSelfNum); |
|
|
|
|
int size = articleList.size(); |
|
|
|
|
for (int i = 0; i < splitOrderDTOList.size();i++){ |
|
|
|
|
for (int i = 0; i < splitOrderDTOList.size(); i++) { |
|
|
|
|
SplitOrderDTO splitOrderDTO = splitOrderDTOList.get(i); |
|
|
|
|
DistributionStockArticleEntity entity = new DistributionStockArticleEntity(); |
|
|
|
|
BeanUtil.copyProperties(distributionStockArticleEntity,entity); |
|
|
|
|
entity.setOrderCode(entity.getOrderCode()+"-"+size); |
|
|
|
|
BeanUtil.copyProperties(distributionStockArticleEntity, entity); |
|
|
|
|
entity.setOrderCode(entity.getOrderCode() + "-" + size); |
|
|
|
|
entity.setCustomerName(splitOrderDTO.getCustomerPerson()); |
|
|
|
|
entity.setCustomerTelephone(splitOrderDTO.getCustomerMobile()); |
|
|
|
|
entity.setCustomerAddress(splitOrderDTO.getCustomerAddress()); |
|
|
|
@ -354,15 +251,15 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
|
|
|
|
|
StringBuffer stringBuffer = new StringBuffer(); |
|
|
|
|
Integer allNum = 0; |
|
|
|
|
List<DistributionParcelListEntity> list = new ArrayList<>(); |
|
|
|
|
for (ProductDTO productDTO:products){ |
|
|
|
|
for (ProductDTO productDTO : products) { |
|
|
|
|
Integer splitNum = productDTO.getSplitNum(); |
|
|
|
|
if(Objects.isNull(splitNum)||splitNum <= 0){ |
|
|
|
|
if (Objects.isNull(splitNum) || splitNum <= 0) { |
|
|
|
|
log.info("#########splitOrder: 该条物料数量值不正确"); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if(StringUtil.isBlank(stringBuffer.toString())){ |
|
|
|
|
if (StringUtil.isBlank(stringBuffer.toString())) { |
|
|
|
|
stringBuffer.append(productDTO.getProductName()); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
stringBuffer.append(",").append(productDTO.getProductName()); |
|
|
|
|
} |
|
|
|
|
allNum = allNum + productDTO.getSplitNum(); |
|
|
|
@ -387,49 +284,139 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
|
|
|
|
|
entity.setDeliveryQuantity(0); |
|
|
|
|
entity.setTransferQuantity(0); |
|
|
|
|
entity.setSigninQuantity(0); |
|
|
|
|
entity.setGroundingStatus(0+""); |
|
|
|
|
entity.setGroundingStatus(0 + ""); |
|
|
|
|
entity.setIsOpai(1); |
|
|
|
|
entity.setAvailableQuantity(allNum); |
|
|
|
|
entity.setCreateUser(null); |
|
|
|
|
entity.setCreateDept(null); |
|
|
|
|
entity.setUpdateUser(null); |
|
|
|
|
entity.setInventoryPersonId(null); |
|
|
|
|
entity.setFreezeStatus(0+""); |
|
|
|
|
entity.setFreezeStatus(0 + ""); |
|
|
|
|
entity.setId(null); |
|
|
|
|
Long aLong = distributionStockArticleClient.addData(entity); |
|
|
|
|
if(aLong == 0){ |
|
|
|
|
if (aLong == 0) { |
|
|
|
|
log.warn("###########splitOrder: 保存新订单数据失败"); |
|
|
|
|
throw new CustomerException(405,"保存新订单数据失败"); |
|
|
|
|
throw new CustomerException(405, "保存新订单数据失败"); |
|
|
|
|
} |
|
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity:list){ |
|
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity : list) { |
|
|
|
|
distributionParcelListEntity.setStockArticleId(aLong); |
|
|
|
|
} |
|
|
|
|
boolean b = distributionParcelListClient.addBatch(list); |
|
|
|
|
if(!b){ |
|
|
|
|
if (!b) { |
|
|
|
|
log.warn("###########splitOrder: 保存包件数据失败"); |
|
|
|
|
throw new CustomerException(405,"保存包件数据失败"); |
|
|
|
|
throw new CustomerException(405, "保存包件数据失败"); |
|
|
|
|
} |
|
|
|
|
//减少主订单上在库数量
|
|
|
|
|
if(handQuantity-allNum < 0){ |
|
|
|
|
if (handQuantity - allNum < 0) { |
|
|
|
|
log.warn("###########splitOrder: 拆单数量大于在库数量"); |
|
|
|
|
throw new CustomerException(405,"拆单数量大于在库数量"); |
|
|
|
|
throw new CustomerException(405, "拆单数量大于在库数量"); |
|
|
|
|
} |
|
|
|
|
distributionStockArticleEntity.setHandQuantity(handQuantity-allNum); |
|
|
|
|
distributionStockArticleClient.submitHandQuantity(allNum,articleId); |
|
|
|
|
distributionStockArticleEntity.setHandQuantity(handQuantity - allNum); |
|
|
|
|
distributionStockArticleClient.submitHandQuantity(allNum, articleId); |
|
|
|
|
String orderSelfNumbering = distributionStockArticleEntity.getOrderCode(); |
|
|
|
|
warehouseWaybillMapper.submitStockCount(orderSelfNumbering,allNum); |
|
|
|
|
warehouseWaybillMapper.submitStockCount(orderSelfNumbering, allNum); |
|
|
|
|
//删除主订单包件对应数据
|
|
|
|
|
for (ProductDTO productDTO:submitList){ |
|
|
|
|
for (ProductDTO productDTO : submitList) { |
|
|
|
|
String productName = productDTO.getProductName(); |
|
|
|
|
Integer num = productDTO.getSplitNum(); |
|
|
|
|
boolean submitFlag = distributionParcelListClient.submitNumByOrderIdAndName(articleId,productName,num); |
|
|
|
|
if(!submitFlag){ |
|
|
|
|
log.warn("###########splitOrder: 减掉包件数量失败 articleId={},productName={},num={}",articleId,productName,num); |
|
|
|
|
throw new CustomerException(405,"减掉包件数量失败"); |
|
|
|
|
boolean submitFlag = distributionParcelListClient.submitNumByOrderIdAndName(articleId, productName, num); |
|
|
|
|
if (!submitFlag) { |
|
|
|
|
log.warn("###########splitOrder: 减掉包件数量失败 articleId={},productName={},num={}", articleId, productName, num); |
|
|
|
|
throw new CustomerException(405, "减掉包件数量失败"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
size++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 插入运单 |
|
|
|
|
* @param wayBillEntity |
|
|
|
|
* @param allNum |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public WarehouseWaybillEntity saveWayBillData(WayBillEntity wayBillEntity, Integer allNum) { |
|
|
|
|
String startSite = wayBillEntity.getStartSite();//始发仓名称
|
|
|
|
|
BasicdataWarehouseEntity starthouse = basicdataWarehouseClient.findByName(startSite); |
|
|
|
|
String warehouseName = wayBillEntity.getWarehouseName();//目的仓
|
|
|
|
|
BasicdataWarehouseEntity endhouse = basicdataWarehouseClient.findByName(warehouseName); |
|
|
|
|
Integer number = wayBillEntity.getNumber();//运单总数量
|
|
|
|
|
String packname = wayBillEntity.getPackname(); |
|
|
|
|
String agent = wayBillEntity.getAgent(); |
|
|
|
|
if (allNum.compareTo(number) > 0) { |
|
|
|
|
log.warn("##############waybillDataHandler: 运单的总数量异常 allNum={} number={}", allNum, number); |
|
|
|
|
throw new CustomerException("运单的总数量异常"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WarehouseWaybillEntity warehouseWaybill = new WarehouseWaybillEntity(); |
|
|
|
|
warehouseWaybill.setWaybillNo(wayBillEntity.getWaybillNo()); |
|
|
|
|
warehouseWaybill.setDestinationWarehouseName(warehouseName); |
|
|
|
|
warehouseWaybill.setDestinationWarehouseId(Objects.isNull(endhouse) ? null : endhouse.getId()); |
|
|
|
|
warehouseWaybill.setDepartureWarehouseName(startSite); |
|
|
|
|
warehouseWaybill.setDepartureWarehouseId(Objects.isNull(starthouse) ? null : starthouse.getId()); |
|
|
|
|
warehouseWaybill.setCustomerTrain(wayBillEntity.getCarNo()); |
|
|
|
|
warehouseWaybill.setBrand(wayBillEntity.getBrand()); |
|
|
|
|
String sendCompany = wayBillEntity.getSendCompany();//发货单位
|
|
|
|
|
String takeCompany = wayBillEntity.getTakeCompany();//收货单位
|
|
|
|
|
BasicdataClientEntity sendClient = basicdataClientClient.findByName(sendCompany); |
|
|
|
|
BasicdataClientEntity takeClient = basicdataClientClient.findByName(takeCompany); |
|
|
|
|
if (!Objects.isNull(sendClient)) { |
|
|
|
|
Long clientEntityId = sendClient.getId();//基础客户
|
|
|
|
|
warehouseWaybill.setShipperId(clientEntityId); |
|
|
|
|
} |
|
|
|
|
if (!Objects.isNull(takeClient)) { |
|
|
|
|
Long clientEntityId = takeClient.getId();//基础客户
|
|
|
|
|
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(clientEntityId, 3); |
|
|
|
|
if (!Objects.isNull(basicdataStoreBusinessEntity)) { |
|
|
|
|
warehouseWaybill.setServiceType(Integer.parseInt(basicdataStoreBusinessEntity.getMold())); |
|
|
|
|
} |
|
|
|
|
warehouseWaybill.setConsigneeId(clientEntityId); |
|
|
|
|
} |
|
|
|
|
warehouseWaybill.setShipper(sendCompany); |
|
|
|
|
warehouseWaybill.setShipperName(wayBillEntity.getSendPerson()); |
|
|
|
|
warehouseWaybill.setShipperMobile(wayBillEntity.getSendMobile()); |
|
|
|
|
warehouseWaybill.setShipperAddress(wayBillEntity.getSendAddress()); |
|
|
|
|
warehouseWaybill.setConsignee(takeCompany); |
|
|
|
|
warehouseWaybill.setConsigneeName(wayBillEntity.getTakePerson()); |
|
|
|
|
warehouseWaybill.setConsigneeMobile(wayBillEntity.getTakeMobile()); |
|
|
|
|
warehouseWaybill.setConsigneeAddress(wayBillEntity.getTakeAddress()); |
|
|
|
|
warehouseWaybill.setDestination(wayBillEntity.getArriveSite()); |
|
|
|
|
warehouseWaybill.setGoodsName(packname); |
|
|
|
|
warehouseWaybill.setTotalCount(number); |
|
|
|
|
warehouseWaybill.setStockCount(allNum); |
|
|
|
|
warehouseWaybill.setTotalWeight(wayBillEntity.getWeight()); |
|
|
|
|
warehouseWaybill.setTotalVolume(wayBillEntity.getVolume()); |
|
|
|
|
warehouseWaybill.setDeliveryMethod(wayBillEntity.getSendType()); |
|
|
|
|
warehouseWaybill.setUrgency(wayBillEntity.getUrgency()); |
|
|
|
|
warehouseWaybill.setReceiptCount(wayBillEntity.getReceiptNum()); |
|
|
|
|
warehouseWaybill.setReceiptRequirement(wayBillEntity.getReceiptAsk()); |
|
|
|
|
//--------------2023-07-28-------------
|
|
|
|
|
warehouseWaybill.setCollectPay(wayBillEntity.getDPay()); |
|
|
|
|
warehouseWaybill.setReceivedCollectPay(BigDecimal.ZERO); |
|
|
|
|
warehouseWaybill.setReplacePrice(wayBillEntity.getReplacePrice()); |
|
|
|
|
warehouseWaybill.setReceivedReplacePrice(BigDecimal.ZERO); |
|
|
|
|
warehouseWaybill.setReceivedTotalPrice(BigDecimal.ZERO); |
|
|
|
|
warehouseWaybill.setWaybillType(2); |
|
|
|
|
warehouseWaybill.setReceivedStatus(0); |
|
|
|
|
|
|
|
|
|
BasicdataClientEntity agentClient = basicdataClientClient.findByName(agent); |
|
|
|
|
if (!Objects.isNull(agentClient)) { |
|
|
|
|
Long clientEntityId = agentClient.getId();//基础客户
|
|
|
|
|
warehouseWaybill.setAgentId(clientEntityId); |
|
|
|
|
} |
|
|
|
|
warehouseWaybill.setAgent(agent); |
|
|
|
|
warehouseWaybill.setDocumentMakingTime(wayBillEntity.getPreparationTime()); |
|
|
|
|
warehouseWaybill.setRemark(wayBillEntity.getMsg()); |
|
|
|
|
warehouseWaybill.setBatchNo(wayBillEntity.getStartCarsNo()); |
|
|
|
|
warehouseWaybill.setFreezeStatus(0); |
|
|
|
|
warehouseWaybill.setStatus(0); |
|
|
|
|
warehouseWaybill.setIsDeleted(0); |
|
|
|
|
Date date = new Date(); |
|
|
|
|
warehouseWaybill.setCreateTime(date); |
|
|
|
|
warehouseWaybill.setUpdateTime(date); |
|
|
|
|
warehouseWaybillMapper.insert(warehouseWaybill); |
|
|
|
|
return warehouseWaybill; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|