Browse Source

Merge branch 'dev' into pre-production

master
汤建军 8 months ago
parent
commit
d82ef60e1c
  1. 8
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseRetentionScanClient.java
  2. 44
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  3. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseRetentionScanClient.java
  4. 9
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java
  5. 46
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

8
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseRetentionScanClient.java

@ -17,6 +17,7 @@
package com.logpm.warehouse.feign;
import com.logpm.warehouse.entity.WarehouseRetentionScanEntity;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.mp.support.BladePage;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import org.springblade.core.tool.api.R;
@ -26,6 +27,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* 滞留扫描记录 Feign接口类
*
@ -33,7 +36,7 @@ import org.springframework.web.bind.annotation.RequestParam;
* @since 2023-11-03
*/
@FeignClient(
value = "warehouseRetentionScan"
value = ModuleNameConstant.APPLICATION_WAREHOUSE_NAME
)
public interface IWarehouseRetentionScanClient {
@ -58,4 +61,7 @@ public interface IWarehouseRetentionScanClient {
@PostMapping(TOP+"/saveRetentionScan")
R saveRetentionScan(@RequestBody WarehouseRetentionScanEntity warehouseRetentionScanEntity);
@PostMapping(TOP+"/saveBatchRetentionScan")
R saveBatchRetentionScan(@RequestBody List<WarehouseRetentionScanEntity> warehouseRetentionScanEntities);
}

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

@ -5941,11 +5941,24 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
public R retentionScan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
if (distrilbutionloadingscanDTO.getBarcode().isEmpty()) {
log.error("参数缺失Barcode:{}", distrilbutionloadingscanDTO.getBarcode());
return R.fail(403, "数据错误");
}
//查询包件
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)) {
return Resp.scanFail("未授权!!!", "未授权!!!");
return R.fail(403, "未授权!!!");
}
List<String> barcode = Func.toStrList(distrilbutionloadingscanDTO.getBarcode());
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.in(DistributionParcelListEntity::getOrderPackageCode, barcode)
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
);
if (!parcelListEntities.isEmpty()) {
boolean flag = parcelListEntities.stream().allMatch(a -> OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(a.getOrderPackageLoadingStatus()) && !OrderPackageStatusConstant.yiqianshou.getValue().equals(a.getOrderPackageStatus()));
if (!flag){
String str = parcelListEntities.stream().filter(a -> OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(a.getOrderPackageLoadingStatus()) && !OrderPackageStatusConstant.yiqianshou.getValue().equals(a.getOrderPackageStatus())).map(DistributionParcelListEntity::getOrderCode).distinct().collect(Collectors.joining(","));
return R.fail(str+"不满足滞留");
}
}
Integer retentionType = distrilbutionloadingscanDTO.getRetentionType();
Long deliveryId = null;
@ -5953,14 +5966,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//不在车次任务内进行扫描
//查询此包件属于哪个车次
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.in(DistributionLoadscanEntity::getOrderPackageCode, barcode)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
.ne(DistributionLoadscanEntity::getSignforState, LoadScanSigningStatusConstant.yiqianshou.getValue())
);
if (loadscanEntityList.isEmpty()) {
//查询库存品
List<DistributionLoadscaninvnEntity> loadscaninvnEntityList = distributionLoadscaninvnService.list(Wrappers.<DistributionLoadscaninvnEntity>query().lambda()
.eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.in(DistributionLoadscaninvnEntity::getOrderPackageCode, barcode)
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
.ne(DistributionLoadscaninvnEntity::getSignforState, LoadScanSigningStatusConstant.yiqianshou.getValue())
);
@ -5978,7 +5991,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryId);
List<DistributionRetentionScanVo> retentionScanVos = new ArrayList<>();
switch (retentionType) {
case 1:
//包件--库存品 和包件
@ -6056,7 +6068,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
retentionScanVos.addAll(distributionRetentionScanVos);
}
}
if (Func.isEmpty(retentionScanVos)) {
if (!Func.isEmpty(retentionScanVos)) {
List<DistributionLoadscanAbnormalEntity> list = distributionLoadscanAbnormalService.list(Wrappers.<DistributionLoadscanAbnormalEntity>query().lambda()
.eq(DistributionLoadscanAbnormalEntity::getPackageCode, distrilbutionloadingscanDTO.getBarcode())
);
@ -6085,16 +6097,22 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
}
}
if (flag) {
//存在该订制品或者库存品包件信息但是未进行装车操作
return Resp.scanFail("包件未装车", "包件未装车");
} else {
//该配送任务查询无该包件信息
return Resp.scanFail("系统无编码", "系统无编码");
List<WarehouseRetentionScanEntity> warehouseRetentionScanEntities = new ArrayList<>();
if (!retentionScanVos.isEmpty()) {
retentionScanVos.forEach(r->{
WarehouseRetentionScanEntity warehouseRetntionScanEntity = Func.copy(r, WarehouseRetentionScanEntity.class);
warehouseRetentionScanEntities.add(warehouseRetntionScanEntity);
});
}
if (!warehouseRetentionScanEntities.isEmpty()) {
//进行批量滞留
R r = warehouseRetentionScanClient.saveBatchRetentionScan(warehouseRetentionScanEntities);
if (!Objects.equals(r.getCode(),200)){
throw new RuntimeException(r.getMsg());
}
}
}
return R.data(retentionScanVos);
return R.success("滞留操作成功");
}
@Override

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseRetentionScanClient.java

@ -30,6 +30,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/**
* 滞留扫描记录 Feign实现类
*
@ -43,6 +45,8 @@ public class WarehouseRetentionScanClient implements IWarehouseRetentionScanClie
private final IWarehouseRetentionScanService warehouseRetentionScanService;
private final IWarehouseRetentionRecordService warehouseRetentionRecordService;
@Override
@GetMapping(TOP)
public BladePage<WarehouseRetentionScanEntity> retentionScanTop(Integer current, Integer size) {
@ -58,4 +62,10 @@ public class WarehouseRetentionScanClient implements IWarehouseRetentionScanClie
return R.status(warehouseRetentionScanService.save(warehouseRetentionScanEntity));
}
@Override
public R saveBatchRetentionScan(List<WarehouseRetentionScanEntity> warehouseRetentionScanEntities) {
return warehouseRetentionRecordService.saveBatchRetentionList(warehouseRetentionScanEntities);
}
}

9
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java

@ -23,6 +23,7 @@ import com.logpm.warehouse.dto.RetentionDTO;
import com.logpm.warehouse.dto.WarehouseRetentionRecordDTO;
import com.logpm.warehouse.dto.WarehouseRetentionScanDTO;
import com.logpm.warehouse.entity.WarehouseRetentionRecordEntity;
import com.logpm.warehouse.entity.WarehouseRetentionScanEntity;
import com.logpm.warehouse.excel.WarehouseRetentionRecordExcel;
import com.logpm.warehouse.vo.WarehouseRetentionRecordVO;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
@ -98,4 +99,12 @@ public interface IWarehouseRetentionRecordService extends BaseService<WarehouseR
* @return
*/
List<WarehouseRetentionScanVO> getRetentionPackageByType(@Param("retentionId") Long retentionId,@Param("type") Integer type);
/**
* 后台批量进行滞留
* @param warehouseRetentionScanEntities
* @return
*/
R saveBatchRetentionList(List<WarehouseRetentionScanEntity> warehouseRetentionScanEntities);
}

46
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

@ -381,4 +381,50 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
return warehouseRetentionScanVOS;
}
@Override
@Transactional
public R saveBatchRetentionList(List<WarehouseRetentionScanEntity> warehouseRetentionScanEntities) {
AtomicBoolean saveFlah = new AtomicBoolean(false);
if (!warehouseRetentionScanEntities.isEmpty()) {
List<Long> deliveryIds = warehouseRetentionScanEntities.stream().map(WarehouseRetentionScanEntity::getDeliveryId).distinct().collect(Collectors.toList());
//查询出该滞留任务是否存在
List<WarehouseRetentionScanEntity> retentionScanEntityList = warehouseRetentionScanService.list(Wrappers.<WarehouseRetentionScanEntity>query().lambda()
.in(WarehouseRetentionScanEntity::getDeliveryId, deliveryIds)
);
if (!retentionScanEntityList.isEmpty()) {
String collect = retentionScanEntityList.stream().filter(f ->
warehouseRetentionScanEntities.stream().map(w -> w.getOrderPackageCode())
.collect(Collectors.toList())
.contains(f.getOrderPackageCode()))
.map(WarehouseRetentionScanEntity::getOrderPackageCode).collect(Collectors.joining(","));
if (Objects.isNull(collect)){
return R.fail(collect+"重复滞留");
}
}
for (WarehouseRetentionScanEntity warehouseRetentionScanEntity : warehouseRetentionScanEntities) {
//进行滞留逻辑处理
switch (warehouseRetentionScanEntity.getConditions()) {
case 1:
//订制品
saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationPackage(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getConditions()));
break;
case 2:
//库存品
saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationInventory(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId()));
break;
case 3:
//零担
saveFlah.set(distributionDeliveryListClient.retentionDeliveryReservationZeroPackage(warehouseRetentionScanEntity.getDeliveryId(), warehouseRetentionScanEntity.getReservationId(), warehouseRetentionScanEntity.getOrderPackageId(), warehouseRetentionScanEntity.getRetentionQuantity(), warehouseRetentionScanEntity.getOrderId()));
break;
default:
log.error(">>>>> rs.getConditions()={}", warehouseRetentionScanEntity.getConditions());
}
//进行滞留信息的保存
warehouseRetentionScanService.save(Func.copy(warehouseRetentionScanEntity, WarehouseRetentionScanEntity.class));
}
}
return R.success("操作成功");
}
}

Loading…
Cancel
Save