|
|
|
@ -24,7 +24,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.google.zxing.WriterException; |
|
|
|
|
import com.logpm.basic.entity.BasicMaterialEntity; |
|
|
|
|
import com.logpm.basic.feign.IBasicMaterialClient; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataClientEntity; |
|
|
|
@ -35,30 +34,10 @@ import com.logpm.basicdata.feign.IBasicdataGoodsAllocationClient;
|
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataWarehouseClient; |
|
|
|
|
import com.logpm.distribution.dto.DistributionParcelListDTO; |
|
|
|
|
import com.logpm.distribution.dto.app.StockupDTO; |
|
|
|
|
import com.logpm.distribution.entity.DistributionParcelListEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionParcelNumberEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockArticleEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockListEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockListInfoEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistrilbutionBillPackageEntity; |
|
|
|
|
import com.logpm.distribution.entity.*; |
|
|
|
|
import com.logpm.distribution.excel.DistributionParcelListExcel; |
|
|
|
|
import com.logpm.distribution.mapper.DistributionParcelListMapper; |
|
|
|
|
import com.logpm.distribution.mapper.DistributionStockArticleMapper; |
|
|
|
|
import com.logpm.distribution.service.IDistributionParcelDetailsService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionParcelListService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionParcelNumberService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionReservationZeroPackageService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionStockArticleService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionStockListInfoService; |
|
|
|
|
import com.logpm.distribution.service.IDistributionStockListService; |
|
|
|
|
import com.logpm.distribution.service.IDistrilbutionBillPackageService; |
|
|
|
|
import com.logpm.distribution.vo.DistributionParcelListBaseVO; |
|
|
|
|
import com.logpm.distribution.vo.DistributionParcelListNodeVO; |
|
|
|
|
import com.logpm.distribution.vo.DistributionParcelListVO; |
|
|
|
|
import com.logpm.distribution.vo.DistributionParcelListZeroVO; |
|
|
|
|
import com.logpm.distribution.vo.PackageStockupVO; |
|
|
|
|
import com.logpm.distribution.service.*; |
|
|
|
|
import com.logpm.distribution.vo.*; |
|
|
|
|
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient; |
|
|
|
@ -98,20 +77,8 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import java.awt.image.BufferedImage; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.Comparator; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.HashSet; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
import java.util.Optional; |
|
|
|
|
import java.util.Set; |
|
|
|
|
import java.util.TreeSet; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -1487,4 +1454,70 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
|
|
|
|
|
} |
|
|
|
|
return orderInfoByOrderPackageCode; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void updateEntityByOpenOrderByAdvanceIds(UpdateOrderDTO updateOrderDTO) { |
|
|
|
|
Long waybillId = updateOrderDTO.getWaybillId(); |
|
|
|
|
List<Long> advanceIds = updateOrderDTO.getAdvanceIds(); |
|
|
|
|
|
|
|
|
|
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId); |
|
|
|
|
if (Objects.isNull(waybillEntity)) { |
|
|
|
|
log.warn("############updateEntityByOpenOrderByAdvanceIds: 运单信息不存在 waybillId={}", waybillId); |
|
|
|
|
throw new CustomerException(405, "运单信息不存在"); |
|
|
|
|
} |
|
|
|
|
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId(); |
|
|
|
|
String departureWarehouseName = waybillEntity.getDepartureWarehouseName(); |
|
|
|
|
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId(); |
|
|
|
|
String destinationWarehouseName = waybillEntity.getDestinationWarehouseName(); |
|
|
|
|
String waybillNo = waybillEntity.getWaybillNo(); |
|
|
|
|
|
|
|
|
|
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.in("advance_id", advanceIds) |
|
|
|
|
.eq("is_deleted", 0); |
|
|
|
|
List<DistributionParcelListEntity> listEntityList = baseMapper.selectList(queryWrapper); |
|
|
|
|
Set<String> orderCodes = new TreeSet<>(); |
|
|
|
|
for (DistributionParcelListEntity parcelListEntity : listEntityList) { |
|
|
|
|
Long packageWarehouseId = parcelListEntity.getWarehouseId(); |
|
|
|
|
parcelListEntity.setWaybillId(waybillId); |
|
|
|
|
parcelListEntity.setWaybillNumber(waybillNo); |
|
|
|
|
parcelListEntity.setSendWarehouseId(departureWarehouseId); |
|
|
|
|
parcelListEntity.setSendWarehouseName(departureWarehouseName); |
|
|
|
|
parcelListEntity.setAcceptWarehouseId(destinationWarehouseId); |
|
|
|
|
parcelListEntity.setAcceptWarehouseName(destinationWarehouseName); |
|
|
|
|
if (departureWarehouseId.equals(destinationWarehouseId)) { |
|
|
|
|
parcelListEntity.setIsTransfer(0); |
|
|
|
|
} else { |
|
|
|
|
if (destinationWarehouseId.equals(packageWarehouseId)) { |
|
|
|
|
parcelListEntity.setIsTransfer(0); |
|
|
|
|
} else { |
|
|
|
|
parcelListEntity.setIsTransfer(1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
orderCodes.add(parcelListEntity.getOrderCode()); |
|
|
|
|
} |
|
|
|
|
updateBatchById(listEntityList); |
|
|
|
|
|
|
|
|
|
Long consigneeId = waybillEntity.getConsigneeId(); |
|
|
|
|
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(consigneeId); |
|
|
|
|
|
|
|
|
|
for (String orderCode : orderCodes) { |
|
|
|
|
QueryWrapper<DistributionStockArticleEntity> stockArticleEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
stockArticleEntityQueryWrapper.eq("order_code", orderCode) |
|
|
|
|
.eq("is_deleted", 0); |
|
|
|
|
List<DistributionStockArticleEntity> stockArticleEntities = distributionStockArticleMapper.selectList(stockArticleEntityQueryWrapper); |
|
|
|
|
for (DistributionStockArticleEntity stockArticleEntity : stockArticleEntities) { |
|
|
|
|
Long orderId = stockArticleEntity.getId(); |
|
|
|
|
String waybillNumber = baseMapper.findOrderWaybillNo(orderId); |
|
|
|
|
stockArticleEntity.setWaybillNumber(waybillNumber); |
|
|
|
|
stockArticleEntity.setMallId(consigneeId); |
|
|
|
|
stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode()); |
|
|
|
|
stockArticleEntity.setMallName(basicdataClientEntity.getClientName()); |
|
|
|
|
stockArticleEntity.setConsigneePerson(waybillEntity.getConsigneeName()); |
|
|
|
|
stockArticleEntity.setConsigneeMobile(waybillEntity.getConsigneeMobile()); |
|
|
|
|
stockArticleEntity.setConsigneeAddress(waybillEntity.getConsigneeAddress()); |
|
|
|
|
stockArticleEntity.setConsigneeUnit(basicdataClientEntity.getClientName()); |
|
|
|
|
} |
|
|
|
|
distributionStockArticleService.updateBatchById(stockArticleEntities); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|