Browse Source

修改备货 商 市库位信息

training
caoyizhong 1 year ago
parent
commit
624518dd17
  1. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  3. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  4. 38
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  5. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java
  6. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  7. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  8. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  9. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  10. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  11. 98
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

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

@ -281,6 +281,7 @@ public class DistributionStockupAppController extends BladeController {
DistributionStockupOrderInfoVO infoVO = distributionStockupService.selectOrderInfoSelf(stockupDTO);
return R.data(infoVO);
} else {
//
DistributionStockupOrderInfoVO infoVO = distributionStockupService.selectOrderInfo(stockupDTO);
return R.data(infoVO);
}
@ -461,8 +462,8 @@ public class DistributionStockupAppController extends BladeController {
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map);
String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1");
//查询是否货位数据是否该下架
//查询是否货位数据是否该下架
distributionAsyncService.stockupSelfOffShelf(stockupDTO);
return Resp.scanSuccess("扫描成功!", audioValue);
case 2:

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

@ -58,7 +58,7 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
int submitNumByOrderIdAndName(@Param("articleId") Long articleId,@Param("productName") String productName, @Param("num") Integer num);
List<PackageStockupVO> selectOrderInfoList(@Param("reservationId") Long reservationId, @Param("stockArticleId") Long stockArticleId, @Param("stockupId") Long stockupId,@Param("trayId") Long trayId);
List<PackageStockupVO> selectOrderInfoList(StockupDTO stockupDTO);
List<String> selectWarehouseAreaByReservationId(@Param("reservationId") Long reservationId);

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

@ -201,7 +201,7 @@
and CONCAT(ldpl.cargo_title,'-',ldpl.shelf_title,'-',ldpl.goods_allocation) = #{allocation}
and ldpl.pallet = #{pallet}
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 DISTINCT 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.position_code positionCode,lwug.allocation_id allocationId
from logpm_distribution_reservation_package ldrp
LEFT JOIN logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id
@ -250,7 +250,7 @@
from logpm_distribution_stockup_info ldsi
LEFT JOIN logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id
LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id
LEFT JOIN logpm_distribution_stock lds on ldpl.id = lds.parcel_list_id and lds.stockup_id = ldsi.stockup_id
<where>
ldsi.stockup_id =#{id}
</where>

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

@ -196,45 +196,13 @@
ldsa.order_code,
ldrs.stock_article_id,
ldpl.pallet -->
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 ,
CASE WHEN lwug.id is null THEN
(
(select COUNT(id)
from logpm_distribution_parcel_list
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,
CASE WHEN lwug.allocation_id is null THEN
(
select COUNT(ldplw.id) - COUNT(lwu.id)
from logpm_distribution_parcel_list ldplw
LEFT JOIN logpm_warehouse_updown_goods lwu on ldplw.id = lwu.association_id and lwu.association_type = '3'
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = lwu.association_id
where ldplw.stock_article_id = ldpl.stock_article_id
) ELSE (
select COUNT(lds.id)
from logpm_distribution_parcel_list ldplw
LEFT JOIN logpm_warehouse_updown_goods lwu on ldplw.id = lwu.association_id and lwu.association_type = '3'
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = lwu.association_id
where ldplw.stock_article_id = ldpl.stock_article_id and lwu.allocation_id = lwug.allocation_id
) END scanNum
select DISTINCT CONCAT(lwug.position_code ) allocation , lwtg.tray_code pallet,lwug.area_id areaId,ldpl.id parcelListId,lds.id stockId,
lwug.shelf_id shelfId,lwug.allocation_id allocationId,lwtg.tray_id trayId,ldpl.order_code orderCode,ldpl.stock_article_id stockArticleId
from logpm_distribution_reservation_package ldrp
LEFT JOIN logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id
LEFT JOIN logpm_warehouse_updown_goods lwug on ldpl.id = lwug.association_id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = lwug.association_id
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id and lds.reservation_id = ldrp.reservation_id
<where>
ldrp.reservation_id = #{reservationId} and ldrp.packet_bar_status in (1,3)
<!-- and lwug.association_type = '3' and lwtg.association_type = '3' -->

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

@ -183,5 +183,5 @@ public interface DistributionStockupMapper extends BaseMapper<DistributionStocku
* @param stockupDTO
* @return
*/
List<DistributionStockupSelfVO> stockupOffShelf(StockupDTO stockupDTO);
List<DistributionStockupSelfVO> stockupOffShelf(@Param("param")StockupDTO stockupDTO);
}

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

@ -223,14 +223,14 @@
from logpm_distribution_stockup ds
LEFT JOIN logpm_distribution_stockup_info ldsi on ds.id = ldsi.stockup_id
LEFT JOIN logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id and ldrp.packet_bar_status in (1,3)
LEFT JOIN logpm_distribution_stock ldsk on ldsk.parcel_list_id = ldrp.parce_list_id
LEFT JOIN logpm_distribution_stock ldsk on ldsk.parcel_list_id = ldrp.parce_list_id and ldsk.stockup_id =ds.id
where ds.id = lds.id
)+(
select COUNT(DISTINCT ldsk.id)
from logpm_distribution_stockup ds
LEFT JOIN logpm_distribution_stockup_info ldsi on ds.id = ldsi.stockup_id
LEFT JOIN logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldsi.reservation_id and ldrs.stock_list_status in (1,3)
LEFT JOIN logpm_distribution_stock ldsk on ldsk.stock_list_id = ldrs.stocklist_id
LEFT JOIN logpm_distribution_stock ldsk on ldsk.stock_list_id = ldrs.stocklist_id and ldsk.stockup_id =ds.id
where ds.id = lds.id and ldsk.stockup_id = lds.id
) realNum
from logpm_distribution_stockup lds

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

@ -47,7 +47,7 @@
</where>
</select>
<select id="selectDistrilbutionBillOverPackWuSelf" resultType="com.logpm.distribution.vo.DistributionStockupSelfVO">
select COUNT(lwugl.id) planNum ,(
select DISTINCT COUNT(lwugl.id) planNum ,(
SELECT COUNT(lt.id)
FROM logpm_distribution_stock lt
WHERE lt.parcel_list_id = ldpl.id and lt.stockup_id = ldsi.stockup_id
@ -65,7 +65,12 @@
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 and ldpl.order_package_grounding_status = 10
LEFT JOIN logpm_warehouse_updown_goods_log lwugl on ldpl.id = lwugl.association_id and lwugl.binding_type = 2
where ldsi.stockup_id = #{param.stockupId} and ldsi.reservation_id = #{param.reservationId} and lwugl.allocation_id = #{param.allocationId}
<where>
ldsi.stockup_id = #{param.stockupId} and ldsi.reservation_id = #{param.reservationId}
<if test=" param.allocationId != '' and param.allocationId != null ">
and lwugl.allocation_id = #{param.allocationId}
</if>
</where>
GROUP BY ldpl.id,lwugl.id
</select>
<select id="selectDistrilbutionBillPackWuSelf" resultType="com.logpm.distribution.vo.DistributionStockupSelfVO">
@ -89,7 +94,7 @@
END planNum ,(
SELECT COUNT(lt.id)
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 and lt.reservation_id = ldsi.reservation_id
) scanNum,(
select stockup_area
from logpm_distribution_stockup

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java

@ -56,7 +56,7 @@ public interface IDistributionParcelListService extends BaseService<Distribution
boolean submitNumByOrderIdAndName(Long articleId, String productName, Integer num);
List<PackageStockupVO> selectOrderInfoList(Long reservationId, Long stockArticleId, Long stockupId,Long trayId);
List<PackageStockupVO> selectOrderInfoList(StockupDTO stockupDTO);
List<String> selectWarehouseAreaByReservationId(Long reservationId);

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -33,6 +33,7 @@ import com.logpm.distribution.service.IDistributionParcelListService;
import com.logpm.distribution.vo.DistributionParcelListBaseVO;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.PackageStockupVO;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.order.OrderStockupStatusConstant;
@ -58,6 +59,8 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient;
@Override
public IPage<DistributionParcelListEntity> selectDistributionParcelListPage(IPage<DistributionParcelListEntity> page, DistributionParcelListVO distributionParcelList) {
List<BasicdataWarehouseEntity> myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse();
@ -91,8 +94,8 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
}
@Override
public List<PackageStockupVO> selectOrderInfoList(Long reservationId, Long stockArticleId, Long stockupId, Long trayId) {
return baseMapper.selectOrderInfoList(reservationId,stockArticleId,stockupId, trayId);
public List<PackageStockupVO> selectOrderInfoList(StockupDTO stockupDTO) {
return baseMapper.selectOrderInfoList(stockupDTO);
}
@Override
@ -119,6 +122,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
if(ObjectUtils.isNotNull(i) && ObjectUtils.isNotNull(i.getStockupStatus())){
i.setStockupStatusName(DictBizCache.getValue(DictBizConstant.STOCKUP_STATUS,i.getStockupStatus()));
}
//出现货位信息
String s = warehouseUpdownGoodsClient.selectMsgBywrap(i.getId());
i.setGoodsAllocation(s);
});
return parcelListOwn;
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -681,7 +681,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
if(collect.size() > 1){
stockArticleEntity.setWarehouseIdList(collect);
}else{
}else if(collect.size() == 1){
stockArticleEntity.setWarehouseId(collect.get(0));
}
IPage<DistributionStockArticleEntity> distributionStockArticleEntityIPage = baseMapper.pageListOwe(page, stockArticleEntity);

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

@ -43,6 +43,7 @@ import com.logpm.warehouse.feign.IWarehouseUpdownGoodsLogClient;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.CodeDesEnum;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.stocklist.StockLockingStatusConstant;
import org.springblade.common.constant.stocklist.StockSignfoStatusConstant;
@ -574,10 +575,80 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//商 市
//1.根据预约单id 查询到对应的数据
List<DistributionStockupOrderListVO> list = distributionReservationService.selectStockupOrderList(reservationId);
// list.forEach( p ->{
//
// });
return list;
List<DistributionStockupOrderListVO> collect11 = list.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList()); //有货位
Set<DistributionStockupOrderListVO> listYou = new HashSet<>();
collect11.forEach( p ->{
if(listYou.size() > 0){
//
boolean b = listYou.stream().anyMatch(a -> a.getAllocationId().equals(p.getAllocationId()));
if(b){
//有一样的
listYou.forEach( y -> {
if(y.getAllocationId().equals(p.getAllocationId())){
//相同
y.setPlanNum(y.getPlanNum()+1);
if(ObjectUtils.isNotNull(p.getStockId())){
y.setScanNum(y.getScanNum()+1);
}
//t托盘信息
if(ObjectUtils.isNotNull(y.getTrayId()) && y.getTrayId().equals(p.getTrayId())){
y.setPallet(y.getPallet()+","+p.getPallet());
}
}
} );
}else{
//没有
p.setPlanNum(1);
if (ObjectUtils.isNull(p.getStockId())){
p.setScanNum(0);
}else{
p.setScanNum(1);
}
listYou.add(p);
}
}else{
//
p.setPlanNum(1);
if (ObjectUtils.isNull(p.getStockId())){
p.setScanNum(0);
}else{
p.setScanNum(1);
}
listYou.add(p);
}
});
List<DistributionStockupOrderListVO> collect22 = list.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList()); //无货位
collect22.forEach(i ->{
boolean b = listYou.stream().anyMatch(ko -> ObjectUtils.isNull(ko.getAllocationId()));
if(b){
listYou.forEach( wu -> {
if(ObjectUtils.isNull(wu.getAllocationId())){
//相同
wu.setPlanNum(wu.getPlanNum()+1);
if(ObjectUtils.isNotNull(i.getStockId())){
wu.setScanNum(wu.getScanNum()+1);
}
//托盘信息
if(ObjectUtils.isNotNull(wu.getTrayId()) && wu.getTrayId().equals(i.getTrayId())){
wu.setPallet(wu.getPallet()+","+i.getPallet());
}
if(wu.getPlanNum().equals(wu.getScanNum())){
wu.setCompleteStact(true);
}
}
});
}else{
i.setPlanNum(1);
if(ObjectUtils.isNotNull(i.getStockId())){
i.setScanNum(1);
}else{
i.setScanNum(0);
}
listYou.add(i);
}
});
return new ArrayList<>(listYou);
}
}
@ -603,7 +674,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//查询客户信息
DistributionReservationEntity reservationEntity = distributionReservationService.getById(stockupDTO.getReservationId()); //预约信息
//通过订单id和预约id,托盘信息查询对应的包件列表
List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoList(stockupDTO.getReservationId(), stockupDTO.getStockArticleId(), stockupDTO.getStockupId(), stockupDTO.getTrayId());
List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoList(stockupDTO);
// int size = list.size(); //数量
Integer size = 0; //数量
Integer scanNum = 0;
@ -624,6 +695,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
List<DistributionStockEntity> list1 = distributionStockService.list(Wrappers.<DistributionStockEntity>query().lambda()
.eq(DistributionStockEntity::getCoding, vo.getPackageBarCode())
.eq(DistributionStockEntity::getParcelListId, vo.getParceListId())
.eq(DistributionStockEntity::getReservationId, stockupDTO.getReservationId())
.eq(DistributionStockEntity::getStockupId, stockupDTO.getStockupId())
);
allocationTitle = vo.getAllocationTitle();
trayCode = vo.getTrayCode();
@ -708,11 +781,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if(stockupDTO.getStatus().equals(1)){
DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillOverPackWuSelf(stockupDTO);
// DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackWuSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId());
List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, stockupDTO.getStockArticleId())
);
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("stock_article_id", stockupDTO.getStockArticleId());
if(!stockupDTO.getTypeService().equals("3")){
queryWrapper.eq("order_package_reservation_status", OrderPackageReservationStatusConstant.yiyueyue.getValue());
}
List<DistributionParcelListEntity> list = distributionParcelListService.list(queryWrapper);
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
List<PackageStockupVO> listPack = new ArrayList<>();
list.forEach( i ->{
@ -769,7 +843,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
iterator.remove();
continue;
}
if (ObjectUtils.isNotNull(next.getIsScan())) {
if (ObjectUtils.isNotNull(next.getIsScan()) && !next.getIsScan().equals(0)) {
next.setIsScanStr("已备货");
next.setIsScan(2);
} else {
@ -784,7 +858,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
iterator.remove();
continue;
}
if (ObjectUtils.isNotNull(next.getIsScan())) {
if (ObjectUtils.isNotNull(next.getIsScan()) && !next.getIsScan().equals(0)) {
next.setIsScanStr("已备货");
next.setIsScan(2);
} else {

Loading…
Cancel
Save