物料库存告警功能

master
maxw@mesnac.com 4 days ago
parent 885f5f1b9c
commit 5d3fbdc652

@ -16,9 +16,11 @@ import org.dromara.wms.domain.bo.WmsAllocateOrderDetailBo;
import org.dromara.wms.domain.bo.WmsInstockDetailBo;
import org.dromara.wms.domain.vo.BaseMaterialInfoVo;
import org.dromara.wms.domain.vo.WmsInstockDetailVo;
import org.dromara.wms.domain.vo.WmsInstockOrderVo;
import org.dromara.wms.mapper.WmsInstockDetailMapper;
import org.dromara.wms.service.IBaseMaterialInfoService;
import org.dromara.wms.service.IWmsInstockDetailService;
import org.dromara.wms.service.IWmsInstockOrderService;
import org.dromara.wms.service.IWmsInstockPrintService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -163,7 +165,7 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
String materialCode = bo.getMaterialCode();
String batchCode = instockCode+materialCode+order;
wmsInstockPrint.setBatchCode(batchCode);
wmsInstockPrint.setApportionQty(bo.getPrintNum().longValue());
wmsInstockPrint.setApportionQty(bo.getPrintNum());
wmsInstockPrint.setMaterialQty(bo.getBarcodeNum());
wmsInstockPrint.setCreateBy(username);
int rows = wmsInstockPrintService.insertWmsInstockPrint(wmsInstockPrint);

@ -16,27 +16,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="listInventoryAlarm" resultType="org.dromara.wms.domain.vo.WmsInventoryVo"
parameterType="org.dromara.wms.domain.bo.WmsInventoryBo">
SELECT
x.material_id,
SUM(x.inventory_qty) inventory_qty,
x.warehouse_id,
MAX(b.min_stock_amount) min_stock_amount,
MAX(b.max_stock_amount) max_stock_amount,
MAX(c.warehouse_code) warehouse_code,
MAX(b.material_code) material_code,
MAX(x.lock_state) lock_state,
MAX(x.inventory_status) inventory_status,
MAX(x.material_categories) material_categories,
MAX(x.location_code) locationCode,
MAX(x.batch_code) batchCode
x.material_id,
SUM(x.inventory_qty) inventory_qty,
CASE when SUM(x.inventory_qty) > MAX(b.max_stock_amount) then '0'
when MIN(b.min_stock_amount) > SUM(x.inventory_qty) then '0'
ELSE '1' END as inventory_status,
x.warehouse_id,
MAX(b.min_stock_amount) min_stock_amount,
MAX(b.max_stock_amount) max_stock_amount,
MAX(c.warehouse_code) warehouse_code,
MAX(b.material_code) material_code,
MAX(x.lock_state) lock_state,
MAX(x.material_categories) material_categories,
MAX(x.location_code) locationCode,
MAX(x.batch_code) batchCode
FROM
hwmom.dbo.wms_inventory x
left join base_material_info b on
x.material_id = b.material_id
left join wms_base_warehouse c on
x.warehouse_id = c.warehouse_id
-- left join base_material_info d
-- on
-- x.material_id = d.material_id
hwmom.dbo.wms_inventory x
left join base_material_info b on
x.material_id = b.material_id
left join wms_base_warehouse c on
x.warehouse_id = c.warehouse_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>

Loading…
Cancel
Save