Browse Source

修改整托备货

training
caoyizhong 2 years ago
parent
commit
849845d58e
  1. 4
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayGoodsClient.java
  2. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  3. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java
  4. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  5. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  6. 28
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  7. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayGoodsClient.java
  8. 11
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownGoodsClient.java

4
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayGoodsClient.java

@ -65,9 +65,11 @@ public interface IWarehouseTrayGoodsClient {
Boolean delByTrayByCode(@RequestParam String code);
/**
* 通过托盘id查询托盘上面的货物
*
* @param trayId
* @param trayBarCode
*/
@PostMapping(GETTRAYIDLIST)
List<WarehouseTrayGoodsEntity> getTrayIdList(@RequestParam String trayId);
List<WarehouseTrayGoodsEntity> getTrayIdList(@RequestParam String trayId,@RequestParam String trayBarCode);
}

19
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java

@ -320,6 +320,10 @@ public class DistributionStockupAppController extends BladeController {
log.warn("##############allocationId: 货位状态为空 allocationId={}", allocationId);
return R.fail(3002, "货位id为空");
}
if (ObjectUtils.isNull(allocationId)) {
log.warn("##############allocationId: 货位状态为空 allocationId={}", allocationId);
return R.fail(3002, "货位id为空");
}
if (Objects.isNull(stockListId)) {
return R.fail(3002, "库存品id为空");
@ -369,14 +373,15 @@ public class DistributionStockupAppController extends BladeController {
@PostMapping("/scanningCode")
@ApiOperation(value = "整托备货")
public R scanningCodelist(@RequestBody StockupDTO stockupDTO) {
log.debug("=====整托数据:{}",stockupDTO);
if (ObjectUtils.isNull(stockupDTO.getStockupId())) {
return R.fail(3002, "备货id不能为空");
}
if (ObjectUtils.isNull(stockupDTO.getReservationId())) {
return R.fail(3002, "预约Id不能为空");
}
if (ObjectUtils.isNull(stockupDTO.getTrayId())) {
return R.fail(3002, "托盘ID不能为空");
if (ObjectUtils.isNull(stockupDTO.getTrayBarCode())) {
return R.fail(3002, "托盘不能为空");
}
R b = distributionStockupService.addPackTrayList(stockupDTO);
return b;
@ -393,10 +398,10 @@ public class DistributionStockupAppController extends BladeController {
return R.data(list);
}
List<DistributionStockupTrayVO> listMarket = distributionStockupService.getLocationMarketSelection(stockupDTO);
if(!listMarket.isEmpty() && ObjectUtils.isNotNull(listMarket.size())){
if(!listMarket.isEmpty() && ObjectUtils.isNotNull(listMarket.get(0))){
return R.data(listMarket);
}
return R.fail(3002,"当前物料未上架,请上架后在继续备货操作!!!");
return Resp.scanFail("当前待备货的库存品未上架,请上架后在继续备货操作!!!","当前待备货的库存品未上架,请上架后在继续备货操作!!!");
}
@ -516,6 +521,7 @@ public class DistributionStockupAppController extends BladeController {
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity();
warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId());
warehouseUpdownGoodsEntity.setAssociationValue(stockupDTO.getPacketBarCode());
warehouseUpdownGoodsEntity.setWarehouseId(distributionStockupEntity.getWarehouseId());
WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationInformation(warehouseUpdownGoodsEntity);
entity.setAllocationTitle(locationInformation.getPositionCode());
entity.setAllocationId(stockupDTO.getAllocationId());
@ -615,10 +621,12 @@ public class DistributionStockupAppController extends BladeController {
warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId());
warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch());
warehouseUpdownGoodsEntity.setMarketId(byId.getMarketId());
warehouseUpdownGoodsEntity.setAssociationId(byId.getMaterialId());
warehouseUpdownGoodsEntity.setAssociationType("4");
warehouseUpdownGoodsEntity.setWarehouseId(byId.getWarehouseId());
WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity);
if(ObjectUtils.isNull(locationInformation)){
return Resp.scanFail("当前货位的本物料已为0,请更换货位继续!!", "当前货位的本物料已为0,请更换货位继续!!");
return Resp.scanFail("当前货位的库存品已为零,请更换货位继续!!", "当前货位的库存品已为零,请更换货位继续!!");
}
Integer i = distributionStockupService.selectPackagePrint(stockupDTO);
switch (i) {
@ -659,6 +667,7 @@ public class DistributionStockupAppController extends BladeController {
JSONObject jsonObject = new JSONObject();
jsonObject.put("marketId",byId.getMarketId());
jsonObject.put("materialCode",byId.getMarketCode());
jsonObject.put("warehouseId",byId.getWarehouseId());
jsonObject.put("incomingBatch",byId.getIncomingBatch());
jsonObject.put("enterNum",1);
jsonObject.put("allocationId",stockupDTO.getAllocationId());

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java

@ -33,6 +33,8 @@ public class StockupDTO implements Serializable {
private String allocation;//库位信息
private Long allocationId;//库位信息ID
private String allocationCode;//库位信息ID
private String allocationType;//库位信息ID
private String pallet;//托盘

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

@ -230,7 +230,8 @@
from logpm_distribution_reservation_stocklist ldrs
left join logpm_distribution_stock_list ldst on ldst.id = ldrs.stocklist_id and ldst.is_deleted = 0
left join logpm_distribution_stock ldss on ldss.stock_list_id = ldst.id and ldss.reservation_id = #{reservationId} and ldss.is_deleted = 0
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldst.material_id and lwug.association_type = '4' and ldst.market_id = lwug.market_id and ldst.incoming_batch = lwug.incoming_batch
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldst.material_id and lwug.association_type = '4'
and ldst.market_id = lwug.market_id and ldst.incoming_batch = lwug.incoming_batch and ldst.warehouse_id = lwug.warehouse_id
where ldrs.reservation_id = #{reservationId}
and ldrs.is_deleted = 0
group by ldst.id, ldst.storage_location, ldst.description_goods, ldst.sku,ldrs.id,

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

@ -72,7 +72,7 @@
from logpm_distribution_reservation_stocklist ldrs
LEFT JOIN logpm_distribution_stock_list ldsl on ldrs.stocklist_id = ldsl.id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldsl.material_id and lwug.association_type = '4' and ldsl.market_id = lwug.market_id
and ldsl.incoming_batch = lwug.incoming_batch
and ldsl.incoming_batch = lwug.incoming_batch and ldsl.warehouse_id = lwug.warehouse_id
where ldrs.id = #{param.deliveryDetailsId}
</select>
<select id="getLocationSelection" resultType="com.logpm.distribution.vo.DistributionStockupTrayVO">
@ -80,17 +80,18 @@
from logpm_distribution_delivery_details lddd
LEFT JOIN logpm_distribution_stock_list ldsl on lddd.stock_list_id = ldsl.id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldsl.material_id and lwug.association_type = '4' and ldsl.market_id = lwug.market_id
and ldsl.incoming_batch = lwug.incoming_batch
and ldsl.incoming_batch = lwug.incoming_batch and ldsl.warehouse_id = lwug.warehouse_id
where lddd.id = #{param.deliveryDetailsId}
GROUP BY lwug.position_code ,lwug.allocation_id,lwug.allocation_title,lwug.num
</select>
<select id="stockupOffShelf" resultType="com.logpm.distribution.vo.DistributionStockupSelfVO">
select lwug.id lwugId,lds.id ldsId,ldrp.packet_bar_code orderPackageCode,lwug.allocation_id allocationId
from logpm_distribution_reservation_package ldrp
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldrp.parce_list_id and lwug.association_type = 3
from logpm_distribution_reservation ldr
LEFT JOIN logpm_distribution_reservation_package ldrp on ldr.id = ldrp.reservation_id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldrp.parce_list_id and lwug.association_type = 3 and ldr.warehouse_id = lwug.warehouse_id
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldrp.parce_list_id
<where>
ldrp.packet_bar_status in (1,3) and ldrp.reservation_id = #{param.reservationId}
ldrp.packet_bar_status in (1,3) and ldr.id = #{param.reservationId}
</where>
</select>
@ -363,7 +364,8 @@
) realNum,lddd.id deliveryDetailsId
from logpm_distribution_delivery_details lddd
LEFT JOIN logpm_distribution_stock_list ldsl on lddd.stock_list_id = ldsl.id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldsl.material_id and lwug.association_type = '4' and ldsl.market_id = lwug.market_id and ldsl.incoming_batch = lwug.incoming_batch
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldsl.material_id and lwug.association_type = '4'
and ldsl.market_id = lwug.market_id and ldsl.incoming_batch = lwug.incoming_batch and ldsl.warehouse_id = lwug.warehouse_id
where lddd.bill_lading_id = #{reservationId}
GROUP BY lddd.stock_list_id,ldsl.description_goods,ldsl.sku,ldsl.cargo_norms,lddd.quantity,ldsl.cargo_unit,ldsl.tray_name,ldsl.unpack,lddd.id

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

@ -27,6 +27,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataCodeClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.dto.app.StockupDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistributionStockupExcel;
@ -48,6 +49,7 @@ import org.springblade.common.constant.stocklist.StockStatusConstant;
import org.springblade.common.constant.stockup.StockAssignStatusConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
@ -69,7 +71,6 @@ import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* 备货信息表 服务实现类
@ -191,7 +192,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//自提
List<DistributionStockListSelfNumVO> distributionStockListSelfNumVOS = distributionStockupInfoService.selectStockListSelfNum(s);
if (distributionStockListSelfNumVOS.size() > 0) {
if (!distributionStockListSelfNumVOS.isEmpty()) {
List<DisStockListDetailEntity> listDetailEntities = new ArrayList<>();
distributionStockListSelfNumVOS.forEach(i -> {
@ -215,7 +216,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
}
});
if (listDetailEntities.size() > 0) {
if (!listDetailEntities.isEmpty()) {
disStockListDetailService.saveBatch(listDetailEntities);
}
@ -1413,16 +1414,20 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
}else {
log.warn("预约信息不存在!");
return R.fail(3001, "备货失败!");
return Resp.scanFail("预约信息不存在", "预约信息不存在!");
}
if(list.size() < 1){
log.warn("包件信息不存在!");
return R.fail(3001, "备货失败!");
return Resp.scanFail("包件信息不存在", "包件信息不存在!");
}
//查询托盘上面的包件
List<WarehouseTrayGoodsEntity> trayIdList = warehouseTrayGoodsClient.getTrayIdList(stockupDTO.getTrayId());
List<WarehouseTrayGoodsEntity> trayIdList = warehouseTrayGoodsClient.getTrayIdList(stockupDTO.getTrayId(),stockupDTO.getTrayBarCode());
List<DistributionStockPackageVO> voList = new ArrayList<>();
List<DistributionStockPackageVO> finalList = list;
if(trayIdList.isEmpty()){
return Resp.scanFail("托盘信息错误!!!", "托盘信息错误!!!");
}
trayIdList.forEach(t -> {
boolean b = finalList.stream().anyMatch(l -> l.getParcelListId().equals(t.getAssociationId()));
if (b) {
@ -1439,7 +1444,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
});
if (stock.get()) {
return R.fail(3001, "备货失败!");
return Resp.scanFail("备货失败", "备货失败!");
} else {
List<DistributionStockEntity> list1 = new ArrayList<>();
voList.forEach(i -> {
@ -1453,7 +1458,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
parcelList.setOrderPackageStockupStatus(OrderPackageStockupStatusConstant.yibeihu.getValue());
distributionParcelListService.updateById(parcelList);
//货位下架
// warehouseUpdownTypeClient.downPackage(i.getPacketBarCode());
R r = warehouseUpdownTypeClient.downPackage(i.getPacketBarCode(), parcelList.getWarehouseId());
if(!r.isSuccess()){
throw new ServiceException("下架失败!!");
}
//判断备货任务是否完成
if(one.getStockUpType().equals("3")){
distributionAsyncService.stockupSelfUpdateState(stockupDTO);
@ -1469,6 +1477,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity();
warehouseUpdownGoodsEntity.setAssociationId(i.getParcelListId());
warehouseUpdownGoodsEntity.setAssociationValue(i.getPacketBarCode());
warehouseUpdownGoodsEntity.setWarehouseId(byId.getWarehouseId());
WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationInformation(warehouseUpdownGoodsEntity);
if(ObjectUtils.isNotNull(locationInformation)){
distributionStock.setAllocationTitle(locationInformation.getPositionCode());
@ -1523,7 +1532,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
while (iterator.hasNext()) {
if (i.getTrayId().equals(iterator.next().getTrayId())) {
Integer trayPackNum = iterator.next().getTrayPackNum(); //在这个托盘的数量
List<WarehouseTrayGoodsEntity> trayIdList = warehouseTrayGoodsClient.getTrayIdList(i.getTrayId().toString());
String trayIdCode = "";
List<WarehouseTrayGoodsEntity> trayIdList = warehouseTrayGoodsClient.getTrayIdList(i.getTrayId().toString(),trayIdCode);
if (trayPackNum.equals(trayIdList.size())) {
trays.set(true);
}

7
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayGoodsClient.java

@ -1,7 +1,7 @@
package com.logpm.warehouse.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.service.IWarehouseTrayGoodsService;
import com.logpm.warehouse.service.IWarehouseTrayTypeService;
@ -48,12 +48,13 @@ public class WarehouseTrayGoodsClient implements IWarehouseTrayGoodsClient {
@Override
@PostMapping(GETTRAYIDLIST)
public List<WarehouseTrayGoodsEntity> getTrayIdList(String trayId) {
public List<WarehouseTrayGoodsEntity> getTrayIdList(String trayId, String trayBarCode) {
QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper = new QueryWrapper();
if(trayId.contains(",")){
queryWrapper.in("tray_id",trayId.split(","));
}else{
queryWrapper.eq("tray_id",trayId);
queryWrapper.eq(ObjectUtils.isNotNull(trayId),"tray_id",trayId);
queryWrapper.eq(ObjectUtils.isNotNull(trayBarCode),"tray_code", trayBarCode);
}
queryWrapper.eq("association_type","3");
return warehouseTrayGoodsService.list(queryWrapper);

11
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownGoodsClient.java

@ -70,6 +70,7 @@ public class WarehouseUpdownGoodsClient implements IWarehouseUpdownGoodsClient {
return warehouseUpdownGoodsService.getOne(Wrappers.<WarehouseUpdownGoodsEntity>query().lambda()
.eq(ObjectUtils.isNotNull(updownGoodsEntity.getAllocationId()),WarehouseUpdownGoodsEntity::getAllocationId,updownGoodsEntity.getAllocationId())
.eq(WarehouseUpdownGoodsEntity::getAssociationValue,updownGoodsEntity.getAssociationValue())
.eq(WarehouseUpdownGoodsEntity::getWarehouseId,updownGoodsEntity.getWarehouseId())
.eq(ObjectUtils.isNotNull(updownGoodsEntity.getAssociationId()),WarehouseUpdownGoodsEntity::getAssociationId,updownGoodsEntity.getAssociationId())
);
}
@ -78,10 +79,12 @@ public class WarehouseUpdownGoodsClient implements IWarehouseUpdownGoodsClient {
@PostMapping(LOCATIONSTOCKLISTINFORMATION)
public WarehouseUpdownGoodsEntity getLocationStockListInformation(WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity) {
return warehouseUpdownGoodsService.getOne(Wrappers.<WarehouseUpdownGoodsEntity>query().lambda()
.eq(WarehouseUpdownGoodsEntity::getAllocationId,warehouseUpdownGoodsEntity.getAllocationId())
.eq(WarehouseUpdownGoodsEntity::getAssociationType,warehouseUpdownGoodsEntity.getAssociationType())
.eq(WarehouseUpdownGoodsEntity::getMarketId,warehouseUpdownGoodsEntity.getMarketId())
.eq(WarehouseUpdownGoodsEntity::getIncomingBatch,warehouseUpdownGoodsEntity.getIncomingBatch())
.eq(ObjectUtils.isNotNull(warehouseUpdownGoodsEntity.getAllocationId()),WarehouseUpdownGoodsEntity::getAllocationId,warehouseUpdownGoodsEntity.getAllocationId())
.eq(ObjectUtils.isNotNull(warehouseUpdownGoodsEntity.getAssociationType()),WarehouseUpdownGoodsEntity::getAssociationType,warehouseUpdownGoodsEntity.getAssociationType())
.eq(ObjectUtils.isNotNull(warehouseUpdownGoodsEntity.getMarketId()),WarehouseUpdownGoodsEntity::getMarketId,warehouseUpdownGoodsEntity.getMarketId())
.eq(ObjectUtils.isNotNull(warehouseUpdownGoodsEntity.getAssociationId()),WarehouseUpdownGoodsEntity::getAssociationId,warehouseUpdownGoodsEntity.getAssociationId())
.eq(ObjectUtils.isNotNull(warehouseUpdownGoodsEntity.getIncomingBatch()),WarehouseUpdownGoodsEntity::getIncomingBatch,warehouseUpdownGoodsEntity.getIncomingBatch())
.eq(ObjectUtils.isNotNull(warehouseUpdownGoodsEntity.getWarehouseId()),WarehouseUpdownGoodsEntity::getWarehouseId,warehouseUpdownGoodsEntity.getWarehouseId())
);
}
}

Loading…
Cancel
Save