|
|
|
@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO; |
|
|
|
|
import com.logpm.basic.entity.BasicPrintTemplateEntity; |
|
|
|
|
import com.logpm.basic.feign.IBasicPrintTemplateClient; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataDriverArteryEntity; |
|
|
|
@ -45,9 +46,11 @@ import com.logpm.distribution.vo.app.DistributionAppReservationVO;
|
|
|
|
|
import com.logpm.distribution.vo.print.PrintPreviewVO; |
|
|
|
|
import com.logpm.distribution.wrapper.*; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWaybillEntity; |
|
|
|
|
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient; |
|
|
|
|
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient; |
|
|
|
|
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; |
|
|
|
|
import com.logpm.warehouse.feign.IWarehouseWaybillClient; |
|
|
|
|
import com.logpm.warehouse.vo.TrayTypeDataVO; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
@ -153,6 +156,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
private final IDistributionReservationZeroPackageService distributionReservationZeroPackageService; |
|
|
|
|
private final IDistributionParcelNumberService distributionParcelNumberService; |
|
|
|
|
private final IWarehouseTrayGoodsClient warehouseTrayGoodsClient; |
|
|
|
|
private final IWarehouseWaybillClient warehouseWaybillClient; |
|
|
|
|
|
|
|
|
|
// 自提mapper
|
|
|
|
|
private final DistrilbutionBillLadingMapper distrilbutionBillLadingMapper; |
|
|
|
@ -501,11 +505,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
.eq(DisStockListDetailEntity::getStockPackageCode, distrilbutionloadingscanDTO.getBarcode()) |
|
|
|
|
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(list)){ |
|
|
|
|
if (Func.isNotEmpty(list)) { |
|
|
|
|
//满足条件此码必定为库存品
|
|
|
|
|
//判断该库存品是否属于当前客户
|
|
|
|
|
List<DisStockListDetailEntity> collect = list.stream().filter(l -> l.getReservationId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList()); |
|
|
|
|
if (Func.isNotEmpty(collect)){ |
|
|
|
|
if (Func.isNotEmpty(collect)) { |
|
|
|
|
return Resp.scanFail("请在库存品页面扫描此码", "请在库存品页面扫描此码"); |
|
|
|
|
} |
|
|
|
|
return Resp.scanFail("此码不是订制品", "此码不是订制品"); |
|
|
|
@ -610,10 +614,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
return R.fail(5000, "异常装车"); |
|
|
|
|
// return Resp.scanFail("装车失败","程序出错,请联系彪桑");
|
|
|
|
|
} else { |
|
|
|
|
if (parcelListEntity.getConditions() == 2){ |
|
|
|
|
if (parcelListEntity.getConditions() == 2) { |
|
|
|
|
return Resp.scanFail("此包件不是订制品", "此包件不是订制品"); |
|
|
|
|
|
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
return Resp.scanFail("装车失败", "窜货"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1498,7 +1502,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
//扣减在库订单的在库数量
|
|
|
|
|
Integer k =distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(),loadscanEntity.getLoadedNub()); |
|
|
|
|
Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub()); |
|
|
|
|
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); |
|
|
|
|
distributionAsyncService.checkOrderLoadingStatus(parcelListEntity.getId()); |
|
|
|
|
} |
|
|
|
@ -2115,7 +2119,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
distributionAsyncService.changeMarketDeliveryListStatus(distributionLoadscaninvnEntity.getOrderPackageCode(), distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId()); |
|
|
|
|
//处理出库问题
|
|
|
|
|
//扣减出库数量
|
|
|
|
|
distributionStockListMapper.deductionQuantityStock(distributionLoadscaninvnEntity.getInventoryId(),distributionLoadscaninvnEntity.getLoadedNub()); |
|
|
|
|
distributionStockListMapper.deductionQuantityStock(distributionLoadscaninvnEntity.getInventoryId(), distributionLoadscaninvnEntity.getLoadedNub()); |
|
|
|
|
// DistributionStockListEntity distributionStockListEntity = distributionStockListMapper.selectOne(Wrappers.<DistributionStockListEntity>query().lambda().eq(DistributionStockListEntity::getId, distributionLoadscaninvnEntity.getInventoryId()));
|
|
|
|
|
// BigDecimal quantityStock = new BigDecimal(distributionStockListEntity.getQuantityStock());
|
|
|
|
|
// BigDecimal loadedNub = new BigDecimal(distributionLoadscaninvnEntity.getLoadedNub());
|
|
|
|
@ -4417,7 +4421,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (planCount.get() - loadingCount > 0) { |
|
|
|
|
builder.append("未装" + (planCount.get() - packageLoadingNum - inventoryLoadingNum) + "件"); |
|
|
|
|
} |
|
|
|
|
if (loadingCount != 0){ |
|
|
|
|
if (loadingCount != 0) { |
|
|
|
|
builder.append("装车" + loadingCount + "件"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -4505,21 +4509,21 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
strings.addAll(collect); |
|
|
|
|
rs.setScanUser(String.join(",", strings)); |
|
|
|
|
|
|
|
|
|
if (loadingNum > 0 && loadingNum == rs.getReservationNum()){ |
|
|
|
|
if (loadingNum > 0 && loadingNum == rs.getReservationNum()) { |
|
|
|
|
rs.setLoadingStatusName(DeliveryLoadingStatusConstant.yizhuangche.getName()); |
|
|
|
|
}else if (loadingNum > 0 && loadingNum < rs.getReservationNum()){ |
|
|
|
|
} else if (loadingNum > 0 && loadingNum < rs.getReservationNum()) { |
|
|
|
|
rs.setLoadingStatusName(DeliveryLoadingStatusConstant.bunfenzhuangche.getName()); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
rs.setLoadingStatusName(DeliveryLoadingStatusConstant.weizhuangche.getName()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int signNum = list.stream().filter(f->f.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum(); |
|
|
|
|
int signNum = list.stream().filter(f -> f.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum(); |
|
|
|
|
|
|
|
|
|
if (signNum > 0 && signNum == rs.getReservationNum()){ |
|
|
|
|
if (signNum > 0 && signNum == rs.getReservationNum()) { |
|
|
|
|
rs.setSigningStatusName(ReservationSigningStatusConstant.yiqianshou.getValue()); |
|
|
|
|
}else if (signNum > 0 && signNum < rs.getReservationNum()){ |
|
|
|
|
} else if (signNum > 0 && signNum < rs.getReservationNum()) { |
|
|
|
|
rs.setSigningStatusName(ReservationSigningStatusConstant.bufenqianshou.getName()); |
|
|
|
|
}else { |
|
|
|
|
} else { |
|
|
|
|
rs.setSigningStatusName(ReservationSigningStatusConstant.daiqianshou.getName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -4655,43 +4659,43 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
// map.put("收货单单位", reservationEntity.getReceivingUnit());//收货单单位
|
|
|
|
|
// map.put("商场名称", reservationEntity.getStoreName());//商场名称
|
|
|
|
|
// 构建map集合中收货单和商场名称
|
|
|
|
|
buildMapByDistrilbutionBillLadingEntity(map, distrilbutionBillStockEntities, distributionParcelListEntities,distrilbutionBillLadingEntity); |
|
|
|
|
buildMapByDistrilbutionBillLadingEntity(map, distrilbutionBillStockEntities, distributionParcelListEntities, distrilbutionBillLadingEntity); |
|
|
|
|
map.put("提货人", distrilbutionBillLadingEntity.getConsignee());//提货人
|
|
|
|
|
map.put("联系电话", distrilbutionBillLadingEntity.getConsigneePhone());//收货人电话
|
|
|
|
|
BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(distrilbutionBillLadingEntity.getWarehouseId()); |
|
|
|
|
|
|
|
|
|
map.put("自提仓库", entityWarehouseId!=null?entityWarehouseId.getName():""); |
|
|
|
|
map.put("自提仓库", entityWarehouseId != null ? entityWarehouseId.getName() : ""); |
|
|
|
|
map.put("自提时间", DateUtil.formatDateTime(distrilbutionBillLadingEntity.getPickUpTime())); |
|
|
|
|
map.put("提货车牌号", distrilbutionBillLadingEntity.getPickUpPlate()); |
|
|
|
|
map.put("创建时间", DateUtil.formatDateTime(distrilbutionBillLadingEntity.getCreateTime())); |
|
|
|
|
|
|
|
|
|
Map<String,Object> fua = new HashMap<>(); |
|
|
|
|
Map<String, Object> fua = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
// 需要去查询费用明细
|
|
|
|
|
LambdaQueryWrapper<DistributionDeliveryChargeEntity> qu = new LambdaQueryWrapper<>(); |
|
|
|
|
qu.eq(DistributionDeliveryChargeEntity::getBillLading,distrilbutionBillLadingEntity.getId()); |
|
|
|
|
qu.eq(DistributionDeliveryChargeEntity::getBillLading, distrilbutionBillLadingEntity.getId()); |
|
|
|
|
List<DistributionDeliveryChargeEntity> distributionDeliveryChargeEntities = distributionDeliveryChargeMapper.selectList(qu); |
|
|
|
|
|
|
|
|
|
HashMap<String, Object> objectObjectHashMap = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
BigDecimal sumMoney =new BigDecimal("0.00"); |
|
|
|
|
BigDecimal sumMoney = new BigDecimal("0.00"); |
|
|
|
|
// 构建费用明细
|
|
|
|
|
for (DistributionDeliveryChargeEntity distributionDeliveryChargeEntity : distributionDeliveryChargeEntities) { |
|
|
|
|
|
|
|
|
|
String costName = distributionDeliveryChargeEntity.getCost();// 查询码表 得到类型
|
|
|
|
|
|
|
|
|
|
costName=DictBizCache.getValue("delivery_cost",costName); |
|
|
|
|
costName = DictBizCache.getValue("delivery_cost", costName); |
|
|
|
|
BigDecimal costMoney = distributionDeliveryChargeEntity.getMoney();// 查询码表 得到类型
|
|
|
|
|
objectObjectHashMap.put(costName,costMoney); |
|
|
|
|
objectObjectHashMap.put(costName, costMoney); |
|
|
|
|
sumMoney.add(costMoney); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fua.put("费用明细",objectObjectHashMap); |
|
|
|
|
fua.put("费用明细", objectObjectHashMap); |
|
|
|
|
|
|
|
|
|
fua.put("费用合计",sumMoney); |
|
|
|
|
fua.put("费用合计", sumMoney); |
|
|
|
|
|
|
|
|
|
map.put("费用统计",fua); |
|
|
|
|
map.put("费用统计", fua); |
|
|
|
|
|
|
|
|
|
String popHtml = TemplateUtil.popTemplate("自提配送单", map, html); |
|
|
|
|
PrintPreviewVO printPreviewVO = new PrintPreviewVO(); |
|
|
|
@ -4705,7 +4709,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void buildMapByDistrilbutionBillLadingEntity(Map<String, Object> map, List<DistrilbutionBillStockEntity> distrilbutionBillStockEntities, List<DistributionParcelListEntity> distributionParcelListEntities,DistrilbutionBillLadingEntity distrilbutionBillLadingEntity) { |
|
|
|
|
private void buildMapByDistrilbutionBillLadingEntity(Map<String, Object> map, List<DistrilbutionBillStockEntity> distrilbutionBillStockEntities, List<DistributionParcelListEntity> distributionParcelListEntities, DistrilbutionBillLadingEntity distrilbutionBillLadingEntity) { |
|
|
|
|
|
|
|
|
|
// 查询订单集合
|
|
|
|
|
Set<Long> ids = new HashSet<Long>(); |
|
|
|
@ -4725,9 +4729,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
List<Map<String, Object>> listMapTemp = new ArrayList<>(); |
|
|
|
|
Map<String, Object> m = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
int hejiNum =0; |
|
|
|
|
int hejiNum = 0; |
|
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { |
|
|
|
|
if(StringUtils.isBlank(distributionParcelListEntity.getThirdProduct())){ |
|
|
|
|
if (StringUtils.isBlank(distributionParcelListEntity.getThirdProduct())) { |
|
|
|
|
distributionParcelListEntity.setThirdProduct("其它"); |
|
|
|
|
} |
|
|
|
|
if (m.containsKey(distributionParcelListEntity.getThirdProduct())) { |
|
|
|
@ -4747,7 +4751,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
// 需要从所有的包件的
|
|
|
|
|
List<DistributionParcelListEntity> ts = new ArrayList<>(); |
|
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { |
|
|
|
|
if (distributionParcelListEntity.getStockArticleId().equals(distributionStockArticleEntity.getId())){ |
|
|
|
|
if (distributionParcelListEntity.getStockArticleId().equals(distributionStockArticleEntity.getId())) { |
|
|
|
|
ts.add(distributionParcelListEntity); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -4777,16 +4781,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
// 构建产品明细 --对于每一个订单
|
|
|
|
|
buildProductDetail(tempMap, m, ts); |
|
|
|
|
|
|
|
|
|
Map<String,Object> os = (Map<String, Object>) tempMap.get("产品明细"); |
|
|
|
|
Map<String, Object> os = (Map<String, Object>) tempMap.get("产品明细"); |
|
|
|
|
|
|
|
|
|
Set<String> strings = os.keySet(); |
|
|
|
|
int sumNum =0; |
|
|
|
|
int sumNum = 0; |
|
|
|
|
for (String string : strings) { |
|
|
|
|
Object o = os.get(string); |
|
|
|
|
sumNum+=(o!=null)?(int)o:0; |
|
|
|
|
sumNum += (o != null) ? (int) o : 0; |
|
|
|
|
} |
|
|
|
|
tempMap.put("小计", sumNum); |
|
|
|
|
hejiNum+=sumNum; |
|
|
|
|
hejiNum += sumNum; |
|
|
|
|
// 查询货物货位
|
|
|
|
|
|
|
|
|
|
//通过订单id和预约id查询对应包件的库位信息
|
|
|
|
@ -4805,16 +4809,15 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
tempMap.put("货位", allocationStr); |
|
|
|
|
//通过订单id和预约id查询对应包件的备货区信息
|
|
|
|
|
LambdaQueryWrapper<DistributionStockEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
lambdaQueryWrapper.eq(DistributionStockEntity::getBillLadingId,distrilbutionBillLadingEntity.getId()).in(DistributionStockEntity::getParcelListId,orderPackageIds); |
|
|
|
|
lambdaQueryWrapper.eq(DistributionStockEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()).in(DistributionStockEntity::getParcelListId, orderPackageIds); |
|
|
|
|
List<DistributionStockEntity> distributionStockEntities = distributionStockMapper.selectList(lambdaQueryWrapper); |
|
|
|
|
|
|
|
|
|
Set<String> stockupAreaStrList=distributionStockEntities.stream().map(DistributionStockEntity::getStockupArea).collect(Collectors.toSet()); |
|
|
|
|
Set<String> stockupAreaStrList = distributionStockEntities.stream().map(DistributionStockEntity::getStockupArea).collect(Collectors.toSet()); |
|
|
|
|
|
|
|
|
|
String stockupAreaStr = StringUtils.join(stockupAreaStrList, ","); |
|
|
|
|
tempMap.put("备货区", stockupAreaStr); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ls.add(tempMap); |
|
|
|
|
a++; |
|
|
|
|
|
|
|
|
@ -4825,15 +4828,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
|
|
|
|
|
map.put("明细", ls); |
|
|
|
|
Map<String, Object> m1 = new HashMap<>(); |
|
|
|
|
m1.put("产品明细",m); |
|
|
|
|
m1.put("产品明细", m); |
|
|
|
|
|
|
|
|
|
m1.put("合计数量",hejiNum); |
|
|
|
|
m1.put("合计数量", hejiNum); |
|
|
|
|
map.put("合计", m1); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 构建分类明细 |
|
|
|
|
* |
|
|
|
|
* @param tempMap |
|
|
|
|
* @param m |
|
|
|
|
* @param distributionParcelListEntities |
|
|
|
@ -4841,12 +4845,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
private void buildProductDetail(Map<String, Object> tempMap, Map<String, Object> m, List<DistributionParcelListEntity> distributionParcelListEntities) { |
|
|
|
|
|
|
|
|
|
Set<String> strings = m.keySet(); |
|
|
|
|
Map<String, Object> newTempMap= new HashMap<>(); |
|
|
|
|
Map<String, Object> newTempMap = new HashMap<>(); |
|
|
|
|
for (String string : strings) { |
|
|
|
|
int count = buildCountNum(string, distributionParcelListEntities); |
|
|
|
|
newTempMap.put(string, count); |
|
|
|
|
} |
|
|
|
|
tempMap.put("产品明细",newTempMap); |
|
|
|
|
tempMap.put("产品明细", newTempMap); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -4861,7 +4865,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
int num = 0; |
|
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { |
|
|
|
|
|
|
|
|
|
if(StringUtils.isBlank(distributionParcelListEntity.getThirdProduct())){ |
|
|
|
|
if (StringUtils.isBlank(distributionParcelListEntity.getThirdProduct())) { |
|
|
|
|
distributionParcelListEntity.setThirdProduct("其它"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -4876,7 +4880,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
StringBuffer sb = new StringBuffer(); |
|
|
|
|
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntitie) { |
|
|
|
|
|
|
|
|
|
if(ObjectUtils.isNotNull(distributionParcelListEntity.getMallName())){ |
|
|
|
|
if (ObjectUtils.isNotNull(distributionParcelListEntity.getMallName())) { |
|
|
|
|
if (!sb.toString().equals("")) { |
|
|
|
|
sb.append(","); |
|
|
|
|
} |
|
|
|
@ -5149,6 +5153,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//更新签收表的装车数量
|
|
|
|
|
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
//扣减订单在库数量
|
|
|
|
|
distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub()); |
|
|
|
|
//异步维护此异常装车包件的订单状态
|
|
|
|
|
distributionAsyncService.checkOrderLoadingStatus(parcelListEntity.getId()); |
|
|
|
|
DistributionSignforEntity signforEntity = distributionSignforService.getOne(Wrappers.<DistributionSignforEntity>query().lambda().eq(DistributionSignforEntity::getReservationId, reservationEntity.getId()).eq(DistributionSignforEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())); |
|
|
|
@ -5676,7 +5682,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
// 对应签收信息的装车数量要进行扣减
|
|
|
|
|
int a = distributionSignforMapper.deductionLoadingPacjageNum(loadscanEntity.getReservationId(), loadscanEntity.getDeliveryId(), loadscanEntity.getLoadedNub()); |
|
|
|
|
//维护在库订单的在库数量字段
|
|
|
|
|
distributionStockArticleMapper.augmentHandQuantity(loadscanEntity.getOrderId(),loadscanEntity.getLoadedNub()); |
|
|
|
|
distributionStockArticleMapper.augmentHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub()); |
|
|
|
|
distributionAsyncService.checkReservationStatusAndLoadingStatusByPackage(parcelListEntity.getId()); |
|
|
|
|
} |
|
|
|
|
//进行了一条包件任务的取消,此时就应该对预约、配送任务进行数量的维护
|
|
|
|
@ -5751,7 +5757,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
.eq(DistributionParcelNumberEntity::getStockArticleId, distributionParcelNumberVO.getStockArticleId()) |
|
|
|
|
.eq(DistributionParcelNumberEntity::getParcelListId, distributionParcelNumberVO.getParcelListId()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(distributionParcelNumberEntity)){ |
|
|
|
|
if (Func.isNotEmpty(distributionParcelNumberEntity)) { |
|
|
|
|
//这里滞留都是在装车之后进行 只需要维护出库数量和在库数量字段
|
|
|
|
|
distributionParcelNumberEntity.setOutboundQuantity(distributionParcelNumberEntity.getOutboundQuantity() - retentionQuantity); |
|
|
|
|
distributionParcelNumberEntity.setHandQuantity(distributionParcelNumberEntity.getHandQuantity() + retentionQuantity); |
|
|
|
@ -5761,7 +5767,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (Func.isNotEmpty(zeroLoadscanEntity)) { |
|
|
|
|
//存在装车数据
|
|
|
|
|
int num = zeroLoadscanEntity.getLoadedNub() - retentionQuantity; |
|
|
|
|
if (num > 0){ |
|
|
|
|
if (num > 0) { |
|
|
|
|
zeroLoadscanEntity.setLoadedNub(0); |
|
|
|
|
zeroLoadscanEntity.setPackageNub(0); |
|
|
|
|
} else { |
|
|
|
@ -5774,7 +5780,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
int a = distributionSignforMapper.deductionLoadingPacjageNum(zeroLoadscanEntity.getReservationId(), zeroLoadscanEntity.getDeliveryId(), retentionQuantity); |
|
|
|
|
distributionAsyncService.checkReservationStatusAndLoadingStatusByPackage(distributionParcelNumberEntity.getParcelListId()); |
|
|
|
|
} |
|
|
|
|
distributionAsyncService.checkRetentionZeroPackageReservationAndDeliveryInfo(reservationId, deliveryId, orderPackageId,orderId); |
|
|
|
|
distributionAsyncService.checkRetentionZeroPackageReservationAndDeliveryInfo(reservationId, deliveryId, orderPackageId, orderId); |
|
|
|
|
return true; |
|
|
|
|
} else { |
|
|
|
|
return false; |
|
|
|
@ -5796,6 +5802,122 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
return baseMapper.selectDeliveryById(deliveryId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<AftersalesAbnormalPackageVO> aftersalesPackageScan(Long deliveryId, String scanBarCode) { |
|
|
|
|
DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryId); |
|
|
|
|
if (ObjectUtils.isNull(deliveryListEntity)) { |
|
|
|
|
log.info("#############查询配送失败,ID:{}", deliveryId); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
List<AftersalesAbnormalPackageVO> aftersalesAbnormalPackageVOS = new ArrayList<>(); |
|
|
|
|
//查询该配送任务下的所有包件,查看是否存在有满足条件的包件
|
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(deliveryListEntity.getId()); |
|
|
|
|
if (Func.isNotEmpty(distributionParcelListEntities)) { |
|
|
|
|
List<DistributionParcelListEntity> packageList = distributionParcelListEntities.stream().filter(p -> p.getOrderPackageCode().equals(scanBarCode)).collect(Collectors.toList()); |
|
|
|
|
if (Func.isNotEmpty(packageList)) { |
|
|
|
|
for (DistributionParcelListEntity parcelListEntity : packageList) { |
|
|
|
|
AftersalesAbnormalPackageVO abnormalPackageVO = Func.copy(parcelListEntity, AftersalesAbnormalPackageVO.class); |
|
|
|
|
abnormalPackageVO.setPackageCode(parcelListEntity.getOrderPackageCode()); |
|
|
|
|
abnormalPackageVO.setOrderCode(parcelListEntity.getOrderCode()); |
|
|
|
|
abnormalPackageVO.setWaybillNumber(parcelListEntity.getWaybillNumber()); |
|
|
|
|
WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(parcelListEntity.getWaybillNumber()); |
|
|
|
|
abnormalPackageVO.setWaybillId(byWaybillNo.getId()); |
|
|
|
|
abnormalPackageVO.setConditions(1); |
|
|
|
|
abnormalPackageVO.setNumber(parcelListEntity.getQuantity().toString()); |
|
|
|
|
abnormalPackageVO.setOrderId(parcelListEntity.getStockArticleId()); |
|
|
|
|
abnormalPackageVO.setWarehouseId(parcelListEntity.getWarehouseId()); |
|
|
|
|
abnormalPackageVO.setIsAbnormalLoading(1); |
|
|
|
|
abnormalPackageVO.setIsAbnormalSinging(1); |
|
|
|
|
aftersalesAbnormalPackageVOS.add(abnormalPackageVO); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
//查看是否是异常装车包件
|
|
|
|
|
List<DistributionLoadscanEntity> list = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() |
|
|
|
|
.eq(DistributionLoadscanEntity::getDeliveryId, deliveryId) |
|
|
|
|
.eq(DistributionLoadscanEntity::getIsAbnormalLoading, IsOrNoConstant.yes.getValue()) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(list)){ |
|
|
|
|
List<DistributionLoadscanEntity> abnormalPackageList = list.stream().filter(f -> f.getOrderPackageCode().equals(scanBarCode)).collect(Collectors.toList()); |
|
|
|
|
if (Func.isNotEmpty(abnormalPackageList)){ |
|
|
|
|
for (DistributionLoadscanEntity distributionLoadscanEntity : abnormalPackageList) { |
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(distributionLoadscanEntity.getPackageId()); |
|
|
|
|
AftersalesAbnormalPackageVO abnormalPackageVO = Func.copy(distributionLoadscanEntity, AftersalesAbnormalPackageVO.class); |
|
|
|
|
abnormalPackageVO.setPackageCode(distributionLoadscanEntity.getOrderPackageCode()); |
|
|
|
|
abnormalPackageVO.setOrderCode(parcelListEntity.getOrderCode()); |
|
|
|
|
abnormalPackageVO.setWaybillNumber(parcelListEntity.getWaybillNumber()); |
|
|
|
|
WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(parcelListEntity.getWaybillNumber()); |
|
|
|
|
abnormalPackageVO.setWaybillId(byWaybillNo.getId()); |
|
|
|
|
abnormalPackageVO.setConditions(1); |
|
|
|
|
abnormalPackageVO.setNumber(parcelListEntity.getQuantity().toString()); |
|
|
|
|
abnormalPackageVO.setOrderId(parcelListEntity.getStockArticleId()); |
|
|
|
|
abnormalPackageVO.setWarehouseId(parcelListEntity.getWarehouseId()); |
|
|
|
|
abnormalPackageVO.setIsAbnormalLoading(distributionLoadscanEntity.getIsAbnormalLoading()); |
|
|
|
|
abnormalPackageVO.setIsAbnormalSinging(distributionLoadscanEntity.getIsAbnormalSigning()); |
|
|
|
|
aftersalesAbnormalPackageVOS.add(abnormalPackageVO); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (deliveryListEntity.getType().equals("2")) { |
|
|
|
|
List<DisStockListDetailEntity> disStockListDetailEntities = distributionDeliveryListMapper.selectInventoryListByDeliveryListId(deliveryId); |
|
|
|
|
if (Func.isNotEmpty(disStockListDetailEntities)) { |
|
|
|
|
List<DisStockListDetailEntity> inventoryList = disStockListDetailEntities.stream().filter(f -> f.getStockPackageCode().equals(scanBarCode)).collect(Collectors.toList()); |
|
|
|
|
if (Func.isNotEmpty(inventoryList)) { |
|
|
|
|
for (DisStockListDetailEntity disStockListDetailEntity : inventoryList) { |
|
|
|
|
AftersalesAbnormalPackageVO abnormalPackageVO = Func.copy(disStockListDetailEntity, AftersalesAbnormalPackageVO.class); |
|
|
|
|
abnormalPackageVO.setPackageCode(disStockListDetailEntity.getStockPackageCode()); |
|
|
|
|
DistributionStockListEntity stockListEntity = distributionStockListService.getById(disStockListDetailEntity.getStockListId()); |
|
|
|
|
if (stockListEntity.getSourceType().equals(1)) { |
|
|
|
|
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleMapper.selectOne(Wrappers.<DistributionStockArticleEntity>query().lambda() |
|
|
|
|
.eq(DistributionStockArticleEntity::getOrderCode, stockListEntity.getIncomingBatch()) |
|
|
|
|
); |
|
|
|
|
//需要查询订单
|
|
|
|
|
abnormalPackageVO.setOrderCode(distributionStockArticleEntity.getOrderCode()); |
|
|
|
|
abnormalPackageVO.setWaybillNumber(distributionStockArticleEntity.getWaybillNumber()); |
|
|
|
|
WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(distributionStockArticleEntity.getWaybillNumber()); |
|
|
|
|
|
|
|
|
|
abnormalPackageVO.setWaybillId(byWaybillNo.getId()); |
|
|
|
|
abnormalPackageVO.setOrderId(distributionStockArticleEntity.getId()); |
|
|
|
|
} |
|
|
|
|
abnormalPackageVO.setConditions(2); |
|
|
|
|
abnormalPackageVO.setNumber(disStockListDetailEntity.getNum().toString()); |
|
|
|
|
abnormalPackageVO.setWarehouseId(disStockListDetailEntity.getWarehouseId()); |
|
|
|
|
abnormalPackageVO.setCargoNumber(stockListEntity.getCargoNumber()); |
|
|
|
|
abnormalPackageVO.setIncomingBatch(stockListEntity.getIncomingBatch()); |
|
|
|
|
aftersalesAbnormalPackageVOS.add(abnormalPackageVO); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<DistributionRetentionScanVo> distributionRetentionScanVos = distributionDeliveryListMapper.selectRetentionZeroPackage(deliveryId, scanBarCode); |
|
|
|
|
if (Func.isNotEmpty(distributionRetentionScanVos)){ |
|
|
|
|
for (DistributionRetentionScanVo distributionRetentionScanVo : distributionRetentionScanVos) { |
|
|
|
|
AftersalesAbnormalPackageVO abnormalPackageVO = Func.copy(distributionRetentionScanVo, AftersalesAbnormalPackageVO.class); |
|
|
|
|
abnormalPackageVO.setConditions(3); |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(distributionRetentionScanVo.getOrderId()); |
|
|
|
|
abnormalPackageVO.setOrderCode(stockArticleEntity.getOrderCode()); |
|
|
|
|
abnormalPackageVO.setOrderId(stockArticleEntity.getId()); |
|
|
|
|
abnormalPackageVO.setWaybillNumber(stockArticleEntity.getWaybillNumber()); |
|
|
|
|
abnormalPackageVO.setWarehouseId(stockArticleEntity.getWarehouseId()); |
|
|
|
|
WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(stockArticleEntity.getWaybillNumber()); |
|
|
|
|
abnormalPackageVO.setWaybillId(byWaybillNo.getId()); |
|
|
|
|
abnormalPackageVO.setMaxQuantity(distributionRetentionScanVo.getMaxQuantity()); |
|
|
|
|
aftersalesAbnormalPackageVOS.add(abnormalPackageVO); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (Func.isEmpty(aftersalesAbnormalPackageVOS)) { |
|
|
|
|
log.info("############此配送任务查询包件信息失败,码值:{}", scanBarCode); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
return aftersalesAbnormalPackageVOS; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Map<String, String> getDriverCar(String kind, Long deliveryListEntityId) { |
|
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
|
String dirverName = null; |
|
|
|
|