|
|
|
@ -17,6 +17,7 @@
|
|
|
|
|
package com.logpm.distribution.service.impl; |
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
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; |
|
|
|
@ -109,7 +110,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
@Autowired |
|
|
|
|
private IWarehouseTrayGoodsClient warehouseTrayGoodsClient; |
|
|
|
|
@Autowired |
|
|
|
|
private IWarehouseTaryAllocationClient warehouseTaryAllocationClient; |
|
|
|
|
private IWarehouseTaryAllocationClient warehouseTaryAllocationClient; //托盘货位ID
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionReservationPackageService distributionReservationPackageService; |
|
|
|
@ -432,9 +433,18 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//没有
|
|
|
|
|
List<DistributionStockPackageVO> list2 = distrilbutionBillStockService.listPackageSelf(i.getReservationId()); |
|
|
|
|
i.setPlanNum(i.getPlanNum()+list2.size()); |
|
|
|
|
List<DistributionStockEntity> listStock = distributionStockService.list(Wrappers.<DistributionStockEntity>query().lambda() |
|
|
|
|
.eq(DistributionStockEntity::getBillLadingId, i.getReservationId()) |
|
|
|
|
.eq(DistributionStockEntity::getStockupId, stockupDTO.getStockupId()) |
|
|
|
|
); |
|
|
|
|
if(!listStock.isEmpty()){ |
|
|
|
|
int sum = listStock.stream().mapToInt(DistributionStockEntity::getStockQuantity).sum(); |
|
|
|
|
i.setStockupNum(sum); |
|
|
|
|
}else{ |
|
|
|
|
i.setStockupNum(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
map.put("orderList", list); |
|
|
|
|
} else { |
|
|
|
|
//商 ,市
|
|
|
|
@ -454,6 +464,16 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
intToStrDistributionStockupListVO(distributionStockupListVO); |
|
|
|
|
distributionStockupListVO.setReservationId(Long.parseLong(split[i])); |
|
|
|
|
distributionStockupListVO.setPlanNum(distributionStockupListVO.getPlanNum()+ list1.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum()); |
|
|
|
|
List<DistributionStockEntity> list2 = distributionStockService.list(Wrappers.<DistributionStockEntity>query().lambda() |
|
|
|
|
.eq(DistributionStockEntity::getReservationId, stockupDTO.getReservationId()) |
|
|
|
|
.eq(DistributionStockEntity::getStockupId, stockupDTO.getStockupId()) |
|
|
|
|
); |
|
|
|
|
if(!list2.isEmpty()){ |
|
|
|
|
int sum = list2.stream().mapToInt(DistributionStockEntity::getStockQuantity).sum(); |
|
|
|
|
distributionStockupListVO.setStockupNum(sum); |
|
|
|
|
}else{ |
|
|
|
|
distributionStockupListVO.setStockupNum(0); |
|
|
|
|
} |
|
|
|
|
list.add(distributionStockupListVO); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -606,6 +626,86 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询零担托盘信息 |
|
|
|
|
*/ |
|
|
|
|
public DistributionStockupOrderListVO getTrayInfo(DistributionStockupOrderListVO i, Long stockArticleId,Long warehouseId,String orderCode,Long allocationId){ |
|
|
|
|
//查询货位上面有没有绑定托盘
|
|
|
|
|
|
|
|
|
|
WarehouseTrayGoodsEntity trayGoodsEntity = new WarehouseTrayGoodsEntity(); |
|
|
|
|
trayGoodsEntity.setAssociationId(stockArticleId); |
|
|
|
|
trayGoodsEntity.setWarehouseId(warehouseId); |
|
|
|
|
trayGoodsEntity.setAssociationValue(orderCode); |
|
|
|
|
trayGoodsEntity.setAssociationType("1"); |
|
|
|
|
|
|
|
|
|
if(ObjectUtils.isNotNull(allocationId)){ |
|
|
|
|
List<WarehouseTaryAllocationEntity> allocationEntityList = warehouseTaryAllocationClient.getAllocationId(allocationId); |
|
|
|
|
if(ObjectUtils.isNotNull(allocationEntityList) && !allocationEntityList.isEmpty()){ |
|
|
|
|
//查询托盘信息
|
|
|
|
|
|
|
|
|
|
List<WarehouseTrayGoodsEntity> trayList = warehouseTrayGoodsClient.getTrayList(trayGoodsEntity); |
|
|
|
|
if(!trayList.isEmpty()){ |
|
|
|
|
i.setTrayId(trayList.get(0).getId().toString()); |
|
|
|
|
i.setPallet(trayList.get(0).getTrayCode()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
List<WarehouseTrayGoodsEntity> trayList = warehouseTrayGoodsClient.getTrayList(trayGoodsEntity); |
|
|
|
|
if(!trayList.isEmpty()){ |
|
|
|
|
String trayId = trayList.stream().map(WarehouseTrayGoodsEntity::getTrayId).collect(Collectors.toList()).stream().map(Object::toString).collect(Collectors.joining(",")); |
|
|
|
|
String trayCode = trayList.stream().map(WarehouseTrayGoodsEntity::getTrayCode).collect(Collectors.joining(",")); |
|
|
|
|
i.setTrayId(trayId); |
|
|
|
|
i.setPallet(trayCode); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return i; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询零担货位信息 |
|
|
|
|
* @param list |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public List<DistributionStockupOrderListVO> getZeroTrayInfo(List<DistributionStockupOrderListVO> list){ |
|
|
|
|
List<DistributionStockupOrderListVO> listStockup = new ArrayList<>(); |
|
|
|
|
Iterator<DistributionStockupOrderListVO> iterator = list.iterator(); |
|
|
|
|
while (iterator.hasNext()){ |
|
|
|
|
DistributionStockupOrderListVO i = iterator.next(); |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if(ObjectUtils.isNull(myCurrentWarehouse)){ |
|
|
|
|
throw new ServiceException("请选择仓库信息!!"); |
|
|
|
|
} |
|
|
|
|
//查询货位信息
|
|
|
|
|
WarehouseUpdownGoodsEntity updownGoodsEntity = new WarehouseUpdownGoodsEntity(); |
|
|
|
|
updownGoodsEntity.setAssociationId(Long.valueOf(i.getStockArticleId())); |
|
|
|
|
updownGoodsEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
updownGoodsEntity.setAssociationValue(i.getOrderCode()); |
|
|
|
|
updownGoodsEntity.setAssociationType("1"); |
|
|
|
|
List<WarehouseUpdownGoodsEntity> information = warehouseUpdownGoodsClient.getLocationStockListInformation(updownGoodsEntity); |
|
|
|
|
if(!information.isEmpty()){ |
|
|
|
|
DistributionStockupOrderListVO finalI = i; |
|
|
|
|
information.stream().forEach(q ->{ |
|
|
|
|
DistributionStockupOrderListVO stockupOrderListVO = new DistributionStockupOrderListVO(); |
|
|
|
|
BeanUtils.copyProperties(finalI,stockupOrderListVO); |
|
|
|
|
//查询托盘信息
|
|
|
|
|
stockupOrderListVO = getTrayInfo(stockupOrderListVO,Long.valueOf(stockupOrderListVO.getStockArticleId()),myCurrentWarehouse.getId(),stockupOrderListVO.getOrderCode(),q.getAllocationId()); |
|
|
|
|
stockupOrderListVO.setAllocation(q.getPositionCode()); |
|
|
|
|
stockupOrderListVO.setAllocationId(q.getAllocationId()); |
|
|
|
|
stockupOrderListVO.setAllocationNumber(q.getNum()); |
|
|
|
|
listStockup.add(stockupOrderListVO); |
|
|
|
|
iterator.remove(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
list.addAll(listStockup); |
|
|
|
|
return list; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询自提信息 |
|
|
|
|
* @param reservationId |
|
|
|
@ -620,35 +720,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
//零担查询货位,托盘信息
|
|
|
|
|
if(stockupDTO.getIsZero().equals("1")){ |
|
|
|
|
list.stream().forEach( i ->{ |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if(ObjectUtils.isNull(myCurrentWarehouse)){ |
|
|
|
|
throw new ServiceException("请选择仓库信息!!"); |
|
|
|
|
} |
|
|
|
|
WarehouseTrayGoodsEntity trayGoodsEntity = new WarehouseTrayGoodsEntity(); |
|
|
|
|
trayGoodsEntity.setAssociationId(Long.valueOf(i.getStockArticleId())); |
|
|
|
|
trayGoodsEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
trayGoodsEntity.setAssociationValue(i.getOrderCode()); |
|
|
|
|
trayGoodsEntity.setAssociationType("1"); |
|
|
|
|
List<WarehouseTrayGoodsEntity> trayList = warehouseTrayGoodsClient.getTrayList(trayGoodsEntity); |
|
|
|
|
if(!trayList.isEmpty()){ |
|
|
|
|
i.setTrayId(trayList.get(0).getId().toString()); |
|
|
|
|
i.setPallet(trayList.get(0).getTrayCode()); |
|
|
|
|
} |
|
|
|
|
WarehouseUpdownGoodsEntity updownGoodsEntity = new WarehouseUpdownGoodsEntity(); |
|
|
|
|
updownGoodsEntity.setAssociationId(Long.valueOf(i.getStockArticleId())); |
|
|
|
|
trayGoodsEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
trayGoodsEntity.setAssociationValue(i.getOrderCode()); |
|
|
|
|
trayGoodsEntity.setAssociationType("1"); |
|
|
|
|
List<WarehouseUpdownGoodsEntity> information = warehouseUpdownGoodsClient.getLocationStockListInformation(updownGoodsEntity); |
|
|
|
|
if(!information.isEmpty()){ |
|
|
|
|
i.setAllocation(information.get(0).getPositionCode()); |
|
|
|
|
i.setAllocationId(information.get(0).getAllocationId()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
List<DistributionStockupOrderListVO> zeroTrayInfo = getZeroTrayInfo(list); |
|
|
|
|
if(!zeroTrayInfo.isEmpty()){ |
|
|
|
|
list = zeroTrayInfo; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取有货位的数据
|
|
|
|
|
List<DistributionStockupOrderListVO> collect11 = list.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList()); |
|
|
|
|
Set<DistributionStockupOrderListVO> listYou = new HashSet<>(); |
|
|
|
@ -838,6 +914,14 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if(!list.isEmpty() && ObjectUtils.isNull(list.get(0))){ |
|
|
|
|
return new ArrayList<>(); |
|
|
|
|
} |
|
|
|
|
//零担查询货位,托盘信息
|
|
|
|
|
if(stockupDTO.getIsZero().equals("1")){ |
|
|
|
|
List<DistributionStockupOrderListVO> zeroTrayInfo = getZeroTrayInfo(list); |
|
|
|
|
if(!zeroTrayInfo.isEmpty()){ |
|
|
|
|
list = zeroTrayInfo; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<DistributionStockupOrderListVO> collect11 = list.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList()); //有货位
|
|
|
|
|
Set<DistributionStockupOrderListVO> listYou = new HashSet<>(); //
|
|
|
|
|
collect11.forEach( p ->{ |
|
|
|
@ -882,6 +966,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if (ObjectUtils.isNull(p.getStockId())){ |
|
|
|
|
p.setScanNum(0); |
|
|
|
|
}else{ |
|
|
|
|
p.setCompleteStact(true); |
|
|
|
|
p.setScanNum(i2); |
|
|
|
|
} |
|
|
|
|
listYou.add(p); |
|
|
|
@ -892,6 +977,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if (ObjectUtils.isNull(p.getStockId())){ |
|
|
|
|
p.setScanNum(0); |
|
|
|
|
}else{ |
|
|
|
|
p.setCompleteStact(true); |
|
|
|
|
p.setScanNum(i2); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2170,20 +2256,68 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询货位数据 |
|
|
|
|
*/ |
|
|
|
|
public WarehouseUpdownGoodsEntity getAllocationInfo(Long allocationId,String orderCode,Long warehouseId){ |
|
|
|
|
//查询货位信息
|
|
|
|
|
WarehouseUpdownGoodsEntity updownGoodsEntity = new WarehouseUpdownGoodsEntity(); |
|
|
|
|
updownGoodsEntity.setAssociationType("1"); |
|
|
|
|
updownGoodsEntity.setAllocationId(allocationId); |
|
|
|
|
updownGoodsEntity.setWarehouseId(warehouseId); |
|
|
|
|
return warehouseUpdownGoodsClient.getLocationInformation(updownGoodsEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 零担备货 |
|
|
|
|
* @param stockupDTO |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public R zeroStockUp(StockupZeroDTO stockupDTO) { |
|
|
|
|
log.info("备货零担数据》》》",stockupDTO); |
|
|
|
|
if (stockupDTO.getList().isEmpty()) return R.fail("基础数据为空"); |
|
|
|
|
if (ObjectUtils.isNull( stockupDTO.getAllocationId())) return Resp.scanFail("当前货物未上架,请上架!","当前货物未上架,请上架!"); |
|
|
|
|
//有没有多个订单数据
|
|
|
|
|
if(stockupDTO.getStockArticleId().contains(",")){ |
|
|
|
|
stockupDTO.setStockArticleIdList(stockupDTO.getStockArticleId().split(",")); |
|
|
|
|
stockupDTO.setStockArticleId(null); |
|
|
|
|
} |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if(ObjectUtils.isNull(myCurrentWarehouse)){ |
|
|
|
|
throw new ServiceException("请选择仓库!!"); |
|
|
|
|
} |
|
|
|
|
//查询货位是否有货
|
|
|
|
|
WarehouseUpdownGoodsEntity allocationInfo = getAllocationInfo(stockupDTO.getAllocationId(), null, myCurrentWarehouse.getId()); |
|
|
|
|
if(ObjectUtils.isNotNull(allocationInfo)){ |
|
|
|
|
int sum = stockupDTO.getList().stream().mapToInt(StockupZeroVO::getQuantity).sum(); |
|
|
|
|
if(allocationInfo.getNum() < sum){ |
|
|
|
|
return Resp.scanFail("备货数量大于该货架的数量!","备货数量大于该货架的数量!"); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
return Resp.scanFail("当前货物未上架,请上架!","当前货物未上架,请上架!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//判断是否备货完成
|
|
|
|
|
for (StockupZeroVO i : stockupDTO.getList()) { |
|
|
|
|
//查询是否备货完成
|
|
|
|
|
DistributionReservationZeroPackageEntity one = reservationZeroPackageService.getOne(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda() |
|
|
|
|
.eq(DistributionReservationZeroPackageEntity::getZeroPackageStatus, "1") |
|
|
|
|
.eq(DistributionReservationZeroPackageEntity::getId, i.getId()) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(ObjectUtils.isNull()){ |
|
|
|
|
return Resp.scanFail(i.getCategoryName()+"备货信息未找到!",i.getCategoryName()+"备货信息未找到!"); |
|
|
|
|
} |
|
|
|
|
if(one.getQuantity().equals(one.getRealityQuantity())){ |
|
|
|
|
return Resp.scanFail(i.getCategoryName()+"备货已完成!!",i.getCategoryName()+"备货已完成!!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//把数据取出来
|
|
|
|
|
List<StockupZeroVO> zeroStockUpData;; |
|
|
|
|
|
|
|
|
@ -2206,7 +2340,6 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//有
|
|
|
|
|
zeroStockUpData = distributionStockupService.getZeroStockUpDataYou(stockupDTO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
int xiugai= 0; |
|
|
|
|
List<StockupZeroVO> collect = stockupDTO.getList().stream().filter( //可以
|
|
|
|
@ -2214,12 +2347,23 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
).collect(Collectors.toList()); |
|
|
|
|
//添加备货信息
|
|
|
|
|
List<DistributionStockEntity> stockEntityList = new ArrayList<>(); |
|
|
|
|
List<JSONObject> jsonObjectList = new ArrayList<>(); |
|
|
|
|
for (StockupZeroVO i : collect) { |
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
jsonObject.put("warehouseId",myCurrentWarehouse.getId()); |
|
|
|
|
//查询是不是当前包件
|
|
|
|
|
DistributionReservationZeroPackageEntity byId1 = reservationZeroPackageService.getById(i.getId()); |
|
|
|
|
if(ObjectUtils.isNull(byId1)){ |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
DistributionStockArticleEntity stockArticle = distributionStockArticleService.getById(byId1.getStockArticleId()); |
|
|
|
|
if(ObjectUtils.isNull(stockArticle)){ |
|
|
|
|
throw new ServiceException("订单数据不存在!!"); |
|
|
|
|
} |
|
|
|
|
jsonObject.put("orderCode",stockArticle.getOrderCode()); |
|
|
|
|
jsonObject.put("waybillCode",stockArticle.getWaybillNumber()); |
|
|
|
|
|
|
|
|
|
//查询备货信息
|
|
|
|
|
QueryWrapper<DistributionStockEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
if(stockupDTO.getTypeService().equals("3")){ |
|
|
|
|
queryWrapper.eq("bill_lading_id",stockupDTO.getReservationId()); |
|
|
|
@ -2232,8 +2376,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
queryWrapper.eq("parcel_list_id", byId1.getParcelListId()); |
|
|
|
|
DistributionStockEntity one = distributionStockService.getOne(queryWrapper ); |
|
|
|
|
//查询备货数量
|
|
|
|
|
DistributionReservationZeroPackageEntity byId = reservationZeroPackageService.getById(i.getId()); |
|
|
|
|
if(i.getQuantity() > byId.getQuantity()){ |
|
|
|
|
// DistributionReservationZeroPackageEntity byId = reservationZeroPackageService.getById(i.getId());
|
|
|
|
|
if(i.getQuantity() > byId1.getQuantity()){ |
|
|
|
|
return Resp.scanFail(i.getCategoryName()+"备货数量大于待备货数量!",i.getCategoryName()+"备货数量大于待备货数量!"); |
|
|
|
|
} |
|
|
|
|
Optional<StockupZeroVO> first = stockupDTO.getList().stream().filter(q -> i.getStockArticleId().equals(q.getStockArticleId()) && q.getQuantity() <= i.getQuantity() && q.getQuantity() > 0).findFirst(); |
|
|
|
@ -2243,12 +2387,14 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
DistributionStockEntity stockEntity = new DistributionStockEntity(); |
|
|
|
|
stockEntity.setId(one.getId()); |
|
|
|
|
stockEntity.setStockQuantity(first.get().getQuantity()); |
|
|
|
|
int i1 = first.get().getQuantity() - first.get().getRealityQuantity(); //这次备货的数量
|
|
|
|
|
jsonObject.put("enterNum",i1); |
|
|
|
|
distributionStockService.updateById(stockEntity); |
|
|
|
|
}else{ |
|
|
|
|
DistributionStockEntity stockEntity = new DistributionStockEntity(); |
|
|
|
|
stockEntity.setStockArticle(i.getStockArticleId()); |
|
|
|
|
stockEntity.setStockupId(stockupDTO.getStockupId()); |
|
|
|
|
stockEntity.setParcelListId(byId.getParcelListId()); |
|
|
|
|
stockEntity.setParcelListId(byId1.getParcelListId()); |
|
|
|
|
if(stockupDTO.getTypeService().equals("3")){ |
|
|
|
|
stockEntity.setBillLadingId(stockupDTO.getReservationId()); |
|
|
|
|
}else{ |
|
|
|
@ -2258,9 +2404,13 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
stockEntity.setGoodsName(i.getCategoryName()); |
|
|
|
|
stockEntity.setOutboundType("3"); |
|
|
|
|
stockEntity.setType(3); |
|
|
|
|
stockEntity.setAllocationId(stockupDTO.getAllocationId()); |
|
|
|
|
//查询货位信息
|
|
|
|
|
stockEntity.setAllocationTitle(getAllocationInfo(stockupDTO.getAllocationId(),stockArticle.getOrderCode(),myCurrentWarehouse.getId()).getAllocationTitle()); |
|
|
|
|
DistributionStockupEntity distributionStockupEntity = distributionStockupService.selectById(stockupDTO.getStockupId()); |
|
|
|
|
stockEntity.setStockupArea(ObjectUtils.isNotNull(distributionStockupEntity) ? distributionStockupEntity.getStockupArea() : null); |
|
|
|
|
stockEntity.setStockQuantity(first.get().getQuantity());// 备货数量
|
|
|
|
|
jsonObject.put("enterNum",i.getQuantity()); |
|
|
|
|
stockEntityList.add(stockEntity); |
|
|
|
|
} |
|
|
|
|
//修改备货数量
|
|
|
|
@ -2273,12 +2423,27 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
}else{ |
|
|
|
|
xiugai += 1; |
|
|
|
|
} |
|
|
|
|
//有货位下架
|
|
|
|
|
jsonObject.put("allocationId",stockupDTO.getAllocationId()); |
|
|
|
|
|
|
|
|
|
jsonObjectList.add(jsonObject); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if(!jsonObjectList.isEmpty()){ |
|
|
|
|
if(ObjectUtils.isNotNull(stockupDTO.getAllocationId())){ |
|
|
|
|
R r = warehouseUpdownTypeClient.downZeroOrder(jsonObjectList); |
|
|
|
|
if(r.getCode() != 200){ |
|
|
|
|
return Resp.scanFail("货架下架失败!请联系管理员!","货架下架失败!请联系管理员!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(!stockEntityList.isEmpty()){ |
|
|
|
|
boolean b = distributionStockService.saveBatch(stockEntityList); |
|
|
|
|
if(b){ |
|
|
|
|
//修改备货状态
|
|
|
|
|
distributionAsyncService.stockZero(stockupDTO); |
|
|
|
|
//下架零担
|
|
|
|
|
|
|
|
|
|
return Resp.scanSuccess("备货成功!","备货成功!"); |
|
|
|
|
}else{ |
|
|
|
|
//
|
|
|
|
@ -2288,6 +2453,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if(collect.size() == xiugai){ |
|
|
|
|
//修改备货状态
|
|
|
|
|
distributionAsyncService.stockZero(stockupDTO); |
|
|
|
|
//下架零担
|
|
|
|
|
return Resp.scanSuccess("备货成功!","备货成功!"); |
|
|
|
|
} |
|
|
|
|
return Resp.scanFail("备货失败!","备货失败!"); |
|
|
|
|