feat: 新增查询存储地点查询方法,新增库存查询方法
This commit is contained in:
parent
881aa009bc
commit
4e1d586bfa
@ -68,5 +68,6 @@ public class InventoryDto extends Inventory {
|
||||
// 母批Lot_State数量
|
||||
private BigDecimal masterLotQty;
|
||||
private String site;
|
||||
private List<String> warehouseList;//线边仓
|
||||
|
||||
}
|
||||
|
||||
@ -3,6 +3,8 @@ package com.foreverwin.mom.wms.dto;
|
||||
import com.foreverwin.mom.wms.entity.StorageLocation;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class StorageLocationDto extends StorageLocation {
|
||||
|
||||
@ -11,4 +13,5 @@ public class StorageLocationDto extends StorageLocation {
|
||||
private String warehouse;
|
||||
private String workCenter;
|
||||
private String fabNo;
|
||||
private List<String> storageLocationList;
|
||||
}
|
||||
|
||||
@ -76,6 +76,29 @@ public class WmsStorageLocationController {
|
||||
return R.ok(storageLocationService.getStorageLocationPage(page, storageLocationDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询", notes = "查询")
|
||||
@GetMapping("/getStorageLocationList")
|
||||
public R getStorageLocationList(Page page, StorageLocationDto storageLocationDto) {
|
||||
return R.ok(storageLocationService.getStorageLocationList(page, storageLocationDto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 单笔查询
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询", notes = "查询")
|
||||
@GetMapping("/getStorageLocations")
|
||||
public R getStorageLocation(String storageLocation) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
String storageLocationBo = StorageLocation.genHandle(site, storageLocation);
|
||||
StorageLocation byId = storageLocationService.getById(storageLocationBo);
|
||||
return R.ok(byId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||
@GetMapping("/getStorageLocationPageBycode")
|
||||
public R getStorageLocationPageBycode(Page page, String str) {
|
||||
|
||||
@ -547,5 +547,23 @@ public class ZWmsInventoryController {
|
||||
return R.ok(inventoryService.readInventoryByDocumentNoPage(page, inventoryByDocumentRequestDTO));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
/**
|
||||
* 查询固定仓库下的条码
|
||||
*/
|
||||
@ApiOperation(value = "查询固定仓库下的条码", notes = "查询固定仓库下的条码")
|
||||
@GetMapping("/getByStorageLocalPage")
|
||||
public R getByStorageLocalPage(FrontPage page, InventoryDto dto){
|
||||
return R.ok(inventoryService.getByStorageLocalPage(page,dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条码
|
||||
*/
|
||||
@ApiOperation(value = "查询条码", notes = "查询条码")
|
||||
@GetMapping("/getInventoryId")
|
||||
public R getInventoryIdByStorageLocation(InventoryDto dto){
|
||||
return R.ok(inventoryService.getInventoryId(dto));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@ -40,4 +40,6 @@ public interface WmsStorageLocationService extends IService<StorageLocation> {
|
||||
|
||||
String labelRePrint(String site, List<StorageLocation> printList, String printer);
|
||||
|
||||
IPage getStorageLocationList(Page page, StorageLocationDto dto);
|
||||
|
||||
}
|
||||
|
||||
@ -146,6 +146,10 @@ public interface ZWmsInventoryService extends IService<Inventory> {
|
||||
|
||||
void saveOrUpdateInventory(List<Inventory> inventoryList);
|
||||
|
||||
IPage getByStorageLocalPage(FrontPage page, InventoryDto dto);
|
||||
|
||||
InventoryDto getInventoryId(InventoryDto dto);
|
||||
|
||||
/**
|
||||
* 通过收料单查询库存信息
|
||||
* @param page 分页对象
|
||||
|
||||
@ -236,6 +236,13 @@ public class WmsStorageLocationServiceImpl extends ServiceImpl<ZWmsStorageLocati
|
||||
return "暂无打印";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage getStorageLocationList(Page page, StorageLocationDto dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
dto.setSite(site);
|
||||
return storageLocationMapper.getStorageLocationList(page, dto);
|
||||
}
|
||||
|
||||
private void changeStorageBinStatus(String storageLocationBo,String status){
|
||||
List<String> storageBinBoList = storageBinService.list(Wrappers.lambdaQuery(StorageBin.class).eq(StorageBin::getStorageLocationBo, storageLocationBo).eq(StorageBin::getStatus, StorageBin.STATUS_Y).select(StorageBin::getHandle))
|
||||
.stream().map(StorageBin::getHandle).collect(Collectors.toList());
|
||||
|
||||
@ -1220,6 +1220,18 @@ public class ZWmsInventoryServiceImpl extends ServiceImpl<ZWmsInventoryMapper, I
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage getByStorageLocalPage(FrontPage page, InventoryDto dto) {
|
||||
dto.setSite(TenantContextHolder.getTenantId());
|
||||
return inventoryMapper.getByStorageLocalPage(page, dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryDto getInventoryId(InventoryDto dto) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
return inventoryMapper.getInventoryId(site,dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过收料单查询库存信息
|
||||
* @param page 分页对象
|
||||
|
||||
@ -83,5 +83,9 @@ public interface ZWmsInventoryMapper extends BaseMapper<Inventory> {
|
||||
|
||||
List<InventoryDto> selectQmsFrozenThaw(@Param("dto")InventoryDto dto);
|
||||
|
||||
IPage<InventoryDto> getByStorageLocalPage(IPage page, @Param("dto")InventoryDto dto);
|
||||
|
||||
InventoryDto getInventoryId(@Param("site") String site, @Param("dto")InventoryDto dto);
|
||||
|
||||
IPage<InventoryByDocumentResponseDTO> readInventoryByDocumentNoPage(Page page, @Param("dto") InventoryByDocumentRequestDTO inventoryByDocumentRequestDTO);
|
||||
}
|
||||
|
||||
@ -34,4 +34,6 @@ public interface ZWmsStorageLocationMapper extends MomBaseMapper<StorageLocation
|
||||
|
||||
IPage<StorageLocation> findStorageLocationList(Page page, @Param("site") String site, @Param("storageLocation") StorageLocation storageLocation);
|
||||
|
||||
IPage<StorageLocationDto> getStorageLocationList(Page page,@Param("dto")StorageLocationDto dto);
|
||||
|
||||
}
|
||||
|
||||
@ -556,4 +556,35 @@
|
||||
and wi.INVENTORY_ID like concat('%',#{dto.inventoryId}, '%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="getByStorageLocalPage" resultType="com.foreverwin.mom.wms.dto.InventoryDto">
|
||||
select wi.HANDLE, wi.`INVENTORY_ID`, wi.`QTY_ON_HAND`, i.`UNIT_OF_MEASURE` , i.`ITEM`, i.`DESCRIPTION` ITEM_DESC
|
||||
from wms_inventory wi
|
||||
join wip.item i on i.HANDLE = wi.ITEM_BO
|
||||
join wms.WMS_WAREHOUSE we on we.WAREHOUSE = wi.ERP_STORAGE_LOCATION and we.SITE = wi.SITE
|
||||
join wms.WMS_STORAGE_LOCATION wn on wn.WAREHOUSE_BO = we.HANDLE
|
||||
join wip.LOT_STATE LS on ls.LOT_NO = wi.INVENTORY_ID
|
||||
where wi.SITE = #{dto.site}
|
||||
<if test="dto.inventoryId != null and dto.inventoryId != ''">
|
||||
and wi.INVENTORY_ID LIKE concat('%', concat(#{dto.inventoryId}, '%'))
|
||||
</if>
|
||||
<if test="dto.storageLocation != null and dto.storageLocation != ''">
|
||||
and wn.STORAGE_LOCATION = #{dto.storageLocation}
|
||||
</if>
|
||||
and ls.STATUS in ('Q','R')
|
||||
and wi.QTY_ON_HAND > 0
|
||||
</select>
|
||||
|
||||
<select id="getInventoryId" resultType="com.foreverwin.mom.wms.dto.InventoryDto">
|
||||
select wi.handle,wi.`INVENTORY_ID`,wi.ORIGINAL_QTY,wi.ITEM_BO, wi.`QTY_ON_HAND`, i.`UNIT_OF_MEASURE` , i.`ITEM`, i.`DESCRIPTION` ITEM_DESC
|
||||
, wi.`STATUS`,wi.QMS_SPECIAL_MARKING
|
||||
from wms_inventory wi
|
||||
left join wip.item i on i.`HANDLE` = wi.`ITEM_BO`
|
||||
join wms.WMS_WAREHOUSE we on we.WAREHOUSE = wi.ERP_STORAGE_LOCATION and we.SITE = wi.SITE
|
||||
join wms.WMS_STORAGE_LOCATION wn on wn.WAREHOUSE_BO = we.HANDLE
|
||||
join wip.LOT_STATE LS on ls.LOT_NO = wi.INVENTORY_ID
|
||||
where wi.INVENTORY_ID = #{dto.inventoryId} and wi.SITE = #{site}
|
||||
and wi.QTY_ON_HAND > 0 and wn.STORAGE_LOCATION = #{dto.storageLocation}
|
||||
and ls.STATUS in ('Q','R')
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -183,4 +183,20 @@
|
||||
and SL.STORAGE_LOCATION = #{storageLocation.storageLocation}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getStorageLocationList" resultMap="wmsStorageLocationDtoMap">
|
||||
select *
|
||||
from WMS_STORAGE_LOCATION
|
||||
where site = #{dto.site}
|
||||
<if test="dto.storageLocation != null and dto.storageLocation != ''">
|
||||
and STORAGE_LOCATION LIKE concat('%', concat(#{dto.storageLocation}, '%'))
|
||||
</if>
|
||||
<if test="dto.storageLocationList != null and dto.storageLocationList.size > 0">
|
||||
and STORAGE_LOCATION IN
|
||||
<foreach collection="dto.storageLocationList" item="storageLocation" open="(" separator="," close=")">
|
||||
#{storageLocation}
|
||||
</foreach>
|
||||
</if>
|
||||
and STATUS = 'Y'
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user