|
|
|
@ -60,6 +60,8 @@ import org.jetbrains.annotations.NotNull;
|
|
|
|
|
import org.springblade.common.constant.DictBizConstant; |
|
|
|
|
import org.springblade.common.constant.DistributionTypeConstant; |
|
|
|
|
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.Inventory.InventorySigningStatusConstant; |
|
|
|
|
import org.springblade.common.constant.Inventory.InventoryStockUpStatusConstant; |
|
|
|
|
import org.springblade.common.constant.RabbitConstant; |
|
|
|
|
import org.springblade.common.constant.common.IsOrNoConstant; |
|
|
|
|
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant; |
|
|
|
@ -4586,28 +4588,71 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
//取出所有的装车操作人
|
|
|
|
|
//所有扫描装车的用户名称
|
|
|
|
|
List<String> collect = list.stream().filter(l -> !l.getScanStatus().equals(LoadingStatusConstant.quxiao.getValue())).map(DistributionLoadscaninvnEntity::getScanUser).collect(Collectors.toList()); |
|
|
|
|
int loadingNum = list.stream().mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum(); |
|
|
|
|
rs.setLoadedinNumber(loadingNum); |
|
|
|
|
// int loadingNum = list.stream().mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum();
|
|
|
|
|
// rs.setLoadedinNumber(loadingNum);
|
|
|
|
|
HashSet<String> strings = new HashSet<>(collect); |
|
|
|
|
rs.setScanUser(String.join(",", strings)); |
|
|
|
|
|
|
|
|
|
if (loadingNum > 0 && loadingNum == rs.getReservationNum()) { |
|
|
|
|
//查询库存品包件列表
|
|
|
|
|
List<DisStockListDetailEntity> stockListDetailEntityList = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda() |
|
|
|
|
.eq(DisStockListDetailEntity::getReservationId, rs.getReservationId()) |
|
|
|
|
.eq(DisStockListDetailEntity::getStockListId, rs.getStocklistId()) |
|
|
|
|
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
int loadingNum = stockListDetailEntityList.stream().filter(f -> InventoryLoadingStatusConstant.yizhuangche.getValue().equals(f.getStockLockingStatus())).mapToInt(DisStockListDetailEntity::getNum).sum(); |
|
|
|
|
rs.setLoadedinNumber(loadingNum); |
|
|
|
|
if (loadingNum == rs.getReservationNum() ){ |
|
|
|
|
rs.setLoadingStatusName(DeliveryLoadingStatusConstant.yizhuangche.getName()); |
|
|
|
|
} else if (loadingNum > 0 && loadingNum < rs.getReservationNum()) { |
|
|
|
|
rs.setLoadingStatusName(DeliveryLoadingStatusConstant.bunfenzhuangche.getName()); |
|
|
|
|
} else { |
|
|
|
|
rs.setLoadingStatusName(DeliveryLoadingStatusConstant.weizhuangche.getName()); |
|
|
|
|
}else { |
|
|
|
|
if (loadingNum > 0){ |
|
|
|
|
rs.setLoadingStatusName(DeliveryLoadingStatusConstant.bunfenzhuangche.getName()); |
|
|
|
|
} |
|
|
|
|
if (loadingNum == 0){ |
|
|
|
|
rs.setLoadingStatusName(DeliveryLoadingStatusConstant.weizhuangche.getName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
int signingNum = stockListDetailEntityList.stream().filter(f -> InventorySigningStatusConstant.yiqianshou.getValue().equals(f.getStockSignfoStatus())).mapToInt(DisStockListDetailEntity::getNum).sum(); |
|
|
|
|
if (signingNum == rs.getReservationNum() ){ |
|
|
|
|
rs.setSigningStatusName(ReservationSigningStatusConstant.yiqianshou.getName()); |
|
|
|
|
}else { |
|
|
|
|
if (signingNum > 0){ |
|
|
|
|
rs.setSigningStatusName(ReservationSigningStatusConstant.bufenqianshou.getName()); |
|
|
|
|
} |
|
|
|
|
if (signingNum == 0){ |
|
|
|
|
rs.setSigningStatusName(ReservationSigningStatusConstant.daiqianshou.getName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
rs.setSignedinNumber(signingNum); |
|
|
|
|
int stockupNum = stockListDetailEntityList.stream().filter(f -> InventoryStockUpStatusConstant.yibeihuo.getValue().equals(f.getStockStatus())).mapToInt(DisStockListDetailEntity::getNum).sum(); |
|
|
|
|
rs.setStockupNum(stockupNum); |
|
|
|
|
if (stockupNum == rs.getReservationNum()){ |
|
|
|
|
rs.setStockUpStatusName(StockupStatusConstant.yibeihuo.getName()); |
|
|
|
|
}else { |
|
|
|
|
if (stockupNum > 0){ |
|
|
|
|
rs.setStockUpStatusName(StockupStatusConstant.beihuozhong.getName()); |
|
|
|
|
} |
|
|
|
|
if (stockupNum == 0){ |
|
|
|
|
rs.setStockUpStatusName(StockupStatusConstant.daibeihuo.getName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int signNum = list.stream().filter(f -> f.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum(); |
|
|
|
|
|
|
|
|
|
if (signNum > 0 && signNum == rs.getReservationNum()) { |
|
|
|
|
rs.setSigningStatusName(ReservationSigningStatusConstant.yiqianshou.getValue()); |
|
|
|
|
} else if (signNum > 0 && signNum < rs.getReservationNum()) { |
|
|
|
|
rs.setSigningStatusName(ReservationSigningStatusConstant.bufenqianshou.getName()); |
|
|
|
|
} else { |
|
|
|
|
rs.setSigningStatusName(ReservationSigningStatusConstant.daiqianshou.getName()); |
|
|
|
|
} |
|
|
|
|
// if (loadingNum > 0 && loadingNum == rs.getReservationNum()) {
|
|
|
|
|
// rs.setLoadingStatusName(DeliveryLoadingStatusConstant.yizhuangche.getName());
|
|
|
|
|
// } else if (loadingNum > 0 && loadingNum < rs.getReservationNum()) {
|
|
|
|
|
// rs.setLoadingStatusName(DeliveryLoadingStatusConstant.bunfenzhuangche.getName());
|
|
|
|
|
// } else {
|
|
|
|
|
// rs.setLoadingStatusName(DeliveryLoadingStatusConstant.weizhuangche.getName());
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// int signNum = list.stream().filter(f -> f.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum();
|
|
|
|
|
//
|
|
|
|
|
// if (signNum > 0 && signNum == rs.getReservationNum()) {
|
|
|
|
|
// rs.setSigningStatusName(ReservationSigningStatusConstant.yiqianshou.getValue());
|
|
|
|
|
// } else if (signNum > 0 && signNum < rs.getReservationNum()) {
|
|
|
|
|
// rs.setSigningStatusName(ReservationSigningStatusConstant.bufenqianshou.getName());
|
|
|
|
|
// } else {
|
|
|
|
|
// rs.setSigningStatusName(ReservationSigningStatusConstant.daiqianshou.getName());
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|