Browse Source

配送任务详情库存品列表维护

pull/2/head
汤建军 1 year ago
parent
commit
a7178bb8e6
  1. 45
      blade-biz-common/src/main/java/org/springblade/common/constant/Inventory/InventoryStockUpStatusConstant.java
  2. 18
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java
  3. 77
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

45
blade-biz-common/src/main/java/org/springblade/common/constant/Inventory/InventoryStockUpStatusConstant.java

@ -0,0 +1,45 @@
package org.springblade.common.constant.Inventory;
/**
* 订单包件状态
* 关联码表 order_package_status
*
* @author pref
*/
public enum InventoryStockUpStatusConstant {
daibeihuo("待备货", "10"),
yibeihuo("已备货", "20");
/**
* 状态
*/
private String name;
/**
*
*/
private String value;
private InventoryStockUpStatusConstant(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

18
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationStocklistVO.java

@ -104,6 +104,18 @@ public class DistributionReservationStocklistVO extends DistributionReservationS
@ApiModelProperty(value = "库存品装车数")
private Integer loadedinNumber;
/**
* 库存品签收数
*/
@ApiModelProperty(value = "库存品签收数")
private Integer signedinNumber;
/**
* 库存品备货数量
*/
@ApiModelProperty(value = "库存品备货数量")
private Integer stockupNum;
/**
* 商场名称
*/
@ -129,6 +141,12 @@ public class DistributionReservationStocklistVO extends DistributionReservationS
@ApiModelProperty(value = "签收状态")
private String signingStatusName;
/**
* 签收状态
*/
@ApiModelProperty(value = "备货状态")
private String stockUpStatusName;
/**
* 装车扫描人
*/

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

@ -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());
// }
}

Loading…
Cancel
Save