Browse Source

Merge branch 'fix_bug_20231227_1' into fix_bug_20231227_2

# Conflicts:
#	blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
#	blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
#	blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
#	blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
#	blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
single_db
pref_mail@163.com 1 year ago
parent
commit
2da3e0374f
  1. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java
  2. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  3. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  4. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java
  5. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  6. 48
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java
  7. 626
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  8. 73
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  9. 574
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  10. 100
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

6
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java

@ -48,6 +48,12 @@ public class DistributionDeliveryInfoVO extends DistributionDeliveryInfoEntity {
* 签收ID
*/
private Long signId;
/**
* 仓库
*/
@ApiModelProperty(value = "签收表ID")
private Long signingId;
/**
* 运单号
*/

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java

@ -385,6 +385,12 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
*/
IPage<DistributionDeliveryWordVO> getShippingInformation(IPage<Object> page, DistributionDeliveryListDTO distributionDeliveryInfoDTO);
/**
* 维护配送任务信息
* @param deliveryId
*/
void maintenanceDeliveryInfo(Long deliveryId);
/**
* 查询商配计划订单是否可以移除
* @param deliveryId

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java

@ -248,4 +248,11 @@ public interface IDistributionReservationService extends BaseService<Distributio
* @return
*/
DistributionStockupStockListVO selectStockupStockListByStockListId(Long reservationId, Long id);
/**
* 维护预约计划状态
* @param reservationId
* @param warehouseId
*/
void maintenanceReservationInfo(Long reservationId);
}

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java

@ -195,4 +195,12 @@ public interface IDistributionStockArticleService extends BaseService<Distributi
void updateOrderInfo(String orderCode, Long warehouseId);
IPage<JSONObject> findZeroListByWarehouseId(Long warehouseId,Integer pageNum,Integer pageSize);
/**
* 维护订单信息支持多个
* @param orderCodes
* @param warehouseId
*/
void maintenanceOrderInfo(String orderCodes, Long warehouseId);
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -733,7 +733,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
// }
// }
//维护订单状态
distributionStockArticleService.updateOrderInfo(parcelListEntity.getOrderCode(),parcelListEntity.getWarehouseId());
// distributionStockArticleService.updateOrderInfo(parcelListEntity.getOrderCode(),parcelListEntity.getWarehouseId());
warehouseUpdownTypeClient.downPackage(parcelListEntity.getOrderPackageCode(),parcelListEntity.getWarehouseId());
checkReservationAndDeliveryLoadingStatus(deliveryId, reservationId);
}

48
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java

@ -35,6 +35,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.loading.LoadingStatusConstant;
import org.springblade.common.constant.order.OrderStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant;
import org.springblade.common.constant.reservation.ReservationOrderStatusConstant;
import org.springblade.common.serviceConstant.ServiceConstant;
@ -148,7 +149,32 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
@Override
public IPage<DistributionStockArticleVO> selectDistributionDeliveryorder(IPage<DistributionStockArticleVO> page, Map<String, Object> distributionStockArticle) {
List<DistributionStockArticleVO> distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryOrderPage(page, distributionStockArticle);
distributionDeliveryInfoVOS.forEach(s -> {
switch (s.getOrderStatus()) {
case "10":
s.setOrderStatusName(OrderStatusConstant.bufenruku.getName());
break;
case "20":
s.setOrderStatusName(OrderStatusConstant.ruku.getName());
break;
case "30":
s.setOrderStatusName(OrderStatusConstant.bufenchuku.getName());
break;
case "40":
s.setOrderStatusName(OrderStatusConstant.chuku.getName());
break;
case "70":
s.setOrderStatusName(OrderStatusConstant.bufenqianshou.getName());
break;
case "80":
s.setOrderStatusName(OrderStatusConstant.qianshou.getName());
break;
}
});
// for (DistributionStockArticleVO distributionDeliveryInfoVO : distributionDeliveryInfoVOS) {
// //查询签收数量
// //查询装车数量
@ -282,13 +308,13 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
distributionAppStockArticleVO.setCompletecode(2);
distributionAppStockArticleVO.setComplete("未齐套");
int loadNum = ks.stream().mapToInt(DistributionAppParcelListVO::getLoadingNum).sum();
if (loadNum == distributionAppStockArticleVO.getReservationNum() && distributionAppStockArticleVO.getReservationNum() >0) {
if (loadNum == distributionAppStockArticleVO.getReservationNum() && distributionAppStockArticleVO.getReservationNum() > 0) {
distributionAppStockArticleVO.setCompletecode(3);
distributionAppStockArticleVO.setComplete("齐套");
}else if (loadNum == 0){
} else if (loadNum == 0) {
distributionAppStockArticleVO.setCompletecode(1);
distributionAppStockArticleVO.setComplete("未装");
}else {
} else {
distributionAppStockArticleVO.setCompletecode(2);
distributionAppStockArticleVO.setComplete("未齐套");
}
@ -396,9 +422,9 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
// }
@Override
public List<DisStockListDetailVO> selectDistributionAppDeliveryInventory( DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) {
public List<DisStockListDetailVO> selectDistributionAppDeliveryInventory(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) {
List<DisStockListDetailEntity> inventoryList = distributionReservationMapper.selectInventoryListByReservation(Long.parseLong(distributionAppDeliveryListDTO.getReservationId()));
if (Func.isEmpty(inventoryList)){
if (Func.isEmpty(inventoryList)) {
log.error("##########查询该客户库存品信息为null");
return null;
}
@ -406,7 +432,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
List<DistributionStockListEntity> distributionStockListEntities = distributionStockListService.listByIds(stockListIds);
Map<Long, DistributionStockListEntity> stockListMap = distributionStockListEntities.stream().collect(Collectors.toMap(DistributionStockListEntity::getId, Function.identity(), (k1, k2) -> k2));
List<DisStockListDetailVO> disStockListDetailVOS = DistributionDisStockListWrapper.build().listVO(inventoryList);
disStockListDetailVOS.stream().forEach(sd->{
disStockListDetailVOS.stream().forEach(sd -> {
//查询一次装车 如果装车了那么
DistributionLoadscaninvnEntity serviceOne = distributionLoadscaninvnService.getOne(Wrappers.<DistributionLoadscaninvnEntity>query().lambda()
.eq(DistributionLoadscaninvnEntity::getReservationId, distributionAppDeliveryListDTO.getReservationId())
@ -414,13 +440,13 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
.eq(DistributionLoadscaninvnEntity::getInventoryId, sd.getStockListId())
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(serviceOne)){
if (Func.isNotEmpty(serviceOne)) {
sd.setLoadingStatusName(OrderPackageLoadingStatusConstant.yizhuangche.getName());
}else {
} else {
sd.setLoadingStatusName(OrderPackageLoadingStatusConstant.weizhuancghe.getName());
}
if (Func.isNotEmpty(stockListMap.get(sd.getStockListId()))){
if (Func.isNotEmpty(stockListMap.get(sd.getStockListId()))) {
DistributionStockListEntity distributionStockListEntity = stockListMap.get(sd.getStockListId());
sd.setMarketName(distributionStockListEntity.getMarketName());
sd.setDescriptionGoods(distributionStockListEntity.getDescriptionGoods());
@ -434,6 +460,4 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
}
}

626
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -96,6 +96,8 @@ import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.feign.IDictBizClient;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
@ -115,65 +117,115 @@ import java.util.stream.Collectors;
* @since 2023-06-16
*/
@Service
@AllArgsConstructor
@Log4j2
public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<DistributionDeliveryListMapper, DistributionDeliveryListEntity> implements IDistributionDeliveryListService {
private final DistributionDeliveryInfoMapper distributionDeliveryInfoMapper;
private final DistributionReservationMapper distributionReservationMapper;
private final IDistributionReservationStockarticleService distributionReservationStockarticleService;
private final IDistributionReservationStocklistService distributionReservationStocklistService;
private final IDistributionReservationPackageService distributionReservationPackageService;
private final DistributionReservationPackageMapper distributionReservationPackageMapper;
private final IDistributionParcelListService distributionParcelListService;
private final DistributionLoadscanMapper distributionLoadscanMapper;
private final DistributionLoadscanServiceImpl distributionLoadscanService;
private final DistributionLoadscaninvnServiceImpl distributionLoadscaninvnService;
private final DistributionDeliveryListMapper distributionDeliveryListMapper;
private final DistributionSignforServiceImpl distributionSignforService;
private final DistributionSignforMapper distributionSignforMapper;
private final IDistributionSignforService distributionSignforServicer;
private final DistributionStockArticleMapper distributionStockArticleMapper;
private final IDistributionStockArticleService distributionStockArticleService;
private final DistributionSigndetailServiceImpl distributionSigndetailService;
private final DistributionPackadeliServiceImpl distributionPackadeliService;
private final DistributionDeliverySelfMapper distributionDeliverySelfMapper;
private final IDistributionDeliverySelfService distributionDeliverySelfService;
private final DistributionDeliveryTripartiteMapper distributionDeliveryTripartiteMapper;
private final IDistributionDeliveryTripartiteService distributionDeliveryTripartiteService;
private final DistributionReservationStockarticleMapper distributionReservationStockarticleMapper;
private final DistributionStockupMapper distributionStockupMapper;
private final IDistributionStockupInfoService distributionStockupInfoService;
private final DistributionStockMapper distributionStockMapper;
private final DistributionLoadscaninvnMapper distributionLoadscaninvnMapper;
private final IDistributionAsyncService distributionAsyncService;
private final IDictBizClient dictBizClient;
private final IBasicdataDriverArteryClient iBasicdataDriverArteryClient;
private final IBasicdataWarehouseClient warehouseClient;
private final IDisStockListDetailService disStockListDetailService;
private final DistributionStockListMapper distributionStockListMapper;
private final IDistributionStockListService distributionStockListService;
private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
private final IBasicPrintTemplateClient basicPrintTemplateClient;
private final IWarehouseTrayTypeClient warehouseTrayTypeClient;
private final IDistributionLoadscanAbnormalService distributionLoadscanAbnormalService;
private final IDistributionReservationZeroPackageService distributionReservationZeroPackageService;
private final IDistributionParcelNumberService distributionParcelNumberService;
private final IWarehouseTrayGoodsClient warehouseTrayGoodsClient;
private final IWarehouseWaybillClient warehouseWaybillClient;
private final BladeRedis bladeRedis;
@Autowired
private DistributionDeliveryInfoMapper distributionDeliveryInfoMapper;
@Autowired
private DistributionReservationMapper distributionReservationMapper;
@Autowired
private IDistributionReservationStockarticleService distributionReservationStockarticleService;
@Autowired
private IDistributionReservationStocklistService distributionReservationStocklistService;
@Autowired
private IDistributionReservationPackageService distributionReservationPackageService;
@Autowired
private DistributionReservationPackageMapper distributionReservationPackageMapper;
@Autowired
private IDistributionParcelListService distributionParcelListService;
@Autowired
private DistributionLoadscanMapper distributionLoadscanMapper;
@Autowired
private DistributionLoadscanServiceImpl distributionLoadscanService;
@Autowired
private DistributionLoadscaninvnServiceImpl distributionLoadscaninvnService;
@Autowired
private DistributionDeliveryListMapper distributionDeliveryListMapper;
@Autowired
private DistributionSignforServiceImpl distributionSignforService;
@Autowired
private DistributionSignforMapper distributionSignforMapper;
@Autowired
private IDistributionSignforService distributionSignforServicer;
private DistributionStockArticleMapper distributionStockArticleMapper;
@Autowired
private IDistributionStockArticleService distributionStockArticleService;
@Autowired
private DistributionSigndetailServiceImpl distributionSigndetailService;
@Autowired
private DistributionPackadeliServiceImpl distributionPackadeliService;
@Autowired
private DistributionDeliverySelfMapper distributionDeliverySelfMapper;
@Autowired
private IDistributionDeliverySelfService distributionDeliverySelfService;
@Autowired
private DistributionDeliveryTripartiteMapper distributionDeliveryTripartiteMapper;
@Autowired
private IDistributionDeliveryTripartiteService distributionDeliveryTripartiteService;
@Autowired
private DistributionReservationStockarticleMapper distributionReservationStockarticleMapper;
@Autowired
private DistributionStockupMapper distributionStockupMapper;
@Autowired
private IDistributionStockupInfoService distributionStockupInfoService;
@Autowired
private DistributionStockMapper distributionStockMapper;
@Autowired
private DistributionLoadscaninvnMapper distributionLoadscaninvnMapper;
@Autowired
private IDistributionAsyncService distributionAsyncService;
@Autowired
private IDictBizClient dictBizClient;
@Autowired
private IBasicdataDriverArteryClient iBasicdataDriverArteryClient;
@Autowired
private IBasicdataWarehouseClient warehouseClient;
@Autowired
private IDisStockListDetailService disStockListDetailService;
@Autowired
private DistributionStockListMapper distributionStockListMapper;
@Autowired
private IDistributionStockListService distributionStockListService;
@Autowired
private IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
@Autowired
private IBasicPrintTemplateClient basicPrintTemplateClient;
@Autowired
private IWarehouseTrayTypeClient warehouseTrayTypeClient;
@Autowired
private IDistributionLoadscanAbnormalService distributionLoadscanAbnormalService;
@Autowired
private IDistributionReservationZeroPackageService distributionReservationZeroPackageService;
@Autowired
private IDistributionParcelNumberService distributionParcelNumberService;
@Autowired
private IWarehouseTrayGoodsClient warehouseTrayGoodsClient;
@Autowired
private IWarehouseWaybillClient warehouseWaybillClient;
@Autowired
private BladeRedis bladeRedis;
@Autowired
// 自提mapper
private final DistrilbutionBillLadingMapper distrilbutionBillLadingMapper;
private DistrilbutionBillLadingMapper distrilbutionBillLadingMapper;
@Autowired
// 自提关联订单
private final DistrilbutionBillStockMapper distrilbutionBillStockMapper;
private DistrilbutionBillStockMapper distrilbutionBillStockMapper;
// 自提关联包件
private final DistrilbutionBillPackageMapper distrilbutionBillPackageMapper;
@Autowired
private DistrilbutionBillPackageMapper distrilbutionBillPackageMapper;
@Autowired
private DistributionParcelListMapper distributionParcelListMapper;
@Autowired
private DistributionDeliveryChargeMapper distributionDeliveryChargeMapper;
private final DistributionParcelListMapper distributionParcelListMapper;
@Autowired
@Lazy
private IDistributionReservationService distributionReservationService;
private final DistributionDeliveryChargeMapper distributionDeliveryChargeMapper;
@Autowired
@Lazy
private IDistributionDeliveryListService distributionDeliveryListService;
// private final IWarehouseRetentionScanClient warehouseRetentionScanClient;
@ -544,7 +596,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//在配送任务中存在该包件的计划
List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()).eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
if (Func.isNotEmpty(distributionLoadscanEntitiesflag) && distributionLoadscanEntitiesflag.size() == 1) {
return Resp.scanSuccess("重复扫码", "重复扫码");
return Resp.scanFail("重复扫码", "重复扫码");
}
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())) {
@ -585,25 +637,22 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadscanEntity.setIsAbnormalLoading(1);
loadscanEntity.setLoadedNub(parcelListEntity.getQuantity());
distributionLoadscanService.save(loadscanEntity);
//出库
// warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(),myCurrentWarehouse.getId());
//订单扣减在库数量
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId());
// stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity() - parcelListEntity.getQuantity());
// distributionStockArticleService.updateById(stockArticleEntity);
//查询本车次是否第一次扫码,没有则更新上车时间
//更新包件装车状态
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
distributionParcelListService.updateById(parcelListEntity);
//更新装车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//扣减订单的在库数量
Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
//这里还需要一个订单维护状态的方法
distributionStockArticleService.updateOrderInfo(parcelListEntity.getOrderCode(),parcelListEntity.getWarehouseId());
//异步维护状态
// str.append("包件装车");
// loadingNum.getAndAdd(loadscanEntity.getPackageNub());
// distributionAsyncService.checkLoadingByPackage(parcelListEntity, loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId());
} else if (parcelListEntityList.isEmpty()) {
//维护订单的信息
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(),myCurrentWarehouse.getId());
//维护预约的信息
distributionReservationService.maintenanceReservationInfo(reservationEntity.getId());
//维护配送任务信息
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
//包件下架
warehouseUpdownTypeClient.downPackage(parcelListEntity.getOrderPackageCode(),myCurrentWarehouse.getId());
} else if (parcelListEntityList.size() == 0) {
//查找出该包件信息
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getOne(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()));
List<DistributionReservationEntity> reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
@ -613,6 +662,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId());
if (shangpeiFlag) {
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName())).collect(Collectors.toList());
//查看是否存在满足条件的预约单
if (reservationEntities.size() == 1) {
@ -631,6 +681,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
} else {
shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shangpei.getValue()));
if (shangpeiFlag) {
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName())).collect(Collectors.toList());
@ -694,6 +745,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// return Resp.scanFail("装车失败", "装车失败");
}
List<DistributionLoadscanEntity> reservationLoadscanEntities = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
List<String> orderPackageCodes = new ArrayList<>();
for (DistributionParcelListEntity parcelListEntity : parcelListEntities) {
log.info("#########!!!!!!!!!!!!!!!!!--------- 88888888888 parcelListEntities={}", parcelListEntities);
if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) {
@ -717,6 +770,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) {
loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
loadscanEntity.setScanTime(now);
loadscanEntity.setOrderId(parcelListEntity.getStockArticleId());
loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
loadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
@ -724,7 +778,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
loadscanEntity.setPackageNub(parcelListEntity.getQuantity());
loadscanEntity.setPackageId(parcelListEntity.getId());
loadscanEntity.setScanTime(now);
BladeUser user = AuthUtil.getUser();
// loadscanEntity.setScanUser(user.getUserName());
loadscanEntity.setScanUser(user.getNickName());
@ -733,21 +786,35 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadscanEntity.setScanType("2");
loadscanEntity.setScanStatus("2");
loadscanEntity.setIsInsert(1);
loadscanEntity.setMsg("司机按照预约整托装车");
loadscanEntity.setMsg("司机整托装车");
loadscanEntity.setTrayNo(trayTypeDataVO.getTrayCode());
reservationLoadscanEntities.add(loadscanEntity);
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//扣减订单的在库数量
Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
// loadingNum.getAndAdd(loadscanEntity.getPackageNub());
distributionAsyncService.checkLoadingByPackage(parcelListEntity, loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId());
orderCodes.add(parcelListEntity.getOrderCode());
//修改包件为装车状态
orderPackageCodes.add(parcelListEntity.getOrderPackageCode());
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
distributionParcelListService.updateById(parcelListEntity);
}
}
// str.append("预约客户整托装车");
distributionLoadscanService.saveBatch(reservationLoadscanEntities);
//这里则进行整托装车的数据构建
//维护订单的信息
if (Func.isNotEmpty(orderCodes)){
String orderCode = orderCodes.stream().distinct().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(orderCode,myCurrentWarehouse.getId());
}
if (Func.isNotEmpty(orderPackageCodes)){
String orderPackages = orderPackageCodes.stream().distinct().collect(Collectors.joining(","));
warehouseUpdownTypeClient.downPackage(orderPackages,myCurrentWarehouse.getId());
}
//维护预约的信息
distributionReservationService.maintenanceReservationInfo(distrilbutionloadingscanDTO.getReservationId());
//维护配送任务信息
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
} else {
log.info("#########!!!!!!!!!!!!!!!!!--------- 101010101010 存在其他客户货物");
return Resp.scanFail("整托装车失败", "存在其他客户货物");
@ -763,11 +830,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return Resp.scanFail("查询托盘货物失败", "查询托盘货物失败");
}
}
//异步维护预约装车状态,
//异步维护配送任务装车状态
//查询已装车件数
String str = getLoadingMsg(distrilbutionloadingscanDTO);
return Resp.scanSuccess("装车成功", str);
@ -1453,6 +1515,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Map<String, List<DistributionReservationStockarticleEntity>> allStockArticle = reservationStockarticleEntityList.stream().filter(f -> Func.isNotEmpty(f.getIsZero())).collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getIsZero));
DistributionDeliverySelfEntity finalDistributionDeliverySelfEntity = distributionDeliverySelfEntity;
List<DistributionParcelListEntity> updatePackageList = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
for (DistributionReservationStockarticleEntity reservationStockarticleEntity : reservationStockarticleEntityList) {
switch (reservationStockarticleEntity.getIsZero()) {
case "0":
@ -1461,6 +1524,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(distrilbutionloadingscanDTO.getReservationId(), reservationStockarticleEntity.getStockArticleId());
for (DistributionParcelListEntity parcelListEntity : parcelListEntities) {
DistributionLoadscanEntity packageLoadingScan = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()).eq(DistributionLoadscanEntity::getOrderId, reservationStockarticleEntity.getStockArticleId()).eq(DistributionLoadscanEntity::getPackageId, parcelListEntity.getId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
//无装车数据包件进行装车
if (Func.isEmpty(packageLoadingScan)) {
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
BladeUser user = AuthUtil.getUser();
@ -1507,26 +1571,23 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isNotEmpty(distrilbutionloadingscanDTO.getDeliveryId())) {
loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
}
// parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
// distributionParcelListService.updateById(parcelListEntity);
distributionLoadscanService.save(loadscanEntity);
//更新装车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新装车件数
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
distributionParcelListService.updateById(parcelListEntity);
//扣减在库订单的在库数量
Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
distributionAsyncService.checkOrderLoadingStatus(parcelListEntity.getStockArticleId());
// Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
updatePackageList.add(parcelListEntity);
orderCodes.add(parcelListEntity.getOrderCode());
//拼接包条码
orderPackages.append(parcelListEntity.getOrderPackageCode()).append(",");
// orderPackages.append(parcelListEntity.getOrderPackageCode()).append(",")
}
//异步修改包件状态
// distributionAsyncService.changeMarketDeliveryListStatus(loadscanEntity.getOrderPackageCode(), loadscanEntity.getDeliveryId());
}
// });
break;
case "1":
//零担订单
// v.forEach(zord -> {
List<DistributionParcelNumberVO> parcelNumberVOS = distributionReservationMapper.selectReservationZeroOrderDetail(reservationStockarticleEntity.getStockArticleId(), distrilbutionloadingscanDTO.getReservationId());
for (DistributionParcelNumberVO parcelNumberVO : parcelNumberVOS) {
//这里需要查询是否已经存在有装车数据,如果有那么这里应该进行修改
@ -1637,36 +1698,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
BigDecimal loadedNumber = new BigDecimal(signforEntity.getLoadedNumber());
signforEntity.setLoadedNumber(loadedNumber.subtract(packageLoadingNub).add(reservationNum).intValue());
distributionSignforService.updateById(signforEntity);
//异步修改包件状态
// distributionAsyncService.checkZeroStockArticleLoadingStatus(parcelNumberEntity);
// JsonObject jsonObject = new JsonObject();
// jsonObject.addProperty("");
// warehouseUpdownTypeClient.downZeroOrder()
}
}
}
}
// });
break;
default:
log.error("####################reservationStockarticleEntity的isZero字段错误:{}", reservationStockarticleEntity);
break;
}
}
// allStockArticle.forEach((k, v) -> {
//
// });
// List<DisStockListDetailEntity> stockListDetailEntityList = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
// .eq(DisStockListDetailEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
// .ne(DisStockListDetailEntity::getStockPackageStatus, ReservationInventoryStatusConstant.quxiao.getValue()));
// boolean inventoryLoadingFlag = stockListDetailEntityList.stream().allMatch(i -> i.getStockPackageStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue()));
// boolean inventoryStockUpFlag = stockListDetailEntityList.stream().anyMatch(l -> Func.isEmpty(l.getStockPackageCode()));
// if (inventoryStockUpFlag) {
// log.error("##################库存品未备货");
// return Resp.scanFail("操作失败","存在库存品未备货");
//// return R.fail("该客户存在库存品暂未备货 一键装车失败!!!");
// }
if (!inventoryLoadingFlag) {
//存在库存品海为进行装车
for (DisStockListDetailEntity disStockListDetailEntity : stockListDetailEntityList) {
@ -1716,279 +1758,40 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadscaninvnEntity.setLoadedNub(disStockListDetailEntity.getNum());
}
distributionLoadscaninvnService.save(loadscaninvnEntity);
//更新装车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新库存品装车数量
Integer j = distributionSignforMapper.updateloadByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
// warehouseUpdownTypeClient.downStock()
//异步修改包件状态 //对于存在库存品的这里还需要将库存品从对应的信息中进行扣除
// distributionAsyncService.changeMarketDeliveryListStatus(loadscaninvnEntity.getOrderPackageCode(), loadscaninvnEntity.getDeliveryId());
// DistributionStockListEntity stockListEntity = distributionStockListMapper.selectOne(Wrappers.<DistributionStockListEntity>query().lambda().eq(DistributionStockListEntity::getId, loadscaninvnEntity.getInventoryId()));
// stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - loadscaninvnEntity.getPackageNub());
// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - loadscaninvnEntity.getPackageNub());
// stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + loadscaninvnEntity.getPackageNub());
// distributionStockListMapper.updateById(stockListEntity);
//扣减对应库存品在库数量
distributionStockListMapper.deductionQuantityStock(loadscaninvnEntity.getInventoryId(),loadscaninvnEntity.getLoadedNub());
}
}
}
//包件维护下架和装车状态
distributionAsyncService.updatepackageListLoadingStatus(updatePackageList,myCurrentWarehouse.getId());
//维护配送任务装车状态
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
//维护预约单装车状态
distributionReservationService.maintenanceReservationInfo(distrilbutionloadingscanDTO.getReservationId());
//维护包件状态
if (Func.isNotEmpty(orderCodes)){
String orderCode = orderCodes.stream().distinct().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(orderCode,myCurrentWarehouse.getId());
}
//包件维护下架和装车状态
// distributionAsyncService.updatepackageListLoadingStatus(updatePackageList,myCurrentWarehouse.getId());
if (Func.isNotEmpty(updatePackageList)){
String updownrOderPackages = updatePackageList.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(","));
if (Func.isNotEmpty(orderPackages)){
warehouseUpdownTypeClient.downPackage(updownrOderPackages,myCurrentWarehouse.getId());
}
List<Long> packageIds = updatePackageList.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList());
if (Func.isNotEmpty(packageIds)){
distributionParcelListMapper.updatePackageListByIds(packageIds);
}
}
return Resp.scanSuccess("操作成功", "装车成功");
}
// //查询该客户下还未进行装车的包件
// List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationPackageMapper.selectList(Wrappers.<DistributionReservationPackageEntity>query().lambda()
// .eq(DistributionReservationPackageEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
// .ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()));
// List<Long> list = reservationPackageEntityList.stream().map(DistributionReservationPackageEntity::getParceListId).collect(Collectors.toList());
// List<DistributionParcelListEntity> distributionParcelListEntityList = distributionParcelListService.list(new QueryWrapper<DistributionParcelListEntity>().lambda().in(DistributionParcelListEntity::getId, list));
// List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
// boolean packageLoadingFlag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
//判断库存品是否进行了备货任务,如果未进行备货任务无法进行一件装车
// if (inventoryStockUpFlag) {
// return R.fail("该客户存在库存品暂未备货 一键装车失败!!!");
// }
// if (packageLoadingFlag && inventoryLoadingFlag) {
// return Resp.scanFail("重复操作","重复操作");
// }
// else {
// if (!packageLoadingFlag) {
// //存在包件还未进行装车
// for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) {
// if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) {
// DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
// BladeUser user = AuthUtil.getUser();
// loadscanEntity.setScanUser(user.getUserName());
// loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
// loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// loadscanEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue());
// loadscanEntity.setOneClick(2);
// loadscanEntity.setScanUser(user.getUserName());
// loadscanEntity.setScanTime(new Date());
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) {
// loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
// }
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) {
// loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
// }
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) {
// loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
// if (Func.isNotEmpty(distributionDeliverySelfEntity.getId())) {
// loadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
// }
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) {
// loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
// if (Func.isNotEmpty(parcelListEntity.getQuantity())) {
// loadscanEntity.setPackageNub(parcelListEntity.getQuantity());
// }
// if (Func.isNotEmpty(distrilbutionloadingscanDTO.getReservationId())) {
// loadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
// }
// if (Func.isNotEmpty(distrilbutionloadingscanDTO.getDeliveryId())) {
// loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
// }
// if (Func.isNotEmpty(parcelListEntity.getOrderPackageCode())) {
// loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
// }
// if (Func.isNotEmpty(parcelListEntity.getId())) {
// loadscanEntity.setPackageId(parcelListEntity.getId());
// }
// if (Func.isNotEmpty(parcelListEntity.getId())) {
// loadscanEntity.setPackageId(parcelListEntity.getId());
// }
// if (Func.isNotEmpty(parcelListEntity.getStockArticleId())) {
// loadscanEntity.setOrderId(parcelListEntity.getStockArticleId());
// }
// distributionLoadscanService.save(loadscanEntity);
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
// Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
// warehouseUpdownTypeClient.downPackage(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
// //异步修改包件状态
// distributionAsyncService.changeMarketDeliveryListStatus(loadscanEntity.getOrderPackageCode(), loadscanEntity.getDeliveryId());
// }
// }
// }
//
// }
// return R.success("成功");
// }
//2、查询该客户下是否存在库存品
// 存在 --> 查询库存品是否均完成备货
// 是 ---> 执行库存品一键装车
// 否 ---> 提示库存品没有进行备货
// 不存在 --> 直接进入包件的判断
//3、数据构建 一件装车需要查询出该客户下的所有包件信息、库存品包件信息。
//4、维护包件、订单、预约、库存品、装车字段
//5、检查包件、订单是否和库位信息解除绑定,如果没有则进行解绑
// //先查询有数据的
// List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectdeliverOne(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId());
// //无数据的
// // List<DistributionLoadscanEntity> distributionLoadscanEntitiesno = baseMapper.selectdeliverOneNo(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId());
// //查询所有的库存品(无拆包)
// //List<DistributionLoadscaninvnEntity> distributionLoadscanvnEntities = baseMapper.selectdeliverOnevn(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId());
// //查询所有的库存品(拆包)
// List<DistributionLoadscaninvnEntity> distributionLoadscanvnEntitiesopen = baseMapper.selectdeliverOnevnopen(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId());
// //将该客户所有的物品上该车辆
// Integer flag = 0;
// Integer flag2 = 0;
// if (distributionLoadscanEntities.size() > 0) {
// for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
// //查询是否重复扫码
// List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
// .ne(DistributionLoadscanEntity::getScanStatus, 1)
// );
//
// if (distributionLoadscanEntitiesflag.size() > 0) {
// continue;
// }
// flag += 1;
// //依次插入该装车记录,设置车辆
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) {
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue());
// distributionLoadscanEntity.setOneClick(2);
// BladeUser user = AuthUtil.getUser();
// distributionLoadscanEntity.setScanUser(user.getNickName());
// distributionLoadscanEntity.setScanTime(new Date());
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) {
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
// }
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) {
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
// }
// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
// //查询本车次是否第一次扫码,没有则更新上车时间
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
// //更新签收表的装车数量
// Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
// distributionLoadscanService.save(distributionLoadscanEntity);
// Long packageId = distributionLoadscanEntity.getPackageId();
// DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(packageId);
// //TODO 这里一件装车需要进行判断
// distributionAsyncService.changeDiscussDeliveryListStatus(parcelListEntity.getOrderPackageCode(),distrilbutionloadingscanDTO.getDeliveryId());
// }
//// distributionLoadscanService.saveBatch(distributionLoadscanEntities);
// }
// //库存品装车
//// if (distributionLoadscanvnEntities.size() > 0) {
//// for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntities) {
//// //依次插入该装车记录,设置车辆
//// if (null != distributionDeliverySelfEntity.getDriverId()) {
//// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
//// }
//// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
//// distributionLoadscanEntity.setScanStatus(2);
//// distributionLoadscanEntity.setScanType("1");
//// distributionLoadscanEntity.setScanTime(new Date());
//// if (null == distributionLoadscanEntity.getPackageNub()) {
//// distributionLoadscanEntity.setPackageNub(1);
//// }
//// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
//// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
//// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
//// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
//// }
//// if (null != distributionDeliverySelfEntity.getVehicleId()) {
//// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
//// }
//// //查询本车次是否第一次扫码,没有则更新上车时间
//// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//// //更新签收表的装车数量
//// Integer j = distributionSignforMapper.updateloadByinvn(distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//// }
//// distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntities);
//// }
// if (distributionLoadscanvnEntitiesopen.size() > 0) {
// for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntitiesopen) {
// //查询是否重复扫码
// List<DistributionLoadscaninvnEntity> distributionLoadscanEntitiesflag = distributionLoadscaninvnMapper.selectList(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda()
// .eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
// .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
// .ne(DistributionLoadscaninvnEntity::getScanStatus, 1)
// );
//
// if (distributionLoadscanEntitiesflag.size() > 0) {
// continue;
// }
// flag2 += 1;
// //依次插入该装车记录,设置车辆
// if (null != distributionDeliverySelfEntity.getDriverId()) {
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
// distributionLoadscanEntity.setScanType("1");
// distributionLoadscanEntity.setScanTime(new Date());
// if (null == distributionLoadscanEntity.getPackageNub()) {
// distributionLoadscanEntity.setPackageNub(1);
// }
// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
// }
// if (null != distributionDeliverySelfEntity.getVehicleId()) {
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
// }
// //查询本车次是否第一次扫码,没有则更新上车时间
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
// //更新签收表的装车数量
// Integer j = distributionSignforMapper.updateloadByinvn(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
// }
// distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntitiesopen);
// }
// if (flag == 0 && flag2 == 0) {
// return R.fail(4002, "无数据进行装车");
// }
// if (distributionLoadscanEntitiesno.size() > 0) {
// for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntitiesno) {
// //查询是否重复扫码
// List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getReservationId())
// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
// .ne(DistributionLoadscanEntity::getScanStatus, 1)
// );
// if (distributionLoadscanEntitiesflag.size() > 0) {
// continue;
// }
// //依次插入该装车记录,设置车辆
// if (null != distributionDeliverySelfEntity.getDriverId()){
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
// distributionLoadscanEntity.setScanStatus(2);
// distributionLoadscanEntity.setScanType("3");
// distributionLoadscanEntity.setScanTime(new Date());
// distributionLoadscanEntity.setScanState(1);
// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
// }
// if (null !=distributionDeliverySelfEntity.getVehicleId()){
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());}
// //查询本车次是否第一次扫码,没有则更新上车时间
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
// //更新签收表的装车数量
// Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
// }
// distributionLoadscanService.saveBatch(distributionLoadscanEntities);
// }
// return R.success("成功");
// }
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
@ -2137,8 +1940,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Integer j = distributionSignforMapper.updateloadByinvn(distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId(), distributionLoadscaninvnEntity.getLoadedNub());
//处理出库问题
distributionStockListMapper.deductionQuantityStock(distributionLoadscaninvnEntity.getInventoryId(), distributionLoadscaninvnEntity.getLoadedNub());
//维护客户信息
distributionReservationService.maintenanceReservationInfo(distrilbutionloadingscanDTO.getReservationId());
//维护配送装车状态
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
//异步处理状态信息
distributionAsyncService.changeMarketDeliveryListStatus(distributionLoadscaninvnEntity.getOrderPackageCode(), distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId());
// distributionAsyncService.changeMarketDeliveryListStatus(distributionLoadscaninvnEntity.getOrderPackageCode(), distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId());
//扣减出库数量
// DistributionStockListEntity distributionStockListEntity = distributionStockListMapper.selectOne(Wrappers.<DistributionStockListEntity>query().lambda().eq(DistributionStockListEntity::getId, distributionLoadscaninvnEntity.getInventoryId()));
// BigDecimal quantityStock = new BigDecimal(distributionStockListEntity.getQuantityStock());
@ -2969,9 +2776,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
});
s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
s.setAvailableQuantity(0);
distributionStockArticleService.updateById(s);
// s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
// s.setAvailableQuantity(0);
// distributionStockArticleService.updateById(s);
} else {
packageListInfo.forEach(p -> {
orderPackageNum.getAndAdd(p.getQuantity());
@ -2985,9 +2792,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
distributionParcelListService.updateById(p);
//这里根据包件进行订单状态的改变
distributionAsyncService.checkStockArticleReservationStatus(p);
// distributionAsyncService.checkStockArticleReservationStatus(p);
});
}
//维护订单信息
distributionStockArticleService.maintenanceOrderInfo(s.getOrderCode(),myCurrentWarehouse.getId());
} else if (s.getIsZero().equals(IsOrNoConstant.yes.getValue())) {
List<DistributionParcelNumberVO> parcelNumberVOS = s.getParcelNumberVOS();
reservationStockarticleEntity.setIsZero(s.getIsZero());
@ -3072,7 +2881,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionReservationMapper.updateById(reservationEntity);
deliveryWarehouseName.add(reservationEntity.getWarehouseName());
deliveryPackageTotal.getAndAdd(reservationEntity.getReservationNum());
//TODO 这里新增的客户还需要进行和配送任务、备货任务之间的绑定关系
//建立这个预约和配送任务之间的关系
DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity();
distributionSignforEntity.setDeliveryId(deliveryListEntityId);
@ -3151,7 +2959,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
distributionParcelListService.updateById(p);
//这里根据包件进行订单状态的改变
distributionAsyncService.checkStockArticleReservationStatus(p);
// distributionAsyncService.checkStockArticleReservationStatus(p);
});
} else {
//查询该订单下的所有包件信息并插入该计划中
@ -3180,10 +2988,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
});
s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
s.setAvailableQuantity(0);
distributionStockArticleService.updateById(s);
// s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
// s.setAvailableQuantity(0);
// distributionStockArticleService.updateById(s);
}
distributionStockArticleService.maintenanceOrderInfo(s.getOrderCode(),myCurrentWarehouse.getId());
} else {
//该客户下增加零担订单
List<DistributionParcelNumberVO> parcelNumberVOS = s.getParcelNumberVOS();
@ -3290,7 +3099,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(reservationPackageEntity.getParceListId());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
distributionParcelListService.updateById(parcelListEntity);
distributionAsyncService.checkStockArticleReservationStatus(parcelListEntity);
// distributionAsyncService.checkStockArticleReservationStatus(parcelListEntity);
});
} else {
//查找该订单没有进行包件选择的操作, 但是存在newOrder列表中 视为该订单保持计划选择
@ -3409,6 +3218,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.error("###########################reservation_stockaticle的isZeroz字段维护错误,reservation_stockarticleID:{}", reservationStockarticleEntity.getId());
new RuntimeException("服务器正忙...");
}
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(n.get(0).getStockArticleId());
distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(),myCurrentWarehouse.getId());
});
}
//重新维护预约信息
@ -3450,8 +3261,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionAsyncService.checkStockArticleReservationStatus(parcelListEntity);
});
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(e.getStockArticleId());
stockArticleEntity.setReservationStatus(distributionReservationPackageService.judgmentStatus(Func.copy(stockArticleEntity, DistributionStockArticleDTO.class)));
distributionStockArticleService.updateById(stockArticleEntity);
distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(),myCurrentWarehouse.getId());
// stockArticleEntity.setReservationStatus(distributionReservationPackageService.judgmentStatus(Func.copy(stockArticleEntity, DistributionStockArticleDTO.class)));
// distributionStockArticleService.updateById(stockArticleEntity);
//修改预约状态和包件状态
} else if (e.getIsZero().equals(IsOrNoConstant.yes.getValue())) {
//零担
@ -5241,10 +5053,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//维护订单信息
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(),myCurrentWarehouse.getId());
//扣减订单在库数量
distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
// distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
//异步维护此异常装车包件的订单状态
distributionAsyncService.maintenanceOrderStatus(parcelListEntity.getOrderCode(),myCurrentWarehouse.getId());
// distributionAsyncService.maintenanceOrderStatus(parcelListEntity.getOrderCode(),myCurrentWarehouse.getId());
DistributionSignforEntity signforEntity = distributionSignforService.getOne(Wrappers.<DistributionSignforEntity>query().lambda().eq(DistributionSignforEntity::getReservationId, reservationEntity.getId()).eq(DistributionSignforEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()));
if (Func.isNotEmpty(signforEntity)) {
//标识该客户存在异常装车包件,为了后续的异常装车审核
@ -6696,4 +6512,42 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
return true;
}
@Override
@Transactional
public void maintenanceDeliveryInfo(Long deliveryId) {
String method = "###################DistributionDeliveryListServiceImpl执行方法maintenanceDeliveryInfo,";
if (Func.isEmpty(deliveryId)){
log.info(method+"参数缺失deliveryId:{}",deliveryId);
throw new RuntimeException("服务器正忙!!!");
}
DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryId);
if (Func.isEmpty(deliveryListEntity)){
log.info(method+"查询配送失败,deliveryId:{}",deliveryId);
throw new RuntimeException("服务器正忙!!!");
}
//查询指定配送计划装车件数
DistributionLoadingNumDTO deliveryLoadingNum = distributionDeliveryListMapper.selectDeliveryLoadingNum(deliveryId);
int loadingNum = 0;
int signingNum = 0;
int deliveryQuantity = deliveryListEntity.getDeliveryNumber() + deliveryListEntity.getInventoryNub();
if (Func.isNotEmpty(deliveryLoadingNum)){
loadingNum += deliveryLoadingNum.getInventoryLoadingQuantity() + deliveryLoadingNum.getPackageLoadingQuantity();
}
if (deliveryQuantity != 0){
if (loadingNum ==deliveryQuantity ){
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue());
}else {
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue());
}
if (loadingNum == 0){
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue());
}
}else {
log.error(method+"查询配送无计划数量,deliveryId:{}",deliveryId);
}
this.updateById(deliveryListEntity);
}
}

73
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -1578,7 +1578,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
mallId.add(stockArticleEntity.getMallId());
storeName.add(stockArticleEntity.getStoreName());
receivingUnit.add(distributionStockArticleDTO.getConsigneeUnit());
Integer integer = distributionStockArticleMapper.augmentDeliveryQuantity(reservationStockarticleEntity.getStockArticleId(), reservationStockarticleEntity.getReservationNum());
// Integer integer = distributionStockArticleMapper.augmentDeliveryQuantity(reservationStockarticleEntity.getStockArticleId(), reservationStockarticleEntity.getReservationNum());
//维护订单信息
distributionStockArticleService.maintenanceOrderInfo(distributionStockArticleDTO.getOrderCode(),myCurrentWarehouse.getId());
} else {
//查询出这个订单原来在这个预约中的勾选情况
DistributionStockArticleDTO distributionStockArticleDTO = v.get(0);
@ -1627,8 +1629,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationStockarticleEntity.setReservationNum(packageNum.get());
distributionReservationStockarticleService.updateById(reservationStockarticleEntity);
packTotal.getAndAdd(reservationStockarticleEntity.getReservationNum());
distributionAsyncService.changeOrderReservationStatus(distributionStockArticleDTO);
// distributionAsyncService.changeOrderReservationStatus(distributionStockArticleDTO);
oldStockArticle.remove(k);
//维护订单信息
distributionStockArticleService.maintenanceOrderInfo(distributionStockArticleDTO.getOrderCode(),myCurrentWarehouse.getId());
} else {
//没有包件 保持原装
packTotal.getAndAdd(reservationStockarticleEntity.getReservationNum());
@ -1761,7 +1765,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//需要修改订单的状态
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(i);
DistributionStockArticleDTO stockArticleDTO = Func.copy(stockArticleEntity, DistributionStockArticleDTO.class);
distributionAsyncService.changeOrderReservationStatus(stockArticleDTO);
//维护订单信息
distributionStockArticleService.maintenanceOrderInfo(stockArticleDTO.getOrderCode(),myCurrentWarehouse.getId());
// distributionAsyncService.changeOrderReservationStatus(stockArticleDTO);
//这里需要根据包件状态进行订单状态的修改
//这里异步查看该订单下的包件信息是否都处于预约状态,如果不是那么为订单预约装填,部分那么订单为部分预约,没有那么订单处于待预约状态
@ -2117,7 +2123,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
p.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.yiyueyue.getValue());
distributionParcelListService.updateById(p);
//这里根据包件进行订单状态的改变
distributionAsyncService.checkStockArticleReservationStatus(p);
// distributionAsyncService.checkStockArticleReservationStatus(p);
});
} else {
//没有进行包件选择 默认添加可配送的所有包件
@ -2154,10 +2160,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
// stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
});
s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
s.setAvailableQuantity(0);
distributionStockArticleService.updateById(s);
// s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
// s.setAvailableQuantity(0);
// distributionStockArticleService.updateById(s);
}
//维护订单信息
distributionStockArticleService.maintenanceOrderInfo(s.getOrderCode(),myCurrentWarehouse.getId());
} else {
//-----------------------------------------------------------2023-10-11--- 零担商配处理-----------------------------------------------------------------------
List<DistributionParcelNumberVO> parcelNumberVOS = s.getParcelNumberVOS();
@ -3124,7 +3132,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionReservationStockarticleService.save(distributionReservationStockarticleEntity);
packageTotal.getAndAdd(distributionReservationStockarticleEntity.getReservationNum());
//维护对应订单的配送件数
Integer i = distributionStockArticleMapper.augmentDeliveryQuantity(distributionReservationStockarticleEntity.getStockArticleId(),distributionReservationStockarticleEntity.getReservationNum());
// Integer i = distributionStockArticleMapper.augmentDeliveryQuantity(distributionReservationStockarticleEntity.getStockArticleId(),distributionReservationStockarticleEntity.getReservationNum());
distributionStockArticleService.maintenanceOrderInfo(s.getOrderCode(),myCurrentWarehouse.getId());
} else if (s.getIsZero().equals("1")) {
//零担订单处理
DistributionReservationStockarticleEntity distributionReservationStockarticleEntity = new DistributionReservationStockarticleEntity();
@ -3455,4 +3464,52 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return distributionStockupStockListVO;
}
@Override
@Transactional
public void maintenanceReservationInfo(Long reservationId) {
String method = "############DistributionReservationServiceImpl,执行方法:maintenanceReservationInfo,";
if (Func.isEmpty(reservationId)){
log.error(method+"查询预约失败reservationId:{}",reservationId);
throw new RuntimeException("服务器正忙!!!");
}
DistributionReservationEntity reservationEntity = this.getById(reservationId);
DistributionLoadingNumDTO reservationLoadingNum = distributionReservationMapper.selectReservationLoadingNum(reservationId);
int loadingQuantity = 0;
int signingQuantity = 0;
int reservationQuantity =(reservationEntity.getReservationNum() + reservationEntity.getReservationStockListNum());
if (Func.isNotEmpty(reservationLoadingNum)){
//存在装车数量
loadingQuantity += reservationLoadingNum.getInventoryLoadingQuantity() + reservationLoadingNum.getPackageLoadingQuantity();
}
DistributionLoadingNumDTO reservationSignNum = distributionReservationMapper.selectReservationSigningNum(reservationId);
if (Func.isNotEmpty(reservationSignNum)){
signingQuantity += reservationSignNum.getPackageSigningQuantity() + reservationSignNum.getInventorySigningQuantity();
}
if (reservationQuantity != 0){
if (loadingQuantity == reservationQuantity){
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
}else {
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue());
}
if (loadingQuantity == 0){
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue());
}
if (signingQuantity == reservationQuantity){
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue());
}else {
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.bufenqianshou.getValue());
}
if (signingQuantity == 0){
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.daiqianshou.getValue());
}
}else {
log.error(method+"预约单无配送包件,reservationId:{}",reservationId);
}
this.updateById(reservationEntity);
}
}

574
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -79,6 +79,8 @@ import org.springblade.system.cache.DictBizCache;
import org.springblade.system.feign.IDictBizClient;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -100,47 +102,84 @@ import java.util.stream.Collectors;
* @since 2023-06-13
*/
@Service
@AllArgsConstructor
@Slf4j
public class DistributionSignforServiceImpl extends BaseServiceImpl<DistributionSignforMapper, DistributionSignforEntity> implements IDistributionSignforService {
private final DistributionLoadscanServiceImpl distributionLoadscanService;
private final DistributionLoadscaninvnServiceImpl distributionLoadscaninvnService;
private final IDistributionParcelListService distributionParcelListService;
private final IDistributionStockArticleService distributionStockArticleService;
private final DistributionLoadscanMapper distributionLoadscanMapper;
private final DistributionLoadscaninvnMapper distributionLoadscaninvnMapper;
private final DistributionDeliveryListMapper distributionDeliveryListMapper;
private final DistributionDeliverySelfMapper distributionDeliverySelfMapper;
private final DistributionDeliveryTripartiteMapper distributionDeliveryTripartiteMapper;
private final DistributionSignforMapper distributionSignforMapper;
private final DistributionStockMapper distributionStockMapper;
private final IDictBizClient dictBizClient;
private final IBasicdataDriverArteryClient iBasicdataDriverArteryClient;
private final IDistributionReservationPackageService reservationPackageService;
private final IDistributionAsyncService distributionAsyncService;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final DistributionReservationMapper distributionReservationMapper;
private final IDisStockListDetailService disStockListDetailService;
private final IDistributionStockListService distributionStockListService;
private final DistributionStockListMapper distributionStockListMapper;
private final DistributionAddvalueMapper distributionAddvalueMapper;
private final IDistributionAddvalueService distributionAddvalueService;
private final IDistributionAddvaluePackageService distributionAddvaluePackageService;
private final IDistributionLoadscanAbnormalService distributionLoadscanAbnormalService;
private final IDistributionReservationStockarticleService distributionReservationStockarticleService;
private final IDistributionReservationPackageService distributionReservationPackageService;
private final IDistributionReservationZeroPackageService distributionReservationZeroPackageService;
private final IDistributionSignPrintService iDistributionSignPrintService;
private final IDistributionParcelNumberService distributionParcelNumberService;
private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
private final DistributionStockArticleMapper distributionStockArticleMapper;
private final IBasicdataClientClient basicdataClientClient;
private final DistributionParcelListMapper distributionParcelListMapper;
private final RabbitTemplate rabbitTemplate;
// private final IBasicdataWarehouseClient warehouseUpdownTypeClient;
@Autowired
private DistributionLoadscanServiceImpl distributionLoadscanService;
@Autowired
private DistributionLoadscaninvnServiceImpl distributionLoadscaninvnService;
@Autowired
private IDistributionParcelListService distributionParcelListService;
@Autowired
private IDistributionStockArticleService distributionStockArticleService;
@Autowired
private DistributionLoadscanMapper distributionLoadscanMapper;
@Autowired
private DistributionLoadscaninvnMapper distributionLoadscaninvnMapper;
@Autowired
private DistributionDeliveryListMapper distributionDeliveryListMapper;
@Autowired
private DistributionDeliverySelfMapper distributionDeliverySelfMapper;
@Autowired
private DistributionDeliveryTripartiteMapper distributionDeliveryTripartiteMapper;
@Autowired
private DistributionSignforMapper distributionSignforMapper;
@Autowired
private DistributionStockMapper distributionStockMapper;
@Autowired
private IDictBizClient dictBizClient;
@Autowired
private IBasicdataDriverArteryClient iBasicdataDriverArteryClient;
@Autowired
private IDistributionReservationPackageService reservationPackageService;
@Autowired
private IDistributionAsyncService distributionAsyncService;
@Autowired
private IBasicdataWarehouseClient basicdataWarehouseClient;
@Autowired
private DistributionReservationMapper distributionReservationMapper;
@Autowired
private IDisStockListDetailService disStockListDetailService;
@Autowired
private IDistributionStockListService distributionStockListService;
@Autowired
private DistributionStockListMapper distributionStockListMapper;
@Autowired
private DistributionAddvalueMapper distributionAddvalueMapper;
@Autowired
private IDistributionAddvalueService distributionAddvalueService;
@Autowired
private IDistributionAddvaluePackageService distributionAddvaluePackageService;
@Autowired
private IDistributionLoadscanAbnormalService distributionLoadscanAbnormalService;
@Autowired
private IDistributionReservationStockarticleService distributionReservationStockarticleService;
@Autowired
private IDistributionReservationPackageService distributionReservationPackageService;
@Autowired
private IDistributionReservationZeroPackageService distributionReservationZeroPackageService;
@Autowired
private IDistributionSignPrintService iDistributionSignPrintService;
@Autowired
private IDistributionParcelNumberService distributionParcelNumberService;
@Autowired
private IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
@Autowired
private DistributionStockArticleMapper distributionStockArticleMapper;
@Autowired
private IBasicdataClientClient basicdataClientClient;
@Autowired
private DistributionParcelListMapper distributionParcelListMapper;
@Autowired
@Lazy
private IDistributionDeliveryListService distributionDeliveryListService;
@Autowired
@Lazy
private IDistributionReservationService distributionReservationService;
@Autowired
private RabbitTemplate rabbitTemplate;
// private IBasicdataWarehouseClient warehouseUpdownTypeClient;
@Override
public IPage<DistributionSignforVO> selectDistributionSignforPage(IPage<DistributionSignforVO> page, DistributionSignforVO distributionSignfor) {
@ -791,10 +830,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()));
//进行包件状态维护
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
distributionParcelListService.updateById(parcelListEntity);
if (Func.isNotEmpty(loadscanEntity)) {
if (loadscanEntity.getSignforState().equals(2)) {
return Resp.scanFail("重复扫描", "重复扫描");
@ -819,13 +854,17 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscanEntity.setSigningUser(nickName);
loadscanEntity.setSigningUserId(userId);
distributionLoadscanService.updateById(loadscanEntity);
//缺少一个异步维护包件签收的方法
// distributionAsyncService.changeOrderSignforStatus(collect.get(0));
Integer j = distributionSignforMapper.updateSignforNum(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), AuthUtil.getUser());
//下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
//维护订单状态
} else {
//这里装车的数据需要进行补录
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
@ -879,26 +918,27 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity.setLoadedNub(collect.get(0).getQuantity());
distributionLoadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
distributionLoadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
// distributionLoadscanEntity.setScanUser(AuthUtil.getUser().getUserName());
distributionLoadscanEntity.setScanUser(AuthUtil.getUser().getNickName());
// distributionLoadscanEntity.setSigningUser(AuthUtil.getUser().getUserName());
distributionLoadscanEntity.setSigningUser(AuthUtil.getUser().getNickName());
distributionLoadscanEntity.setSigningUserId(AuthUtil.getUser().getUserId());
distributionLoadscanService.save(distributionLoadscanEntity);
//进行签收数量的修改
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//修改签收数量
// Integer j = distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新装车包件数和签收包件数
Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
//扣减订单的在库数量
Integer k = distributionStockArticleMapper.deductionHandQuantity(distributionLoadscanEntity.getOrderId(), distributionLoadscanEntity.getLoadedNub());
distributionAsyncService.checkSignStatus(distributionLoadscanEntity.getPackageId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getDeliveryId());
//包件解托下架
warehouseUpdownTypeClient.downPackageOrDelTray(collect.get(0).getOrderPackageCode(), myCurrentWarehouse.getId());
}
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
//修改包件状态为装车、签收
DistributionParcelListEntity updatePackage = collect.get(0);
updatePackage.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
updatePackage.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
distributionParcelListService.updateById(updatePackage);
//维护签收包件状态
distributionStockArticleService.maintenanceOrderInfo(collect.get(0).getOrderCode(),myCurrentWarehouse.getId());
//推送信息至工厂
distributionAsyncService.sendFactory(collect.get(0), signingTime, distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getId());
//TODO 这里就需要一个异步的包件状态维护方法
} else if (Func.isEmpty(collect)) {
@ -937,8 +977,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.error("############出现重复包条码:{}", collect);
}
String str = checkSignNum(distrilbutionloadingscanDTO);
//查询出客户下的所有包件信息
distributionAsyncService.checkDeliverySignStatus(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
//维护客户
distributionReservationService.maintenanceReservationInfo(distrilbutionloadingscanDTO.getReservationId());
//维护配送任务
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
return Resp.scanSuccess("签收成功", str);
}
@ -1049,7 +1091,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
public DistributionSignforVO getOneCustom(Long id) {
// todo 这里需要配TJJ 来进行修改 传入的参数未预约单DI
DistributionSignforVO distributionSignforVO = baseMapper.selectOneCustom(id);
//查询客户下的订单列表信息
DistributionSignforEntity signforEntity = this.getById(id);
@ -1293,10 +1334,19 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
//进行签收数量的修改
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//修改包件装车、签收状态
} else {
return Resp.scanFail("操作失败", "不属于该客户");
}
break;
default:
//修改包件信息
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
distributionParcelListService.updateById(parcelListEntity);
//维护订单信息
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(),parcelListEntity.getWarehouseId());
break;
}
//查询一次是否进行了异常装车,如果没有进行异常装车数据进行审核
List<DistributionLoadscanAbnormalEntity> list = distributionLoadscanAbnormalService.list(Wrappers.<DistributionLoadscanAbnormalEntity>query().lambda()
@ -1652,34 +1702,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.error("########该客户下的库存品是否已备货:{}", isHaveCode);
return Resp.scanFail("操作失败", "操作失败");
}
distributionAsyncService.checkDeliverySignStatus(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
//维护客户
distributionReservationService.maintenanceReservationInfo(distrilbutionloadingscanDTO.getReservationId());
//维护配送任务
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
String str = checkSignNum(distrilbutionloadingscanDTO);
return Resp.scanSuccess("签收成功", str);
// List<DistributionLoadscaninvnEntity> distributionLoadscaninvnEntities = distributionLoadscaninvnMapper.selectList(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda()
// .ne(DistributionLoadscaninvnEntity::getScanStatus, 1)
// .eq(DistributionLoadscaninvnEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
// .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
// );
// if (distributionLoadscaninvnEntities.size() <= 0) {
// return R.fail(3006, "该库存品并未装车处理");
// }
// //修改装车表状态
// boolean b = false;
// for (DistributionLoadscaninvnEntity distributionLoadscaninvnEntity : distributionLoadscaninvnEntities) {
// distributionLoadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date()));
// distributionLoadscaninvnEntity.setSignforState(2);
// distributionLoadscaninvnEntity.setReceivedQuantity(1);
// b = distributionLoadscaninvnService.updateById(distributionLoadscaninvnEntity);
// //修改签收表司机签收数量
// this.update(new UpdateWrapper<DistributionSignforEntity>().lambda()
// .eq(DistributionSignforEntity::getReservationId, distributionLoadscaninvnEntity.getReservationId())
// .setSql("receivedin_quantity = receivedin_quantity + " + 1)
// );
// }
//
// return R.status(b);
}
@Override
@ -2309,114 +2337,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + newLoadscaninvnEntity.getPackageNub());
distributionStockListService.updateById(stockListEntity);
distributionAsyncService.checkSignStatus(null, newLoadscaninvnEntity.getReservationId(), newLoadscaninvnEntity.getDeliveryId());
}
}
// //库存品均已备货
// List<DisStockListDetailEntity> unLoadingiNventoryList = detailEntities.stream().filter(i -> i.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())).collect(Collectors.toList());
// if (Func.isNotEmpty(unLoadingiNventoryList) && unLoadingiNventoryList.size() > 0) {
// for (DisStockListDetailEntity disStockListDetailEntity : unLoadingiNventoryList) {
//// --------------------修改库存品包件装车和签收状态——————————————————————————————————————————
// disStockListDetailEntity.setStockLockingStatus(InventoryLoadingStatusConstant.yizhuangche.getValue());
// disStockListDetailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue());
// disStockListDetailService.updateById(disStockListDetailEntity);
//
// DistributionLoadscaninvnEntity loadscaninvnEntity = new DistributionLoadscaninvnEntity();
// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) {
// loadscaninvnEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
// loadscaninvnEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
// }
// if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) {
// loadscaninvnEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
// }
// if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) {
// loadscaninvnEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// }
// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) {
// loadscaninvnEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
// }
// loadscaninvnEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
// loadscaninvnEntity.setOrderPackageCode(disStockListDetailEntity.getStockPackageCode());
// loadscaninvnEntity.setInventoryId(disStockListDetailEntity.getStockListId());
// loadscaninvnEntity.setDeliveryId(distributionSignforEntity.getDeliveryId());
// loadscaninvnEntity.setReservationId(distributionSignforEntity.getReservationId());
// loadscaninvnEntity.setScanUser(user.getNickName());
// loadscaninvnEntity.setScanTime(new Date());
// loadscaninvnEntity.setPackageNub(disStockListDetailEntity.getNum());
// loadscaninvnEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue());
// loadscaninvnEntity.setIsInsert(LoadingIsInsertConstant.bulu.getValue());
// loadscaninvnEntity.setScanType("1");
// loadscaninvnEntity.setType(2);
// loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
// loadscaninvnEntity.setIsSignfor(1);
// loadscaninvnEntity.setReceivedQuantity(disStockListDetailEntity.getNum());
// loadscaninvnEntity.setOneClick(2);
// loadscaninvnEntity.setOneQclick(2);
// loadscaninvnEntity.setSigningUser(user.getNickName());
// loadscaninvnEntity.setSigningUserId(user.getUserId());
// loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date()));
//
// if (distributionSignfor.getIsClerk()) {
// loadscaninvnEntity.setMsg("文员一键签收数据补录");
// } else {
// loadscaninvnEntity.setMsg("司机一键签收数据补录");
// }
// distributionLoadscaninvnService.save(loadscaninvnEntity);
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
// //更新签收表的签收数量和装车数量
// Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
// //维护预约库存品数据
// //扣减库存
// DistributionStockListEntity stockListEntity = distributionStockListService.getById(disStockListDetailEntity.getStockListId());
// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - loadscaninvnEntity.getPackageNub());
// stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - loadscaninvnEntity.getPackageNub());
// stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + loadscaninvnEntity.getPackageNub());
// distributionStockListService.updateById(stockListEntity);
// }
// }
// //库存品扫描记录补充
// for (DisStockListDetailEntity detailEntity : detailEntities) {
// if (detailEntity.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())) {
// detailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue());
// disStockListDetailService.updateById(detailEntity);
// //查询出对于的装车扫描记录
// List<DistributionLoadscaninvnEntity> list = distributionLoadscaninvnService.list(Wrappers.<DistributionLoadscaninvnEntity>query().lambda()
// .eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionSignfor.getDeliveryId())
// .eq(DistributionLoadscaninvnEntity::getReservationId, distributionSignfor.getReservationId())
// .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, detailEntity.getStockPackageCode())
// .ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
// if (list.size() == 1) {
// //正常进行扫描记录签收修改
// DistributionLoadscaninvnEntity loadscaninvnEntity = list.get(0);
// if (distributionSignfor.getIsClerk()) {
// loadscaninvnEntity.setMsg("文员一键签收数据补录");
// } else {
// loadscaninvnEntity.setMsg("司机一键签收数据补录");
// }
// loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
// loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum());
// loadscaninvnEntity.setOneClick(1);
// loadscaninvnEntity.setOneQclick(2);
// loadscaninvnEntity.setSigningUser(user.getUserName());
// loadscaninvnEntity.setSigningUserId(user.getUserId());
// loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum());
// loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date()));
// distributionLoadscaninvnService.updateById(loadscaninvnEntity);
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
// Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
// } else {
// log.error("################库存品未进行备货操作+{}" + list);
// //此时说明在同一配送任务下,同一客户出现了相同的库存品包件码
// }
// }
// //对库存品包件上级的状态维护
// distributionAsyncService.checkStockArticleListSigningStatus(detailEntity);
// }
} else {
log.error("################库存品未进行备货操作+{}" + detailEntities);
return R.fail("库存品未进行备货操作");
@ -2569,6 +2491,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
String signingTime = simpleDateFormat.format(new Date());
List<Long> packageIds = new ArrayList<>();
List<String> orderCodes = new ArrayList<>();
if (Func.isNotEmpty(parcelListEntityList)) {
for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) {
//查询是否进行装车
@ -2632,9 +2555,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), AuthUtil.getUser());
// distributionAsyncService.checkStockArticleSignStatus(parcelListEntity);
// log.info("一件签收包件下架解托>>>>>>>>>>>>>>>parcelListEntity.getOrderPackageCode():{}", parcelListEntity.getOrderPackageCode());
// warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
} else {
//存在装车数据
if (distributionSignfor.getIsClerk()) {
@ -2663,6 +2583,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
distributionAsyncService.sendFactory(parcelListEntity, signingTime, reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getId());
packageIds.add(parcelListEntity.getId());
orderCodes.add(parcelListEntity.getOrderCode());
}
//批量维护订单信息
if (Func.isNotEmpty(orderCodes)){
String orderCode = orderCodes.stream().distinct().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(orderCode,myCurrentWarehouse.getId());
}
@ -2673,108 +2600,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
// if (Func.equals(parcelListEntity.getOrderPackageStatus(), OrderPackageStatusConstant.yiqianshou.getValue())) {
// continue;
// } else if (Func.equals(parcelListEntity.getOrderPackageLoadingStatus(), OrderPackageLoadingStatusConstant.yizhuangche.getValue())) {
// //修改包件的状态为出库状态
// parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
// distributionParcelListService.updateById(parcelListEntity);
// //查询出对应的装车扫描信息进行修改
// List<DistributionLoadscanEntity> list = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
// .eq(DistributionLoadscanEntity::getPackageId, parcelListEntity.getId())
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionSignforEntity.getDeliveryId())
// .eq(DistributionLoadscanEntity::getReservationId, distributionSignforEntity.getReservationId())
// .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
// if (list.size() == 1) {
// DistributionLoadscanEntity loadscanEntity = list.get(0);
// if (distributionSignfor.getIsClerk()) {
// loadscanEntity.setMsg("文员一键签收数据补录");
// } else {
// loadscanEntity.setMsg("司机一键签收数据补录");
// }
// loadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
// loadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity());
// loadscanEntity.setOneClick(1);
// loadscanEntity.setOneQclick(2);
// loadscanEntity.setSigningUser(user.getUserName());
// loadscanEntity.setSigningUserId(user.getUserId());
// loadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity());
// loadscanEntity.setSigningTime(simpleDateFormat.format(new Date()));
// distributionLoadscanService.updateById(loadscanEntity);
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
// Integer j = distributionSignforMapper.updateSignforNum(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
// } else {
// //一个配送任务下,同一个客户出现了相同的包件信息
// log.error("#########相同的包件信息={}" + parcelListEntity.getId());
// }
// } else {
// log.error("#########包件异常{}" + parcelListEntity.getId());
// }
// distributionAsyncService.checkStockArticleSignStatus(parcelListEntity);
// }
// }
// if (Func.isNotEmpty(noLoadingPackage) && noLoadingPackage.size() > 0) {
// //存在有未装车的包件信息
// //统计新装车的包件数
// for (DistributionParcelListEntity parcelListEntity : noLoadingPackage) {
// parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
// parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
// distributionParcelListService.updateById(parcelListEntity);
// DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
// loadscanEntity.setPackageId(parcelListEntity.getId());
// loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
// loadscanEntity.setOrderId(parcelListEntity.getStockArticleId());
// loadscanEntity.setDeliveryId(distributionSignforEntity.getDeliveryId());
// loadscanEntity.setReservationId(distributionSignforEntity.getReservationId());
// loadscanEntity.setScanUser(user.getUserName());
// loadscanEntity.setScanTime(new Date());
// loadscanEntity.setPackageNub(parcelListEntity.getQuantity());
// loadscanEntity.setSigningUser(user.getUserName());
// loadscanEntity.setSigningUserId(user.getUserId());
// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) {
// loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
// loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
// }
// if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) {
// loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
// }
// if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) {
// loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// }
// if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) {
// loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
// }
// loadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
// loadscanEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue());
// loadscanEntity.setIsInsert(LoadingIsInsertConstant.bulu.getValue());
// loadscanEntity.setScanType("1");
// loadscanEntity.setType(2);
// loadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
// loadscanEntity.setIsSignfor(1);
// loadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity());
// loadscanEntity.setOneClick(2);
// loadscanEntity.setOneQclick(2);
// loadscanEntity.setSigningTime(simpleDateFormat.format(new Date()));
// if (distributionSignfor.getIsClerk()) {
// loadscanEntity.setMsg("文员一键签收数据补录");
// } else {
// loadscanEntity.setMsg("司机一键签收数据补录");
// }
// distributionLoadscanService.save(loadscanEntity);
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
// //更新签收表的签收数量和装车数量
// Integer j = distributionSignforMapper.updateSignforByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
// distributionAsyncService.checkStockArticleSignStatus(parcelListEntity);
// warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
//
//// distributionAsyncService.checkStockArticleSignStatus(parcelListEntity);
// //保存完成签收包件装车数量累加
// }
// }
//维护客户信息状态
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
reservationEntity.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue());
@ -2808,171 +2633,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
// distributionSignforEntity.setSigningTime(simpleDateFormat.format(new Date()));
// distributionSignforEntity.setSigneeName(user.getUserName());
// distributionSignforEntity.setDriverSigning(SignforDriverSigningStatusConstant.yiqianshou.getValue());
// this.updateById(distributionSignforEntity);
// if (distributionSignfor.getIsClerk()) {
// if (null != distributionSignforEntity.getSigningType()) {
// return R.fail(3010, "已经签收");
// }
// } else {
// if (null != distributionSignforEntity.getSjsigningTime()) {
// return R.fail(3010, "已经签收");
// }
// }
// //先查询有数据的
// List<DistributionLoadscanEntity> distributionLoadscanEntities = distributionDeliveryListMapper.selectdeliverOne(distributionSignfor.getReservationId(), distributionSignfor.getDeliveryId());
// //查询所有的库存品(拆包)
// List<DistributionLoadscaninvnEntity> distributionLoadscanvnEntitiesopen = distributionDeliveryListMapper.selectdeliverOnevnopen(distributionSignfor.getReservationId(), distributionSignfor.getDeliveryId());
// //将该客户所有的物品上该车辆
// if (distributionLoadscanEntities.size() > 0) {
// //配送订单数据
// for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
// //查询该包件是否扫码
// List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
// .ne(DistributionLoadscanEntity::getScanStatus, 1)
// );
// if (distributionLoadscanEntitiesflag.size() > 0) {
// //有扫码记录
// // 修改该记录
// for (DistributionLoadscanEntity loadscanEntity : distributionLoadscanEntitiesflag) {
// if (loadscanEntity.getSignforState() == 2) break;
// distributionLoadscanService.update(new UpdateWrapper<DistributionLoadscanEntity>().lambda()
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
// .set(DistributionLoadscanEntity::getSigningTime, simpleDateFormat.format(new Date()))
// .set(DistributionLoadscanEntity::getSignforState, 2)
// .set(DistributionLoadscanEntity::getReceivedQuantity, 1)
// );
// //修改签收数量
// distributionSignforMapper.updateSignforNum(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
// //更新签收表的签收数量和装车数量
//// Integer j = distributionSignforMapper.updateSignforByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
// }
//// distributionLoadscanService.update()
// continue;
// }else{
// //没有扫码数据
// //依次插入该装车记录,设置车辆,
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) {
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
// distributionLoadscanEntity.setReceivedQuantity(1);
// if (null == distributionLoadscanEntity.getPackageNub()) {
// distributionLoadscanEntity.setPackageNub(1);
// distributionLoadscanEntity.setLoadedNub(distributionLoadscanEntity.getPackageNub());
// }
// distributionLoadscanEntity.setScanType("1");
// distributionLoadscanEntity.setMsg("司机签收");
// if (distributionSignfor.getIsClerk()) {
// distributionLoadscanEntity.setMsg("文员签收");
// }
//// distributionLoadscanEntity.setOneClick(2);
// distributionLoadscanEntity.setSignforState(2);
// distributionLoadscanEntity.setOneQclick(2);
//// distributionLoadscanEntity.setScanTime(new Date());
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) {
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
// }
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) {
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
// }
// distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
// distributionLoadscanService.save(distributionLoadscanEntity);
// }
// //查询本车次是否第一次扫码,没有则更新上车时间
//// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
// //更新签收表的签收数量和装车数量
// Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//
// }
// }
// if (distributionLoadscanvnEntitiesopen.size() > 0) {
// //库存品数据
// for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntitiesopen) {
// //查询是否重复扫码
// List<DistributionLoadscaninvnEntity> distributionLoadscaninvnEntitiesflag = distributionLoadscaninvnMapper.selectList(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda()
// .eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
// .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
// .ne(DistributionLoadscaninvnEntity::getScanStatus, 1)
// .eq(DistributionLoadscaninvnEntity::getSignforState, 2)
// );
// if (distributionLoadscaninvnEntitiesflag.size() > 0) {
// // 修改该记录
// for (DistributionLoadscaninvnEntity loadscanEntity : distributionLoadscaninvnEntitiesflag) {
// if (loadscanEntity.getSignforState() == 2) break;
// distributionLoadscaninvnService.update(new UpdateWrapper<DistributionLoadscaninvnEntity>().lambda()
// .eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
// .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
// .set(DistributionLoadscaninvnEntity::getSigningTime, simpleDateFormat.format(new Date()))
// .set(DistributionLoadscaninvnEntity::getSignforState, 2)
// .set(DistributionLoadscaninvnEntity::getReceivedQuantity, 1)
// );
// //更新签收表的签收数量和装车数量
// Integer j = distributionSignforMapper.updateSignforByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
// }
//// distributionLoadscanService.update()
// continue;
// }
// //依次插入该装车记录,设置车辆
// if (null != distributionDeliverySelfEntity.getDriverId()) {
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
// distributionLoadscanEntity.setScanType("1");
// distributionLoadscanEntity.setReceivedQuantity(1);
//// distributionLoadscanEntity.setOneClick(2);
// distributionLoadscanEntity.setSignforState(2);
// distributionLoadscanEntity.setOneQclick(2);
// distributionLoadscanEntity.setMsg("司机签收");
// if (distributionSignfor.getIsClerk()) {
// distributionLoadscanEntity.setMsg("文员签收");
// }
//// distributionLoadscanEntity.setScanTime(new Date());
// if (null == distributionLoadscanEntity.getPackageNub()) {
// distributionLoadscanEntity.setPackageNub(1);
// distributionLoadscanEntity.setLoadedNub(distributionLoadscanEntity.getPackageNub());
// }
// distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
// }
// if (null != distributionDeliverySelfEntity.getVehicleId()) {
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
// }
// //查询本车次是否第一次扫码,没有则更新上车时间
//// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
// //更新签收表的装车数量和签收数量
// Integer j = distributionSignforMapper.updatesignforByinvn(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
// }
// distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntitiesopen);
// }
// boolean update = this.update(new UpdateWrapper<DistributionSignforEntity>().lambda()
// .eq(DistributionSignforEntity::getId, distributionSignforEntity.getId())
// .set(StringUtils.isNotBlank(distributionSignfor.getDeliverySignPictures()), DistributionSignforEntity::getDeliverySignPictures, distributionSignfor.getDeliverySignPictures())
// .set(StringUtils.isNotBlank(distributionSignfor.getSigningType()), DistributionSignforEntity::getSigningType, distributionSignfor.getSigningType())
// .set(distributionSignfor.getIsClerk(), DistributionSignforEntity::getSigningStatus, 2)
// .set(distributionSignfor.getIsClerk(), DistributionSignforEntity::getSigningTime, simpleDateFormat.format(new Date()))
// .set(distributionSignfor.getIsClerk() && StringUtils.isNotBlank(distributionSignfor.getClerkSignRemarks()), DistributionSignforEntity::getSigningStatus, distributionSignfor.getClerkSignRemarks())
// .set(!distributionSignfor.getIsClerk() && StringUtils.isNotBlank(distributionSignfor.getDriverRemarks()), DistributionSignforEntity::getDriverRemarks, distributionSignfor.getDriverRemarks())
// .set(!distributionSignfor.getIsClerk(), DistributionSignforEntity::getDriverSigning, 2)
// .set(!distributionSignfor.getIsClerk(), DistributionSignforEntity::getSjsigningTime, simpleDateFormat.format(new Date()))
// );
// return R.status(true);
// }
@Override
public R offline(String offlineJson) {

100
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -49,7 +49,11 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.order.OrderReservationStatusConstant;
import org.springblade.common.constant.order.OrderStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.exception.CustomerException;
@ -1450,6 +1454,102 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
return baseMapper.findZeroListByWarehouseId(page,warehouseId);
}
@Override
@Transactional
public void maintenanceOrderInfo(String orderCodes, Long warehouseId) {
String method = "###############方法:maintenanceOrderInfo,";
if (Func.isEmpty(orderCodes)) {
log.error(method + "参数缺失orderCodes:{}", orderCodes);
return;
}
String[] split = Func.split(orderCodes, ",");
for (String s : split) {
//查询订单
DistributionStockArticleEntity stockArticleEntity = this.findStockArticleByOrderCodeAndWarehouseId(s, warehouseId);
if (Func.isEmpty(stockArticleEntity)) {
log.error(method + "订单不存在orderCode:{}", s);
throw new RuntimeException("订单不存在");
}
//查询包件列表
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderCode, s)
.eq(DistributionParcelListEntity::getStockArticleId, stockArticleEntity.getId())
.eq(DistributionParcelListEntity::getWarehouseId, warehouseId)
);
if (Func.isEmpty(parcelListEntities)) {
log.error(method + "查询包件列表空orderCode:{}", s);
throw new RuntimeException("包件列表为空");
}
//在库数量
int inWarehouseQuantity = 0;
//装车数量
int loadingQuantity = 0;
//配送件数
int deliveryQuantity = 0;
//签收件数
int signingQuantity = 0;
//订单总件数
int totalNumber = stockArticleEntity.getTotalNumber().intValue();
for (DistributionParcelListEntity parcelListEntity : parcelListEntities) {
//统计订单相关的状态节点数量
if (parcelListEntity.getOrderPackageReservationStatus().equals(OrderPackageReservationStatusConstant.yiyueyue.getValue())) {
deliveryQuantity += parcelListEntity.getQuantity();
}
if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())) {
loadingQuantity += parcelListEntity.getQuantity();
}
if (parcelListEntity.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) {
signingQuantity += parcelListEntity.getQuantity();
}
}
inWarehouseQuantity += stockArticleEntity.getTotalNumber() - loadingQuantity;
stockArticleEntity.setHandQuantity(inWarehouseQuantity);
stockArticleEntity.setDeliveryQuantity(deliveryQuantity);
stockArticleEntity.setSigninQuantity(signingQuantity);
if (totalNumber != 0) {
if (totalNumber == deliveryQuantity) {
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
} else {
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue());
}
if (deliveryQuantity == 0) {
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue());
}
//未签收的情况下分析订单的装车状态,此时该订单未有包件进行其拿手
if (signingQuantity == 0) {
if (totalNumber == loadingQuantity) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue());
} else {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue());
}
if (loadingQuantity == 0) {
if (totalNumber == inWarehouseQuantity) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
} else {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
}
}
} else {
//订单存在签收数据了,此时就需要进行签收状态的判断
if (totalNumber == signingQuantity) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue());
} else {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
}
}
this.updateById(stockArticleEntity);
}
}
}
@Override
public DistributionStockArticleEntity findZeroByOrderCodeAndWarehouseId(String orderCode, Long warehouseId) {

Loading…
Cancel
Save