|
|
|
@ -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) { |
|
|
|
|