新增库存物料查询下拉,返回字段

master
maxw@mesnac.com 2 days ago
parent 46bf83678f
commit 097c6afca0

@ -95,6 +95,8 @@ public class WmsInventory{
private String warehouseCode;//字段映射
// @TableField(exist = false)
private String materialCode;//字段映射
@TableField(exist = false)
private String materialName;//字段映射
private String warehouseId;

@ -78,5 +78,6 @@ public class WmsInventoryBo extends BaseEntity {
private String tenantId;
private String warehouseId;
private String materialCode;//字段映射
private String materialName;//字段映射
}

@ -113,6 +113,7 @@ public class WmsInventoryVo implements Serializable {
private String warehouseCode;//字段映射
private String materialCode;//字段映射
private String materialName;//字段映射
private String warehouseId;
private BigDecimal maxStockAmount;
private BigDecimal minStockAmount;

@ -21,4 +21,6 @@ public interface WmsInventoryMapper extends BaseMapperPlus<WmsInventory, WmsInve
BigDecimal materailCount(@Param("entity") WmsInventory wmsInventory);
List<WmsInventoryVo> listInventoryAlarm(@Param("entity")WmsInventoryBo bo);
List<WmsInventoryVo> selectInventoryMaterialInfoList(@Param("entity")WmsInventoryBo bo);
}

@ -172,12 +172,7 @@ public class WmsInventoryServiceImpl implements IWmsInventoryService {
@Override
public List<WmsInventoryVo> getMaterialInfoList(WmsInventoryBo bo) {
MPJLambdaWrapper<WmsInventory> lqw = new MPJLambdaWrapper<>();
lqw.selectAll(WmsInventory.class).select(BaseMaterialInfo::getMaterialCode)
.leftJoin(BaseMaterialInfo.class,BaseMaterialInfo::getMaterialId,WmsInventory::getMaterialId);
lqw.eq(WmsInventory::getLocationCode,bo.getLocationCode())
.eq(WmsInventory::getMaterialCategories,bo.getMaterialCategories());
return baseMapper.selectVoList(lqw);
return baseMapper.selectInventoryMaterialInfoList(bo);
}
@Override

@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM
hwmom.dbo.wms_configuration x
where
(x.approve_range = '1'
((x.approve_range = '1'
and x.warehouse_id = #{warehouseId})
or x.approve_range = '0')
and x.node_code = 'in'

@ -50,5 +50,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
x.warehouse_id ,
x.material_id
</select>
<select id="selectInventoryMaterialInfoList" resultType="org.dromara.wms.domain.vo.WmsInventoryVo"
parameterType="org.dromara.wms.domain.bo.WmsInventoryBo">
SELECT
x.material_id,
MAX(b.material_code) material_code,
MAX(b.material_name) material_name,
SUM(x.inventory_qty) inventory_qty
FROM
hwmom.dbo.wms_inventory x
left join base_material_info b on
x.material_id = b.material_id
<where>
<!-- <if test="entity.materialId != null ">and x.material_id = #{entity.materialId}</if>-->
<if test="entity.warehouseId != null and entity.warehouseId != ''">and x.warehouse_id = #{entity.warehouseId}</if>
<if test="entity.lockState != null and entity.lockState != ''">and x.lock_state = #{entity.lockState}</if>
<if test="entity.materialCategories != null and entity.materialCategories != ''">and x.material_categories = #{entity.materialCategories}</if>
<if test="entity.inventoryStatus != null and entity.inventoryStatus != ''">and x.inventory_status = #{entity.inventoryStatus}</if>
<if test="entity.locationCode != null and entity.locationCode != ''">and x.location_code like concat('%',#{entity.locationCode},'%')</if>
<if test="entity.batchCode != null and entity.batchCode != ''">and x.batch_code like concat('%',#{entity.batchCode},'%')</if>
<if test="entity.storeId != null and entity.storeId != ''">and x.store_id = #{entity.storeId}</if>
</where>
group by
x.material_id
</select>
</mapper>

Loading…
Cancel
Save