|
|
|
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.SerializationUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataCategoryClient; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataWarehouseClient; |
|
|
|
|
import com.logpm.distribution.bean.Resp; |
|
|
|
|
import com.logpm.distribution.dto.splitOrder.DistributionSplitAllTaskSearchDTO; |
|
|
|
|
import com.logpm.distribution.dto.splitOrder.DistributionSplitTaskSearchDTO; |
|
|
|
@ -26,6 +28,7 @@ import com.logpm.distribution.service.IDistributionStockArticleService;
|
|
|
|
|
import com.logpm.distribution.vo.DistributionSplitOrderAllTaskVO; |
|
|
|
|
import com.logpm.distribution.vo.DistributionSplitOrderTaskVO; |
|
|
|
|
import com.logpm.distribution.vo.SplitPackageOrderVO; |
|
|
|
|
import com.logpm.oldproject.feign.IWarehouseClient; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.common.constant.order.*; |
|
|
|
@ -40,6 +43,7 @@ import org.springblade.core.secure.utils.AuthUtil;
|
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.system.entity.User; |
|
|
|
|
import org.springblade.system.feign.IUserClient; |
|
|
|
|
import org.springframework.beans.factory.annotation.Qualifier; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
@ -60,6 +64,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
|
|
|
|
|
private final IDistributionSplitOrderLogService distributionSplitOrderLogService; |
|
|
|
|
private final RedisLockClient redisLockClient; |
|
|
|
|
private final IUserClient iUserClient; |
|
|
|
|
private final IBasicdataWarehouseClient iWarehouseClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -269,7 +274,7 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 预约、签收状态的不允许拆单
|
|
|
|
|
long count = distributionParcelListService.count( |
|
|
|
|
List<DistributionParcelListEntity> packageList = distributionParcelListService.list( |
|
|
|
|
Wrappers.<DistributionParcelListEntity>lambdaQuery() |
|
|
|
|
.in(DistributionParcelListEntity::getOrderPackageCode, packageCodes) |
|
|
|
|
.eq(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiruku.getValue()) |
|
|
|
@ -278,8 +283,11 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl<Distr
|
|
|
|
|
.eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue()) |
|
|
|
|
.eq(DistributionParcelListEntity::getIsTransfer, 0) |
|
|
|
|
); |
|
|
|
|
if (count != packageCodes.size()) { |
|
|
|
|
return R.fail("提交包件包含预约、签收状态的包件"); |
|
|
|
|
if (packageList.size() != packageCodes.size()) { |
|
|
|
|
return R.fail("提交包件包含预约、签收状态的包件或包件不存在"); |
|
|
|
|
} |
|
|
|
|
if (!packageList.get(0).getWarehouseId().equals(iWarehouseClient.getMyCurrentWarehouse().getId())) { |
|
|
|
|
return R.fail("提交包件包含不属于当前仓库的包件"); |
|
|
|
|
} |
|
|
|
|
long currentOrderCount = distributionParcelListService.count( |
|
|
|
|
Wrappers.<DistributionParcelListEntity>lambdaQuery() |
|
|
|
|