Browse Source

装车方式补录、配送计划订单搜索、复核签收释放未装车和未签收资源

single_db
汤建军 1 year ago
parent
commit
af0238f743
  1. 3
      blade-biz-common/src/main/java/org/springblade/common/constant/loading/LoadingStatusConstant.java
  2. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationPackageEntity.java
  3. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationStockarticleEntity.java
  4. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  5. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  6. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  7. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  8. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  9. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  10. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java
  11. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  12. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  13. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationStockarticleService.java
  14. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationStocklistService.java
  15. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java
  16. 74
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  17. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  18. 38
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationStockarticleServiceImpl.java
  19. 40
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationStocklistServiceImpl.java
  20. 59
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

3
blade-biz-common/src/main/java/org/springblade/common/constant/loading/LoadingStatusConstant.java

@ -10,7 +10,8 @@ public enum LoadingStatusConstant {
quxiao("取消","1"),
saomiao("扫描","2"),
queren("确认","3"),
yijianzhuangche("一键装车","4");
yijianzhuangche("一键装车","4"),
bulu("补录","5");
/**

6
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationPackageEntity.java

@ -89,6 +89,12 @@ public class DistributionReservationPackageEntity extends TenantEntity {
@ApiModelProperty(value = "包件状态")
private String packetBarStatus;
/**
* 包件任务取消状态 0- 1 -
*/
@ApiModelProperty(value = "包件任务取消状态 0-否 1 -是")
private Integer cancelStatus;
}

6
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationStockarticleEntity.java

@ -76,6 +76,12 @@ public class DistributionReservationStockarticleEntity extends TenantEntity {
*/
@ApiModelProperty(value = "有无数据源;1-否、2-是")
private Integer isHaveData;
/**
* 任务取消 0- 1-
*/
@ApiModelProperty(value = "任务取消 0-否 1-是")
private Integer cancelStatus;
/**
* 预留1
*/

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java

@ -395,8 +395,14 @@ public class DistributionSignforController extends BladeController {
@ApiOperation(value = "待签收数字明细详情", notes = "传入ids")
public R getNumberDetail(@RequestParam Long signingId,Integer type) {
return distributionSignforService.getNumberDetail(signingId,type);
}
@GetMapping("/isSign")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "待签收数字明细详情", notes = "传入ids")
public R isSign(@RequestParam Long signingId) {
return distributionSignforService.isSign(signingId);
}
@ -407,6 +413,8 @@ public class DistributionSignforController extends BladeController {
// /**
// * 签收管理 修改签收照片信息
// */

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

@ -156,4 +156,11 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
* @return
*/
List<DistributionParcelListEntity> getPackageListByMap(@Param("param") Map<String, Object> packageDTO,@Param("warehouseId") Long id);
/**
* 配送包件资源释放
* @param packageIds
* @return
*/
int updateOrderPackageInceptionStatus(@Param("packageIds") List<Long> packageIds);
}

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

@ -1027,6 +1027,13 @@
#{item}
</foreach>
</update>
<update id="updateOrderPackageInceptionStatus">
UPDATE logpm_distribution_parcel_list SET order_package_status = 20 , order_package_reservation_status = 10
WHERE id in
<foreach collection="packageIds" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</update>
</mapper>

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

@ -340,4 +340,12 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
* @return
*/
List<DistributionParcelListEntity> selectPackageByMap(@Param("param") Map<String, Object> packageDTO,@Param("warehouseId") Long warehouseId);
/**
* 进行包件任务取消
* @param reservationId
* @param packageIds
* @return
*/
int updatePackageDeliveryStatus(@Param("reservationId") Long reservationId,@Param("packageIds") List<Long> packageIds);
}

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

@ -84,6 +84,14 @@
<update id="cancelReservationInventory">
update logpm_dis_stock_list_detail SET stock_package_status = 2 WHERE reservation_id = #{reservationId} AND id=#{orderPackageId} and is_deleted = 0
</update>
<update id="updatePackageDeliveryStatus">
UPDATE logpm_distribution_reservation_package SET packet_bar_status = 2 ,cancel_status = 1
WHERE
reservation_id = #{reservationId} and parce_list_id in
<foreach collection="packageId" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</update>
<select id="selectDistrbutionReservationPage" resultMap="reservationResultMap">

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -572,7 +572,7 @@
ldsa.create_time,
ldsa.update_user,
ldsa.update_time,
(ldsa.incoming_num - oun.num) AS handQuantity,
(ldsa.incoming_num - IF(oun.num is null,0,oun.num)) AS handQuantity,
ldsa.status, ldsa.is_deleted, ldsa.create_dept,
ldsa.reserve1, ldsa.reserve2, ldsa.reserve3, ldsa.reserve4, ldsa.reserve5,
ldsa.service_number, ldsa.order_code,
@ -612,7 +612,9 @@
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
LEFT JOIN order_use_num AS oun ON ldsa.id = oun.stock_article_id
<where>
ldsa.order_status in ('10','20','30','70') and ldsa.reservation_status in ('10','20') AND (ldsa.incoming_num - oun.num) > 0
ldsa.order_status in ('10','20','30','70')
and ldsa.reservation_status in ('10','20')
AND (ldsa.incoming_num - IF(oun.num is null,0,oun.num)) > 0
<if test="par.warehouseId != null and par.warehouseId != '' ">
and ldsa.warehouse_id = #{par.warehouseId}
</if>

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

@ -127,4 +127,11 @@ public interface DistributionStockListMapper extends BaseMapper<DistributionStoc
* @return
*/
int updateInventoryQuantityOccupied(@Param("stockListId") Long id,@Param("reservationNum") Integer reservationNum);
/**
* 扣减对应库存品的冻结数量
* @param k
* @param size
*/
void decreaseStockListQuantityOccupied(@Param("stockListId") Long stockListId,@Param("num") int num);
}

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

@ -514,5 +514,8 @@
<update id="updateInventoryQuantityOccupied">
UPDATE logpm_distribution_stock_list SET quantity_occupied = (quantity_occupied + #{reservationNum}) WHERE id = #{stockListId}
</update>
<update id="decreaseStockListQuantityOccupied">
UPDATE logpm_distribution_stock_list SET quantity_occupied = (quantity_occupied - #{num}) WHERE id = #{stockListId}
</update>
</mapper>

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java

@ -289,4 +289,10 @@ public interface IDistributionAsyncService {
* @param warehouseId
*/
void maintenanceOrderStatus(String orderCode, Long warehouseId);
/**
* 释放当前客户能够进行资源释放的包件包含库存品
* @param reservationId
*/
void releaseSource(Long reservationId,Long warehouseId);
}

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationStockarticleService.java

@ -58,4 +58,10 @@ public interface IDistributionReservationStockarticleService extends BaseService
* @return
*/
IPage<DistributionReservationStockarticleVO> selectDistributionReservationStockarticleorderPage(IPage<DistributionReservationStockarticleVO> page, DistributionReservationStockarticleVO distributionReservationStockarticle);
/**
* 维护预约订单状态
* @param reservationId
*/
void maintenanceReservationStockArticle(Long reservationId);
}

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationStocklistService.java

@ -51,4 +51,10 @@ public interface IDistributionReservationStocklistService extends BaseService<Di
*/
List<DistributionReservationStocklistExcel> exportDistributionReservationStocklist(Map<String, Object> distributionReservationStocklist);
/**
* 维护对应客户的库存品配送计划状态
* @param reservationId
*/
void maintenanceReservationStockList(Long reservationId);
}

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

@ -235,4 +235,11 @@ public interface IDistributionSignforService extends BaseService<DistributionSig
* @param id
*/
R recheck(Long id);
/**
* 查询是否可以进行复核签收
* @param signingId
* @return
*/
R isSign(Long signingId);
}

74
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -21,6 +21,7 @@ import com.logpm.factory.mt.dto.MtReceiveDTO;
import com.logpm.factory.mt.dto.MtReceiveImagesDTO;
import com.logpm.factory.mt.feign.IMtOrderMainClinet;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.sun.xml.bind.v2.TODO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.DistributionTypeConstant;
@ -78,7 +79,9 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
private final DistributionStockupMapper distributionStockupService;
private final DistributionStockupInfoMapper distributionStockupInfoMapper;
private final DistributionReservationStockarticleMapper distributionReservationStockarticleMapper;
private final IDistributionReservationStockarticleService distributionReservationStockarticleService;
private final DistributionReservationStocklistMapper distributionReservationStocklistMapper;
private final IDistributionReservationStocklistService distributionReservationStocklistService;
private final DistributionBillLadingScanMapper distributionBillLadingScanMapper;
private final DistrilbutionBillStockMapper distrilbutionBillStockMapper;
private final DistrilbutionBillLadingMapper distrilbutionBillLadingMapper;
@ -1477,10 +1480,81 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
@Override
@Async
@Transactional
public void maintenanceOrderStatus(String orderCode, Long warehouseId) {
distributionStockArticleService.updateOrderInfo(orderCode,warehouseId);
}
@Override
@Transactional
@Async
public void releaseSource(Long reservationId,Long warehouseId) {
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(reservationId);
if (reservationEntity.getReservationNum() > 0){
//存在订单
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId);
if (Func.isNotEmpty(distributionParcelListEntities)){
List<Long> packageIds = distributionParcelListEntities.stream()
.filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) && !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()))
.map(DistributionParcelListEntity::getId)
.collect(Collectors.toList());
if (Func.isNotEmpty(packageIds)){
//对包件进行批量的修改
//将这些包件恢复到初始状态
int row = distributionParcelListMapper.updateOrderPackageInceptionStatus(packageIds);
}
//维护这些进行包件对应的订单
String orderCodes = distributionParcelListEntities.stream()
.filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) && !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()))
.map(DistributionParcelListEntity::getOrderCode)
.distinct().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(orderCodes,warehouseId);
//完成对该客户下此包件任务的取消
int row = distributionReservationMapper.updatePackageDeliveryStatus(reservationId,packageIds);
//TODO 欠缺零担的资源释放
//维护预约订单状态
distributionReservationStockarticleService.maintenanceReservationStockArticle(reservationId);
}
//存在库存品信息
if (reservationEntity.getReservationStockListNum() > 0){
//进行库存品的资源释放
List<DisStockListDetailEntity> disStockListDetailEntities = distributionReservationMapper.selectInventoryListByReservation(reservationId);
if (Func.isNotEmpty(disStockListDetailEntities)){
//未签收并且未装车
List<DisStockListDetailEntity> inventoryList = disStockListDetailEntities.stream().filter(inven -> inven.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue()) && inven.getStockLockingStatus().equals(InventorySigningStatusConstant.weiqianshou.getValue())).collect(Collectors.toList());
if (Func.isNotEmpty(inventoryList)){
Map<Long, List<DisStockListDetailEntity>> stockListMap = inventoryList.stream().collect(Collectors.groupingBy(DisStockListDetailEntity::getStockListId));
stockListMap.forEach((k,v)->{
//扣减对应批次库存品的冻结数量
distributionStockListMapper.decreaseStockListQuantityOccupied(k,v.size());
//维护对应的客户库存品的
for (DisStockListDetailEntity disStockListDetailEntity : v) {
//取消对应的库存品包件信息
disStockListDetailEntity.setStockPackageStatus(ReservationPackageStatusConstant.quxiao.getValue());
disStockListDetailService.updateById(disStockListDetailEntity);
}
});
}
}
//维护对应的库存品计划状态
distributionReservationStocklistService.maintenanceReservationStockList(reservationId);
}
}
}
private Map<String,List<MtReceiveContentDTO>> handkeBrandsPackageList(String[] split, List<DistributionStockArticleEntity> distributionStockArticleEntities, Long warehouseId,Long reservationId,String deliveryCode) {
Map<String,List<MtReceiveContentDTO>> packageList = new HashMap<>();
Map<String, List<DistributionStockArticleEntity>> orderMap = distributionStockArticleEntities.stream().collect(Collectors.groupingBy(DistributionStockArticleEntity::getBrand));

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

@ -4100,6 +4100,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
case "4":
distributionParcelListVO.setScanStatus(LoadingStatusConstant.yijianzhuangche.getName());
break;
case "5":
distributionParcelListVO.setScanStatus(LoadingStatusConstant.bulu.getName());
break;
}
distributionParcelListVO.setLoadingNub(loadscanEntity.getLoadedNub());
}

38
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationStockarticleServiceImpl.java

@ -20,21 +20,29 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.dto.DistributionReservationStockarticleDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionReservationStockarticleEntity;
import com.logpm.distribution.excel.DistributionReservationStockarticleExcel;
import com.logpm.distribution.mapper.DistributionReservationMapper;
import com.logpm.distribution.mapper.DistributionReservationStockarticleMapper;
import com.logpm.distribution.service.IDistributionReservationStockarticleService;
import com.logpm.distribution.vo.DistributionReservationStockarticleVO;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.reservation.ReservationOrderStatusConstant;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 预约订单中间表 服务实现类
@ -43,8 +51,13 @@ import java.util.Map;
* @since 2023-06-28
*/
@Service
@AllArgsConstructor
public class DistributionReservationStockarticleServiceImpl extends BaseServiceImpl<DistributionReservationStockarticleMapper, DistributionReservationStockarticleEntity> implements IDistributionReservationStockarticleService {
private final DistributionReservationMapper distributionReservationMapper;
@Override
public IPage<DistributionReservationStockarticleVO> selectDistributionReservationStockarticlePage(IPage<DistributionReservationStockarticleVO> page, DistributionReservationStockarticleVO distributionReservationStockarticle) {
return page.setRecords(baseMapper.selectDistributionReservationStockarticlePage(page, distributionReservationStockarticle));
@ -72,4 +85,29 @@ public class DistributionReservationStockarticleServiceImpl extends BaseServiceI
return page.setRecords(baseMapper.selectDistributionReservationStockarticleorderPage(page, distributionReservationStockarticle));
}
@Override
public void maintenanceReservationStockArticle(Long reservationId) {
List<DistributionReservationStockarticleEntity> reservationStockarticleEntities = this.list(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, reservationId)
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(reservationStockarticleEntities)){
List<DistributionReservationStockarticleEntity> reservationOrderList = reservationStockarticleEntities.stream().filter(order -> order.getIsZero().equals(IsOrNoConstant.no.getValue())).collect(Collectors.toList());
if (Func.isNotEmpty(reservationOrderList)){
for (DistributionReservationStockarticleEntity reservationStockarticleEntity : reservationOrderList) {
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, reservationStockarticleEntity.getStockArticleId());
if (Func.isNotEmpty(distributionParcelListEntities)){
int sum = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
if (sum == 0){
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
//标识任务取消
reservationStockarticleEntity.setCancelStatus(1);
this.updateById(reservationStockarticleEntity);
}
}
}
}
}
}
}

40
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationStocklistServiceImpl.java

@ -20,19 +20,29 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.dto.DistributionReservationStocklistDTO;
import com.logpm.distribution.entity.DisStockListDetailEntity;
import com.logpm.distribution.entity.DistributionReservationStocklistEntity;
import com.logpm.distribution.excel.DistributionReservationStocklistExcel;
import com.logpm.distribution.mapper.DistributionReservationStocklistMapper;
import com.logpm.distribution.service.IDisStockListDetailService;
import com.logpm.distribution.service.IDistributionReservationStocklistService;
import com.logpm.distribution.vo.DistributionReservationStocklistVO;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.reservation.ReservationInventoryStatusConstant;
import org.springblade.common.constant.reservation.ReservationPackageStatusConstant;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 预约库存中间表 服务实现类
@ -43,6 +53,11 @@ import java.util.Map;
@Service
public class DistributionReservationStocklistServiceImpl extends BaseServiceImpl<DistributionReservationStocklistMapper, DistributionReservationStocklistEntity> implements IDistributionReservationStocklistService {
@Autowired
@Lazy
private IDisStockListDetailService disStockListDetailService;
@Override
public IPage<DistributionReservationStocklistVO> selectDistributionReservationStocklistPage(IPage<DistributionReservationStocklistVO> page, DistributionReservationStocklistVO distributionReservationStocklist) {
return page.setRecords(baseMapper.selectDistributionReservationStocklistPage(page, distributionReservationStocklist));
@ -64,4 +79,29 @@ public class DistributionReservationStocklistServiceImpl extends BaseServiceImpl
return distributionReservationStocklistList;
}
@Override
public void maintenanceReservationStockList(Long reservationId) {
List<DistributionReservationStocklistEntity> reservationStocklistEntityList = this.list(Wrappers.<DistributionReservationStocklistEntity>query().lambda()
.eq(DistributionReservationStocklistEntity::getReservationId, reservationId)
);
if (Func.isNotEmpty(reservationStocklistEntityList)){
//过滤计划中已经进行取消标识的库存品
List<DistributionReservationStocklistEntity> reservationStocklistEntities = reservationStocklistEntityList.stream().filter(rs -> !rs.getStockListStatus().equals(ReservationInventoryStatusConstant.quxiao.getValue())).collect(Collectors.toList());
if (Func.isNotEmpty(reservationStocklistEntities)){
for (DistributionReservationStocklistEntity r : reservationStocklistEntities) {
//查询对应库存品是否存在
List<DisStockListDetailEntity> detailEntities = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, reservationId)
.eq(DisStockListDetailEntity::getStockListId, r.getStocklistId())
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (detailEntities.size() ==0 || detailEntities.isEmpty()){
r.setStockListStatus(ReservationInventoryStatusConstant.quxiao.getValue());
this.updateById(r);
}
}
}
}
}
}

59
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -429,11 +429,17 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
@Override
@Transactional
public R recheck(Long id) {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)) {
return R.fail(403, "未授权!!!");
}
if (Func.isEmpty(id)){
log.error("参数缺失,signforId:{}",id);
return null;
}
DistributionSignforEntity distributionSignfor = this.getById(id);
BladeUser user = AuthUtil.getUser();
distributionSignfor.setExamineUserId(user.getUserId());
@ -441,9 +447,62 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionSignfor.setExamineUserName(user.getNickName());
this.updateById(distributionSignfor);
distributionAsyncService.sendReviewFactory(id, myCurrentWarehouse.getId());
//还需要对未装车未签收的包件进行状态的回退
boolean flag = this.judgmentSignIsHavePackage(distributionSignfor.getReservationId());
if (!flag){
distributionAsyncService.releaseSource(distributionSignfor.getReservationId(), myCurrentWarehouse.getId());
}
return R.success("操作成功");
}
@Override
public R isSign(Long signingId) {
String method = "#####################DistributionSignforServiceImpl类,方法isSign";
if (Func.isEmpty(signingId)){
log.error(method+"参数缺失:{}",signingId);
return null;
}
DistributionSignforEntity signforEntity = this.getById(signingId);
if (Objects.isNull(signforEntity)){
log.error(method+"查询签收失败,signingId:{}",signingId);
return null;
}
Integer isHaveAbnormalPackage = signforEntity.getIsHaveAbnormalPackage();
//判断该签收是否存在待审核的异常包件
if (isHaveAbnormalPackage == 2){
return R.data(200,"存在异常包件","存在异常包件");
}
//判断该客户是否具备进行复核
//需要满足条件,存在包件或者以备货库存品未装车和签收
boolean flag = judgmentSignIsHavePackage(signforEntity.getReservationId());
if (flag){
//该客户的包件和库存品都进行装车、签收
return R.data(200,"直接进行复核操作","直接进行复核操作");
}else {
//存在满足进行资源释放的包件,返回前端进行提示确认后
return R.data(200,"此任务存在未完成包件,请确认","此任务存在未完成包件,请确认");
}
}
private boolean judgmentSignIsHavePackage(Long reservationId) {
boolean flag = false;
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId);
//判断计划内的包件是否都进行签收了
if (Func.isNotEmpty(distributionParcelListEntities)){
flag = distributionParcelListEntities.stream().allMatch(p->p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue()));
}
List<DisStockListDetailEntity> disStockListDetailEntities = distributionReservationMapper.selectInventoryListByReservation(reservationId);
if (Func.isNotEmpty(disStockListDetailEntities)){
flag = disStockListDetailEntities.stream().allMatch(p->p.getStockSignfoStatus().equals(InventorySigningStatusConstant.yiqianshou.getValue()));
}
return flag;
}
private List<DistributionNumberDetailDTO> deliveryUnsigningInventoryNumberDetail(List<DisStockListDetailEntity> disStockListDetailEntities) {
List<DisStockListDetailEntity> unsignInventoryList = disStockListDetailEntities.stream().filter(p -> p.getStockSignfoStatus().equals(InventorySigningStatusConstant.yiqianshou.getValue())).collect(Collectors.toList());
if (Func.isEmpty(unsignInventoryList)) {

Loading…
Cancel
Save