fix(库存接口):新增通过收料单查询库存信息
This commit is contained in:
parent
b0f133da90
commit
556f588cf6
@ -1,6 +1,9 @@
|
||||
package com.foreverwin.mom.wms.api.feign;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.mom.wms.dto.InventoryByDocumentRequestDTO;
|
||||
import com.foreverwin.mom.wms.dto.InventoryByDocumentResponseDTO;
|
||||
import com.foreverwin.mom.wms.dto.InventoryDto;
|
||||
import com.foreverwin.mom.wms.dto.IqcResultNoticeDto;
|
||||
import com.foreverwin.mom.wms.entity.Inventory;
|
||||
@ -84,4 +87,12 @@ public interface RemoteWmsInventoryService {
|
||||
*/
|
||||
@PostMapping("/wms-inventory/api/saveOrUpdateInventory")
|
||||
R saveOrUpdateInventory(@RequestBody List<Inventory> inventoryList);
|
||||
|
||||
/**
|
||||
* 通过收料单查询库存信息
|
||||
* @param inventoryByDocumentRequestDTO 通过收料单查询库存信息请求DTO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/wms-inventory/api/readInventoryByDocumentNoPage")
|
||||
R<Page<InventoryByDocumentResponseDTO>> readInventoryByDocumentNoPage(@RequestBody InventoryByDocumentRequestDTO inventoryByDocumentRequestDTO);
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.foreverwin.mom.wms.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 通过收料单查询库存信息请求DTO
|
||||
*
|
||||
* @author hechuan.liao
|
||||
* @date 2024-07-31 09:47:44
|
||||
*/
|
||||
@Data
|
||||
public class InventoryByDocumentRequestDTO {
|
||||
|
||||
/**
|
||||
* 分页对象
|
||||
*/
|
||||
private Page page;
|
||||
|
||||
/**
|
||||
* 站点
|
||||
*/
|
||||
private String site;
|
||||
|
||||
/**
|
||||
* 收料单号
|
||||
*/
|
||||
private String documentNo;
|
||||
|
||||
/**
|
||||
* 项次号
|
||||
*/
|
||||
private String seq;
|
||||
|
||||
/**
|
||||
* 库存ID
|
||||
*/
|
||||
private String inventoryId;
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package com.foreverwin.mom.wms.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 通过收料单查询库存信息响应DTO
|
||||
*
|
||||
* @author hechuan.liao
|
||||
* @date 2024-07-31 09:47:44
|
||||
*/
|
||||
@Data
|
||||
public class InventoryByDocumentResponseDTO {
|
||||
|
||||
/**
|
||||
* 库存ID
|
||||
*/
|
||||
private String inventoryId;
|
||||
|
||||
/**
|
||||
* 物料描述
|
||||
*/
|
||||
private String itemDescription;
|
||||
|
||||
/**
|
||||
* 当前库存数量
|
||||
*/
|
||||
private BigDecimal qtyOnHand;
|
||||
}
|
||||
@ -11,6 +11,8 @@ import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.log.annotation.SysLog;
|
||||
import com.foreverwin.mom.common.security.util.SecurityUtils;
|
||||
import com.foreverwin.mom.wms.dto.FreezeDto;
|
||||
import com.foreverwin.mom.wms.dto.InventoryByDocumentRequestDTO;
|
||||
import com.foreverwin.mom.wms.dto.InventoryByDocumentResponseDTO;
|
||||
import com.foreverwin.mom.wms.dto.InventoryDto;
|
||||
import com.foreverwin.mom.wms.entity.Inventory;
|
||||
import com.foreverwin.mom.wms.service.BarCodeQueryService;
|
||||
@ -531,5 +533,16 @@ public class ZWmsInventoryController {
|
||||
return R.ok(inventoryService.list(Wrappers.<Inventory>lambdaQuery().eq(Inventory::getSite, site).eq(Inventory::getBatchNo,batchNo)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过收料单查询库存信息
|
||||
* @param inventoryByDocumentRequestDTO 通过收料单查询库存信息请求DTO
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过收料单查询库存信息", notes = "通过收料单查询库存信息")
|
||||
@PostMapping("/api/readInventoryByDocumentNoPage" )
|
||||
public R<Page<InventoryByDocumentResponseDTO>> readInventoryByDocumentNoPage(@RequestBody InventoryByDocumentRequestDTO inventoryByDocumentRequestDTO) {
|
||||
return R.ok(inventoryService.readInventoryByDocumentNoPage(inventoryByDocumentRequestDTO.getPage(), inventoryByDocumentRequestDTO));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.foreverwin.iep.common.base.FrontPage;
|
||||
import com.foreverwin.mom.wms.dto.InventoryByDocumentRequestDTO;
|
||||
import com.foreverwin.mom.wms.dto.InventoryByDocumentResponseDTO;
|
||||
import com.foreverwin.mom.wms.dto.InventoryDto;
|
||||
import com.foreverwin.mom.wms.dto.ScanCodeDTO;
|
||||
import com.foreverwin.mom.wms.entity.Inventory;
|
||||
@ -143,4 +145,12 @@ public interface ZWmsInventoryService extends IService<Inventory> {
|
||||
void lotSplitAddAndUpdateInventory(InventoryDto dto);
|
||||
|
||||
void saveOrUpdateInventory(List<Inventory> inventoryList);
|
||||
|
||||
/**
|
||||
* 通过收料单查询库存信息
|
||||
* @param page 分页对象
|
||||
* @param inventoryByDocumentRequestDTO 通过收料单查询库存信息请求DTO
|
||||
* @return
|
||||
*/
|
||||
Page<InventoryByDocumentResponseDTO> readInventoryByDocumentNoPage(Page page, InventoryByDocumentRequestDTO inventoryByDocumentRequestDTO);
|
||||
}
|
||||
|
||||
@ -22,6 +22,8 @@ import com.foreverwin.mom.common.core.exception.BusinessException;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.security.util.SecurityUtils;
|
||||
import com.foreverwin.mom.wms.constant.Constant;
|
||||
import com.foreverwin.mom.wms.dto.InventoryByDocumentRequestDTO;
|
||||
import com.foreverwin.mom.wms.dto.InventoryByDocumentResponseDTO;
|
||||
import com.foreverwin.mom.wms.dto.InventoryDto;
|
||||
import com.foreverwin.mom.wms.dto.ScanCodeDTO;
|
||||
import com.foreverwin.mom.wms.entity.Carrier;
|
||||
@ -1216,4 +1218,15 @@ public class ZWmsInventoryServiceImpl extends ServiceImpl<ZWmsInventoryMapper, I
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过收料单查询库存信息
|
||||
* @param page 分页对象
|
||||
* @param inventoryByDocumentRequestDTO 通过收料单查询库存信息请求DTO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<InventoryByDocumentResponseDTO> readInventoryByDocumentNoPage(Page page, InventoryByDocumentRequestDTO inventoryByDocumentRequestDTO) {
|
||||
return baseMapper.readInventoryByDocumentNoPage(page, inventoryByDocumentRequestDTO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.foreverwin.mom.wms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.foreverwin.iep.common.base.FrontPage;
|
||||
import com.foreverwin.mom.wms.dto.*;
|
||||
import com.foreverwin.mom.wms.entity.Inventory;
|
||||
@ -82,4 +83,5 @@ public interface ZWmsInventoryMapper extends BaseMapper<Inventory> {
|
||||
|
||||
List<InventoryDto> selectQmsFrozenThaw(@Param("dto")InventoryDto dto);
|
||||
|
||||
Page<InventoryByDocumentResponseDTO> readInventoryByDocumentNoPage(Page page, @Param("dto") InventoryByDocumentRequestDTO inventoryByDocumentRequestDTO);
|
||||
}
|
||||
|
||||
@ -530,4 +530,30 @@
|
||||
order by DATE_CREATE desc
|
||||
</select>
|
||||
|
||||
<!--通过收料单查询库存信息-->
|
||||
<select id="readInventoryByDocumentNoPage"
|
||||
resultType="com.foreverwin.mom.wms.dto.InventoryByDocumentResponseDTO">
|
||||
select
|
||||
wi.INVENTORY_ID,
|
||||
i.DESCRIPTION as ITEM_DESCRIPTION,
|
||||
wi.QTY_ON_HAND
|
||||
from
|
||||
wms.z_document_detailed zdd
|
||||
inner join wip.item i on
|
||||
i.SITE = zdd.SITE
|
||||
and i.ITEM = zdd.ITEM
|
||||
and i.CURRENT_REVISION = 'Y'
|
||||
inner join wms.wms_inventory wi on
|
||||
wi.SITE = zdd.SITE
|
||||
and wi.BATCH_NO = zdd.BATCH
|
||||
and wi.ITEM_BO = i.HANDLE
|
||||
and wi.QTY_ON_HAND > 0
|
||||
where
|
||||
zdd.SITE = #{dto.site}
|
||||
and zdd.DOCUMENT_NO = #{dto.documentNo}
|
||||
and zdd.SEQ = #{dto.seq}
|
||||
<if test="dto.inventoryId != null and dto.inventoryId != ''">
|
||||
and wi.INVENTORY_ID like concat('%',#{dto.inventoryId}, '%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user