change - 成品库存信息、原材料库存信息

master
yinq 7 months ago
parent 50857772d0
commit 5f9ae76601

@ -38,7 +38,7 @@ public class WmsProductStockController extends BaseController
/**
*
*/
@RequiresPermissions("wms:productstock:list")
// @RequiresPermissions("wms:productstock:list")
@GetMapping("/list")
public TableDataInfo list(WmsProductStock wmsProductStock)
{

@ -38,7 +38,7 @@ public class WmsRawStockController extends BaseController
/**
*
*/
@RequiresPermissions("wms:rawstock:list")
// @RequiresPermissions("wms:rawstock:list")
@GetMapping("/list")
public TableDataInfo list(WmsRawStock wmsRawStock)
{

@ -1,7 +1,6 @@
package com.hw.wms.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -23,7 +22,7 @@ import com.hw.common.core.utils.poi.ExcelUtil;
import com.hw.common.core.web.page.TableDataInfo;
/**
* Controller
* /Controller
*
* @author xins
* @date 2024-03-14
@ -36,7 +35,7 @@ public class WmsStockTotalController extends BaseController
private IWmsStockTotalService wmsStockTotalService;
/**
*
* /
*/
@RequiresPermissions("wms:stocktotal:list")
@GetMapping("/list")
@ -48,20 +47,20 @@ public class WmsStockTotalController extends BaseController
}
/**
*
* /
*/
@RequiresPermissions("wms:stocktotal:export")
@Log(title = "原材料库存", businessType = BusinessType.EXPORT)
@Log(title = "原材料/成品库存", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WmsStockTotal wmsStockTotal)
{
List<WmsStockTotal> list = wmsStockTotalService.selectWmsStockTotalList(wmsStockTotal);
ExcelUtil<WmsStockTotal> util = new ExcelUtil<WmsStockTotal>(WmsStockTotal.class);
util.exportExcel(response, list, "原材料库存数据");
util.exportExcel(response, list, "原材料/成品库存数据");
}
/**
*
* /
*/
@RequiresPermissions("wms:stocktotal:query")
@GetMapping(value = "/{stockTotalId}")
@ -71,10 +70,10 @@ public class WmsStockTotalController extends BaseController
}
/**
*
* /
*/
@RequiresPermissions("wms:stocktotal:add")
@Log(title = "原材料库存", businessType = BusinessType.INSERT)
@Log(title = "原材料/成品库存", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WmsStockTotal wmsStockTotal)
{
@ -82,10 +81,10 @@ public class WmsStockTotalController extends BaseController
}
/**
*
* /
*/
@RequiresPermissions("wms:stocktotal:edit")
@Log(title = "原材料库存", businessType = BusinessType.UPDATE)
@Log(title = "原材料/成品库存", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WmsStockTotal wmsStockTotal)
{
@ -93,10 +92,10 @@ public class WmsStockTotalController extends BaseController
}
/**
*
* /
*/
@RequiresPermissions("wms:stocktotal:remove")
@Log(title = "原材料库存", businessType = BusinessType.DELETE)
@Log(title = "原材料/成品库存", businessType = BusinessType.DELETE)
@DeleteMapping("/{stockTotalIds}")
public AjaxResult remove(@PathVariable Long[] stockTotalIds)
{

@ -25,6 +25,10 @@ public class WmsProductStock extends BaseEntity
@Excel(name = "仓库ID")
private Long warehouseId;
/** 仓库名称 */
@Excel(name = "仓库名称")
private String warehouseName;
/** 仓库楼层 */
@Excel(name = "仓库楼层")
private Long warehouseFloor;
@ -49,6 +53,14 @@ public class WmsProductStock extends BaseEntity
@Excel(name = "产品ID")
private Long productId;
/** 产品编码 */
@Excel(name = "产品编码")
private String materialCode;
/** 产品名称 */
@Excel(name = "产品名称")
private String materialName;
/**
* ,pd_base_plan_infoplan_id
*/
@ -79,13 +91,13 @@ public class WmsProductStock extends BaseEntity
private BigDecimal occupyAmount;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createDate;
/** 最后更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updateDate;
/** 有效标记 */
@ -96,17 +108,10 @@ public class WmsProductStock extends BaseEntity
@Excel(name = "入库时间", readConverterExp = "预=留")
private Date instockDate;
private String materialCode;
private String materialName;
private BigDecimal orderAmount;
private String warehouseName;
private BigDecimal applyAmount;
public void setProductStockId(Long productStockId)
{
this.productStockId = productStockId;

@ -25,6 +25,10 @@ public class WmsRawStock extends BaseEntity
@Excel(name = "仓库ID")
private Long warehouseId;
/** 仓库名称 */
@Excel(name = "仓库名称")
private String warehouseName;
/** 仓库楼层 */
@Excel(name = "仓库楼层")
private Long warehouseFloor;
@ -34,13 +38,21 @@ public class WmsRawStock extends BaseEntity
private String locationCode;
/** 库存类型1原材料 2半成品 */
@Excel(name = "库存类型1原材料 2半成品")
@Excel(name = "库存类型")
private String stockType;
/** 物料ID */
@Excel(name = "物料ID")
private Long materialId;
/** 物料编号 */
@Excel(name = "物料编号")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 入库批次号 */
@Excel(name = "入库批次号")
private String instockBatch;
@ -49,21 +61,21 @@ public class WmsRawStock extends BaseEntity
private String palletInfoCode;
/** 入库时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date instockDate;
/** 最晚出库时间;入库时,根据物料信“存放周期“计算出来的时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最晚出库时间;入库时,根据物料信“存放周期“计算出来的时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最晚出库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date lastOutstockTime;
/** 质检状态(1检验中,2质检通过,3质检不通过) */
@Excel(name = "质检状态(1检验中,2质检通过,3质检不通过)")
@Excel(name = "质检状态")
private String qualityStatus;
/** 质检状态(1检验中,2质检通过,3质检不通过) */
@Excel(name = "完整标识(1是0否)拆分后为0")
/** 完整标识 */
@Excel(name = "完整标识")
private String completeFlag;
/** 总数量 */
@ -83,19 +95,43 @@ public class WmsRawStock extends BaseEntity
private Long supplierId;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createDate;
/** 最后更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updateDate;
/** 有效标记 */
@Excel(name = "有效标记")
private String activeFlag;
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public void setRawStockId(Long rawStockId)
{
this.rawStockId = rawStockId;

@ -25,6 +25,10 @@ public class WmsStockTotal extends BaseEntity
@Excel(name = "仓库ID")
private Long warehouseId;
/** 仓库名称 */
@Excel(name = "仓库名称")
private String warehouseName;
/** 仓库楼层 */
@Excel(name = "仓库楼层")
private Long warehouseFloor;
@ -37,6 +41,14 @@ public class WmsStockTotal extends BaseEntity
@Excel(name = "物料ID")
private Long materialId;
/** 物料编号 */
@Excel(name = "物料编号")
private String materialCode;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 总数量;仓库存放的总数量 */
@Excel(name = "总数量;仓库存放的总数量")
private BigDecimal totalAmount;
@ -50,22 +62,27 @@ public class WmsStockTotal extends BaseEntity
private BigDecimal occupyAmount;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createDate;
/** 最后更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date updateDate;
/** 有效标记 */
@Excel(name = "有效标记")
private String activeFlag;
private String materialCode;
private String materialName;
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public void setStockTotalId(Long stockTotalId)
{

@ -1,70 +1,99 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.wms.mapper.WmsProductStockMapper">
<resultMap type="WmsProductStock" id="WmsProductStockResult">
<result property="productStockId" column="product_stock_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseFloor" column="warehouse_floor" />
<result property="locationCode" column="location_code" />
<result property="stockType" column="stock_type" />
<result property="productBatch" column="product_batch" />
<result property="qualityStatus" column="quality_status" />
<result property="productId" column="product_id" />
<result property="planCode" column="plan_code" />
<result property="planDetailCode" column="plan_detail_code" />
<result property="saleOrderId" column="sale_order_id" />
<result property="saleorderCode" column="saleorder_code" />
<result property="totalAmount" column="total_amount" />
<result property="frozenAmount" column="frozen_amount" />
<result property="occupyAmount" column="occupy_amount" />
<result property="createBy" column="create_by" />
<result property="createDate" column="create_date" />
<result property="updateBy" column="update_by" />
<result property="updateDate" column="update_date" />
<result property="activeFlag" column="active_flag" />
<result property="instockDate" column="instock_date" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="orderAmount" column="order_amount" />
<result property="warehouseName" column="warehouse_name" />
<result property="applyAmount" column="apply_amount" />
<result property="productStockId" column="product_stock_id"/>
<result property="warehouseId" column="warehouse_id"/>
<result property="warehouseFloor" column="warehouse_floor"/>
<result property="locationCode" column="location_code"/>
<result property="stockType" column="stock_type"/>
<result property="productBatch" column="product_batch"/>
<result property="qualityStatus" column="quality_status"/>
<result property="productId" column="product_id"/>
<result property="planCode" column="plan_code"/>
<result property="planDetailCode" column="plan_detail_code"/>
<result property="saleOrderId" column="sale_order_id"/>
<result property="saleorderCode" column="saleorder_code"/>
<result property="totalAmount" column="total_amount"/>
<result property="frozenAmount" column="frozen_amount"/>
<result property="occupyAmount" column="occupy_amount"/>
<result property="createBy" column="create_by"/>
<result property="createDate" column="create_date"/>
<result property="updateBy" column="update_by"/>
<result property="updateDate" column="update_date"/>
<result property="activeFlag" column="active_flag"/>
<result property="instockDate" column="instock_date"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="orderAmount" column="order_amount"/>
<result property="warehouseName" column="warehouse_name"/>
<result property="applyAmount" column="apply_amount"/>
</resultMap>
<sql id="selectWmsProductStockVo">
select product_stock_id, warehouse_id, location_code, stock_type, product_batch, quality_status, product_id, plan_code, plan_detail_code,sale_order_id,saleorder_code, total_amount, frozen_amount, occupy_amount, create_by, create_date, update_by, update_date, active_flag, instock_date from wms_product_stock
select wps.product_stock_id,
wps.warehouse_id,
wbw.warehouse_name,
wbw.warehouse_floor,
wps.location_code,
wps.stock_type,
wps.product_batch,
wps.quality_status,
wps.product_id,
mbmi.material_code,
mbmi.material_name,
wps.plan_code,
wps.plan_detail_code,
wps.sale_order_id,
wps.saleorder_code,
wps.total_amount,
wps.frozen_amount,
wps.occupy_amount,
wps.create_by,
wps.create_date,
wps.update_by,
wps.update_date,
wps.active_flag,
wps.instock_date
from wms_product_stock wps
left join wms_base_warehouse wbw on wbw.warehouse_id = wps.warehouse_id
left join mes_base_material_info mbmi on mbmi.material_id = wps.product_id
</sql>
<select id="selectWmsProductStockList" parameterType="WmsProductStock" resultMap="WmsProductStockResult">
<include refid="selectWmsProductStockVo"/>
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''"> and stock_type = #{stockType}</if>
<if test="productBatch != null and productBatch != ''"> and product_batch = #{productBatch}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
<if test="productId != null "> and product_id = #{productId}</if>
<if test="planCode != null "> and plan_code = #{planCode}</if>
<if test="planDetailCode != null "> and plan_detail_code = #{planDetailCode}</if>
<if test="saleorderCode != null "> and saleorder_code = #{saleorderCode}</if>
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
<if test="frozenAmount != null "> and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null "> and occupy_amount = #{occupyAmount}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="instockDate != null "> and instock_date = #{instockDate}</if>
<if test="warehouseId != null ">and wps.warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''">and wps.location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''">and wps.stock_type = #{stockType}</if>
<if test="productBatch != null and productBatch != ''">and wps.product_batch = #{productBatch}</if>
<if test="qualityStatus != null and qualityStatus != ''">and wps.quality_status = #{qualityStatus}</if>
<if test="productId != null ">and wps.product_id = #{productId}</if>
<if test="planCode != null ">and wps.plan_code = #{planCode}</if>
<if test="planDetailCode != null ">and wps.plan_detail_code = #{planDetailCode}</if>
<if test="saleorderCode != null ">and wps.saleorder_code = #{saleorderCode}</if>
<if test="totalAmount != null ">and wps.total_amount = #{totalAmount}</if>
<if test="frozenAmount != null ">and wps.frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null ">and wps.occupy_amount = #{occupyAmount}</if>
<if test="updateDate != null ">and wps.update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and wps.active_flag = #{activeFlag}</if>
<if test="instockDate != null ">and wps.instock_date = #{instockDate}</if>
<if test="params.beginCreateDate != null and params.beginCreateDate != '' and params.endCreateDate != null and params.endCreateDate != ''">
and wps.create_date between #{params.beginCreateDate} and #{params.endCreateDate}
</if>
</where>
</select>
<select id="selectWmsProductStockByProductStockId" parameterType="Long" resultMap="WmsProductStockResult">
<include refid="selectWmsProductStockVo"/>
where product_stock_id = #{productStockId}
where wps.product_stock_id = #{productStockId}
</select>
<insert id="insertWmsProductStock" parameterType="WmsProductStock" useGeneratedKeys="true" keyProperty="productStockId">
<insert id="insertWmsProductStock" parameterType="WmsProductStock" useGeneratedKeys="true"
keyProperty="productStockId">
insert into wms_product_stock
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="warehouseId != null">warehouse_id,</if>
@ -86,7 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateDate != null">update_date,</if>
<if test="activeFlag != null">active_flag,</if>
<if test="instockDate != null">instock_date,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warehouseId != null">#{warehouseId},</if>
<if test="warehouseFloor != null">#{warehouseFloor},</if>
@ -107,7 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateDate != null">#{updateDate},</if>
<if test="activeFlag != null">#{activeFlag},</if>
<if test="instockDate != null">#{instockDate},</if>
</trim>
</trim>
</insert>
<update id="updateWmsProductStock" parameterType="WmsProductStock">
@ -136,7 +165,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteWmsProductStockByProductStockId" parameterType="Long">
delete from wms_product_stock where product_stock_id = #{productStockId}
delete
from wms_product_stock
where product_stock_id = #{productStockId}
</delete>
<delete id="deleteWmsProductStockByProductStockIds" parameterType="String">
@ -147,17 +178,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="getProductStockTotalAmount" resultType="BigDecimal" parameterType="WmsProductStock">
select sum(total_amount) from wms_product_stock
<where>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="locationCode != null and locationCode != ''">and location_code = #{locationCode}</if>
and total_amount > 0
</where>
</select>
@ -169,12 +193,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectProductStockByLocationAndBatchAndSaleOrderId" resultMap="WmsProductStockResult">
<include refid="selectWmsProductStockVo"/>
where location_code = #{locationCode} and product_batch = #{productBatch} and sale_order_id=#{saleOrderId} and stock_type = #{stockType}
where location_code = #{locationCode} and product_batch = #{productBatch} and sale_order_id=#{saleOrderId} and
stock_type = #{stockType}
</select>
<select id="selectWmsProductStockInList" parameterType="WmsProductStock" resultMap="WmsProductStockResult">
<include refid="selectWmsProductStockVo"/>
<where>
@ -197,45 +220,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectWmsProductStockJoinList" parameterType="WmsProductStock" resultMap="WmsProductStockResult">
select wps.product_stock_id, wps.warehouse_id, wps.location_code, wps.stock_type, wps.product_batch, wps.quality_status, wps.product_id,
wps.plan_code, wps.plan_detail_code, wps.total_amount, wps.frozen_amount, wps.occupy_amount, wps.active_flag, wps.instock_date,
select wps.product_stock_id, wps.warehouse_id, wps.location_code, wps.stock_type, wps.product_batch,
wps.quality_status, wps.product_id,
wps.plan_code, wps.plan_detail_code, wps.total_amount, wps.frozen_amount, wps.occupy_amount, wps.active_flag,
wps.instock_date,
mai.material_code,mai.material_name
from wms_product_stock wps left join mes_base_material_info mai on wps.product_id = mai.material_id
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''"> and stock_type = #{stockType}</if>
<if test="productBatch != null and productBatch != ''"> and product_batch = #{productBatch}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
<if test="productId != null "> and product_id = #{productId}</if>
<if test="planCode != null "> and plan_code = #{planCode}</if>
<if test="planDetailCode != null "> and plan_detail_code = #{planDetailCode}</if>
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
<if test="frozenAmount != null "> and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null "> and occupy_amount = #{occupyAmount}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="instockDate != null "> and instock_date = #{instockDate}</if>
<if test="warehouseId != null ">and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''">and location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''">and stock_type = #{stockType}</if>
<if test="productBatch != null and productBatch != ''">and product_batch = #{productBatch}</if>
<if test="qualityStatus != null and qualityStatus != ''">and quality_status = #{qualityStatus}</if>
<if test="productId != null ">and product_id = #{productId}</if>
<if test="planCode != null ">and plan_code = #{planCode}</if>
<if test="planDetailCode != null ">and plan_detail_code = #{planDetailCode}</if>
<if test="totalAmount != null ">and total_amount = #{totalAmount}</if>
<if test="frozenAmount != null ">and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null ">and occupy_amount = #{occupyAmount}</if>
<if test="createDate != null ">and create_date = #{createDate}</if>
<if test="updateDate != null ">and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if>
<if test="instockDate != null ">and instock_date = #{instockDate}</if>
and totalAmount>0
</where>
</select>
<select id="selectWmsProductStocksBySaleorder" parameterType="WmsProductStock" resultMap="WmsProductStockResult">
select wps.warehouse_id,wps.sale_order_id,wps.product_id,sum(total_amount) total_amount,sum(frozen_amount) frozen_amount,sum(occupy_amount) occupy_amount,
select wps.warehouse_id,wps.sale_order_id,wps.product_id,sum(total_amount) total_amount,sum(frozen_amount)
frozen_amount,sum(occupy_amount) occupy_amount,
mbmi.material_code,mbmi.material_name,
wbw.warehouse_name,mso.order_amount,mso.saleorder_code,
(select sum(wpo.apply_qty) from wms_product_outstock wpo where wpo.sale_order_id=wps.sale_order_id and wpo.warehouse_id=wps.warehouse_id and wpo.product_id=wps.product_id and (wpo.execute_status='0' or wpo.execute_status='1')) apply_amount
(select sum(wpo.apply_qty) from wms_product_outstock wpo where wpo.sale_order_id=wps.sale_order_id and
wpo.warehouse_id=wps.warehouse_id and wpo.product_id=wps.product_id and (wpo.execute_status='0' or
wpo.execute_status='1')) apply_amount
from wms_product_stock wps
left join mes_base_material_info mbmi on wps.product_id=mbmi.material_id
left join wms_base_warehouse wbw on wps.warehouse_id=wbw.warehouse_id
left join wms_base_warehouse wbw on wps.warehouse_id=wbw.warehouse_id
left join mes_sale_order mso on wps.sale_order_id=mso.sale_order_id
<where>
wps.total_amount>0 and wps.stock_type='3'
<if test="saleorderCode != null and saleorderCode != ''"> and mso.saleorder_code = #{saleorderCode}</if>
<if test="saleorderCode != null and saleorderCode != ''">and mso.saleorder_code = #{saleorderCode}</if>
<if test="warehouseId != null ">and wps.warehouse_id = #{warehouseId}</if>
<if test="productId != null ">and wps.product_id = #{productId}</if>
</where>
@ -243,7 +270,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<!--select id="selectWmsProductStocksBySaleorder" parameterType="WmsProductStock" resultMap="WmsProductStockResult">
select wgb.warehouse_id,wgb.saleorder_code,wgb.product_id,mso.order_amount,wgb.total_amount,wgb.frozen_amount,wgb.occupy_amount,wbw.warehouse_name,mbmi.material_code,mbmi.material_name from mes_sale_order mso left join
(select wps.warehouse_id,wps.saleorder_code,wps.product_id,sum(total_amount) total_amount,sum(frozen_amount) frozen_amount,sum(occupy_amount) occupy_amount from wms_product_stock wps where wps.total_amount>0 and wps.stock_type='3'

@ -1,61 +1,92 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.wms.mapper.WmsRawStockMapper">
<resultMap type="WmsRawStock" id="WmsRawStockResult">
<result property="rawStockId" column="raw_stock_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseFloor" column="warehouse_floor" />
<result property="locationCode" column="location_code" />
<result property="stockType" column="stock_type" />
<result property="materialId" column="material_id" />
<result property="instockBatch" column="instock_batch" />
<result property="palletInfoCode" column="pallet_info_code" />
<result property="instockDate" column="instock_date" />
<result property="lastOutstockTime" column="last_outstock_time" />
<result property="qualityStatus" column="quality_status" />
<result property="completeFlag" column="complete_flag" />
<result property="totalAmount" column="total_amount" />
<result property="frozenAmount" column="frozen_amount" />
<result property="occupyAmount" column="occupy_amount" />
<result property="supplierId" column="supplier_id" />
<result property="createBy" column="create_by" />
<result property="createDate" column="create_date" />
<result property="updateBy" column="update_by" />
<result property="updateDate" column="update_date" />
<result property="activeFlag" column="active_flag" />
<result property="rawStockId" column="raw_stock_id"/>
<result property="warehouseId" column="warehouse_id"/>
<result property="warehouseFloor" column="warehouse_floor"/>
<result property="locationCode" column="location_code"/>
<result property="stockType" column="stock_type"/>
<result property="materialId" column="material_id"/>
<result property="instockBatch" column="instock_batch"/>
<result property="palletInfoCode" column="pallet_info_code"/>
<result property="instockDate" column="instock_date"/>
<result property="lastOutstockTime" column="last_outstock_time"/>
<result property="qualityStatus" column="quality_status"/>
<result property="completeFlag" column="complete_flag"/>
<result property="totalAmount" column="total_amount"/>
<result property="frozenAmount" column="frozen_amount"/>
<result property="occupyAmount" column="occupy_amount"/>
<result property="supplierId" column="supplier_id"/>
<result property="createBy" column="create_by"/>
<result property="createDate" column="create_date"/>
<result property="updateBy" column="update_by"/>
<result property="updateDate" column="update_date"/>
<result property="activeFlag" column="active_flag"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="warehouseName" column="warehouse_name"/>
</resultMap>
<sql id="selectWmsRawStockVo">
select raw_stock_id, warehouse_id, location_code, stock_type, material_id, instock_batch,pallet_info_code, instock_date, last_outstock_time, quality_status, complete_flag,total_amount, frozen_amount, occupy_amount, supplier_id, create_by, create_date, update_by, update_date, active_flag from wms_raw_stock
select wrs.raw_stock_id,
wrs.warehouse_id,
wbw.warehouse_name,
wbw.warehouse_floor,
wrs.location_code,
wrs.stock_type,
wrs.material_id,
mbmi.material_code,
mbmi.material_name,
wrs.instock_batch,
wrs.pallet_info_code,
wrs.instock_date,
wrs.last_outstock_time,
wrs.quality_status,
wrs.complete_flag,
wrs.total_amount,
wrs.frozen_amount,
wrs.occupy_amount,
wrs.supplier_id,
wrs.create_by,
wrs.create_date,
wrs.update_by,
wrs.update_date,
wrs.active_flag
from wms_raw_stock wrs
left join wms_base_warehouse wbw on wbw.warehouse_id = wrs.warehouse_id
left join mes_base_material_info mbmi on mbmi.material_id = wrs.material_id
</sql>
<select id="selectWmsRawStockList" parameterType="WmsRawStock" resultMap="WmsRawStockResult">
<include refid="selectWmsRawStockVo"/>
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''"> and stock_type = #{stockType}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="instockBatch != null and instockBatch != ''"> and instock_batch = #{instockBatch}</if>
<if test="instockDate != null "> and instock_date = #{instockDate}</if>
<if test="lastOutstockTime != null "> and last_outstock_time = #{lastOutstockTime}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
<if test="frozenAmount != null "> and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null "> and occupy_amount = #{occupyAmount}</if>
<if test="supplierId != null "> and supplier_id = #{supplierId}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="warehouseId != null ">and wrs.warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''">and wrs.location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''">and wrs.stock_type = #{stockType}</if>
<if test="materialId != null ">and wrs.material_id = #{materialId}</if>
<if test="instockBatch != null and instockBatch != ''">and wrs.instock_batch = #{instockBatch}</if>
<if test="instockDate != null ">and wrs.instock_date = #{instockDate}</if>
<if test="lastOutstockTime != null ">and wrs.last_outstock_time = #{lastOutstockTime}</if>
<if test="qualityStatus != null and qualityStatus != ''">and wrs.quality_status = #{qualityStatus}</if>
<if test="totalAmount != null ">and wrs.total_amount = #{totalAmount}</if>
<if test="frozenAmount != null ">and wrs.frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null ">and wrs.occupy_amount = #{occupyAmount}</if>
<if test="supplierId != null ">and wrs.supplier_id = #{supplierId}</if>
<if test="updateDate != null ">and wrs.update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and wrs.active_flag = #{activeFlag}</if>
<if test="params.beginCreateDate != null and params.beginCreateDate != '' and params.endCreateDate != null and params.endCreateDate != ''">
and wrs.create_date between #{params.beginCreateDate} and #{params.endCreateDate}
</if>
</where>
</select>
<select id="selectWmsRawStockByRawStockId" parameterType="Long" resultMap="WmsRawStockResult">
<include refid="selectWmsRawStockVo"/>
where raw_stock_id = #{rawStockId}
where wrs.raw_stock_id = #{rawStockId}
</select>
<insert id="insertWmsRawStock" parameterType="WmsRawStock" useGeneratedKeys="true" keyProperty="rawStockId">
@ -80,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateDate != null">update_date,</if>
<if test="activeFlag != null">active_flag,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warehouseId != null">#{warehouseId},</if>
<if test="warehouseFloor != null">#{warehouseFloor},</if>
@ -101,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateDate != null">#{updateDate},</if>
<if test="activeFlag != null">#{activeFlag},</if>
</trim>
</trim>
</insert>
<update id="updateWmsRawStock" parameterType="WmsRawStock">
@ -130,7 +161,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteWmsRawStockByRawStockId" parameterType="Long">
delete from wms_raw_stock where raw_stock_id = #{rawStockId}
delete
from wms_raw_stock
where raw_stock_id = #{rawStockId}
</delete>
<delete id="deleteWmsRawStockByRawStockIds" parameterType="String">
@ -141,8 +174,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectRawStockByLocationAndBatch" resultMap="WmsRawStockResult">
<include refid="selectWmsRawStockVo"/>
where location_code = #{locationCode} and instock_batch = #{instockBatch}
@ -151,53 +182,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getRawStockTotalAmount" resultType="BigDecimal" parameterType="WmsRawStock">
select sum(total_amount) from wms_raw_stock
<where>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="locationCode != null and locationCode != ''">and location_code = #{locationCode}</if>
and total_amount > 0
</where>
</select>
<select id="selectWmsRawStocks4Apply" parameterType="WmsRawStock" resultMap="WmsRawStockResult">
<include refid="selectWmsRawStockVo"/>
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
<if test="warehouseId != null ">and warehouse_id = #{warehouseId}</if>
<if test="materialId != null ">and material_id = #{materialId}</if>
<if test="qualityStatus != null and qualityStatus != ''">and quality_status = #{qualityStatus}</if>
</where>
order by instock_date asc
</select>
<select id="selectWmsRawStockInList" parameterType="WmsRawStock" resultMap="WmsRawStockResult">
<include refid="selectWmsRawStockVo"/>
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''"> and stock_type = #{stockType}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="instockBatch != null and instockBatch != ''"> and instock_batch = #{instockBatch}</if>
<if test="instockDate != null "> and instock_date = #{instockDate}</if>
<if test="lastOutstockTime != null "> and last_outstock_time = #{lastOutstockTime}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
<if test="completeFlag != null and completeFlag != ''"> and complete_flag = #{completeFlag}</if>
<if test="frozenAmount != null "> and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null "> and occupy_amount = #{occupyAmount}</if>
<if test="supplierId != null "> and supplier_id = #{supplierId}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
and total_amount > 0
<if test="warehouseId != null ">and warehouse_id = #{warehouseId}</if>
<if test="locationCode != null and locationCode != ''">and location_code = #{locationCode}</if>
<if test="stockType != null and stockType != ''">and stock_type = #{stockType}</if>
<if test="materialId != null ">and material_id = #{materialId}</if>
<if test="instockBatch != null and instockBatch != ''">and instock_batch = #{instockBatch}</if>
<if test="instockDate != null ">and instock_date = #{instockDate}</if>
<if test="lastOutstockTime != null ">and last_outstock_time = #{lastOutstockTime}</if>
<if test="qualityStatus != null and qualityStatus != ''">and quality_status = #{qualityStatus}</if>
<if test="completeFlag != null and completeFlag != ''">and complete_flag = #{completeFlag}</if>
<if test="frozenAmount != null ">and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null ">and occupy_amount = #{occupyAmount}</if>
<if test="supplierId != null ">and supplier_id = #{supplierId}</if>
<if test="createDate != null ">and create_date = #{createDate}</if>
<if test="updateDate != null ">and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and active_flag = #{activeFlag}</if>
and total_amount > 0
</where>
</select>
</mapper>

@ -1,50 +1,69 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hw.wms.mapper.WmsStockTotalMapper">
<resultMap type="WmsStockTotal" id="WmsStockTotalResult">
<result property="stockTotalId" column="stock_total_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseFloor" column="warehouse_floor" />
<result property="stockType" column="stock_type" />
<result property="materialId" column="material_id" />
<result property="totalAmount" column="total_amount" />
<result property="frozenAmount" column="frozen_amount" />
<result property="occupyAmount" column="occupy_amount" />
<result property="createBy" column="create_by" />
<result property="createDate" column="create_date" />
<result property="updateBy" column="update_by" />
<result property="updateDate" column="update_date" />
<result property="activeFlag" column="active_flag" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="stockTotalId" column="stock_total_id"/>
<result property="warehouseId" column="warehouse_id"/>
<result property="warehouseFloor" column="warehouse_floor"/>
<result property="stockType" column="stock_type"/>
<result property="materialId" column="material_id"/>
<result property="totalAmount" column="total_amount"/>
<result property="frozenAmount" column="frozen_amount"/>
<result property="occupyAmount" column="occupy_amount"/>
<result property="createBy" column="create_by"/>
<result property="createDate" column="create_date"/>
<result property="updateBy" column="update_by"/>
<result property="updateDate" column="update_date"/>
<result property="activeFlag" column="active_flag"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="warehouseName" column="warehouse_name"/>
</resultMap>
<sql id="selectWmsStockTotalVo">
select stock_total_id, warehouse_id, warehouse_floor, stock_type, material_id, total_amount, frozen_amount, occupy_amount, create_by, create_date, update_by, update_date, active_flag from wms_stock_total
select wst.stock_total_id,
wst.warehouse_id,
wbw.warehouse_name,
wst.warehouse_floor,
wst.stock_type,
wst.material_id,
mbmi.material_code,
mbmi.material_name,
wst.total_amount,
wst.frozen_amount,
wst.occupy_amount,
wst.create_by,
wst.create_date,
wst.update_by,
wst.update_date,
wst.active_flag
from wms_stock_total wst
left join wms_base_warehouse wbw on wbw.warehouse_id = wst.warehouse_id
left join mes_base_material_info mbmi on mbmi.material_id = wst.material_id
</sql>
<select id="selectWmsStockTotalList" parameterType="WmsStockTotal" resultMap="WmsStockTotalResult">
<include refid="selectWmsStockTotalVo"/>
<where>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="warehouseFloor != null "> and warehouse_floor = #{warehouseFloor}</if>
<if test="stockType != null and stockType != ''"> and stock_type = #{stockType}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
<if test="frozenAmount != null "> and frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null "> and occupy_amount = #{occupyAmount}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="warehouseId != null ">and wst.warehouse_id = #{warehouseId}</if>
<if test="warehouseFloor != null ">and wst.warehouse_floor = #{warehouseFloor}</if>
<if test="stockType != null and stockType != ''">and wst.stock_type = #{stockType}</if>
<if test="materialId != null ">and wst.material_id = #{materialId}</if>
<if test="totalAmount != null ">and wst.total_amount = #{totalAmount}</if>
<if test="frozenAmount != null ">and wst.frozen_amount = #{frozenAmount}</if>
<if test="occupyAmount != null ">and wst.occupy_amount = #{occupyAmount}</if>
<if test="createDate != null ">and wst.create_date = #{createDate}</if>
<if test="updateDate != null ">and wst.update_date = #{updateDate}</if>
<if test="activeFlag != null and activeFlag != ''">and wst.active_flag = #{activeFlag}</if>
</where>
</select>
<select id="selectWmsStockTotalByStockTotalId" parameterType="Long" resultMap="WmsStockTotalResult">
<include refid="selectWmsStockTotalVo"/>
where stock_total_id = #{stockTotalId}
where wst.stock_total_id = #{stockTotalId}
</select>
<insert id="insertWmsStockTotal" parameterType="WmsStockTotal" useGeneratedKeys="true" keyProperty="stockTotalId">
@ -62,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateDate != null">update_date,</if>
<if test="activeFlag != null">active_flag,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warehouseId != null">#{warehouseId},</if>
<if test="warehouseFloor != null">#{warehouseFloor},</if>
@ -76,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateDate != null">#{updateDate},</if>
<if test="activeFlag != null">#{activeFlag},</if>
</trim>
</trim>
</insert>
<update id="updateWmsStockTotal" parameterType="WmsStockTotal">
@ -99,7 +118,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteWmsStockTotalByStockTotalId" parameterType="Long">
delete from wms_stock_total where stock_total_id = #{stockTotalId}
delete
from wms_stock_total
where stock_total_id = #{stockTotalId}
</delete>
<delete id="deleteWmsStockTotalByStockTotalIds" parameterType="String">
@ -110,24 +131,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectWmsStockTotalJoinList" parameterType="WmsStockTotal" resultMap="WmsStockTotalResult">
select wst.stock_total_id, wst.warehouse_id, wst.warehouse_floor, wst.stock_type, wst.material_id,
wst.total_amount, wst.frozen_amount, wst.occupy_amount,
mbmi.material_code,mbmi.material_name
wst.total_amount, wst.frozen_amount, wst.occupy_amount,
mbmi.material_code,mbmi.material_name
from wms_stock_total wst left join mes_base_material_info mbmi on wst.material_id = mbmi.material_id
<where>
<if test="warehouseId != null "> and wst.warehouse_id = #{warehouseId}</if>
<if test="warehouseFloor != null "> and wst.warehouse_floor = #{warehouseFloor}</if>
<if test="stockType != null and stockType != ''"> and wst.stock_type = #{stockType}</if>
<if test="materialId != null "> and wst.material_id = #{materialId}</if>
<if test="materialName != null and materialName != ''">and mbmi.material_name like concat('%', #{materialName},
<if test="warehouseId != null ">and wst.warehouse_id = #{warehouseId}</if>
<if test="warehouseFloor != null ">and wst.warehouse_floor = #{warehouseFloor}</if>
<if test="stockType != null and stockType != ''">and wst.stock_type = #{stockType}</if>
<if test="materialId != null ">and wst.material_id = #{materialId}</if>
<if test="materialName != null and materialName != ''">and mbmi.material_name like concat('%',
#{materialName},
'%')
</if>
</where>

@ -42,3 +42,21 @@ export function delStocktotal(stockTotalId) {
method: 'delete'
})
}
// 查询原材料库存列表
export function listRawstock(query) {
return request({
url: '/wms/rawstock/list',
method: 'get',
params: query
})
}
// 查询成品库存列表
export function listProductstock(query) {
return request({
url: '/wms/productstock/list',
method: 'get',
params: query
})
}

Loading…
Cancel
Save