@ -16,6 +16,7 @@
* /
package com.logpm.distribution.service.impl ;
import com.alibaba.fastjson.JSONObject ;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper ;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper ;
import com.baomidou.mybatisplus.core.metadata.IPage ;
@ -34,17 +35,16 @@ import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.* ;
import com.logpm.distribution.wrapper.* ;
import com.logpm.oldproject.feign.IWayBillClient ;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient ;
import com.logpm.trunkline.feign.ITrunklineWaybillTrackClient ;
import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity ;
import com.logpm.warehouse.entity.WarehouseWaybillEntity ;
import com.logpm.warehouse.feign.IWarehouseGoodsAllocationClient ;
import com.logpm.warehouse.feign.IWarehouseWaybillClient ;
import lombok.extern.slf4j.Slf4j ;
import org.apache.logging.log4j.util.Strings ;
import org.springblade.common.constant.DictBizConstant ;
import org.springblade.common.constant.DistributionTypeConstant ;
import org.springblade.common.constant.* ;
import org.springblade.common.constant.Inventory.* ;
import org.springblade.common.constant.ModuleNameConstant ;
import org.springblade.common.constant.RabbitConstant ;
import org.springblade.common.constant.common.IsOrNoConstant ;
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant ;
import org.springblade.common.constant.delivery.DeliveryStatusConstant ;
@ -225,6 +225,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
@Autowired
private RabbitTemplate rabbitTemplate ;
@Autowired
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient ;
@ -1507,6 +1510,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
//推翻原有的
Long id = distributionReservationDTO . getId ( ) ;
DistributionReservationEntity reservationEntity = this . getById ( id ) ;
//这里需要查询出这个预约原来的订单、包件信息
List < DistributionReservationStockarticleEntity > distributionReservationStockarticleEntities = distributionReservationStockarticleService . getBaseMapper ( ) . selectList ( Wrappers . < DistributionReservationStockarticleEntity > query ( ) . lambda ( ) . eq ( DistributionReservationStockarticleEntity : : getReservationId , id ) . ne ( DistributionReservationStockarticleEntity : : getStockArticleStatus , ReservationOrderStatusConstant . quxiao . getValue ( ) ) ) ;
Map < Long , List < DistributionReservationStockarticleEntity > > oldStockArticle = distributionReservationStockarticleEntities . stream ( ) . collect ( Collectors . groupingBy ( DistributionReservationStockarticleEntity : : getStockArticleId ) ) ;
@ -1519,6 +1523,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
List < Long > mallId = new ArrayList < > ( ) ;
HashSet < String > storeName = new HashSet < > ( ) ;
HashSet < String > receivingUnit = new HashSet < > ( ) ;
List < String > addOrderPackageCodes = new ArrayList < > ( ) ;
List < String > cancelOrderPackageCodes = new ArrayList < > ( ) ;
List < JSONObject > addPackageLog = new ArrayList < > ( ) ;
List < JSONObject > cancelPackageLog = new ArrayList < > ( ) ;
newStockArticle . forEach ( ( k , v ) - > {
List < Long > packageLockIds = new ArrayList < > ( ) ;
if ( Func . isEmpty ( oldStockArticle . get ( k ) ) ) {
@ -1542,6 +1550,25 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
parcelListEntity . setOrderPackageReservationStatus ( OrderPackageReservationStatusConstant . yiyueyue . getValue ( ) ) ;
distributionParcelListService . updateById ( parcelListEntity ) ;
distributionAsyncService . checkStockArticleReservationStatus ( p ) ;
String content = "包件在" + myCurrentWarehouse . getName ( ) + "由" + AuthUtil . getUser ( ) . getNickName ( ) + "新增计划配送,操作方式:新增订单选中包件,预约任务号:" + reservationEntity . getReservationCode ( ) ;
JSONObject trunklinePackageTrackLog = new JSONObject ( ) ;
trunklinePackageTrackLog . put ( "tenantId" , reservationEntity . getTenantId ( ) ) ;
trunklinePackageTrackLog . put ( "createTime" , reservationEntity . getCreateTime ( ) ) ;
trunklinePackageTrackLog . put ( "createUser" , reservationEntity . getCreateUser ( ) ) ;
trunklinePackageTrackLog . put ( "updateUser" , reservationEntity . getUpdateUser ( ) ) ;
trunklinePackageTrackLog . put ( "updateTime" , reservationEntity . getUpdateTime ( ) ) ;
trunklinePackageTrackLog . put ( "isDeleted" , reservationEntity . getIsDeleted ( ) ) ;
trunklinePackageTrackLog . put ( "status" , reservationEntity . getStatus ( ) ) ;
trunklinePackageTrackLog . put ( "createDept" , reservationEntity . getCreateDept ( ) ) ;
trunklinePackageTrackLog . put ( "orderPackageCode" , p . getOrderPackageCode ( ) ) ;
trunklinePackageTrackLog . put ( "warehouseId" , reservationEntity . getWarehouseId ( ) ) ;
trunklinePackageTrackLog . put ( "warehouseName" , reservationEntity . getWarehouseName ( ) ) ;
trunklinePackageTrackLog . put ( "workNode" , WorkNodeEnums . PLAN_DELIVERY . getCode ( ) ) ;
trunklinePackageTrackLog . put ( "content" , content ) ;
trunklinePackageTrackLog . put ( "operator" , AuthUtil . getUser ( ) . getNickName ( ) ) ;
addPackageLog . add ( trunklinePackageTrackLog ) ;
addOrderPackageCodes . add ( p . getOrderPackageCode ( ) ) ;
} ) ;
} else {
//添加此订单可用所有包件数量
@ -1569,6 +1596,25 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
dp . setOrderPackageReservationStatus ( OrderPackageReservationStatusConstant . yiyueyue . getValue ( ) ) ;
distributionParcelListService . updateById ( dp ) ;
distributionAsyncService . checkStockArticleReservationStatus ( dp ) ;
String content = "包件在" + myCurrentWarehouse . getName ( ) + "由" + AuthUtil . getUser ( ) . getNickName ( ) + "新增计划配送,操作方式:新增订单系统默认选中,预约任务号:" + reservationEntity . getReservationCode ( ) ;
JSONObject trunklinePackageTrackLog = new JSONObject ( ) ;
trunklinePackageTrackLog . put ( "tenantId" , reservationEntity . getTenantId ( ) ) ;
trunklinePackageTrackLog . put ( "createTime" , reservationEntity . getCreateTime ( ) ) ;
trunklinePackageTrackLog . put ( "createUser" , reservationEntity . getCreateUser ( ) ) ;
trunklinePackageTrackLog . put ( "updateUser" , reservationEntity . getUpdateUser ( ) ) ;
trunklinePackageTrackLog . put ( "updateTime" , reservationEntity . getUpdateTime ( ) ) ;
trunklinePackageTrackLog . put ( "isDeleted" , reservationEntity . getIsDeleted ( ) ) ;
trunklinePackageTrackLog . put ( "status" , reservationEntity . getStatus ( ) ) ;
trunklinePackageTrackLog . put ( "createDept" , reservationEntity . getCreateDept ( ) ) ;
trunklinePackageTrackLog . put ( "orderPackageCode" , dp . getOrderPackageCode ( ) ) ;
trunklinePackageTrackLog . put ( "warehouseId" , reservationEntity . getWarehouseId ( ) ) ;
trunklinePackageTrackLog . put ( "warehouseName" , reservationEntity . getWarehouseName ( ) ) ;
trunklinePackageTrackLog . put ( "workNode" , WorkNodeEnums . PLAN_DELIVERY . getCode ( ) ) ;
trunklinePackageTrackLog . put ( "content" , content ) ;
trunklinePackageTrackLog . put ( "operator" , AuthUtil . getUser ( ) . getNickName ( ) ) ;
addPackageLog . add ( trunklinePackageTrackLog ) ;
addOrderPackageCodes . add ( dp . getOrderPackageCode ( ) ) ;
}
}
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
@ -1710,6 +1756,27 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
// reduceNum.getAndAdd(distributionParcelListService.getById(reservationPackageEntity.getParceListId()).getQuantity());
DistributionParcelListEntity parcelListEntity = distributionParcelListService . getById ( reservationPackageEntity . getParceListId ( ) ) ;
parcelListEntity . setOrderPackageReservationStatus ( OrderPackageReservationStatusConstant . daiyuyue . getValue ( ) ) ;
String content = "包件在" + myCurrentWarehouse . getName ( ) + "由" + AuthUtil . getUser ( ) . getNickName ( ) + "取消计划配送,操作方式:取消选中包件,预约任务号:" + reservationEntity . getReservationCode ( ) ;
JSONObject trunklinePackageTrackLog = new JSONObject ( ) ;
trunklinePackageTrackLog . put ( "tenantId" , reservationEntity . getTenantId ( ) ) ;
trunklinePackageTrackLog . put ( "createTime" , reservationEntity . getCreateTime ( ) ) ;
trunklinePackageTrackLog . put ( "createUser" , reservationEntity . getCreateUser ( ) ) ;
trunklinePackageTrackLog . put ( "updateUser" , reservationEntity . getUpdateUser ( ) ) ;
trunklinePackageTrackLog . put ( "updateTime" , reservationEntity . getUpdateTime ( ) ) ;
trunklinePackageTrackLog . put ( "isDeleted" , reservationEntity . getIsDeleted ( ) ) ;
trunklinePackageTrackLog . put ( "status" , reservationEntity . getStatus ( ) ) ;
trunklinePackageTrackLog . put ( "createDept" , reservationEntity . getCreateDept ( ) ) ;
trunklinePackageTrackLog . put ( "orderPackageCode" , parcelListEntity . getOrderPackageCode ( ) ) ;
trunklinePackageTrackLog . put ( "warehouseId" , reservationEntity . getWarehouseId ( ) ) ;
trunklinePackageTrackLog . put ( "warehouseName" , reservationEntity . getWarehouseName ( ) ) ;
trunklinePackageTrackLog . put ( "workNode" , WorkNodeEnums . CANCEL_DELIVERY . getCode ( ) ) ;
trunklinePackageTrackLog . put ( "content" , content ) ;
trunklinePackageTrackLog . put ( "operator" , AuthUtil . getUser ( ) . getNickName ( ) ) ;
cancelPackageLog . add ( trunklinePackageTrackLog ) ;
cancelOrderPackageCodes . add ( parcelListEntity . getOrderPackageCode ( ) ) ;
distributionParcelListService . updateById ( parcelListEntity ) ;
if ( Func . isNotEmpty ( bladeRedis . get ( "warehouseId:" + myCurrentWarehouse . getId ( ) + "orderCode:" + parcelListEntity . getOrderCode ( ) ) ) ) {
List < Long > ids = bladeRedis . get ( "warehouseId:" + myCurrentWarehouse . getId ( ) + "orderCode:" + parcelListEntity . getOrderCode ( ) ) ;
@ -1838,6 +1905,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
}
} ) ;
if ( ! addOrderPackageCodes . isEmpty ( ) ) {
trunklinePackageTrackLogClient . addPackageTrackLog ( addPackageLog , addOrderPackageCodes , WorkNodeEnums . PLAN_DELIVERY . getCode ( ) ) ;
}
if ( Func . isNotEmpty ( oldStockArticle ) ) {
oldStockArticle . forEach ( ( i , j ) - > {
//这里就是需要进行取消的订单信息
@ -1850,6 +1921,24 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
packageEntityList . forEach ( p - > {
p . setPacketBarStatus ( ReservationPackageStatusConstant . quxiao . getValue ( ) ) ;
distributionReservationPackageService . updateById ( p ) ;
String content = "包件在" + myCurrentWarehouse . getName ( ) + "由" + AuthUtil . getUser ( ) . getNickName ( ) + "取消计划配送,操作方式:取消订单,预约任务号:" + reservationEntity . getReservationCode ( ) ;
JSONObject trunklinePackageTrackLog = new JSONObject ( ) ;
trunklinePackageTrackLog . put ( "tenantId" , reservationEntity . getTenantId ( ) ) ;
trunklinePackageTrackLog . put ( "createTime" , reservationEntity . getCreateTime ( ) ) ;
trunklinePackageTrackLog . put ( "createUser" , reservationEntity . getCreateUser ( ) ) ;
trunklinePackageTrackLog . put ( "updateUser" , reservationEntity . getUpdateUser ( ) ) ;
trunklinePackageTrackLog . put ( "updateTime" , reservationEntity . getUpdateTime ( ) ) ;
trunklinePackageTrackLog . put ( "isDeleted" , reservationEntity . getIsDeleted ( ) ) ;
trunklinePackageTrackLog . put ( "status" , reservationEntity . getStatus ( ) ) ;
trunklinePackageTrackLog . put ( "createDept" , reservationEntity . getCreateDept ( ) ) ;
trunklinePackageTrackLog . put ( "orderPackageCode" , p . getPacketBarCode ( ) ) ;
trunklinePackageTrackLog . put ( "warehouseId" , reservationEntity . getWarehouseId ( ) ) ;
trunklinePackageTrackLog . put ( "warehouseName" , reservationEntity . getWarehouseName ( ) ) ;
trunklinePackageTrackLog . put ( "workNode" , WorkNodeEnums . CANCEL_DELIVERY . getCode ( ) ) ;
trunklinePackageTrackLog . put ( "content" , content ) ;
trunklinePackageTrackLog . put ( "operator" , AuthUtil . getUser ( ) . getNickName ( ) ) ;
cancelPackageLog . add ( trunklinePackageTrackLog ) ;
cancelOrderPackageCodes . add ( p . getPacketBarCode ( ) ) ;
reduceTotal . getAndAdd ( distributionParcelListService . getById ( p . getParceListId ( ) ) . getQuantity ( ) ) ;
DistributionParcelListEntity parcelListEntity = distributionParcelListService . getById ( p . getParceListId ( ) ) ;
parcelListEntity . setOrderPackageReservationStatus ( OrderPackageReservationStatusConstant . daiyuyue . getValue ( ) ) ;
@ -1894,6 +1983,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionReservationStockarticleService . updateById ( reservationStockarticleEntity ) ;
} ) ;
}
if ( ! cancelOrderPackageCodes . isEmpty ( ) ) {
trunklinePackageTrackLogClient . addPackageTrackLog ( cancelPackageLog , cancelOrderPackageCodes , WorkNodeEnums . CANCEL_DELIVERY . getCode ( ) ) ;
}
//库存品修改
//查询出原来的库存品信息
List < DistributionReservationStocklistEntity > reservationStocklistEntities = distributionReservationStocklistService . getBaseMapper ( ) . selectList ( Wrappers . < DistributionReservationStocklistEntity > query ( ) . lambda ( )
@ -2030,7 +2122,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
list . forEach ( l - > l . setStockPackageStatus ( InventoryPackageStatusConstant . quxiao . getValue ( ) ) ) ;
disStockListDetailService . updateBatchById ( list ) ;
} ) ;
DistributionReservationEntity reservationEntity = this . getById ( id ) ;
//推送日志
Integer reservationNum = reservationEntity . getReservationNum ( ) ;
reservationEntity . setOtherFee ( distributionReservationDTO . getOtherFee ( ) ) ;
reservationEntity . setConsignee ( distributionReservationDTO . getConsignee ( ) ) ;
@ -2593,6 +2686,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
. eq ( DistributionReservationStockarticleEntity : : getReservationId , reservationEntity . getId ( ) )
. ne ( DistributionReservationStockarticleEntity : : getStockArticleStatus , ReservationOrderStatusConstant . quxiao . getValue ( ) ) ) ;
if ( Func . isNotEmpty ( reservationStockarticleEntityList ) & & reservationStockarticleEntityList . size ( ) > 0 ) {
List < String > orderPackageCodes = new ArrayList < > ( ) ;
List < JSONObject > aaa = new ArrayList < > ( ) ;
reservationStockarticleEntityList . forEach ( rs - > {
rs . setStockArticleStatus ( ReservationOrderStatusConstant . quxiao . getValue ( ) ) ;
// distributionReservationStockarticleService.updateById(rs);
@ -2613,10 +2708,33 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
parcelListEntity . setOrderPackageReservationStatus ( OrderPackageReservationStatusConstant . daiyuyue . getValue ( ) ) ;
distributionParcelListService . updateById ( parcelListEntity ) ;
// distributionAsyncService.checkStockArticleReservationStatus(parcelListEntity);
String content = "包件在" + myCurrentWarehouse . getName ( ) + "由" + AuthUtil . getUser ( ) . getNickName ( ) + "取消配送,操作方式:取消配送任务,预约任务号:" + reservationEntity . getReservationCode ( ) ;
JSONObject trunklinePackageTrackLog = new JSONObject ( ) ;
trunklinePackageTrackLog . put ( "tenantId" , reservationEntity . getTenantId ( ) ) ;
trunklinePackageTrackLog . put ( "createTime" , reservationEntity . getCreateTime ( ) ) ;
trunklinePackageTrackLog . put ( "createUser" , reservationEntity . getCreateUser ( ) ) ;
trunklinePackageTrackLog . put ( "updateUser" , reservationEntity . getUpdateUser ( ) ) ;
trunklinePackageTrackLog . put ( "updateTime" , reservationEntity . getUpdateTime ( ) ) ;
trunklinePackageTrackLog . put ( "isDeleted" , reservationEntity . getIsDeleted ( ) ) ;
trunklinePackageTrackLog . put ( "status" , reservationEntity . getStatus ( ) ) ;
trunklinePackageTrackLog . put ( "createDept" , reservationEntity . getCreateDept ( ) ) ;
trunklinePackageTrackLog . put ( "orderPackageCode" , rp . getPacketBarCode ( ) ) ;
trunklinePackageTrackLog . put ( "warehouseId" , reservationEntity . getWarehouseId ( ) ) ;
trunklinePackageTrackLog . put ( "warehouseName" , reservationEntity . getWarehouseName ( ) ) ;
trunklinePackageTrackLog . put ( "workNode" , WorkNodeEnums . DISTRIBUTION_LOADING . getCode ( ) ) ;
trunklinePackageTrackLog . put ( "content" , content ) ;
trunklinePackageTrackLog . put ( "operator" , AuthUtil . getUser ( ) . getNickName ( ) ) ;
aaa . add ( trunklinePackageTrackLog ) ;
orderPackageCodes . add ( rp . getPacketBarCode ( ) ) ;
} else {
log . error ( "#################错误包件ID:{}" , rp . getParceListId ( ) ) ;
}
} ) ;
if ( ! aaa . isEmpty ( ) ) {
trunklinePackageTrackLogClient . addPackageTrackLog ( aaa , orderPackageCodes , WorkNodeEnums . CANCEL_DELIVERY . getCode ( ) ) ;
}
}
} else if ( rs . getIsZero ( ) . equals ( IsOrNoConstant . yes . getValue ( ) ) ) {
//零担
@ -3109,6 +3227,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//预约订单数量
AtomicInteger packageNum = new AtomicInteger ( ) ;
List < DistributionParcelListDTO > packageList = s . getPackageListInfo ( ) ;
List < String > orderPackageCodes = new ArrayList < > ( ) ;
List < JSONObject > aaa = new ArrayList < > ( ) ;
if ( Func . isEmpty ( packageList ) ) {
//添加订单下的所有在库订单的包件
List < DistributionParcelListEntity > distributionParcelListEntities = distributionParcelListService . list ( Wrappers . < DistributionParcelListEntity > query ( ) . lambda ( ) . eq ( DistributionParcelListEntity : : getStockArticleId , s . getId ( ) )
@ -3140,19 +3260,28 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
dp . setOrderPackageReservationStatus ( OrderPackageReservationStatusConstant . yiyueyue . getValue ( ) ) ;
distributionParcelListService . updateById ( dp ) ;
// distributionAsyncService.checkStockArticleReservationStatus(dp);
orderPackageCodes . add ( dp . getOrderPackageCode ( ) ) ;
String content = "包件在" + myCurrentWarehouse . getName ( ) + "由" + AuthUtil . getUser ( ) . getNickName ( ) + "计划配送,操作方式:系统默认全部包件,预约任务号:" + reservationEntity . getReservationCode ( ) ;
JSONObject trunklinePackageTrackLog = new JSONObject ( ) ;
trunklinePackageTrackLog . put ( "tenantId" , reservationEntity . getTenantId ( ) ) ;
trunklinePackageTrackLog . put ( "createTime" , reservationEntity . getCreateTime ( ) ) ;
trunklinePackageTrackLog . put ( "createUser" , reservationEntity . getCreateUser ( ) ) ;
trunklinePackageTrackLog . put ( "updateUser" , reservationEntity . getUpdateUser ( ) ) ;
trunklinePackageTrackLog . put ( "updateTime" , reservationEntity . getUpdateTime ( ) ) ;
trunklinePackageTrackLog . put ( "isDeleted" , reservationEntity . getIsDeleted ( ) ) ;
trunklinePackageTrackLog . put ( "status" , reservationEntity . getStatus ( ) ) ;
trunklinePackageTrackLog . put ( "createDept" , reservationEntity . getCreateDept ( ) ) ;
trunklinePackageTrackLog . put ( "orderPackageCode" , dp . getOrderPackageCode ( ) ) ;
trunklinePackageTrackLog . put ( "warehouseId" , reservationEntity . getWarehouseId ( ) ) ;
trunklinePackageTrackLog . put ( "warehouseName" , reservationEntity . getWarehouseName ( ) ) ;
trunklinePackageTrackLog . put ( "workNode" , WorkNodeEnums . DISTRIBUTION_LOADING . getCode ( ) ) ;
trunklinePackageTrackLog . put ( "content" , content ) ;
trunklinePackageTrackLog . put ( "operator" , AuthUtil . getUser ( ) . getNickName ( ) ) ;
aaa . add ( trunklinePackageTrackLog ) ;
}
}
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
} ) ;
// s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
// s.setAvailableQuantity(0);
// if (Func.isNotEmpty(s.getAllocation())) {
// s.setAllocation(null);
// }
// distributionStockArticleService.updateById(s);
} else {
//维护选中的包件信息
List < Long > packageIds = packageList . stream ( ) . map ( DistributionParcelListEntity : : getId ) . collect ( Collectors . toList ( ) ) ;
@ -3168,30 +3297,33 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionReservationPackageService . save ( distributionReservationPackageEntity ) ;
packageNum . getAndAdd ( p . getQuantity ( ) ) ;
p . setOrderPackageReservationStatus ( OrderPackageReservationStatusConstant . yiyueyue . getValue ( ) ) ;
// p.setBrandId(p.getBrandId());
distributionParcelListService . updateById ( p ) ;
// distributionAsyncService.checkStockArticleReservationStatus(p);
orderPackageCodes . add ( p . getOrderPackageCode ( ) ) ;
String content = "包件在" + myCurrentWarehouse . getName ( ) + "由" + AuthUtil . getUser ( ) . getNickName ( ) + "计划配送,操作方式:选择包件,预约任务号:" + reservationEntity . getReservationCode ( ) ;
JSONObject trunklinePackageTrackLog = new JSONObject ( ) ;
trunklinePackageTrackLog . put ( "tenantId" , reservationEntity . getTenantId ( ) ) ;
trunklinePackageTrackLog . put ( "createTime" , reservationEntity . getCreateTime ( ) ) ;
trunklinePackageTrackLog . put ( "createUser" , reservationEntity . getCreateUser ( ) ) ;
trunklinePackageTrackLog . put ( "updateUser" , reservationEntity . getUpdateUser ( ) ) ;
trunklinePackageTrackLog . put ( "updateTime" , reservationEntity . getUpdateTime ( ) ) ;
trunklinePackageTrackLog . put ( "isDeleted" , reservationEntity . getIsDeleted ( ) ) ;
trunklinePackageTrackLog . put ( "status" , reservationEntity . getStatus ( ) ) ;
trunklinePackageTrackLog . put ( "createDept" , reservationEntity . getCreateDept ( ) ) ;
trunklinePackageTrackLog . put ( "orderPackageCode" , p . getOrderPackageCode ( ) ) ;
trunklinePackageTrackLog . put ( "warehouseId" , reservationEntity . getWarehouseId ( ) ) ;
trunklinePackageTrackLog . put ( "warehouseName" , reservationEntity . getWarehouseName ( ) ) ;
trunklinePackageTrackLog . put ( "workNode" , WorkNodeEnums . DISTRIBUTION_LOADING . getCode ( ) ) ;
trunklinePackageTrackLog . put ( "content" , content ) ;
trunklinePackageTrackLog . put ( "operator" , AuthUtil . getUser ( ) . getNickName ( ) ) ;
aaa . add ( trunklinePackageTrackLog ) ;
}
}
} ) ;
// s.setReservationStatus(ServiceConstant.ORDER_RESERVATION_STATE_PART);
//设置订单可用数量为
// s.setAvailableQuantity(s.getHandQuantity() - s.getReservationNum());
//这里查询到当前订单下的包件信息和选中包件进行比对,如果数量一致那么说明该订单是已预约状态、否则为部分预约状态
// LambdaQueryWrapper<DistributionParcelListEntity> qw = new QueryWrapper<DistributionParcelListEntity>().lambda().eq(DistributionParcelListEntity::getStockArticleId, s.getId());
// List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.getBaseMapper().selectList(qw);
// if (packageList.size() == parcelListEntities.size()) {
// //这里就是表示进行了包件选取的操作,但是选取的包件数量为全部
// s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
// } else {
// s.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue());
// }
}
distributionReservationStockarticleEntity . setReservationNum ( packageNum . get ( ) ) ;
//日志记录
trunklinePackageTrackLogClient . addPackageTrackLog ( aaa , orderPackageCodes , WorkNodeEnums . PLAN_DELIVERY . getCode ( ) ) ;
//维护对应订单的配送件数
// Integer i = distributionStockArticleMapper.augmentDeliveryQuantity(distributionReservationStockarticleEntity.getStockArticleId(),distributionReservationStockarticleEntity.getReservationNum());
// distributionStockArticleService.maintenanceOrderInfo(s.getOrderCode(),myCurrentWarehouse.getId());
} else if ( "1" . equals ( s . getIsZero ( ) ) ) {
//零担订单处理
if ( Func . isNotBlank ( s . getServiceNumber ( ) ) ) {