Browse Source

PDA增加托盘详情,整托备货,修复订制品包件备货BUG

fix-sign
汤建军 3 months ago
parent
commit
95be20e18e
  1. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java
  2. 1
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpClientVO.java
  3. 10
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpScanDetailVO.java
  4. 41
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpTrayDetailVO.java
  5. 27
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java
  6. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  7. 40
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  8. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  9. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java
  10. 41
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  11. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java
  12. 204
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java

@ -204,4 +204,7 @@ public class DistributionStockEntity extends TenantEntity {
@ApiModelProperty(value = "取消操作人")
private String cancelUser;
@ApiModelProperty(value = "是否整托备货 0-否 1-是")
private Integer isTray;
}

1
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpClientVO.java

@ -49,6 +49,7 @@ public class DistributionAppStockUpClientVO implements Serializable {
private List<DistributionAppStockUpInventoryDetailVO> stockUpInventoryDetailVOList;
private List<DistributionAppStockUpZeroOrderDetailVO> stockUpZeroOrderDetailVOList;
private List<DistributionAppStockUpPackageDetailVO> deliveryPackageDetailList;
private List<DistributionAppStockUpTrayDetailVO> deliveryTrayList;

10
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpScanDetailVO.java

@ -31,12 +31,10 @@ import java.util.List;
public class DistributionAppStockUpScanDetailVO implements Serializable {
private static final long serialVersionUID = 1L;
private Long Id;
private String orderPackageCode;
private String typeName;
private String goodsName;
private String orderCode;
private String stockupAllocation;
private String trayName;
private String trayCode;
private Integer planNum;
private Integer scanNum;
}

41
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockUpTrayDetailVO.java

@ -0,0 +1,41 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.vo.app;
import lombok.Data;
import java.io.Serializable;
/**
* 在库订单包件清单 视图实体类
*
* @author cyz
* @since 2023-06-13
*/
@Data
public class DistributionAppStockUpTrayDetailVO implements Serializable {
private Long orderId;
private Long packageId;
private String waybillNumber;
private String orderCode;
private String categoryName;
private Integer planNum;
private String scanNum;
}

27
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionStockupAppController.java

@ -1113,9 +1113,6 @@ public class DistributionStockupAppController extends BladeController {
if (Objects.isNull(stockupDTO.getReservationId())){
return R.fail("stockupDTO.getReservationId()参数缺失");
}
if (Objects.isNull(stockupDTO.getOrderId())){
return R.fail("stockupDTO.getOrderId()参数缺失");
}
if (Objects.isNull(stockupDTO.getTypeService())){
return R.fail("stockupDTO.getTypeService()参数缺失");
}
@ -1132,6 +1129,30 @@ public class DistributionStockupAppController extends BladeController {
}
}
@ResponseBody
@PostMapping("/trayDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "客户订单包件列表", notes = "传入stockupDTO")
public R trayDetail(@RequestBody StockupDTO stockupDTO) {
if (Objects.isNull(stockupDTO.getReservationId())){
return R.fail("stockupDTO.getReservationId()参数缺失");
}
if (Objects.isNull(stockupDTO.getTypeService())){
return R.fail("stockupDTO.getTypeService()参数缺失");
}
String typeService = stockupDTO.getTypeService();
Long orderId = stockupDTO.getOrderId();
Long reservationId = stockupDTO.getReservationId();
switch (typeService){
case "1": case "2":
return distributionStockupService.handleDeliveryTrayDetailList(reservationId);
case "3":
return distributionStockupService.handleBillTrayDetailList(reservationId);
default:
return R.fail("未知的typeService");
}
}
@ResponseBody
@PostMapping("/stockupScan")
@ApiOperationSupport(order = 1)

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java

@ -26,9 +26,11 @@ import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistributionReservationExcel;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.DistributionAppStockUpTrayDetailVO;
import com.logpm.oldproject.dto.SignPushDataContactDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.tool.api.R;
import java.util.List;
import java.util.Map;
@ -438,4 +440,12 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
* @return
*/
Integer getZeroPackagePlanNum(@Param("orderId")Long orderId,@Param("reservationId") Long reservationId,@Param("packageId") Long packageId);
/**
* 查询商市配可备货托盘
* @param reservationId
* @return
*/
List<DistributionAppStockUpTrayDetailVO> deliveryTrayDetailList(@Param("reservationId") Long reservationId);
}

40
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -72,6 +72,46 @@
WHERE
reservation_id = #{reservationId} AND parce_list_id = #{packageId}
</delete>
<select id="deliveryTrayDetailList" resultType="com.logpm.distribution.vo.app.DistributionAppStockUpScanDetailVO" >
SELECT
t.trayName,
t.trayCode,
t.planNum,
t.scanNum,
SUM( lwtg.num )
FROM
(
SELECT
ldpl.pallet AS trayName,
lwt.pallet_code AS trayCode,
IFNULL( sum( ldpl.quantity ), 0 ) AS planNum,
ldpl.warehouse_id,
IFNULL( SUM( lds.stock_quantity ), 0 ) AS scanNum
FROM
logpm_distribution_reservation_package AS ldrp
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldpl.id = ldrp.parce_list_id AND ldpl.is_deleted = 0 AND ldpl.is_transfer = 0
LEFT JOIN logpm_warehouse_tray AS lwt ON ldpl.pallet = lwt.pallet_name
AND lwt.warehouse_id = ldpl.warehouse_id
LEFT JOIN logpm_distribution_stock AS lds ON lds.reservation_id = ldrp.reservation_id
AND lds.type = 1
AND lds.outbound_type != 3
AND lds.cancel_status != 1
WHERE
ldrp.is_deleted = 0 AND ldrp.packet_bar_status != 2
AND ldrp.reservation_id = #{reservationId}
GROUP BY
ldpl.pallet
HAVING
IFNULL( sum( ldpl.quantity ), 0 ) > 0
) AS t
LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON lwtg.tray_code = t.trayCode
AND lwtg.is_deleted = 0
AND lwtg.warehouse_id = t.warehouse_id
GROUP BY
lwtg.tray_id
HAVING
t.planNum >= SUM( lwtg.num )
</select>
<update id="cancelReservationZeroPackage">
UPDATE logpm_distribution_reservation_zero_package AS ldrzp
SET ldrzp.quantity = ( ldrzp.quantity - #{retentionQuantity})

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

@ -2347,7 +2347,7 @@
WHERE
ldrp.is_deleted = 0
AND ldrp.packet_bar_status != 2
AND ldrp.reservation_id = #{reservationId} AND ldrp.stock_article_id = #{orderId}
AND ldrp.reservation_id = #{reservationId}
</select>
<select id="selectBillPackageDetailList"
resultType="com.logpm.distribution.vo.app.DistributionAppStockUpPackageDetailVO">
@ -2368,7 +2368,7 @@
WHERE
ldbp.is_deleted = 0
AND ldbp.packet_bar_status != 2
AND ldbp.bill_lading_id = #{billId} AND ldbp.stock_article_id = #{orderId}
AND ldbp.bill_lading_id = #{billId}
</select>
</mapper>

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java

@ -25,6 +25,7 @@ import com.logpm.distribution.dto.app.BillLadingAppDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.DistributionAppStockUpTrayDetailVO;
import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingDetailVO;
import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingOrderMainVO;
import com.logpm.oldproject.dto.SignPushDataContactDTO;
@ -214,7 +215,7 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper<DistrilbutionB
List<DisStockListDetailEntity> selectInventoryListByBill(@Param("billId")Long billId);
List<DistributionAppStockUpTrayDetailVO> billTrayDetailList(@Param("billId")Long billId);
// Page<DistrilbutionBillLadingAppVO> getInventoryPage(IPage<Object> page, DistrilbutionBillLadingEntity distrilbutionBillLadingEntity);

41
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml

@ -1124,6 +1124,47 @@
<select id="selectInventoryListByBill" resultType="com.logpm.distribution.entity.DisStockListDetailEntity">
SELECT * FROM logpm_dis_stock_list_detail WHERE reservation_id = #{billId} AND stock_package_status != 2
</select>
<select id="billTrayDetailList"
resultType="com.logpm.distribution.vo.app.DistributionAppStockUpTrayDetailVO">
SELECT
t.trayName,
t.trayCode,
t.planNum,
t.scanNum,
SUM( lwtg.num )
FROM
(
SELECT
ldpl.pallet AS trayName,
lwt.pallet_code AS trayCode,
IFNULL( sum( ldpl.quantity ), 0 ) AS planNum,
ldpl.warehouse_id,
IFNULL( SUM( lds.stock_quantity ), 0 ) AS scanNum
FROM
logpm_distrilbution_bill_package AS ldbp
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldpl.id = ldbp.parce_list_id AND ldpl.is_deleted = 0 AND ldpl.is_transfer = 0
LEFT JOIN logpm_warehouse_tray AS lwt ON ldpl.pallet = lwt.pallet_name
AND lwt.warehouse_id = ldpl.warehouse_id
LEFT JOIN logpm_distribution_stock AS lds ON lds.reservation_id = ldbp.bill_lading_id
AND lds.type = 1
AND lds.outbound_type = 3
AND lds.cancel_status != 1
WHERE
ldbp.is_deleted = 0 AND ldbp.packet_bar_status != 2
AND ldbp.bill_lading_id = #{billId}
GROUP BY
ldpl.pallet
HAVING
IFNULL( sum( ldpl.quantity ), 0 ) > 0
) AS t
LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON lwtg.tray_code = t.trayCode
AND lwtg.is_deleted = 0
AND lwtg.warehouse_id = t.warehouse_id
GROUP BY
lwtg.tray_id
HAVING
t.planNum >= SUM( lwtg.num )
</select>
</mapper>

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java

@ -421,4 +421,18 @@ public interface IDistributionStockupService extends BaseService<DistributionSto
R cancelStock(StockupDTO stockupDTO);
boolean judgeIsPickingStaff(BladeUser user);
/**
* 查询客货下可备货托盘
* @param reservationId
* @return
*/
R handleDeliveryTrayDetailList(Long reservationId);
/**
* 查询自提托盘备货详情列表
* @param reservationId
* @return
*/
R handleBillTrayDetailList(Long reservationId);
}

204
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -105,14 +105,7 @@ import com.logpm.distribution.vo.DistributionStockupTrayVO;
import com.logpm.distribution.vo.DistributionStockupVO;
import com.logpm.distribution.vo.PackageStockupVO;
import com.logpm.distribution.vo.StockListInfoListVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpClientVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpInventoryConfiglVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpInventoryDetailVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpOrderDetailVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpPackageDetailVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpScanDetailVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpVO;
import com.logpm.distribution.vo.app.DistributionAppStockUpZeroOrderDetailVO;
import com.logpm.distribution.vo.app.*;
import com.logpm.distribution.wrapper.DistributionStockupWrapper;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity;
@ -1985,8 +1978,6 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
return Resp.scanFail(PdaAudioLingoStatus.baojianbucunzai.getName(), PdaAudioLingoStatus.baojianbucunzai.getName());
}
//查询托盘上面的包件
List<WarehouseTrayGoodsEntity> trayIdList = warehouseTrayGoodsClient.getTrayIdList(stockupDTO.getTrayId(), stockupDTO.getTrayBarCode());
List<DistributionStockPackageVO> voList = new ArrayList<>();
List<DistributionStockPackageVO> finalList = list;
@ -4651,12 +4642,96 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
case 3:
//配送零担备货
return handleDeliveryZeroStockUp(stockupDTO, myCurrentWarehouse, reservationId, stockupEntity);
case 4:
//配送零担备货
return handleDeliveryTrayStockUp(stockupDTO, myCurrentWarehouse, reservationId, stockupEntity);
default:
log.error(method + "未知scanType");
return Resp.scanFail("未知操作类型", "未知操作类型");
}
}
private R handleDeliveryTrayStockUp(StockupDTO stockupDTO, BasicdataWarehouseEntity myCurrentWarehouse, Long reservationId, DistributionStockupEntity stockupEntity) {
String method = "#######################DistributionStockupServiceImpl.handleDeliveryTrayStockUp";
if (Objects.isNull(stockupDTO.getTrayBarCode())){
log.info(method+"参数缺失>>>>>>>>>>>>>>>>>>stockupDTO.getOrderId()");
return R.fail("参数缺失,请联系管理员");
}
if (Objects.isNull(AuthUtil.getUser())){
log.info(method+"参数缺失>>>>>>>>>>>>>>>>>>AuthUtil.getUser():{}",AuthUtil.getUser());
return R.fail("请重新登陆后操作");
}
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
if (Objects.isNull(reservationEntity)) {
return Resp.scanFail("当前计划信息错误", "当前计划信息错误");
}
BladeUser user = AuthUtil.getUser();
//校验托盘
BasicdataTrayEntity trayByTrayCode = basicdataTrayClient.getTrayByTrayCode(stockupDTO.getTrayBarCode());
if (Objects.isNull(trayByTrayCode)){
log.info(method+"当前托盘信息不存在>>>>>>>>>>>>>>>>>>当前托盘信息不存在:{}",AuthUtil.getUser());
return R.fail("当前托盘信息不存在");
}
//查询当前托盘上货物是否都存在计划内
List<WarehouseTrayGoodsEntity> trayIdList = warehouseTrayGoodsClient.getTrayIdList(String.valueOf(trayByTrayCode.getId()), trayByTrayCode.getPalletCode());
if (trayIdList.isEmpty()) {
return R.fail("当前托盘无货物信息");
}
boolean isAllPackage = trayIdList.stream().allMatch(a -> "3".equals(a.getAssociationType()));
if (!isAllPackage) {
return R.fail("当前托盘存在其他类型货物");
}
//查询计划包件信息
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId);
if (distributionParcelListEntities.isEmpty()) {
log.info(method+"查询预约包件计划信息错误>>>>>>>>>>>>>>>>>>>>>>reservationId:{}",reservationId);
return R.fail("查询计划信息错误");
}
List<Long> trayPackageIds = trayIdList.stream().map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList());
List<DistributionParcelListEntity> packageData = distributionParcelListEntities.stream().filter(f -> trayPackageIds.contains(f.getId())).collect(Collectors.toList());
if (packageData.isEmpty()) {
return R.fail("当前托盘无此客户的货物");
}
warehouseUpdownTypeClient.downTray(trayByTrayCode.getPalletCode(),myCurrentWarehouse.getId());
//生成扫描数据
List<DistributionStockEntity> stockEntityList = generateDeliveryTrayPackageStockEntity(reservationEntity,packageData,myCurrentWarehouse,user,stockupDTO.getStockupId());
if (!stockEntityList.isEmpty()) {
distributionStockService.saveBatch(stockEntityList);
}
return Resp.scanSuccess("操作成功"," ");
}
private List<DistributionStockEntity> generateDeliveryTrayPackageStockEntity(DistributionReservationEntity reservationEntity,
List<DistributionParcelListEntity> packageData,
BasicdataWarehouseEntity warehouse,
BladeUser user,
Long stockUpId) {
List<DistributionStockEntity> list= new ArrayList<>();
for (DistributionParcelListEntity parcelListEntity : packageData) {
DistributionStockEntity distributionStockEntity = new DistributionStockEntity();
distributionStockEntity.setWarehouseId(warehouse.getId());
distributionStockEntity.setWarehouseName(warehouse.getName());
distributionStockEntity.setReservationId(reservationEntity.getId());
distributionStockEntity.setReservationCode(reservationEntity.getReservationCode());
distributionStockEntity.setStockQuantity(parcelListEntity.getQuantity());
distributionStockEntity.setOrderSelfNumbering(parcelListEntity.getOrderCode());
distributionStockEntity.setStockArticle(parcelListEntity.getStockArticleId());
distributionStockEntity.setParcelListId(parcelListEntity.getId());
distributionStockEntity.setCoding(parcelListEntity.getOrderPackageCode());
distributionStockEntity.setOutboundType(reservationEntity.getDeliveryType());
distributionStockEntity.setStockupId(stockUpId);
distributionStockEntity.setGoodsName(parcelListEntity.getThirdProduct());
distributionStockEntity.setType(1);
distributionStockEntity.setMaterialId(parcelListEntity.getMaterialId());
distributionStockEntity.setMarketId(reservationEntity.getMallId());
distributionStockEntity.setScanUser(user.getNickName());
distributionStockEntity.setIsTray(Integer.parseInt(IsOrNoConstant.yes.getValue()));
list.add(distributionStockEntity);
}
return list;
}
/**
*
* @param stockupDTO
@ -5172,12 +5247,96 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
case 3:
//零担
return handleBillZeroStockUp(stockupDTO, myCurrentWarehouse, reservationId, stockupEntity);
case 4:
//零担
return handleBilltrayStockUp(stockupDTO, myCurrentWarehouse, reservationId, stockupEntity);
default:
log.error(method + "未知scanType");
return Resp.scanFail("未知操作类型", "未知操作类型");
}
}
private R handleBilltrayStockUp(StockupDTO stockupDTO, BasicdataWarehouseEntity myCurrentWarehouse, Long reservationId, DistributionStockupEntity stockupEntity) {
String method = "#######################DistributionStockupServiceImpl.handleBilltrayStockUp";
if (Objects.isNull(stockupDTO.getTrayBarCode())){
log.info(method+"参数缺失>>>>>>>>>>>>>>>>>>stockupDTO.getTrayBarCode()");
return R.fail("参数缺失,请联系管理员");
}
if (Objects.isNull(AuthUtil.getUser())){
log.info(method+"参数缺失>>>>>>>>>>>>>>>>>>AuthUtil.getUser():{}",AuthUtil.getUser());
return R.fail("请重新登陆后操作");
}
DistrilbutionBillLadingEntity billLadingEntity = distrilbutionBillLadingService.getById(reservationId);
if (Objects.isNull(billLadingEntity)) {
return Resp.scanFail("当前计划信息错误", "当前计划信息错误");
}
BladeUser user = AuthUtil.getUser();
//校验托盘
BasicdataTrayEntity trayByTrayCode = basicdataTrayClient.getTrayByTrayCode(stockupDTO.getTrayBarCode());
if (Objects.isNull(trayByTrayCode)){
log.info(method+"当前托盘信息不存在>>>>>>>>>>>>>>>>>>当前托盘信息不存在:{}",AuthUtil.getUser());
return R.fail("当前托盘信息不存在");
}
//查询当前托盘上货物是否都存在计划内
List<WarehouseTrayGoodsEntity> trayIdList = warehouseTrayGoodsClient.getTrayIdList(String.valueOf(trayByTrayCode.getId()), trayByTrayCode.getPalletCode());
if (trayIdList.isEmpty()) {
return R.fail("当前托盘无货物信息");
}
boolean isAllPackage = trayIdList.stream().allMatch(a -> "3".equals(a.getAssociationType()));
if (!isAllPackage) {
return R.fail("当前托盘存在其他类型货物");
}
//查询计划包件信息
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId);
if (distributionParcelListEntities.isEmpty()) {
log.info(method+"查询预约包件计划信息错误>>>>>>>>>>>>>>>>>>>>>>reservationId:{}",reservationId);
return R.fail("查询计划信息错误");
}
List<Long> trayPackageIds = trayIdList.stream().map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList());
List<DistributionParcelListEntity> packageData = distributionParcelListEntities.stream().filter(f -> trayPackageIds.contains(f.getId())).collect(Collectors.toList());
if (packageData.isEmpty()) {
return R.fail("当前托盘无此客户的货物");
}
warehouseUpdownTypeClient.downTray(trayByTrayCode.getPalletCode(),myCurrentWarehouse.getId());
//生成扫描数据
List<DistributionStockEntity> stockEntityList = generateBillTrayPackageStockEntity(billLadingEntity,packageData,myCurrentWarehouse,user,stockupDTO.getStockupId());
if (!stockEntityList.isEmpty()) {
distributionStockService.saveBatch(stockEntityList);
}
return Resp.scanSuccess("操作成功"," ");
}
private List<DistributionStockEntity> generateBillTrayPackageStockEntity(DistrilbutionBillLadingEntity billLadingEntity,
List<DistributionParcelListEntity> packageData,
BasicdataWarehouseEntity myCurrentWarehouse,
BladeUser user,
Long stockupId) {
List<DistributionStockEntity> list= new ArrayList<>();
for (DistributionParcelListEntity parcelListEntity : packageData) {
DistributionStockEntity distributionStockEntity = new DistributionStockEntity();
distributionStockEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionStockEntity.setWarehouseName(myCurrentWarehouse.getName());
distributionStockEntity.setReservationId(billLadingEntity.getId());
distributionStockEntity.setReservationCode(billLadingEntity.getPickupBatch());
distributionStockEntity.setStockQuantity(parcelListEntity.getQuantity());
distributionStockEntity.setOrderSelfNumbering(parcelListEntity.getOrderCode());
distributionStockEntity.setStockArticle(parcelListEntity.getStockArticleId());
distributionStockEntity.setParcelListId(parcelListEntity.getId());
distributionStockEntity.setCoding(parcelListEntity.getOrderPackageCode());
distributionStockEntity.setOutboundType("3");
distributionStockEntity.setStockupId(stockupId);
distributionStockEntity.setGoodsName(parcelListEntity.getThirdProduct());
distributionStockEntity.setType(1);
distributionStockEntity.setMaterialId(parcelListEntity.getMaterialId());
distributionStockEntity.setMarketId(billLadingEntity.getClientId());
distributionStockEntity.setScanUser(user.getNickName());
distributionStockEntity.setIsTray(Integer.parseInt(IsOrNoConstant.yes.getValue()));
list.add(distributionStockEntity);
}
return list;
}
private R handleBillZeroStockUp(StockupDTO stockupDTO, BasicdataWarehouseEntity myCurrentWarehouse, Long reservationId, DistributionStockupEntity stockupEntity) {
String method = "#######################DistributionStockupServiceImpl.handleDeliveryZeroStockUp";
if (Objects.isNull(stockupDTO.getOrderId())){
@ -5392,9 +5551,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
List<DistributionAppStockUpZeroOrderDetailVO> stockUpZeroOrderDetailVOList = this.handleStockupDeliveryZeroOrder(reservationEntity);
if (!stockUpZeroOrderDetailVOList.isEmpty()) {
stockUpClientVO.setStockUpZeroOrderDetailVOList(stockUpZeroOrderDetailVOList);
}
//零担
break;
}
default:
log.info("未知orderStatus>>>>>>>>>>>>>>orderStatus:{}",orderStatus);
}
break;
case "3":
@ -5426,6 +5586,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
stockUpClientVO.setStockUpZeroOrderDetailVOList(stockupBillZeroOrder);
}
break;
default:
log.info("未知orderStatus>>>>>>>>>>>>>>orderStatus:{}",orderStatus);
}
break;
default:
@ -5435,6 +5597,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
return R.data(stockUpClientVO);
}
@Override
public void maintainDeliveryStockUpEntity(Long stockupId) {
//查询此备货任务所关联的包件信息
@ -5892,6 +6056,17 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
return false;
}
@Override
public R handleDeliveryTrayDetailList(Long reservationId) {
return R.data(distributionReservationMapper.deliveryTrayDetailList(reservationId));
}
@Override
public R handleBillTrayDetailList(Long reservationId) {
return R.data(distrilbutionBillLadingMapper.billTrayDetailList(reservationId));
}
/**
* 自提库存品备货
*
@ -6430,6 +6605,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionReservationPackageEntity::getPacketBarCode, packetBarCode)
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (!packageEntityList.isEmpty()) {
return Resp.scanFail("无此备货计划","无此备货计划");
}
if (packageEntityList.size() > 1) {
return Resp.scanFail("当前包件计划重复", "当前包件计划重复");
}

Loading…
Cancel
Save