Browse Source

订制品扫描装车接口

dist.1.3.0
汤建军 5 months ago
parent
commit
a8c435f654
  1. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java
  2. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java
  3. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml
  4. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java
  5. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java
  6. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistrilbutionloadingscanDTO.java
  7. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.java
  8. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml
  9. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.java
  10. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.xml
  11. 269
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java

@ -86,7 +86,7 @@ public class BasicdataVehicleController extends BladeController {
public R<BasicdataVehicleVO> detail(@Param("id") Long id) {
// BasicdataVehicleEntity detail = basicdataVehicleService.getOne(Condition.getQueryWrapper(basicdataVehicle));
BasicdataVehicleEntity detail = basicdataVehicleService.getVehicleDetail(id);
BasicdataVehicleVO detail = basicdataVehicleService.getVehicleDetail(id);
//查询历史照片
BasicdataVehicleVO basicdataVehicleVO = new BasicdataVehicleVO();
BeanUtils.copyProperties(detail,basicdataVehicleVO);

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java

@ -69,5 +69,5 @@ public interface BasicdataVehicleMapper extends BaseMapper<BasicdataVehicleEntit
* @param id
* @return
*/
BasicdataVehicleEntity getVehicleDetail(@Param("id")Long id);
BasicdataVehicleVO getVehicleDetail(@Param("id")Long id);
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml

@ -252,7 +252,7 @@
and vehicle_nub like concat('%',#{carNumber},'%')
limit 10
</select>
<select id="getVehicleDetail" resultType="com.logpm.basicdata.entity.BasicdataVehicleEntity">
<select id="getVehicleDetail" resultType="com.logpm.basicdata.vo.BasicdataVehicleVO">
SELECT
lbv.id id,
lbv.tenant_id tenantId,

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java

@ -99,5 +99,5 @@ public interface IBasicdataVehicleService extends BaseService<BasicdataVehicleEn
* @param id
* @return
*/
BasicdataVehicleEntity getVehicleDetail(Long id);
BasicdataVehicleVO getVehicleDetail(Long id);
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java

@ -295,7 +295,7 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl<BasicdataVehicl
}
@Override
public BasicdataVehicleEntity getVehicleDetail(Long id) {
public BasicdataVehicleVO getVehicleDetail(Long id) {
return baseMapper.getVehicleDetail(id);
}

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistrilbutionloadingscanDTO.java

@ -25,6 +25,12 @@ public class DistrilbutionloadingscanDTO {
@ApiModelProperty(value = "配送任务Id")
private Long deliveryId;
/**
* 司机ID
*/
@ApiModelProperty(value = "司机ID")
private Long driverId;
// /**
// * 配送任务Id
// */

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.java

@ -93,4 +93,11 @@ public interface DistributionDeliverySelfMapper extends BaseMapper<DistributionD
List<Long> selectNewDeliveryList(@Param("param") DistributionAppDeliveryListDTO distributionDeliveryList);
/**
* 查询车次信息内司机信息
* @param id
* @param deliveryId
* @return
*/
DistributionDeliverySelfEntity selectDriverInfoByDeliveryIdAndDriverId(@Param("driverId")Long driverId,@Param("deliveryId") Long deliveryId);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml

@ -89,5 +89,9 @@
<select id="selectByDeliveyId" resultType="com.logpm.distribution.entity.DistributionDeliverySelfEntity">
SELECT * FROM logpm_distribution_delivery_self WHERE delivery_id = #{deliveryId} AND is_master = 2
</select>
<select id="selectDriverInfoByDeliveryIdAndDriverId"
resultType="com.logpm.distribution.entity.DistributionDeliverySelfEntity">
SELECT * FROM logpm_distribution_delivery_self WHERE driver_id = #{driver_id} AND delivery_id = #{deliveryId} AND is_deleted = 0
</select>
</mapper>

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.java

@ -74,4 +74,11 @@ public interface DistributionDeliveryTripartiteMapper extends BaseMapper<Distrib
* @return
*/
DistributionDeliveryTripartiteEntity selectTripartiteInfo(@Param("deliveryId")Long deliveryId);
/**
* 查询配送任务外协司机信息
* @param deliveryId
* @return
*/
DistributionDeliveryTripartiteEntity selectDriverInfoByDeliveryId(@Param("deliveryId")Long deliveryId);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.xml

@ -57,5 +57,9 @@
resultType="com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity">
SELECT * logpm_distribution_delivery_tripartite WHERE delivery_id = #{deliveryId}
</select>
<select id="selectDriverInfoByDeliveryId"
resultType="com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity">
SELECT * FROM logpm_distribution_delivery_tripartite WHERE is_deleted = 0 AND delivery_id = #{deliveryId}
</select>
</mapper>

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

@ -781,14 +781,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionParcelListService.updateById(parcelListEntity);
//更新装车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//进行解托操作
Map<String, Object> info = new HashMap<>();
info.put("orderPackageCode", parcelListEntity.getOrderPackageCode());
info.put("warehouseId", myCurrentWarehouse.getId());
if (StringUtils.isNotBlank(parcelListEntity.getOrderPackageCode())) {
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "扫描装车进行下架、解托");
}
@ -8009,74 +8007,285 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
public R newLoadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
//参数校验
String method = "########################DistributionAppDeliveryListServiceImpl.newLoadingscan";
if (Objects.isNull(distrilbutionloadingscanDTO.getDeliveryId())){
log.error(method+"参数缺失DeliveryId");
return Resp.fail("参数缺失,请联系管理员");
}
if (Objects.isNull(distrilbutionloadingscanDTO.getBarcode())){
log.error(method+"参数缺失Barcode");
if (Objects.isNull(distrilbutionloadingscanDTO.getDeliveryId())) {
log.error(method + "参数缺失DeliveryId");
return Resp.fail("参数缺失,请联系管理员");
}
if (Objects.isNull(distrilbutionloadingscanDTO.getType())){
log.error(method+"参数缺失Type");
if (Objects.isNull(distrilbutionloadingscanDTO.getType())) {
log.error(method + "参数缺失Type");
return Resp.fail("参数缺失,请联系管理员");
}
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)){
log.error(method+"作业未选择仓库");
return R.fail(403,"未授权!!!");
if (Objects.isNull(myCurrentWarehouse)) {
log.error(method + "作业未选择仓库");
return R.fail(403, "未授权!!!");
}
Integer type = distrilbutionloadingscanDTO.getType();
String orderPackageCode = distrilbutionloadingscanDTO.getBarcode();
Long deliveryId = distrilbutionloadingscanDTO.getDeliveryId();
Long warehouseId = myCurrentWarehouse.getId();
DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryId);
if (Objects.isNull(deliveryListEntity)) {
log.error(method + "配送任务异常deliveryId:{}",deliveryId);
return R.fail(403, "配送任务错误!!!");
}
//查询当前登录人所在计划
BladeUser user = AuthUtil.getUser();
Boolean isDriverFlag = judgeIsDriver(user);
if (!isDriverFlag) {
return R.fail(403,"无权限执行此操作!!!");
//Redis缓存 防止重复操作
List<Long> packageLockIds = new ArrayList<>();
//工厂回推
List<DistributionParcelListEntity> pushList = new ArrayList<>();
//备货库位待下架
List<JSONObject> jsonObjects = new ArrayList<>();
//查询司机信息
DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(deliveryListEntity,user,distrilbutionloadingscanDTO,isDriverFlag);
switch (type) {
case 1:
if (Objects.isNull(distrilbutionloadingscanDTO.getBarcode())) {
log.error(method + "参数缺失Barcode");
return Resp.fail("参数缺失,请联系管理员");
}
switch (type){
case 1 :
List<JSONObject> packageLogs = new ArrayList<>();
DistributionParcelListEntity parcelListEntity = distributionParcelListMapper.selectByOrderPackageCode(orderPackageCode, myCurrentWarehouse.getId());
if (Objects.isNull(parcelListEntity)){
if (Objects.isNull(parcelListEntity)) {
//查询是否为库存品
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getStockPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (list.isEmpty()){
if (list.isEmpty()) {
return Resp.scanFail("请在库存品页面扫描此码", "请在库存品页面扫描此码");
} else {
return Resp.scanFail("系统无编码", "系统无编码");
}
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelListEntity.getOrderPackageLoadingStatus())){
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelListEntity.getOrderPackageLoadingStatus())) {
return Resp.scanFail("此包件已装车", "此包件已装车");
}
//再次校验是否装车
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getOrderPackageCode, orderPackageCode)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (!loadscanEntityList.isEmpty()) {
return Resp.scanFail("此包件已装车", "此包件已装车");
}
//查询是否满足计划 以及计划在哪个客户中
Long reservationId = baseMapper.selectPackageByorderPackageCodeAndDeliveryId(orderPackageCode,deliveryId,warehouseId);
if (Objects.isNull(reservationId)){
Long reservationId = baseMapper.selectPackageByorderPackageCodeAndDeliveryId(orderPackageCode, deliveryId, warehouseId);
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
if (Objects.isNull(reservationEntity)) {
log.error(method + "预约任务错误reservationId:{}",reservationId);
return R.fail(403, "预约任务错误!!!");
}
if (Objects.isNull(reservationId)) {
//判定是否满足异常装车
Boolean isAbnormalLoadingFlag = judgeIsAbnormalLoading(deliveryId, parcelListEntity);
if (isAbnormalLoadingFlag) {
return R.fail(5000, "异常装车");
log.info("异常装车判定成功>>>>>>packageCode:{},reservationId:{}", distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getReservationId());
}
return Resp.scanFail("蹿货", "蹿货");
}
//正常进行装车
DistributionLoadscanEntity loadscanEntity = createdDistributionLoadscanEntity(deliveryListEntity,distributionDeliverySelfEntity,reservationId,parcelListEntity);
distributionLoadscanService.save(loadscanEntity);
//更新包件装车状态
packageLockIds.add(parcelListEntity.getId());
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageGroundingStatus(OrderPackageGroundingStatusConstant.daishangjia.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
distributionParcelListService.updateById(parcelListEntity);
//更新装车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//进行解托操作
Map<String, Object> info = new HashMap<>();
info.put("orderPackageCode", parcelListEntity.getOrderPackageCode());
info.put("warehouseId", myCurrentWarehouse.getId());
if (StringUtils.isNotBlank(parcelListEntity.getOrderPackageCode())) {
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "扫描装车进行下架、解托");
}
String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getScanUser() + "扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject packageLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_LOADING.getCode());
packageLogs.add(packageLog);
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", orderPackageCode);
jsonObject.put("warehouseId", myCurrentWarehouse.getId());
jsonObject.put("taskId", reservationId);
jsonObject.put("type", 1);
jsonObject.put("num", 1);
jsonObject.put("remark", "装车下架");
jsonObjects.add(jsonObject);
pushList.add(parcelListEntity);
}
break;
case 2:
if (Objects.isNull(distrilbutionloadingscanDTO.getParcelListDTOS())){
log.error(method + "参数缺失ParcelListDTOS");
return Resp.fail("参数缺失,请联系管理员");
}
List<DistributionParcelNumberDTO> parcelListDTOS = distrilbutionloadingscanDTO.getParcelListDTOS();
break;
}
break;
//添加缓存
if (!packageLockIds.isEmpty()) {
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:");
if (Func.isNotEmpty(a)) {
boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any));
if (flag) {
//正在操作,请稍后重试
throw new CustomerException("该包件正在被操作,请稍后再试!!!");
} else {
packageLockIds.addAll(a);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L);
}
} else {
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L);
}
}
if (CollUtil.isNotEmpty(pushList)) {
for (DistributionParcelListEntity parcelListEntity : pushList) {
List<Object> contents = new ArrayList<>();
PushData pushData = PushData.builder()
.packageCode(parcelListEntity.getOrderPackageCode())
.orderCode(parcelListEntity.getOrderCode())
.warehouseName(myCurrentWarehouse.getName())
.waybillNumber(parcelListEntity.getWaybillNumber()).build();
contents.add(pushData);
NodePushMsg msg = new NodePushMsg();
msg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING);
msg.setBrand(BrandEnums.getByValue(parcelListEntity.getBrandName()));
msg.setOperator(AuthUtil.getNickName());
msg.setOperatorTime(new Date());
msg.setContent(contents);
log.info("推送工厂数据:{}", JSONUtil.toJsonStr(msg));
factoryDataMessageSender.sendNodeDataByBrand(msg);
}
}
warehouseUpdownStockUpAreaClient.downStockUpShelf(jsonObjects);
return null;
}
private DistributionLoadscanEntity createdDistributionLoadscanEntity(DistributionDeliveryListEntity deliveryListEntity,
DistributionDeliverySelfEntity distributionDeliverySelfEntity,
Long reservationId,
DistributionParcelListEntity parcelListEntity,
BasicdataWarehouseEntity warehouseEntity,
BladeUser user) {
String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) {
loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) {
loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) {
loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
//添加车次号
loadscanEntity.setTrainNumber(deliveryListEntity.getTrainNumber());
loadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
loadscanEntity.setScanType("1");
loadscanEntity.setOneClick(1);
loadscanEntity.setWarehouseId(warehouseEntity.getId());
loadscanEntity.setWarehouseName(warehouseEntity.getName());
loadscanEntity.setPackageId(parcelListEntity.getId());
loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
loadscanEntity.setPackageNub(parcelListEntity.getQuantity());
loadscanEntity.setReservationId(reservationId);
loadscanEntity.setDeliveryId(deliveryListEntity.getId());
loadscanEntity.setOrderId(parcelListEntity.getStockArticleId());
loadscanEntity.setScanTime(now);
loadscanEntity.setScanUser(user.getNickName());
loadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId()+"");
loadscanEntity.setIsAbnormalLoading(1);
loadscanEntity.setLoadedNub(parcelListEntity.getQuantity());
return loadscanEntity;
}
private DistributionDeliverySelfEntity getDriver(DistributionDeliveryListEntity deliveryListEntity, BladeUser user,DistrilbutionloadingscanDTO distrilbutionloadingscanDTO,boolean isDriverFlag) {
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity();
if ("1".equals(deliveryListEntity.getKind())) {
if (isDriverFlag) {
BasicdataDriverArteryEntity driverArtery = iBasicdataDriverArteryClient.getDriverArtery(user.getUserId());
if (null == driverArtery) {
log.error("没有司机的信息!!");
throw new CustomerException("没有司机的信息");
}
//查询当前扫描司机是否属于当前配送任务
distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectDriverInfoByDeliveryIdAndDriverId(driverArtery.getId(),deliveryListEntity.getId());
} else {
if (Objects.isNull(distrilbutionloadingscanDTO.getDriverId())) {
log.error("文员扫描未选择司机!!");
throw new CustomerException("文员扫描未选择司机");
}
BasicdataDriverArteryEntity driverArtery = iBasicdataDriverArteryClient.getDriverArtery(distrilbutionloadingscanDTO.getDriverId());
if (null == driverArtery) {
log.error("没有司机的信息!!");
throw new CustomerException("没有司机的信息");
}
//默认为文员进行扫描,此时需要文员选择进行帮助扫描的司机
distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectDriverInfoByDeliveryIdAndDriverId(driverArtery.getId(),deliveryListEntity.getId());
}
} else {
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectDriverInfoByDeliveryId(deliveryListEntity.getId());
if (Func.isEmpty(distributionDeliveryTripartiteEntity)) {
log.error("没有司机的信息!!");
throw new CustomerException("没有司机的信息");
}
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity);
}
return distributionDeliverySelfEntity;
}
private Boolean judgeIsAbnormalLoading(Long deliveryId, DistributionParcelListEntity parcelListEntity) {
List<DistributionReservationEntity> reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId);
if (!reservationEntityList.isEmpty()) {
boolean shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shipie.getValue()));
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId());
if (shangpeiFlag) {
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList());
//查看是否存在满足条件的预约单
boolean flag = reservationEntityList.stream().anyMatch(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId()));
//存在多个,操作人指定具体客户即可
if (reservationEntities.size() == 1 && flag) {
return true;
} else {
return false;
}
} else {
shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shangpei.getValue()));
if (shangpeiFlag) {
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()) && r.getId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList());
//查询是否满足商配异常装车
boolean flag = reservationEntityList.stream().anyMatch(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName()));
if (reservationEntities.size() == 1 && flag) {
return true;
} else {
return false;
}
} else {
log.error("配送计划预约类型错误:{}", reservationEntityList);
}
}
}
return false;
}
private List<DistributionAppStockListVO> handleAppDeliveryInventory(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO, BasicdataWarehouseEntity myCurrentWarehouse) {
List<DistributionAppStockListVO> distributionAppStockListVOS = new ArrayList<>();
List<DisStockListDetailEntity> disStockListDetailEntities = baseMapper.selectInventoryListByDeliveryListId(distributionAppDeliveryListDTO.getId());
@ -8097,10 +8306,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Integer planNum = 0;
Integer scanNum = 0;
for (Long inventoryId : inventoryPackageMap.keySet()) {
if (inventoryIds.contains(inventoryId)){
if (inventoryIds.contains(inventoryId)) {
List<DisStockListDetailEntity> entityList1 = inventoryPackageMap.get(inventoryId);
planNum += entityList1.stream().mapToInt(DisStockListDetailEntity::getNum).sum();
scanNum += entityList1.stream().filter(f->InventoryLoadingStatusConstant.yizhuangche.getValue().equals(f.getStockLockingStatus())).mapToInt(DisStockListDetailEntity::getNum).sum();
scanNum += entityList1.stream().filter(f -> InventoryLoadingStatusConstant.yizhuangche.getValue().equals(f.getStockLockingStatus())).mapToInt(DisStockListDetailEntity::getNum).sum();
}
}
distributionAppStockListVO.setPlanNum(planNum);

Loading…
Cancel
Save