Browse Source

零担释放BUg修复

dev
汤建军 2 months ago
parent
commit
f7d5753f44
  1. 12
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationZeroPackageEntity.java
  2. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionParcelListController.java
  3. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationZeroPackageService.java
  4. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  5. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationZeroPackageServiceImpl.java
  6. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  7. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

12
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationZeroPackageEntity.java

@ -119,6 +119,18 @@ public class DistributionReservationZeroPackageEntity extends TenantEntity {
@ApiModelProperty(value = "备货结束时间")
private Date endTimeStocking;
/**
* 是否释放 0- 1-
*/
@ApiModelProperty(value = "是否释放 0-否 1-是")
private Integer cancelStatus;
/**
* 计划数量(用于释放记录)
*/
@ApiModelProperty(value = "计划数量(用于释放记录)")
private Integer planNum;

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionParcelListController.java

@ -250,6 +250,7 @@ public class DistributionParcelListController extends BladeController {
parcelListEntity.setMaterialCode(materialOwnId.getProductCode());
parcelListEntity.setMaterialName(materialOwnId.getName());
parcelListEntity.setMaterialUnit(materialOwnId.getLogpmUnit());
parcelListEntity.setMaterialId(materialOwnId.getId());
updateList.add(parcelListEntity);
}
if (!updateList.isEmpty()) {

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

@ -70,7 +70,7 @@ public interface IDistributionReservationZeroPackageService extends BaseService<
* @param reservationId
* @param collect
*/
void recoverZeroPackage(Long reservationId, List<Long> collect);
void recoverZeroPackage(Long reservationId, List<Long> collect,Boolean isAutoRecover);
/**

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

@ -1357,9 +1357,13 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
.in(DistributionLoadscanEntity::getPackageId, packageIds)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
for (DistributionParcelNumberDTO distributionParcelNumberDTO : distributionParcelNumberDTOS) {
//判断是全部进行返回还是部分
}
if (Func.isNotEmpty(loadscanEntityList)) {
//查看是否存在需要进行回库的零担
List<Long> collect = loadscanEntityList.stream().filter(f -> !packageIds.contains(f.getPackageId())).map(DistributionLoadscanEntity::getPackageId).collect(Collectors.toList());
List<Long> collect = loadscanEntityList.stream().filter(f -> packageIds.contains(f.getPackageId())).map(DistributionLoadscanEntity::getPackageId).collect(Collectors.toList());
if (Func.isNotEmpty(collect)) {
String orderCode = distributionParcelNumberDTOS.stream().filter(f -> collect.contains(f.getParcelListId())).map(DistributionParcelNumberDTO::getOrderCode).collect(Collectors.joining(","));
log.info(method + "维护零担订单:{}", orderCode);
@ -1367,8 +1371,11 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
builder.append(",");
}
builder.append(orderCode);
//针对未签收完成零担进行回库操作
//这些单子就是需要进行状态回退的零担包件
reservationZeroPackageService.recoverZeroPackage(reservationId, collect);
reservationZeroPackageService.recoverZeroPackage(reservationId, collect,true);
}
} else {
//计划数量全部回退
@ -1378,7 +1385,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
builder.append(",");
}
builder.append(orderCode);
reservationZeroPackageService.recoverZeroPackage(reservationId, packageIds);
reservationZeroPackageService.recoverZeroPackage(reservationId, packageIds,true);
}
}
distributionStockArticleService.maintenanceOrderInfo(builder.toString(), warehouse.getId());

22
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationZeroPackageServiceImpl.java

@ -20,19 +20,22 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionReservationZeroPackageEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistributionReservationZeroPackageExcel;
import com.logpm.distribution.mapper.DistributionParcelListMapper;
import com.logpm.distribution.mapper.DistributionReservationZeroPackageMapper;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionReservationZeroPackageVO;
import com.sun.org.apache.xpath.internal.operations.Bool;
import io.jsonwebtoken.lang.Objects;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.reservation.ReservationPackageStatusConstant;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
@ -118,7 +121,7 @@ public class DistributionReservationZeroPackageServiceImpl extends BaseServiceIm
*/
@Override
@Transactional
public void recoverZeroPackage(Long reservationId, List<Long> collect) {
public void recoverZeroPackage(Long reservationId, List<Long> collect, Boolean isAutoRecover) {
String method = "###################DistributionReservationZeroPackageServiceImpl.recoverZeroPackage";
List<DistributionReservationZeroPackageEntity> reservationZeroPackageEntities = this.list(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, reservationId)
@ -133,19 +136,26 @@ public class DistributionReservationZeroPackageServiceImpl extends BaseServiceIm
int i = distributionParcelNumberEntity.getDeliveryQuantity() - reservationZeroPackageEntity.getQuantity();
distributionParcelNumberEntity.setDeliveryQuantity(i);
if (i == 0){
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
distributionParcelListMapper.updateById(parcelListEntity);
DistributionParcelListEntity parcelListEntity1 = new DistributionParcelListEntity();
parcelListEntity1.setId(parcelListEntity.getId());
parcelListEntity1.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
distributionParcelListMapper.updateById(parcelListEntity1);
}
distributionParcelNumberEntity.setDeliveryQuantity(i);
reservationZeroPackageEntity.setPlanNum(reservationZeroPackageEntity.getQuantity());
distributionParcelNumberService.updateById(distributionParcelNumberEntity);
reservationZeroPackageEntity.setQuantity(0);
reservationZeroPackageEntity.setZeroPackageStatus(ReservationPackageStatusConstant.quxiao.getValue());
if (isAutoRecover) {
reservationZeroPackageEntity.setCancelStatus(Integer.parseInt(IsOrNoConstant.yes.getValue()));
}
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(),parcelListEntity.getWarehouseId());
this.updateById(reservationZeroPackageEntity);
}
}
@Override
@Transactional
public void maintainReservationZeroPackage(Long reservationId, Long packageId) {

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

@ -1906,7 +1906,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (!planMap.get(k).isEmpty()) {
List<Long> ids = v.stream().map(DistributionReservationZeroPackageEntity::getParcelListId).collect(Collectors.toList());
num.updateAndGet(v1 -> v1 + v.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum());
distributionReservationZeroPackageService.recoverZeroPackage(distrilbutionloadingscanDTO.getReservationId(), ids);
distributionReservationZeroPackageService.recoverZeroPackage(distrilbutionloadingscanDTO.getReservationId(), ids,false);
if (planMap.get(k).size() == ids.size()) {
orderNum.getAndSet(1);
distributionReservationStockarticleService.update(new UpdateWrapper<DistributionReservationStockarticleEntity>().lambda()
@ -1942,7 +1942,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
deliveryListEntity.setCustomersNumber(newCustomersNumber);
distributionDeliveryListService.updateById(deliveryListEntity);
// 发送零担作业节点
// 作业节点推送
NodeFanoutMsg<ReservationVO> nodeFanoutMsg = distributionReservationService.buildNodeFanoutMsgByReservation(reservationEntity, map, BizOperationEnums.REMOVE);
@ -8455,10 +8454,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
deliveryQuantity = deliveryQuantity - loadscanEntity.getLoadedNub();
signinQuantity += loadscanEntity.getLoadedNub();
handQuantity = handQuantity - loadscanEntity.getLoadedNub();
deliveryQuantity = deliveryQuantity - loadscanEntity.getLoadedNub();
//将装车和签收进行统一数量
signinQuantity += loadscanEntity.getReceivedQuantity();
deliveryQuantity = deliveryQuantity - loadscanEntity.getLoadedNub();
distributionLoadscanService.save(loadscanEntity);
//维护签收数量
// distributionSignforMapper.updateSignforNum(deliveryId, reservationId, loadscanEntity.getReceivedQuantity());
@ -9686,14 +9682,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
log.info(method + "维护零担订单:{}", orderCode);
builder.append(orderCode);
//这些单子就是需要进行状态回退的零担包件
distributionReservationZeroPackageService.recoverZeroPackage(reservationId, collect);
distributionReservationZeroPackageService.recoverZeroPackage(reservationId, collect,false);
}
} else {
//计划数量全部回退
String orderCode = distributionParcelNumberDTOS.stream().map(DistributionParcelNumberDTO::getOrderCode).distinct().collect(Collectors.joining(","));
log.info(method + "维护零担订单:{}", orderCode);
builder.append(orderCode);
distributionReservationZeroPackageService.recoverZeroPackage(reservationId, packageIds);
distributionReservationZeroPackageService.recoverZeroPackage(reservationId, packageIds,false);
}
}
distributionStockArticleService.maintenanceOrderInfo(builder.toString(), warehouse.getId());

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -1883,7 +1883,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
if (Func.isNotEmpty(reservationZeroPackageEntities)) {
List<Long> collect = reservationZeroPackageEntities.stream().map(DistributionReservationZeroPackageEntity::getStockArticleId).distinct().collect(Collectors.toList());
//释放零担资源
distributionZeroPackageService.recoverZeroPackage(id, collect);
distributionZeroPackageService.recoverZeroPackage(id, collect,true);
}
});
//维护订单状态
@ -2170,7 +2170,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
if (!longs.isEmpty()) {
//进行零担在库数量恢复
distributionZeroPackageService.recoverZeroPackage(distrilbutionBillLadingDTO.getId(), longs);
distributionZeroPackageService.recoverZeroPackage(distrilbutionBillLadingDTO.getId(), longs,false);
}
//收集需要进行新增的包件信息

Loading…
Cancel
Save