Browse Source

修改备货 商 市库位信息查询

training
caoyizhong 2 years ago
parent
commit
d86d5fd265
  1. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java
  2. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java
  3. 1
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/PackageStockupVO.java
  4. 15
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsLogClient.java
  5. 56
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  7. 27
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  8. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java
  9. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  10. 40
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  11. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  12. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java
  13. 46
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  14. 130
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  15. 32
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownGoodsLogClient.java

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupOrderListVO.java

@ -22,6 +22,8 @@ public class DistributionStockupOrderListVO implements Serializable {
private String pallet;//托盘 private String pallet;//托盘
@ApiModelProperty(value = "整托状态") @ApiModelProperty(value = "整托状态")
private boolean trayLean;//整托状态 private boolean trayLean;//整托状态
@ApiModelProperty(value = "货位配货状态")
private boolean completeStact;//货位配货状态
@ApiModelProperty(value = "容器件数") @ApiModelProperty(value = "容器件数")
private Integer containerNum;//容器件数 private Integer containerNum;//容器件数
@ApiModelProperty(value = "计划件数") @ApiModelProperty(value = "计划件数")

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java

@ -17,6 +17,9 @@ public class DistributionStockupSelfVO {
private Integer scanNum; // 扫描数 private Integer scanNum; // 扫描数
private String warehouseArea; // 库位 private String warehouseArea; // 库位
private String trays; // 托盘 private String trays; // 托盘
private String orderPackageCode; // 包件码
private Long lwugId; // 货位ID
private Long ldsId; // 扫码ID
} }

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

@ -28,6 +28,7 @@ public class PackageStockupVO implements Serializable {
private String allocationTitle;//货位名称 private String allocationTitle;//货位名称
private Long scanId;//扫码记录id private Long scanId;//扫码记录id
private Long allocationId;//货位id
private List<DistributionParcelDetailsEntity> detailsEntities = new ArrayList<>(); private List<DistributionParcelDetailsEntity> detailsEntities = new ArrayList<>();

15
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsLogClient.java

@ -21,8 +21,12 @@ import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.BladePage;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/** /**
* 上下架记录表 Feign接口类 * 上下架记录表 Feign接口类
* *
@ -37,6 +41,9 @@ public interface IWarehouseUpdownGoodsLogClient {
String API_PREFIX = "warehouseUpdownGoodsLog/client"; String API_PREFIX = "warehouseUpdownGoodsLog/client";
String TOP = API_PREFIX + "/top"; String TOP = API_PREFIX + "/top";
String GETUPDOWNGOODS = API_PREFIX + "/updownGoods";
String GETUPDOWNGOODSLIST = API_PREFIX + "/updownGoodsList";
/** /**
* 获取上下架记录表列表 * 获取上下架记录表列表
* *
@ -47,4 +54,12 @@ public interface IWarehouseUpdownGoodsLogClient {
@GetMapping(TOP) @GetMapping(TOP)
BladePage<WarehouseUpdownGoodsLogEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); BladePage<WarehouseUpdownGoodsLogEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
/**
* 查询包件的历史货位
*
* @param updownGoodsLogEntity@return
*/
@PostMapping(GETUPDOWNGOODS)
WarehouseUpdownGoodsLogEntity getUpdownGoods(@RequestBody WarehouseUpdownGoodsLogEntity updownGoodsLogEntity);
} }

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

@ -30,6 +30,7 @@ import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*; import com.logpm.distribution.vo.*;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity; import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient; import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsLogClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -40,11 +41,13 @@ import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant; import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.utils.CommonUtil; import org.springblade.common.utils.CommonUtil;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache; import org.springblade.system.cache.DictBizCache;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.lang.reflect.Field; import java.lang.reflect.Field;
@ -73,10 +76,12 @@ public class DistributionStockupAppController extends BladeController {
private final IDistributionStockArticleService distributionStockArticleService; private final IDistributionStockArticleService distributionStockArticleService;
private final IDistributionParcelListService distributionParcelListService; private final IDistributionParcelListService distributionParcelListService;
private final IDistributionReservationPackageService distributionReservationPackageService; private final IDistributionReservationPackageService distributionReservationPackageService;
private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
private final IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient; private final IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient;
private final IWarehouseUpdownGoodsLogClient warehouseUpdownGoodsLogClient;
private IDistributionAsyncService distributionAsyncService;
private final RabbitTemplate rabbitTemplate; private final RabbitTemplate rabbitTemplate;
private final BladeRedis bladeRedis;
private final IDistributionStockListService iDistributionStockListService; private final IDistributionStockListService iDistributionStockListService;
/** /**
@ -250,6 +255,7 @@ public class DistributionStockupAppController extends BladeController {
Long stockupId = stockupDTO.getStockupId();//备货任务Id Long stockupId = stockupDTO.getStockupId();//备货任务Id
Integer orderStatus = stockupDTO.getOrderStatus();//1 客户订单 2库存品 Integer orderStatus = stockupDTO.getOrderStatus();//1 客户订单 2库存品
Integer status = stockupDTO.getStatus();//0未完成 1已完成
Long allocationId = stockupDTO.getAllocationId(); //货位 Long allocationId = stockupDTO.getAllocationId(); //货位
Long trayId = stockupDTO.getTrayId(); //托盘Id Long trayId = stockupDTO.getTrayId(); //托盘Id
@ -257,6 +263,10 @@ public class DistributionStockupAppController extends BladeController {
log.warn("##############orderInfo: 备货任务ID为空 allocation={}", stockupId); log.warn("##############orderInfo: 备货任务ID为空 allocation={}", stockupId);
return R.fail(3002, "备货任务Id为空"); return R.fail(3002, "备货任务Id为空");
} }
if (ObjectUtils.isNull(status)) {
log.warn("##############status: 货位状态为空 allocation={}", stockupId);
return R.fail(3002, "货位状态为空");
}
//查询自提还是商 市 //查询自提还是商 市
DistributionStockupEntity byId = distributionStockupService.getById(stockupId); DistributionStockupEntity byId = distributionStockupService.getById(stockupId);
@ -271,10 +281,10 @@ public class DistributionStockupAppController extends BladeController {
} }
if(byId.getTypeService().equals("3")){ if(byId.getTypeService().equals("3")){
//自 //自
DistributionStockupOrderInfoVO infoVO = distributionStockupService.selectOrderInfoSelf(reservationId,stockArticleId,stockupId,trayId,allocationId); DistributionStockupOrderInfoVO infoVO = distributionStockupService.selectOrderInfoSelf(stockupDTO);
return R.data(infoVO); return R.data(infoVO);
} else { } else {
DistributionStockupOrderInfoVO infoVO = distributionStockupService.selectOrderInfo(reservationId, stockArticleId, stockupId, trayId,allocationId); DistributionStockupOrderInfoVO infoVO = distributionStockupService.selectOrderInfo(stockupDTO);
return R.data(infoVO); return R.data(infoVO);
} }
@ -343,7 +353,6 @@ public class DistributionStockupAppController extends BladeController {
return b; return b;
} }
;
@PutMapping("/updateStockArea") @PutMapping("/updateStockArea")
@ -435,7 +444,7 @@ public class DistributionStockupAppController extends BladeController {
//修改包件备货状态 //修改包件备货状态
one.setOrderPackageStockupStatus(StockupStatusConstant.yibeihuo.getValue()); one.setOrderPackageStockupStatus(StockupStatusConstant.yibeihuo.getValue());
//todo 待下架操作 //todo 待下架操作
warehouseUpdownTypeClient.downPackage(stockupDTO.getPacketBarCode()); // warehouseUpdownTypeClient.downPackage(stockupDTO.getPacketBarCode());
distributionParcelListService.updateById(one); distributionParcelListService.updateById(one);
}else{ }else{
entity.setReservationId(reservationId); entity.setReservationId(reservationId);
@ -455,7 +464,8 @@ public class DistributionStockupAppController extends BladeController {
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map); rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map);
String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1"); String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1");
//查询是否货位数据是否该下架
distributionAsyncService.stockupSelfOffShelf(stockupDTO);
return Resp.scanSuccess("扫描成功!", audioValue); return Resp.scanSuccess("扫描成功!", audioValue);
case 2: case 2:
//重复扫描 //重复扫描
@ -535,23 +545,23 @@ public class DistributionStockupAppController extends BladeController {
entity.setMarketId(byId.getMarketId()); entity.setMarketId(byId.getMarketId());
entity.setMaterialId(byId.getMaterialId()); entity.setMaterialId(byId.getMaterialId());
//查询库位id //查询库位id
WarehouseUpdownGoodsEntity updownGoods = new WarehouseUpdownGoodsEntity(); // WarehouseUpdownGoodsEntity updownGoods = new WarehouseUpdownGoodsEntity();
updownGoods.setAssociationId(byId.getId()); // updownGoods.setAssociationId(byId.getId());
updownGoods.setMarketId(byId.getMarketId()); // updownGoods.setMarketId(byId.getMarketId());
updownGoods.setIncomingBatch(byId.getIncomingBatch()); // updownGoods.setIncomingBatch(byId.getIncomingBatch());
Long l = warehouseUpdownGoodsClient.selectStockListOwe(updownGoods); // Long l = warehouseUpdownGoodsClient.selectStockListOwe(updownGoods);
if(!ObjectUtils.isNull(l)){ // if(!ObjectUtils.isNull(l)){
//todo 待下架操作 // //todo 待下架操作
JSONObject jsonObject = new JSONObject(); // JSONObject jsonObject = new JSONObject();
jsonObject.put("marketId",byId.getMarketId()); // jsonObject.put("marketId",byId.getMarketId());
jsonObject.put("materialCode",byId.getMarketCode()); // jsonObject.put("materialCode",byId.getMarketCode());
jsonObject.put("incomingBatch",byId.getIncomingBatch()); // jsonObject.put("incomingBatch",byId.getIncomingBatch());
jsonObject.put("enterNum",1); // jsonObject.put("enterNum",1);
jsonObject.put("allocationId",l); // jsonObject.put("allocationId",l);
List<JSONObject> list = new ArrayList<>(); // List<JSONObject> list = new ArrayList<>();
list.add(jsonObject); // list.add(jsonObject);
warehouseUpdownTypeClient.downStock(list); // warehouseUpdownTypeClient.downStock(list);
} // }
} }
entity.setConditions("0"); entity.setConditions("0");
entity.setType(2); entity.setType(2);

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

@ -200,7 +200,7 @@
and ldpl.pallet = #{pallet} and ldpl.pallet = #{pallet}
and ldr.is_deleted = 0 --> and ldr.is_deleted = 0 -->
select ldpl.order_code orderCode,ldpl.order_package_code packageBarCode, 1 goodsType,ldrp.parce_list_id parceListId,ldpl.material_name materialName, select ldpl.order_code orderCode,ldpl.order_package_code packageBarCode, 1 goodsType,ldrp.parce_list_id parceListId,ldpl.material_name materialName,
lwug.allocation_title allocationTitle,lwtg.tray_code trayCode lwug.allocation_title allocationTitle,lwtg.tray_code trayCode,lwug.position_code positionCode,lwug.allocation_id allocationId
from logpm_distribution_reservation_package ldrp from logpm_distribution_reservation_package ldrp
LEFT JOIN logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id LEFT JOIN logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id =ldrp.parce_list_id and lwtg.association_type = '3' LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id =ldrp.parce_list_id and lwtg.association_type = '3'

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

@ -196,13 +196,26 @@
ldsa.order_code, ldsa.order_code,
ldrs.stock_article_id, ldrs.stock_article_id,
ldpl.pallet --> ldpl.pallet -->
select DISTINCT CONCAT(lwug.area_title,'-',lwug.shelf_title,'-',lwug.allocation_title ) allocation , lwtg.tray_code pallet,lwug.area_id areaId, select DISTINCT CONCAT(lwug.position_code ) allocation , lwtg.tray_code pallet,lwug.area_id areaId,
lwug.shelf_id shelfId,lwug.allocation_id allocationId,lwtg.tray_id trayId,ldpl.order_code orderCode,ldpl.stock_article_id stockArticleId lwug.shelf_id shelfId,lwug.allocation_id allocationId,lwtg.tray_id trayId,ldpl.order_code orderCode,ldpl.stock_article_id stockArticleId ,
,( CASE WHEN lwug.id is null THEN
select COUNT(drp.id) (
from logpm_distribution_reservation_package drp (select COUNT(id)
where drp.reservation_id = ldrp.reservation_id and drp.packet_bar_status in (1,3) and drp.stock_article_id = ldpl.stock_article_id from logpm_distribution_parcel_list
) planNum, where stock_article_id = ldpl.stock_article_id) - (
select COUNT(lwug.id)
from logpm_distribution_parcel_list dpl
LEFT JOIN logpm_warehouse_updown_goods lwug on dpl.id = lwug.association_id
where dpl.stock_article_id = ldpl.stock_article_id
)
)ELSE (
select COUNT(wug.id)
from logpm_distribution_reservation_stockarticle ldrs
LEFT JOIN logpm_distribution_parcel_list ldpl on ldrs.stock_article_id = ldpl.stock_article_id
LEFT JOIN logpm_warehouse_updown_goods wug on wug.association_id = ldpl.id
where ldrs.reservation_id = ldrp.reservation_id and ldrs.stock_article_id = ldpl.stock_article_id and wug.allocation_id = lwug.allocation_id
)
END planNum,
( (
select COUNT(lds.id) select COUNT(lds.id)
from logpm_distribution_reservation_package drp from logpm_distribution_reservation_package drp

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

@ -170,4 +170,18 @@ public interface DistributionStockupMapper extends BaseMapper<DistributionStocku
IPage<DistributionStockupEntity> pageOweList(IPage<Object> page,@Param("param")DistributionStockupEntity distributionStockupEntity); IPage<DistributionStockupEntity> pageOweList(IPage<Object> page,@Param("param")DistributionStockupEntity distributionStockupEntity);
IPage<DistributionStockupVO> getInventoryOwnSelf(IPage<Object> page,@Param("id") Long id); IPage<DistributionStockupVO> getInventoryOwnSelf(IPage<Object> page,@Param("id") Long id);
/**
*
* @param stockupDTO
* @return
*/
List<DistributionStockupSelfVO> stockupSelfOffShelf(@Param("param")StockupDTO stockupDTO);
/**
*
* @param stockupDTO
* @return
*/
List<DistributionStockupSelfVO> stockupOffShelf(StockupDTO stockupDTO);
} }

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

@ -48,7 +48,25 @@
</where> </where>
</select> </select>
<select id="stockupSelfOffShelf" resultType="com.logpm.distribution.vo.DistributionStockupSelfVO">
select lwug.id lwugId,lds.id ldsId,ldpl.order_package_code orderPackageCode
from logpm_distrilbution_bill_stock ldbs
LEFT JOIN logpm_distribution_parcel_list ldpl on ldbs.stock_article_id = ldpl.stock_article_id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id and lwug.association_type = 3
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id
<where>
ldbs.order_status in (1,2) and ldbs.bill_lading_id = #{param.reservationId}
</where>
</select>
<select id="stockupOffShelf" resultType="com.logpm.distribution.vo.DistributionStockupSelfVO">
select lwug.id lwugId,lds.id ldsId,ldrp.packet_bar_code orderPackageCode
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
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}
</where>
</select>
<select id="selectDistributionStockupPage" resultMap="distributionStockupResultMap"> <select id="selectDistributionStockupPage" resultMap="distributionStockupResultMap">
select * from logpm_distribution_stockup where is_deleted = 0 select * from logpm_distribution_stockup where is_deleted = 0

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

@ -48,11 +48,24 @@
</where> </where>
</select> </select>
<select id="selectDistrilbutionBillPackWuSelf" resultType="com.logpm.distribution.vo.DistributionStockupSelfVO"> <select id="selectDistrilbutionBillPackWuSelf" resultType="com.logpm.distribution.vo.DistributionStockupSelfVO">
select ( select CASE WHEN lwug.id is null THEN
SELECT COUNT(lpl.id) (
FROM logpm_distribution_parcel_list lpl (select COUNT(id)
where lpl.stock_article_id = ldbs.stock_article_id and lpl.order_package_grounding_status = 10 from logpm_distribution_parcel_list
) planNum ,( where stock_article_id = ldbs.stock_article_id) - (
select COUNT(lwug.id)
from logpm_distribution_parcel_list dpl
LEFT JOIN logpm_warehouse_updown_goods lwug on dpl.id = lwug.association_id
where dpl.stock_article_id = ldbs.stock_article_id
)
)
ELSE (
select COUNT(lwug.id)
from logpm_distribution_parcel_list dpl
LEFT JOIN logpm_warehouse_updown_goods lwug on dpl.id = lwug.association_id
where dpl.stock_article_id = ldbs.stock_article_id
)
END planNum ,(
SELECT COUNT(lt.id) SELECT COUNT(lt.id)
FROM logpm_distribution_stock lt FROM logpm_distribution_stock lt
WHERE lt.parcel_list_id = ldpl.id and lt.stockup_id = ldsi.stockup_id WHERE lt.parcel_list_id = ldpl.id and lt.stockup_id = ldsi.stockup_id
@ -68,9 +81,9 @@
) trays ) trays
from logpm_distribution_stockup_info ldsi from logpm_distribution_stockup_info ldsi
LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldsi.reservation_id = ldbs.bill_lading_id LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldsi.reservation_id = ldbs.bill_lading_id
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id and ldpl.order_package_grounding_status = 10
where LEFT JOIN logpm_warehouse_updown_goods lwug on ldpl.id = lwug.association_id
ldsi.stockup_id = #{stockupId} and ldsi.reservation_id = #{reservationId} and ldpl.order_package_grounding_status = 10 where ldsi.stockup_id = #{stockupId} and ldsi.reservation_id = #{reservationId} and lwug.id is null
</select> </select>
<select id="exportDistrilbutionBillStock" resultType="com.logpm.distribution.excel.DistrilbutionBillStockExcel"> <select id="exportDistrilbutionBillStock" resultType="com.logpm.distribution.excel.DistrilbutionBillStockExcel">
@ -112,12 +125,17 @@
</select> </select>
<select id="selectDistrilbutionBillSelf" resultType="com.logpm.distribution.vo.DistributionStockupOrderListVO"> <select id="selectDistrilbutionBillSelf" resultType="com.logpm.distribution.vo.DistributionStockupOrderListVO">
select DISTINCT CONCAT( lwug.position_code ) allocation ,lwug.allocation_id allocationId , lwtg.tray_code pallet,lwtg.tray_id trayId,lwug.area_id areaId, select DISTINCT CONCAT( lwug.position_code ) allocation ,lwug.allocation_id allocationId , lwtg.tray_code pallet,lwtg.tray_id trayId,lwug.area_id areaId,
lwug.shelf_id shelfId,lwug.allocation_id allocationId,lwtg.tray_id trayId,ldpl.order_code orderCode,ldpl.stock_article_id stockArticleId , lwug.shelf_id shelfId,ldpl.order_code orderCode,ldpl.stock_article_id stockArticleId ,
CASE WHEN lwug.id is null THEN CASE WHEN lwug.id is null THEN
( (
select COUNT(id) (select COUNT(id)
from logpm_distribution_parcel_list from logpm_distribution_parcel_list
where stock_article_id = ldbs.stock_article_id and order_package_grounding_status = 10 where stock_article_id = ldbs.stock_article_id) - (
select COUNT(lwug.id)
from logpm_distribution_parcel_list dpl
LEFT JOIN logpm_warehouse_updown_goods lwug on dpl.id = lwug.association_id
where dpl.stock_article_id = ldbs.stock_article_id
)
) )
ELSE ( ELSE (
select COUNT(lwug.id) select COUNT(lwug.id)

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

@ -161,4 +161,10 @@ public interface IDistributionAsyncService {
* @param deliveryId * @param deliveryId
*/ */
void checkDeliverySignStatusByReservation(Long deliveryId); void checkDeliverySignStatusByReservation(Long deliveryId);
/**
* 判断自提包件是否该下架
* @param stockupDTO
*/
void stockupSelfOffShelf(StockupDTO stockupDTO);
} }

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

@ -72,25 +72,20 @@ public interface IDistributionStockupService extends BaseService<DistributionSto
/** /**
* 查询已经备货的列表 * 查询已经备货的列表
* * reservationId
* @param reservationId * stockArticleId
* @param stockArticleId * stockupId
* @param stockupId * trayId
* @param trayId * allocation
* @param allocation
* @return * @return
*/ */
DistributionStockupOrderInfoVO selectOrderInfo(Long reservationId, Long stockArticleId, Long stockupId,Long trayId,Long allocation); DistributionStockupOrderInfoVO selectOrderInfo(StockupDTO stockupDTO);
/** /**
* 自提备货客户包件数据查询 * 自提备货客户包件数据查询
* @param reservationId
* @param stockArticleId
* @param stockupId
* @param trayId
* @return * @return
*/ */
DistributionStockupOrderInfoVO selectOrderInfoSelf(Long reservationId, Long stockArticleId, Long stockupId, Long trayId,Long allocationId); DistributionStockupOrderInfoVO selectOrderInfoSelf(StockupDTO stockupDTO);
/** /**
* 备货基础信息 * 备货基础信息

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

@ -2,6 +2,7 @@ package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.dto.DistributionStockArticleDTO; import com.logpm.distribution.dto.DistributionStockArticleDTO;
import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO; import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO;
@ -9,9 +10,12 @@ import com.logpm.distribution.dto.app.StockupDTO;
import com.logpm.distribution.entity.*; import com.logpm.distribution.entity.*;
import com.logpm.distribution.mapper.*; import com.logpm.distribution.mapper.*;
import com.logpm.distribution.service.*; import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionStockupSelfVO;
import com.logpm.distribution.vo.DistrilbutionBillStockVO; import com.logpm.distribution.vo.DistrilbutionBillStockVO;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant; import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant;
import org.springblade.common.constant.Inventory.InventoryPackageStatusConstant; import org.springblade.common.constant.Inventory.InventoryPackageStatusConstant;
import org.springblade.common.constant.Inventory.InventorySigningStatusConstant; import org.springblade.common.constant.Inventory.InventorySigningStatusConstant;
@ -30,9 +34,10 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
@ -63,6 +68,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
private final DistributionDeliveryDetailsMapper distributionDeliveryDetailsMapper; private final DistributionDeliveryDetailsMapper distributionDeliveryDetailsMapper;
private final DistributionParcelListMapper distributionParcelListMapper; private final DistributionParcelListMapper distributionParcelListMapper;
private final IDisStockListDetailService disStockListDetailService; private final IDisStockListDetailService disStockListDetailService;
private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
@Override @Override
@ -577,6 +583,44 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
} }
/**
* 判断自提包件是否该下架
* @param stockupDTO
*/
@Async
@Override
public void stockupSelfOffShelf(StockupDTO stockupDTO) {
//判断类型
List<DistributionStockupSelfVO> distributionStockupSelfVO = new ArrayList<>();
if(stockupDTO.getTypeService().equals(DistributionTypeConstant.ziti.getValue())){
//自
distributionStockupSelfVO = distributionStockupService.stockupSelfOffShelf(stockupDTO);
}else{
//商 市
distributionStockupSelfVO = distributionStockupService.stockupOffShelf(stockupDTO);
}
List<String> list = new ArrayList<>();
AtomicInteger a = new AtomicInteger();
AtomicInteger b = new AtomicInteger();
distributionStockupSelfVO.forEach( i -> {
if(ObjectUtils.isNotNull(i.getLwugId())){
a.addAndGet(1);
if(ObjectUtils.isNotNull(i.getLdsId())){
b.addAndGet(1);
list.add(i.getOrderPackageCode());
}
}
});
if(a.get() == b.get()){
//下架
list.forEach( i ->{
warehouseUpdownTypeClient.downPackage(i);
});
}
}
/** /**
* 自提签收片段是否签收完全 * 自提签收片段是否签收完全

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

@ -36,10 +36,15 @@ import com.logpm.distribution.vo.*;
import com.logpm.distribution.wrapper.DistributionStockupWrapper; import com.logpm.distribution.wrapper.DistributionStockupWrapper;
import com.logpm.warehouse.entity.WarehouseTaryAllocationEntity; import com.logpm.warehouse.entity.WarehouseTaryAllocationEntity;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity; import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsLogEntity;
import com.logpm.warehouse.feign.IWarehouseTaryAllocationClient; import com.logpm.warehouse.feign.IWarehouseTaryAllocationClient;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient; import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsLogClient;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.CodeDesEnum; import org.springblade.common.constant.CodeDesEnum;
import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant; import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.stocklist.StockLockingStatusConstant; import org.springblade.common.constant.stocklist.StockLockingStatusConstant;
import org.springblade.common.constant.stocklist.StockSignfoStatusConstant; import org.springblade.common.constant.stocklist.StockSignfoStatusConstant;
@ -59,6 +64,7 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.xml.ws.BindingType;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
@ -69,6 +75,7 @@ import java.util.concurrent.atomic.AtomicReference;
* @since 2023-06-15 * @since 2023-06-15
*/ */
@Service @Service
@AllArgsConstructor
public class DistributionStockupServiceImpl extends BaseServiceImpl<DistributionStockupMapper, DistributionStockupEntity> implements IDistributionStockupService { public class DistributionStockupServiceImpl extends BaseServiceImpl<DistributionStockupMapper, DistributionStockupEntity> implements IDistributionStockupService {
@Lazy @Lazy
@ -130,6 +137,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
@Autowired @Autowired
private IDistributionAsyncService distributionAsyncService; private IDistributionAsyncService distributionAsyncService;
private IWarehouseUpdownGoodsLogClient warehouseUpdownGoodsLogClient;
@Override @Override
public IPage<DistributionStockupVO> selectDistributionStockupPage(IPage<DistributionStockupVO> page, DistributionStockupVO distributionStockup) { public IPage<DistributionStockupVO> selectDistributionStockupPage(IPage<DistributionStockupVO> page, DistributionStockupVO distributionStockup) {
@ -475,11 +484,40 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
public List<DistributionStockupOrderListVO> selectStockupOrderList(StockupDTO stockupDTO) { public List<DistributionStockupOrderListVO> selectStockupOrderList(StockupDTO stockupDTO) {
Long reservationId = stockupDTO.getReservationId();//预约单id Long reservationId = stockupDTO.getReservationId();//预约单id
if (stockupDTO.getTypeService().equals("3")) { if (stockupDTO.getTypeService().equals("3")) {
//查询客户数据 //查询客户数据
List<DistributionStockupOrderListVO> list = distrilbutionBillStockService.selectDistrilbutionBillSelf(reservationId); List<DistributionStockupOrderListVO> list = distrilbutionBillStockService.selectDistrilbutionBillSelf(reservationId);
//查询包件的库位的
if(!list.isEmpty()){
list.forEach( i ->{
if(ObjectUtils.isNull(i.getAllocationId())){
//查询包件信息
List<DistributionParcelListEntity> list1 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, i.getStockArticleId())
);
if(!list1.isEmpty()){
list1.forEach( a ->{
WarehouseUpdownGoodsLogEntity updownGoodsLog = new WarehouseUpdownGoodsLogEntity();
updownGoodsLog.setAssociationType("3");
updownGoodsLog.setAssociationId(a.getId());
updownGoodsLog.setBindingType("2"); //下架
BasicdataWarehouseEntity my = basicdataWarehouseClient.getMyCurrentWarehouse();
updownGoodsLog.setWarehouseId(my.getId());
WarehouseUpdownGoodsLogEntity updownGoods = warehouseUpdownGoodsLogClient.getUpdownGoods(updownGoodsLog);
if(ObjectUtils.isNotNull(updownGoods)){
i.setAllocation(updownGoods.getPositionCode());
i.setAllocationId(updownGoods.getAllocationId());
i.setCompleteStact(true);
}
});
}
}
});
}
return list; return list;
} else { } else {
// //商 市
//1.根据预约单id 查询到对应的数据 //1.根据预约单id 查询到对应的数据
List<DistributionStockupOrderListVO> list = distributionReservationService.selectStockupOrderList(reservationId); List<DistributionStockupOrderListVO> list = distributionReservationService.selectStockupOrderList(reservationId);
return list; return list;
@ -504,23 +542,25 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
} }
@Override @Override
public DistributionStockupOrderInfoVO selectOrderInfo(Long reservationId, Long stockArticleId, Long stockupId, Long trayId, Long allocation) { public DistributionStockupOrderInfoVO selectOrderInfo(StockupDTO stockupDTO) {
//查询客户信息 //查询客户信息
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId); //预约信息 DistributionReservationEntity reservationEntity = distributionReservationService.getById(stockupDTO.getReservationId()); //预约信息
//通过订单id和预约id,托盘信息查询对应的包件列表 //通过订单id和预约id,托盘信息查询对应的包件列表
List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoList(reservationId, stockArticleId, stockupId, trayId); List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoList(stockupDTO.getReservationId(), stockupDTO.getStockArticleId(), stockupDTO.getStockupId(), stockupDTO.getTrayId());
int size = list.size(); //数量 // int size = list.size(); //数量
Integer size = 0; //数量
Integer scanNum = 0; Integer scanNum = 0;
DistributionStockupEntity byId = distributionStockupService.selectById(stockupId); DistributionStockupEntity byId = distributionStockupService.selectById(stockupDTO.getStockupId());
String allocationTitle = null; String allocationTitle = null;
String trayCode = null; String trayCode = null;
Iterator<PackageStockupVO> iterator = list.iterator(); Iterator<PackageStockupVO> iterator = list.iterator();
if(ObjectUtils.isNotNull(allocation)){ if(ObjectUtils.isNotNull(stockupDTO.getAllocationId())){
//有 //有
while (iterator.hasNext()){ while (iterator.hasNext()){
PackageStockupVO vo = iterator.next(); PackageStockupVO vo = iterator.next();
if(ObjectUtils.isNull(vo.getPositionCode())){ if(ObjectUtils.isNull(vo.getPositionCode()) || ObjectUtils.isNotNull(vo.getAllocationId()) && !vo.getAllocationId().equals(stockupDTO.getAllocationId()) ){
iterator.remove(); iterator.remove();
continue; continue;
} }
@ -546,11 +586,13 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
qw.eq("package_code", orderPackageCode); qw.eq("package_code", orderPackageCode);
List<DistributionParcelDetailsEntity> parcelDetailsEntityList = distributionParcelDetailsService.list(qw); List<DistributionParcelDetailsEntity> parcelDetailsEntityList = distributionParcelDetailsService.list(qw);
vo.setDetailsEntities(parcelDetailsEntityList); vo.setDetailsEntities(parcelDetailsEntityList);
size += 1;
} }
}else{ }else{
//没有 //没有
PackageStockupVO vo = iterator.next();
while (iterator.hasNext()){ while (iterator.hasNext()){
PackageStockupVO vo = iterator.next();
if(ObjectUtils.isNotNull(vo.getPositionCode())){ if(ObjectUtils.isNotNull(vo.getPositionCode())){
iterator.remove(); iterator.remove();
continue; continue;
@ -577,11 +619,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
qw.eq("package_code", orderPackageCode); qw.eq("package_code", orderPackageCode);
List<DistributionParcelDetailsEntity> parcelDetailsEntityList = distributionParcelDetailsService.list(qw); List<DistributionParcelDetailsEntity> parcelDetailsEntityList = distributionParcelDetailsService.list(qw);
vo.setDetailsEntities(parcelDetailsEntityList); vo.setDetailsEntities(parcelDetailsEntityList);
size += 1;
} }
} }
DistributionStockupOrderInfoVO vo = new DistributionStockupOrderInfoVO(); DistributionStockupOrderInfoVO vo = new DistributionStockupOrderInfoVO();
vo.setReservationId(reservationId); //预约id vo.setReservationId(stockupDTO.getReservationId()); //预约id
vo.setCustomer(reservationEntity.getConsignee()); //客户0 vo.setCustomer(reservationEntity.getConsignee()); //客户0
vo.setAddress(reservationEntity.getDeliveryAddress()); //地址 vo.setAddress(reservationEntity.getDeliveryAddress()); //地址
vo.setPlanNum(size); //计划件数 vo.setPlanNum(size); //计划件数
@ -596,28 +639,67 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
/** /**
* 自提备货客户包件数据查询 * 自提备货客户包件数据查询
* *
* @param reservationId 自提id * reservationId 自提id
* @param stockArticleId 订单id * stockArticleId 订单id
* @param stockupId 备货id * stockupId 备货id
* @param trayId 托盘id * trayId 托盘id
* @return * @return
*/ */
@Override @Override
public DistributionStockupOrderInfoVO selectOrderInfoSelf(Long reservationId, Long stockArticleId, Long stockupId, Long trayId,Long allocationId) { public DistributionStockupOrderInfoVO selectOrderInfoSelf(StockupDTO stockupDTO) {
DistributionStockArticleEntity byId = distributionStockArticleService.getById(stockArticleId); DistributionStockArticleEntity byId = distributionStockArticleService.getById(stockupDTO.getStockArticleId());
if(stockupDTO.getStatus().equals(1)){
DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackWuSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId());
List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, stockupDTO.getStockArticleId())
);
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
List<PackageStockupVO> listPack = new ArrayList<>();
list.forEach( i ->{
WarehouseUpdownGoodsLogEntity updownGoodsLogEntity = new WarehouseUpdownGoodsLogEntity();
updownGoodsLogEntity.setAssociationType("3");
updownGoodsLogEntity.setAssociationId(stockupDTO.getAllocationId());
updownGoodsLogEntity.setBindingType("2");
updownGoodsLogEntity.setWarehouseId(myCurrentWarehouse.getId());
updownGoodsLogEntity.setAllocationId(i.getId());
WarehouseUpdownGoodsLogEntity updownGoods = warehouseUpdownGoodsLogClient.getUpdownGoods(updownGoodsLogEntity);
PackageStockupVO packageStockupVO = new PackageStockupVO();
packageStockupVO.setOrderCode(i.getOrderCode());
packageStockupVO.setPackageBarCode(i.getOrderPackageCode());
packageStockupVO.setGoodsType(1);
packageStockupVO.setGoodsTypeStr("定制品");
packageStockupVO.setMaterialName(i.getMaterialName());
packageStockupVO.setIsScanStr("已备货");
packageStockupVO.setIsScan(2);
listPack.add(packageStockupVO);
});
DistributionStockupOrderInfoVO vo = new DistributionStockupOrderInfoVO();
vo.setReservationId(stockupDTO.getReservationId()); //预约id
vo.setCustomer(byId.getMallName()); //客户0
vo.setAddress(byId.getConsigneeAddress()); //地址
vo.setPlanNum(distributionStockupSelfVO.getPlanNum()); //计划件数
vo.setScanNum(distributionStockupSelfVO.getScanNum()); //备货件数
vo.setStockupArea(distributionStockupSelfVO.getConsignee()); //备货区
vo.setWarehouseArea(distributionStockupSelfVO.getWarehouseArea()); //库位
vo.setTrays(distributionStockupSelfVO.getTrays()); //托盘
vo.setPackageList(listPack); //
return vo;
}else{
DistributionStockupSelfVO distributionStockupSelfVO = new DistributionStockupSelfVO(); DistributionStockupSelfVO distributionStockupSelfVO = new DistributionStockupSelfVO();
if(ObjectUtils.isNotNull(allocationId)){ if(ObjectUtils.isNotNull(stockupDTO.getAllocationId())){
//查询订单数量 有库位 //查询订单数量 有库位
distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackSelf(reservationId, stockupId,allocationId); distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId(),stockupDTO.getAllocationId());
}else{ }else{
//查询订单数量 无库位 //查询订单数量 无库位
distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackWuSelf(reservationId, stockupId); distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackWuSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId());
} }
List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoSelfList(reservationId, stockArticleId, stockupId, trayId); List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoSelfList(stockupDTO.getReservationId(), stockupDTO.getStockArticleId(), stockupDTO.getStockupId(), stockupDTO.getTrayId());
Iterator<PackageStockupVO> iterator = list.iterator(); Iterator<PackageStockupVO> iterator = list.iterator();
if(Objects.isNull(allocationId)){ if(Objects.isNull(stockupDTO.getAllocationId())){
while (iterator.hasNext()){ while (iterator.hasNext()){
PackageStockupVO next = iterator.next(); PackageStockupVO next = iterator.next();
if(ObjectUtils.isNotNull(next.getPositionCode()) ){ if(ObjectUtils.isNotNull(next.getPositionCode()) ){
@ -649,7 +731,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
} }
} }
DistributionStockupOrderInfoVO vo = new DistributionStockupOrderInfoVO(); DistributionStockupOrderInfoVO vo = new DistributionStockupOrderInfoVO();
vo.setReservationId(reservationId); //预约id vo.setReservationId(stockupDTO.getReservationId()); //预约id
vo.setCustomer(byId.getMallName()); //客户0 vo.setCustomer(byId.getMallName()); //客户0
vo.setAddress(byId.getConsigneeAddress()); //地址 vo.setAddress(byId.getConsigneeAddress()); //地址
vo.setPlanNum(distributionStockupSelfVO.getPlanNum()); //计划件数 vo.setPlanNum(distributionStockupSelfVO.getPlanNum()); //计划件数
@ -658,9 +740,9 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
vo.setWarehouseArea(distributionStockupSelfVO.getWarehouseArea()); //库位 vo.setWarehouseArea(distributionStockupSelfVO.getWarehouseArea()); //库位
vo.setTrays(distributionStockupSelfVO.getTrays()); //托盘 vo.setTrays(distributionStockupSelfVO.getTrays()); //托盘
vo.setPackageList(list); // vo.setPackageList(list); //
return vo; return vo;
} }
}
/** /**
* 查询备货信息 * 查询备货信息

32
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseUpdownGoodsLogClient.java

@ -16,17 +16,26 @@
*/ */
package com.logpm.warehouse.feign; package com.logpm.warehouse.feign;
import com.alibaba.nacos.plugin.auth.constant.Constants;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsLogEntity; import com.logpm.warehouse.entity.WarehouseUpdownGoodsLogEntity;
import com.logpm.warehouse.service.IWarehouseUpdownGoodsLogService; import com.logpm.warehouse.service.IWarehouseUpdownGoodsLogService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/** /**
* 上下架记录表 Feign实现类 * 上下架记录表 Feign实现类
* *
@ -39,6 +48,7 @@ import springfox.documentation.annotations.ApiIgnore;
public class WarehouseUpdownGoodsLogClient implements IWarehouseUpdownGoodsLogClient { public class WarehouseUpdownGoodsLogClient implements IWarehouseUpdownGoodsLogClient {
private final IWarehouseUpdownGoodsLogService warehouseUpdownGoodsLogService; private final IWarehouseUpdownGoodsLogService warehouseUpdownGoodsLogService;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
@Override @Override
@GetMapping(TOP) @GetMapping(TOP)
@ -50,4 +60,26 @@ public class WarehouseUpdownGoodsLogClient implements IWarehouseUpdownGoodsLogCl
return BladePage.of(page); return BladePage.of(page);
} }
/**
* 查询包件的历史货位
* @param updownGoodsLogEntity@return
* @return
*/
@Override
@PostMapping(GETUPDOWNGOODS)
public WarehouseUpdownGoodsLogEntity getUpdownGoods(WarehouseUpdownGoodsLogEntity updownGoodsLogEntity) {
return warehouseUpdownGoodsLogService.getOne(Wrappers.<WarehouseUpdownGoodsLogEntity>query().lambda()
.eq(WarehouseUpdownGoodsLogEntity::getAssociationId,updownGoodsLogEntity.getAssociationId())
.eq(ObjectUtils.isNotEmpty(updownGoodsLogEntity.getAllocationId()),WarehouseUpdownGoodsLogEntity::getAllocationId,updownGoodsLogEntity.getAllocationId())
.eq(WarehouseUpdownGoodsLogEntity::getAssociationType,updownGoodsLogEntity.getAssociationType())
.eq(WarehouseUpdownGoodsLogEntity::getBindingType,updownGoodsLogEntity.getBindingType())
.eq(WarehouseUpdownGoodsLogEntity::getWarehouseId,updownGoodsLogEntity.getWarehouseId())
.orderByDesc(WarehouseUpdownGoodsLogEntity::getCreateTime)
.last("limit 1")
);
}
} }

Loading…
Cancel
Save