Browse Source

add:

1.修改备货
dist.1.3.0
pref_mail@163.com 7 months ago
parent
commit
16aedeada7
  1. 6
      blade-biz-common/src/main/java/org/springblade/common/model/ReservationVO.java
  2. 12
      blade-biz-common/src/main/java/org/springblade/common/model/StockUpVO.java
  3. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java
  4. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java
  5. 94
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

6
blade-biz-common/src/main/java/org/springblade/common/model/ReservationVO.java

@ -77,11 +77,7 @@ public class ReservationVO {
private String deliveryType;
/**
* 预约数据列表
* 包含包件 零担 库存破
*/
private List<PackageData> packageDataList;

12
blade-biz-common/src/main/java/org/springblade/common/model/StockUpVO.java

@ -31,9 +31,17 @@ public class StockUpVO implements Serializable {
*/
private String stockupArea;
/**
* 备货的预约单对象
* 关联单号
*/
private ReservationVO reservationVO;
private String referenceCode;
/**
* 预约数据列表
* 包含包件 零担 库存破
*/
private List<PackageData> packageDataList;
}

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

@ -20,10 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.app.StockConfigInfoVO;
import com.logpm.distribution.dto.app.StockupDTO;
import com.logpm.distribution.dto.app.StockupZeroDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.entity.DistributionStockupEntity;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistributionCityExcel;
import com.logpm.distribution.excel.DistributionMarketExcel;
import com.logpm.distribution.excel.DistributionSelfExcel;
@ -320,5 +317,5 @@ public interface IDistributionStockupService extends BaseService<DistributionSto
*/
R stockupScanByStock(StockupDTO stockupDTO);
NodeFanoutMsg<StockUpVO> buildStockUpNodeData(DistributionStockupEntity distributionStockupEntity, DistributionReservationEntity reservationEntity, List<DistributionParcelListEntity> parcelListEntitys);
NodeFanoutMsg<StockUpVO> buildStockUpNodeData(DistributionStockupEntity distributionStockupEntity, DistributionStockEntity entity ,DistributionParcelListEntity parcelListEntitys);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java

@ -308,9 +308,7 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
// 备货作业节点
DistributionStockupEntity distributionStockupEntity = distributionStockupMapper.selectById(distributionStocks.getStockupId());
List<DistributionParcelListEntity> datas = new ArrayList<>();
datas.add(byId);
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = distributionStockupService.buildStockUpNodeData(distributionStockupEntity,reservationEntity, datas);
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = distributionStockupService.buildStockUpNodeData(distributionStockupEntity, stockEntity,byId);
if (ObjectUtils.isNotNull(nodeFanoutMsg)) {
distributionNodeWorkService.planStock(nodeFanoutMsg, AuthUtil.getUser());
}

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

@ -1874,7 +1874,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
log.warn("预约信息不存在!");
return Resp.scanFail(PdaAudioLingoStatus.yuyuebuzai.getName(), PdaAudioLingoStatus.yuyuebuzai.getName());
}
if (list.size() < 1) {
if (list.isEmpty()) {
log.warn("包件信息不存在!");
return Resp.scanFail(PdaAudioLingoStatus.baojianbucunzai.getName(), PdaAudioLingoStatus.baojianbucunzai.getName());
}
@ -1963,6 +1963,13 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
distributionStock.setStockQuantity(1);
distributionStock.setCoding(i.getPacketBarCode());
list1.add(distributionStock);
// 备货作业节点
DistributionParcelListEntity distributionParcelListEntitie = distributionParcelListService.getById(i.getParcelListId());
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeData(distributionStockupEntity,distributionStock, distributionParcelListEntitie);
if (ObjectUtils.isNotNull(nodeFanoutMsg)) {
distributionNodeWorkService.planStock(nodeFanoutMsg, AuthUtil.getUser());
}
}
});
if (!fa.get()) {
@ -2026,15 +2033,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (!list1.isEmpty()) {
List<Long> collect = list1.stream().map(DistributionStockEntity::getParcelListId).collect(Collectors.toList());
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.listByIds(collect);
// List<Long> collect = list1.stream().map(DistributionStockEntity::getParcelListId).collect(Collectors.toList());
// List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.listByIds(collect);
// 查询预约单、
DistributionReservationEntity reservationEntity = distributionReservationService.getById(stockupDTO.getReservationId());
// 备货作业节点
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeData(distributionStockupEntity,reservationEntity, distributionParcelListEntities);
if (ObjectUtils.isNotNull(nodeFanoutMsg)) {
distributionNodeWorkService.planStock(nodeFanoutMsg, AuthUtil.getUser());
}
// DistributionReservationEntity reservationEntity = distributionReservationService.getById(stockupDTO.getReservationId());
}
@ -3884,11 +3888,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
distributionParcelListService.updateById(parcelListEntity);
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
parcelListEntity = distributionParcelListService.getById(entity.getParcelListId());
List<DistributionParcelListEntity> ls = new ArrayList<>();
ls.add(parcelListEntity);
// 备货作业节点
DistributionReservationEntity reservationEntity = distributionReservationService.getById(stockupDTO.getReservationId());
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeData(distributionStockupEntity,reservationEntity, ls);
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeData(distributionStockupEntity,entity, parcelListEntity);
if (ObjectUtils.isNotNull(nodeFanoutMsg)) {
distributionNodeWorkService.planStock(nodeFanoutMsg, user);
}
@ -4267,22 +4268,27 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
entity.setTenantId(AuthUtil.getTenantId());
distributionStockService.save(entity);
//这里尝试修改备货库存品包件的备货状态
boolean update = distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, entity.getCoding())
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
.eq(DistributionParcelListEntity::getConditions, "2")
.eq(DistributionParcelListEntity::getMaterialId, entity.getMaterialId())
.eq(entity.getStockArticle() != null, DistributionParcelListEntity::getStockArticleId, entity.getStockArticle())
.set(DistributionParcelListEntity::getOrderPackageStockupStatus, OrderPackageStockupStatusConstant.yibeihu.getValue())
);
DistributionStockListEntity distributionStockListEntity = distributionStockListService.getById(stockupDTO.getStockListId());
if(distributionStockListEntity!=null && "1".equals(distributionStockListEntity.getSourceType())){
//这里尝试修改备货库存品包件的备货状态
boolean update = distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, entity.getCoding())
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
.eq(DistributionParcelListEntity::getConditions, "2")
.eq(DistributionParcelListEntity::getMaterialId, entity.getMaterialId())
.eq(entity.getStockArticle() != null, DistributionParcelListEntity::getStockArticleId, entity.getStockArticle())
.set(DistributionParcelListEntity::getOrderPackageStockupStatus, OrderPackageStockupStatusConstant.yibeihu.getValue())
);
}
// todo 这里需要完善
// 备货作业节点
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeDataByStock(stockupEntity,reservationEntity, entity);
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeDataByStock(stockupEntity, entity);
if (ObjectUtils.isNotNull(nodeFanoutMsg)) {
distributionNodeWorkService.planStock(nodeFanoutMsg, AuthUtil.getUser());
}
@ -4340,7 +4346,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
@Override
public NodeFanoutMsg<StockUpVO> buildStockUpNodeData(DistributionStockupEntity distributionStockupEntity, DistributionReservationEntity reservationEntity, List<DistributionParcelListEntity> parcelListEntitys) {
public NodeFanoutMsg<StockUpVO> buildStockUpNodeData(DistributionStockupEntity distributionStockupEntity, DistributionStockEntity entity ,DistributionParcelListEntity parcelListEntitys) {
try {
BladeUser user = AuthUtil.getUser();
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = new NodeFanoutMsg<StockUpVO>();
@ -4358,11 +4364,23 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
stockUpVO.setStockupDate(distributionStockupEntity.getStockupDate());
stockUpVO.setStockupCode(distributionStockupEntity.getStockupCode());
stockUpVO.setStockupArea(distributionStockupEntity.getStockupArea());
ReservationVO reservationVO = distributionReservationService.getReservationVO(reservationEntity);
// ReservationVO reservationVO = distributionReservationService.getReservationVO(reservationEntity);
if("3".equals(entity.getOutboundType())){
// 自提
DistrilbutionBillLadingEntity billLadingEntity = distrilbutionBillLadingService.getById(entity.getBillLadingId());
if(billLadingEntity!=null){
stockUpVO.setReferenceCode(billLadingEntity.getPickupBatch());
}
}else{
DistributionReservationEntity reservationEntity = distributionReservationService.getById(entity.getReservationId());
if (reservationEntity != null){
stockUpVO.setReferenceCode(reservationEntity.getReservationCode());
}
}
List<PackageData> packageDataList = new ArrayList<>();
parcelListEntitys.forEach(parcelListEntity -> packageDataList.add(getPackageData(parcelListEntity)));
reservationVO.setPackageDataList(packageDataList);
stockUpVO.setReservationVO(reservationVO);
packageDataList.add(getPackageData(parcelListEntitys));
stockUpVO.setPackageDataList(packageDataList);
nodeFanoutMsg.setMain(stockUpVO);
nodeFanoutMsg.setTenantId(AuthUtil.getTenantId());
@ -4408,7 +4426,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
return trunklinePackageTrackLog;
}
private NodeFanoutMsg<StockUpVO> buildStockUpNodeDataByStock(DistributionStockupEntity stockupEntity,DistributionReservationEntity reservationEntity, DistributionStockEntity stockEntity) {
private NodeFanoutMsg<StockUpVO> buildStockUpNodeDataByStock(DistributionStockupEntity stockupEntity, DistributionStockEntity stockEntity) {
try {
BladeUser user = AuthUtil.getUser();
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = new NodeFanoutMsg();
@ -4429,14 +4447,24 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
stockUpVO.setTypeService(stockupEntity.getTypeService());
stockUpVO.setStockupArea(stockupEntity.getStockupArea());
if("3".equals(stockEntity.getOutboundType())){
// 自提
DistrilbutionBillLadingEntity billLadingEntity = distrilbutionBillLadingService.getById(stockEntity.getBillLadingId());
if(billLadingEntity!=null){
stockUpVO.setReferenceCode(billLadingEntity.getPickupBatch());
}
}else{
DistributionReservationEntity reservationEntity = distributionReservationService.getById(stockEntity.getReservationId());
if (reservationEntity != null){
stockUpVO.setReferenceCode(reservationEntity.getReservationCode());
}
}
ReservationVO reservationVO = distributionReservationService.getReservationVO(reservationEntity);
List<PackageData> packageDataList = new ArrayList<>();
PackageData packageData = getPackageDataByStock(stockEntity);
packageDataList.add(packageData);
reservationVO.setPackageDataList(packageDataList);
stockUpVO.setPackageDataList(packageDataList);
stockUpVO.setReservationVO(reservationVO);
nodeFanoutMsg.setMain(stockUpVO);
nodeFanoutMsg.setTenantId(AuthUtil.getTenantId());

Loading…
Cancel
Save