|
|
|
@ -22,14 +22,12 @@ import com.logpm.factory.mt.dto.MtReceiveImagesDTO;
|
|
|
|
|
import com.logpm.factory.mt.feign.IMtOrderMainClinet; |
|
|
|
|
import com.logpm.factory.oupai.feign.IOuPaiFactoryClinet; |
|
|
|
|
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; |
|
|
|
|
import com.sun.xml.bind.v2.TODO; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
|
import org.springblade.common.constant.DistributionTypeConstant; |
|
|
|
|
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.Inventory.InventoryPackageStatusConstant; |
|
|
|
|
import org.springblade.common.constant.Inventory.InventorySigningStatusConstant; |
|
|
|
|
import org.springblade.common.constant.billLading.BillLadingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.common.IsOrNoConstant; |
|
|
|
|
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.delivery.DeliveryStatusConstant; |
|
|
|
@ -47,10 +45,7 @@ import org.springblade.common.constant.stockup.StockupStatusConstant;
|
|
|
|
|
import org.springblade.common.constant.stockup.StockupTypeConstant; |
|
|
|
|
import org.springblade.common.exception.CustomerException; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Isolation; |
|
|
|
@ -88,7 +83,6 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
private final DistributionReservationStocklistMapper distributionReservationStocklistMapper; |
|
|
|
|
private final IDistributionReservationStocklistService distributionReservationStocklistService; |
|
|
|
|
private final DistributionBillLadingScanMapper distributionBillLadingScanMapper; |
|
|
|
|
private final DistrilbutionBillStockMapper distrilbutionBillStockMapper; |
|
|
|
|
private final DistrilbutionBillLadingMapper distrilbutionBillLadingMapper; |
|
|
|
|
private final DistributionDeliveryDetailsMapper distributionDeliveryDetailsMapper; |
|
|
|
|
private final DistributionParcelListMapper distributionParcelListMapper; |
|
|
|
@ -97,14 +91,12 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
private final IBasicdataWarehouseClient warehouseClient; |
|
|
|
|
private final IDistributionReservationZeroPackageService reservationZeroPackageService; |
|
|
|
|
private final IDistributionParcelNumberService distributionParcelNumberService; |
|
|
|
|
// private final IDistributionParcelNumberService distributionParcelNumberService;
|
|
|
|
|
private final IMtOrderMainClinet orderMainClinet; |
|
|
|
|
private final IOuPaiFactoryClinet ouPaiFactoryClinet; |
|
|
|
|
|
|
|
|
|
private final IDistrilbutionBillPackageService billPackageService; |
|
|
|
|
private final IDistributionReservationZeroPackageService zeroPackageService; |
|
|
|
|
|
|
|
|
|
// private DistributionReservationMapper reservationService;
|
|
|
|
|
private final DistributionSignforMapper distributionSignforService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -116,10 +108,6 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
List<DistributionLoadscanEntity> distributionLoadscanEntities = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda() |
|
|
|
|
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) |
|
|
|
|
); |
|
|
|
|
if (distributionLoadscanEntities.size() < 0) { |
|
|
|
|
log.info("[makeSureByPackage]包条无数据"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
// 使用流式操作和映射,提取包条Id并创建新的列表
|
|
|
|
|
// List<Long> packageIdList = distributionLoadscanEntities.stream().map(DistributionLoadscanEntity::getPackageId).collect(Collectors.toList());
|
|
|
|
|
// for (Long aLong : packageIdList) {
|
|
|
|
@ -264,7 +252,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
@Override |
|
|
|
|
public void updateParcelListReservation(List<Long> ids) { |
|
|
|
|
log.debug("####修改包件预约状态"); |
|
|
|
|
ids.stream().forEach(i -> { |
|
|
|
|
ids.forEach(i -> { |
|
|
|
|
DistributionParcelListEntity distributionParcelListEntity = new DistributionParcelListEntity(); |
|
|
|
|
distributionParcelListEntity.setId(i); |
|
|
|
|
distributionParcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue()); |
|
|
|
@ -436,7 +424,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue()); |
|
|
|
|
//修改包件状态
|
|
|
|
|
distributionParcelListService.updateById(parcelListEntity); |
|
|
|
|
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectOne(Wrappers.<DistributionDeliveryListEntity>query().lambda().eq(DistributionDeliveryListEntity::getId, deliveryId)); |
|
|
|
|
// DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectOne(Wrappers.<DistributionDeliveryListEntity>query().lambda().eq(DistributionDeliveryListEntity::getId, deliveryId));
|
|
|
|
|
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, parcelListEntity.getStockArticleId())); |
|
|
|
|
boolean packageLoadingFlag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); |
|
|
|
|
boolean packageSigningFlag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); |
|
|
|
@ -524,7 +512,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(loadscanEntityList)) { |
|
|
|
|
loadingNum += loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); |
|
|
|
|
signNum += loadscanEntityList.stream().filter(l -> l.getSignforState().equals(SignforStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); |
|
|
|
|
signNum += loadscanEntityList.stream().filter(l -> l.getSignforState().equals(Integer.parseInt(SignforStatusConstant.yiqianshou.getValue()))).mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
List<DistributionLoadscaninvnEntity> loadscaninvnEntityList = distributionLoadscaninvnMapper.selectList(Wrappers.<DistributionLoadscaninvnEntity>query().lambda() |
|
|
|
@ -533,7 +521,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(loadscanEntityList)) { |
|
|
|
|
loadingNum += loadscaninvnEntityList.stream().mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum(); |
|
|
|
|
signNum += loadscaninvnEntityList.stream().filter(l -> l.getSignforState().equals(SignforStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum(); |
|
|
|
|
signNum += loadscaninvnEntityList.stream().filter(l -> l.getSignforState().equals(Integer.parseInt(SignforStatusConstant.yiqianshou.getValue()))).mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (loadingNum == reservationTotal) { |
|
|
|
@ -595,7 +583,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(loadscanEntityList)) { |
|
|
|
|
deliverySigningNum += loadscanEntityList.stream().filter(l -> l.getSignforState().equals(SignforStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); |
|
|
|
|
deliverySigningNum += loadscanEntityList.stream().filter(l -> l.getSignforState().equals(Integer.parseInt(SignforStatusConstant.yiqianshou.getValue()))).mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
List<DistributionLoadscaninvnEntity> loadscaninvnEntityList = distributionLoadscaninvnMapper.selectList(Wrappers.<DistributionLoadscaninvnEntity>query().lambda() |
|
|
|
@ -603,10 +591,10 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(loadscanEntityList)) { |
|
|
|
|
deliverySigningNum += loadscaninvnEntityList.stream().filter(l -> l.getSignforState().equals(SignforStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum(); |
|
|
|
|
deliverySigningNum += loadscaninvnEntityList.stream().filter(l -> l.getSignforState().equals(Integer.parseInt(SignforStatusConstant.yiqianshou.getValue()))).mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (deliverySigningNum == delivertTotal) { |
|
|
|
|
if (deliverySigningNum.equals(delivertTotal)) { |
|
|
|
|
deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.yiwancheng.getValue()); |
|
|
|
|
} else { |
|
|
|
|
deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); |
|
|
|
@ -889,7 +877,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
distributionDeliveryListMapper.updateById(deliveryListEntity); |
|
|
|
|
} |
|
|
|
|
List<DistributionReservationEntity> reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId); |
|
|
|
|
if (Func.isNotEmpty(reservationEntityList) && reservationEntityList.size() > 0) { |
|
|
|
|
if (Func.isNotEmpty(reservationEntityList) && !reservationEntityList.isEmpty()) { |
|
|
|
|
for (DistributionReservationEntity reservationEntity : reservationEntityList) { |
|
|
|
|
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationEntity.getId()); |
|
|
|
|
Map<Long, List<DistributionParcelListEntity>> order = parcelListEntities.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getStockArticleId)); |
|
|
|
@ -937,7 +925,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(orderId); |
|
|
|
|
Integer orderLoadingNum = distributionLoadscanMapper.selectOrderLoadingNum(stockArticleEntity.getId()); |
|
|
|
|
if (Func.isNotEmpty(orderLoadingNum) && orderLoadingNum > 0) { |
|
|
|
|
if (stockArticleEntity.getTotalNumber() == orderLoadingNum) { |
|
|
|
|
if (stockArticleEntity.getTotalNumber().equals(orderLoadingNum)) { |
|
|
|
|
stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); |
|
|
|
|
} else { |
|
|
|
|
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); |
|
|
|
@ -986,7 +974,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
if (Func.isNotEmpty(parcelNumberEntityList)) { |
|
|
|
|
parcelNumberEntityList.forEach(p -> { |
|
|
|
|
DistributionParcelListEntity zeroParcelListEntity = distributionParcelListService.getById(p.getParcelListId()); |
|
|
|
|
if (p.getOutboundQuantity() == p.getQuantity() && p.getOutboundQuantity() > 0) { |
|
|
|
|
if (p.getOutboundQuantity() .equals(p.getQuantity()) && p.getOutboundQuantity() > 0) { |
|
|
|
|
//出库数量和总数量一致,此时包件处于装车状态
|
|
|
|
|
zeroParcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
|
} |
|
|
|
@ -1036,19 +1024,19 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|
} |
|
|
|
|
log.debug("修改备货数据》》》", stockupDTO); |
|
|
|
|
log.info("修改备货数据》》》 {}", stockupDTO); |
|
|
|
|
QueryWrapper<DistributionReservationZeroPackageEntity> queryWrapper = new QueryWrapper(); |
|
|
|
|
if (ObjectUtils.isNotNull(stockupDTO.getStockArticleId())) { |
|
|
|
|
queryWrapper.eq("stock_article_id", stockupDTO.getStockArticleId()); |
|
|
|
|
} |
|
|
|
|
if (stockupDTO.getStockArticleIdList() != null && !stockupDTO.getStockArticleIdList().equals(null)) { |
|
|
|
|
if (stockupDTO.getStockArticleIdList() != null && ObjectUtils.isNotNull(stockupDTO.getStockArticleIdList())) { |
|
|
|
|
queryWrapper.in("stock_article_id", stockupDTO.getStockArticleIdList()); |
|
|
|
|
} |
|
|
|
|
queryWrapper.eq("reservation_id", stockupDTO.getReservationId()); |
|
|
|
|
List<DistributionReservationZeroPackageEntity> list = reservationZeroPackageService.list(queryWrapper); |
|
|
|
|
AtomicBoolean pian = new AtomicBoolean(true); |
|
|
|
|
DistributionStockupEntity stockupEntity = new DistributionStockupEntity(); |
|
|
|
|
list.stream().forEach(i -> { |
|
|
|
|
list.forEach(i -> { |
|
|
|
|
if (!i.getQuantity().equals(i.getRealityQuantity())) { |
|
|
|
|
//不同 不能修改为完成
|
|
|
|
|
pian.set(false); |
|
|
|
@ -1234,7 +1222,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
} |
|
|
|
|
parcelNumberEntities.forEach(p -> { |
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(p.getParcelListId()); |
|
|
|
|
if (p.getOutboundQuantity() == p.getQuantity()) { |
|
|
|
|
if (Objects.equals(p.getOutboundQuantity(), p.getQuantity())) { |
|
|
|
|
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
|
} else { |
|
|
|
|
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()); |
|
|
|
@ -1448,7 +1436,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Async |
|
|
|
|
public void sendFactory(DistributionParcelListEntity distributionParcelListEntity, String signingTime, Long reservationId, String reservationCode, String warehouseName,String userName) { |
|
|
|
|
public void sendFactory(DistributionParcelListEntity distributionParcelListEntity, String signingTime, Long reservationId, String reservationCode, String warehouseName, String userName) { |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(distributionParcelListEntity.getStockArticleId()); |
|
|
|
|
log.info(">>>>>>>>>>> 签收推送 对象 {}", distributionParcelListEntity); |
|
|
|
|
if (Func.isNotEmpty(stockArticleEntity)) { |
|
|
|
@ -1465,8 +1453,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
case "欧派": |
|
|
|
|
//推送到欧派
|
|
|
|
|
try { |
|
|
|
|
// ouPaiFactoryClinet.newSystemHandleStatusDataSignforOne("7",distributionParcelListEntity.getOrderPackageCode(), signingTime, userName );//*签收人*//
|
|
|
|
|
// log.info(">>>>>>>>>>>>>>>>>>>>>>>> 签收推送 欧派:{} {} {} {}", "7",distributionParcelListEntity.getOrderPackageCode(), signingTime, userName );
|
|
|
|
|
// ouPaiFactoryClinet.newSystemHandleStatusDataSignforOne("7",distributionParcelListEntity.getOrderPackageCode(), signingTime, userName );//*签收人*//
|
|
|
|
|
// log.info(">>>>>>>>>>>>>>>>>>>>>>>> 签收推送 欧派:{} {} {} {}", "7",distributionParcelListEntity.getOrderPackageCode(), signingTime, userName );
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|
} |
|
|
|
@ -1482,7 +1470,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
@Async |
|
|
|
|
public void sendReviewFactory(Long signingId, String warehouseName, Long warehouseId) { |
|
|
|
|
String brands = "梦天,欧派";//可追加
|
|
|
|
|
log.info(">>>>>>>>>>> 签收推送 对象 {}", "signingId:="+signingId+"warehouseName:="+warehouseName+"warehouseId:="+warehouseId); |
|
|
|
|
log.info(">>>>>>>>>>> 签收推送 对象 {}", "signingId:=" + signingId + "warehouseName:=" + warehouseName + "warehouseId:=" + warehouseId); |
|
|
|
|
//查询签收信息
|
|
|
|
|
DistributionSignforEntity distributionSignforEntity = distributionSignforMapper.selectById(signingId); |
|
|
|
|
if (Func.isNotEmpty(distributionSignforEntity)) { |
|
|
|
@ -1498,29 +1486,28 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, List<MtReceiveContentDTO>> brand = null; |
|
|
|
|
log.info(">>>brand {} ",brand); |
|
|
|
|
List<DistributionReservationStockarticleEntity> distributionReservationStockarticleEntities = distributionReservationMapper.selectStockArticleByReservationId(distributionReservationEntity.getId()); |
|
|
|
|
log.info(">>>brand distributionReservationStockarticleEntities 长度 {} ",distributionReservationStockarticleEntities.size()); |
|
|
|
|
log.info(">>>brand distributionReservationStockarticleEntities 长度 {} ", distributionReservationStockarticleEntities.size()); |
|
|
|
|
if (Func.isNotEmpty(distributionReservationStockarticleEntities)) { |
|
|
|
|
log.info(">>>brand 进入 长度 {} ",distributionReservationStockarticleEntities); |
|
|
|
|
log.info(">>>brand 进入 长度 {} ", distributionReservationStockarticleEntities); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//存在订单
|
|
|
|
|
List<Long> orderIds = distributionReservationStockarticleEntities.stream().filter(f -> f.getIsZero().equals(IsOrNoConstant.no.getValue())).map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
log.info(">>>brand 进入 orderIds {} ",orderIds); |
|
|
|
|
log.info(">>>brand 进入 orderIds {} ", orderIds); |
|
|
|
|
|
|
|
|
|
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleService.listByIds(orderIds); |
|
|
|
|
log.info(">>>brand 进入 distributionStockArticleEntities {} ",distributionStockArticleEntities); |
|
|
|
|
log.info(">>>brand 进入 distributionStockArticleEntities {} ", distributionStockArticleEntities); |
|
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(distributionStockArticleEntities)) { |
|
|
|
|
String[] split = Func.split(brands, ","); |
|
|
|
|
log.info(">>>brand 进入 split {} ",split); |
|
|
|
|
log.info(">>>brand 进入 split {} ", (Object) split); |
|
|
|
|
|
|
|
|
|
//包件信息列表
|
|
|
|
|
brand = handkeBrandsPackageList(split, distributionStockArticleEntities, warehouseName, distributionReservationEntity.getId(), distributionDeliveryListEntity.getOrderCode(), warehouseId); |
|
|
|
|
} |
|
|
|
|
log.info(">>>brand 进入 {} ",brand); |
|
|
|
|
log.info(">>>brand 进入 {} ", brand); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1541,7 +1528,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
|
|
|
|
|
log.info(">>>>>>>>>>>>>>> 文员复核推送 品牌 {} ", brand); |
|
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(brand.get("梦天"))) { |
|
|
|
|
assert brand != null; |
|
|
|
|
if (Func.isNotEmpty(brand.get("梦天"))) { |
|
|
|
|
mtReceiveDTO.setReceiveContentList(brand.get("梦天")); |
|
|
|
|
orderMainClinet.sendReceiveInfoByNewSystem(mtReceiveDTO); |
|
|
|
|
} |
|
|
|
@ -1557,26 +1545,23 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { |
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>distributionParcelListEntities: {}",distributionParcelListEntities); |
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>distributionParcelListEntity: {}",distributionParcelListEntity); |
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>distributionParcelListEntities: {}", distributionParcelListEntities); |
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>distributionParcelListEntity: {}", distributionParcelListEntity); |
|
|
|
|
// todo 查询签收信息
|
|
|
|
|
DistributionSignforEntity distributionSignfor = distributionSignforService.getByReservationId(distributionReservationStockarticleEntity.getReservationId()); |
|
|
|
|
OrderStatusDTO orderStatusDTO = new OrderStatusDTO(); |
|
|
|
|
OrderStatusDTO orderStatusDTO = new OrderStatusDTO(); |
|
|
|
|
orderStatusDTO.setUnitNo(distributionParcelListEntity.getOrderPackageCode()); //单号
|
|
|
|
|
orderStatusDTO.setUsername(distributionSignfor.getSigneeName()); //操作人名称
|
|
|
|
|
orderStatusDTO.setStatus("7"); |
|
|
|
|
orderStatusDTO.setOperationTime(distributionSignfor.getSigningTime()); //时间
|
|
|
|
|
ouPaiFactoryClinet.newSystemHandleStatusData(orderStatusDTO); |
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>进入newSystemHandleStatusData orderStatusDTO值 :{}",orderStatusDTO); |
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>进入newSystemHandleStatusData orderStatusDTO值 :{}", orderStatusDTO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// orderMainClinet.sendReceiveInfoByNewSystem(mtReceiveDTO);
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1589,11 +1574,13 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//TODO 需要测试
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据预约单查询预约单下面的订单下面的包件 |
|
|
|
|
* 并且状态为已签收的包件 |
|
|
|
|
* |
|
|
|
|
* @param distributionReservationStockarticleEntity |
|
|
|
|
* @return List<DistributionParcelListEntity> |
|
|
|
|
* @return List<DistributionParcelListEntity> |
|
|
|
|
*/ |
|
|
|
|
private List<DistributionParcelListEntity> buildOpByReservationId(DistributionReservationStockarticleEntity distributionReservationStockarticleEntity) { |
|
|
|
|
Long stockArticleId = distributionReservationStockarticleEntity.getStockArticleId();//订单id
|
|
|
|
@ -1635,14 +1622,14 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
.distinct().collect(Collectors.joining(",")); |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(orderCodes, warehouseId); |
|
|
|
|
|
|
|
|
|
log.info(">>>>>> updatePackageDeliveryStatus,{}, {}",reservationId,packageIds); |
|
|
|
|
log.info(">>>>>> updatePackageDeliveryStatus,{}, {}", reservationId, packageIds); |
|
|
|
|
//完成对该客户下此包件任务的取消
|
|
|
|
|
int row = distributionReservationMapper.updatePackageDeliveryStatus(reservationId, packageIds); |
|
|
|
|
//TODO 欠缺零担的资源释放
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//维护预约订单状态
|
|
|
|
|
distributionReservationStockarticleService.maintenanceReservationStockArticle(reservationId,warehouseId); |
|
|
|
|
distributionReservationStockarticleService.maintenanceReservationStockArticle(reservationId, warehouseId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//存在库存品信息
|
|
|
|
@ -1677,37 +1664,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Map<String,List<MtReceiveContentDTO>> handkeBrandsPackageList(String[] split, List<DistributionStockArticleEntity> distributionStockArticleEntities, Long warehouseId,Long reservationId,String deliveryCode) { |
|
|
|
|
Map<String,List<MtReceiveContentDTO>> packageList = new HashMap<>(); |
|
|
|
|
Map<String, List<DistributionStockArticleEntity>> orderMap = distributionStockArticleEntities.stream().collect(Collectors.groupingBy(DistributionStockArticleEntity::getBrand)); |
|
|
|
|
for (String s : split) { |
|
|
|
|
orderMap.forEach((k,v)->{ |
|
|
|
|
if (k.equals(s)){ |
|
|
|
|
List<MtReceiveContentDTO> mtReceiveContentDTOS = new ArrayList<>(); |
|
|
|
|
for (DistributionStockArticleEntity distributionStockArticleEntity : v) { |
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, distributionStockArticleEntity.getId(),warehouseId); |
|
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { |
|
|
|
|
if (distributionParcelListEntity.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())){ |
|
|
|
|
String signingTime = distributionLoadscanMapper.selectPackageSigningTime(distributionParcelListEntity.getId()); |
|
|
|
|
MtReceiveContentDTO mtReceiveContentDTO = new MtReceiveContentDTO(); |
|
|
|
|
//查询签收时间
|
|
|
|
|
mtReceiveContentDTO.setWarehouse(warehouseId.toString());//仓库Id
|
|
|
|
|
mtReceiveContentDTO.setOrderCode(distributionStockArticleEntity.getOrderCode());//仓库Id
|
|
|
|
|
mtReceiveContentDTO.setUnitNo(distributionParcelListEntity.getOrderPackageCode());//仓库Id
|
|
|
|
|
mtReceiveContentDTO.setOperateDate(signingTime);//操作时间
|
|
|
|
|
mtReceiveContentDTO.setInvoiceOrderCode(deliveryCode);//发货编号
|
|
|
|
|
mtReceiveContentDTOS.add(mtReceiveContentDTO); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
packageList.put(s,mtReceiveContentDTOS); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return packageList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 定制品 修改备货时间 |
|
|
|
@ -1723,7 +1680,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
Long stockupId = stockupDTO.getStockupId(); |
|
|
|
|
//修改包件备货状态
|
|
|
|
|
DistributionParcelListEntity one = distributionParcelListService.getOne(Wrappers.<DistributionParcelListEntity>query().lambda() |
|
|
|
|
.eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode()) |
|
|
|
|
.eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode()) |
|
|
|
|
); |
|
|
|
|
//修改包件备货状态
|
|
|
|
|
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity(); |
|
|
|
@ -2096,7 +2053,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
boolean apj = false; |
|
|
|
|
if (list.size() > 0) { |
|
|
|
|
if (!list.isEmpty()) { |
|
|
|
|
//查询包件数量
|
|
|
|
|
// list.forEach(i -> {
|
|
|
|
|
// List<DistributionParcelListEntity> list1 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
|
|
|
|
@ -2312,16 +2269,13 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListService.getBaseMapper().selectList(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, id)); |
|
|
|
|
boolean flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.yiyueyue.getValue())); |
|
|
|
|
if (flag && stockArticleEntity.getTotalNumber() == parcelListEntityList.size()) { |
|
|
|
|
assert stockArticleEntity != null; |
|
|
|
|
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); |
|
|
|
|
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); |
|
|
|
|
} else { |
|
|
|
|
flag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.daiyuyue.getValue())); |
|
|
|
|
if (flag) { |
|
|
|
|
assert stockArticleEntity != null; |
|
|
|
|
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); |
|
|
|
|
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); |
|
|
|
|
} else { |
|
|
|
|
assert stockArticleEntity != null; |
|
|
|
|
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue()); |
|
|
|
|
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
@ -2618,14 +2572,13 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
|
|
|
|
|
//修改
|
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (i == 0) { |
|
|
|
|
distributionStockup.setId(stockupDTO.getStockupId()); |
|
|
|
|
if (i == 0) { |
|
|
|
|
//修改备货状态
|
|
|
|
|
distributionStockup.setId(stockupDTO.getStockupId()); |
|
|
|
|
distributionStockup.setStockupStatus(StockupStatusConstant.yibeihuo.getValue()); |
|
|
|
|
distributionStockup.setStockupStatus(StockupStatusConstant.yibeihuo.getValue()); |
|
|
|
|
} else { |
|
|
|
|
//修改备货状态
|
|
|
|
|
distributionStockup.setId(stockupDTO.getStockupId()); |
|
|
|
|
distributionStockup.setStockupStatus(StockupStatusConstant.beihuozhong.getValue()); |
|
|
|
|
distributionStockup.setStockupStatus(StockupStatusConstant.beihuozhong.getValue()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|