parent
3b7adc0bb6
commit
68b53fbbf6
@ -0,0 +1,27 @@
|
|||||||
|
package com.hw.wms.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 盘点记录明细确认VO对象
|
||||||
|
* @ClassName: WmsInventoryCheckDetailVo
|
||||||
|
* @Author : xins
|
||||||
|
* @Date :2024-04-01 9:51
|
||||||
|
* @Version :1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsInventoryCheckDetailVo {
|
||||||
|
|
||||||
|
//盘点记录明细ID
|
||||||
|
@NotNull(message="inventoryCheckDetailId")
|
||||||
|
private Long inventoryCheckDetailId;
|
||||||
|
|
||||||
|
//实际盘点数量
|
||||||
|
@NotNull(message = "实际盘点数量必须输入")
|
||||||
|
private BigDecimal realAmount;
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.hw.wms.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 进行盘点VO对象
|
||||||
|
* @ClassName: WmsInventoryCheckVo
|
||||||
|
* @Author : xins
|
||||||
|
* @Date :2024-03-29 11:27
|
||||||
|
* @Version :1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WmsInventoryCheckVo {
|
||||||
|
|
||||||
|
//仓库ID
|
||||||
|
@NotNull(message="warehouseId必须输入")
|
||||||
|
private Long warehouseId;
|
||||||
|
|
||||||
|
@NotEmpty(message="库位编码必须输入")
|
||||||
|
private List<String> locationCodes;
|
||||||
|
|
||||||
|
private Long inventoryCheckId;
|
||||||
|
}
|
@ -0,0 +1,79 @@
|
|||||||
|
package com.hw.wms.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.hw.wms.domain.WmsInventoryCheckDetail;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点记录明细Mapper接口
|
||||||
|
*
|
||||||
|
* @author xins
|
||||||
|
* @date 2024-03-29
|
||||||
|
*/
|
||||||
|
public interface WmsInventoryCheckDetailMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询盘点记录明细
|
||||||
|
*
|
||||||
|
* @param inventoryCheckDetailId 盘点记录明细主键
|
||||||
|
* @return 盘点记录明细
|
||||||
|
*/
|
||||||
|
public WmsInventoryCheckDetail selectWmsInventoryCheckDetailByInventoryCheckDetailId(Long inventoryCheckDetailId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询盘点记录明细列表
|
||||||
|
*
|
||||||
|
* @param wmsInventoryCheckDetail 盘点记录明细
|
||||||
|
* @return 盘点记录明细集合
|
||||||
|
*/
|
||||||
|
public List<WmsInventoryCheckDetail> selectWmsInventoryCheckDetailList(WmsInventoryCheckDetail wmsInventoryCheckDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增盘点记录明细
|
||||||
|
*
|
||||||
|
* @param wmsInventoryCheckDetail 盘点记录明细
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertWmsInventoryCheckDetail(WmsInventoryCheckDetail wmsInventoryCheckDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改盘点记录明细
|
||||||
|
*
|
||||||
|
* @param wmsInventoryCheckDetail 盘点记录明细
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateWmsInventoryCheckDetail(WmsInventoryCheckDetail wmsInventoryCheckDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除盘点记录明细
|
||||||
|
*
|
||||||
|
* @param inventoryCheckDetailId 盘点记录明细主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteWmsInventoryCheckDetailByInventoryCheckDetailId(Long inventoryCheckDetailId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除盘点记录明细
|
||||||
|
*
|
||||||
|
* @param inventoryCheckDetailIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteWmsInventoryCheckDetailByInventoryCheckDetailIds(Long[] inventoryCheckDetailIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据盘点记录ID和库位编码获取盘点记录明细
|
||||||
|
* @param inventoryCheckId
|
||||||
|
* @param locationCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int selectCountOfCheckDetailByCheckIdAndLocation(@Param("inventoryCheckId") Long inventoryCheckId,
|
||||||
|
@Param("locationCode") String locationCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询盘点记录明细列表,Join material
|
||||||
|
*
|
||||||
|
* @param wmsInventoryCheckDetail 盘点记录明细
|
||||||
|
* @return 盘点记录明细集合
|
||||||
|
*/
|
||||||
|
public List<WmsInventoryCheckDetail> selectWmsInventoryCheckDetailJoinList(WmsInventoryCheckDetail wmsInventoryCheckDetail);
|
||||||
|
}
|
@ -0,0 +1,167 @@
|
|||||||
|
<?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">
|
||||||
|
<mapper namespace="com.hw.wms.mapper.WmsInventoryCheckDetailMapper">
|
||||||
|
|
||||||
|
<resultMap type="WmsInventoryCheckDetail" id="WmsInventoryCheckDetailResult">
|
||||||
|
<result property="inventoryCheckDetailId" column="inventory_check_detail_id" />
|
||||||
|
<result property="inventoryCheckId" column="inventory_check_id" />
|
||||||
|
<result property="materialId" column="material_id" />
|
||||||
|
<result property="locationCode" column="location_code" />
|
||||||
|
<result property="materialBatch" column="material_batch" />
|
||||||
|
<result property="stockType" column="stock_type" />
|
||||||
|
<result property="stockId" column="stock_id" />
|
||||||
|
<result property="stockAmount" column="stock_amount" />
|
||||||
|
<result property="realAmount" column="real_amount" />
|
||||||
|
<result property="checkStatus" column="check_status" />
|
||||||
|
<result property="inventoryTime" column="inventory_time" />
|
||||||
|
<result property="erpStatus" column="erp_status" />
|
||||||
|
<result property="erpAmount" column="erp_amount" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<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="materialCode" column="material_code" />
|
||||||
|
<result property="materialName" column="material_name" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectWmsInventoryCheckDetailVo">
|
||||||
|
select inventory_check_detail_id, inventory_check_id, material_id, location_code, material_batch, stock_type, stock_id, stock_amount, real_amount, check_status, inventory_time, erp_status, erp_amount, remark, create_by, create_date, update_by, update_date from wms_inventory_check_detail
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectWmsInventoryCheckDetailList" parameterType="WmsInventoryCheckDetail" resultMap="WmsInventoryCheckDetailResult">
|
||||||
|
<include refid="selectWmsInventoryCheckDetailVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="inventoryCheckId != null "> and inventory_check_id = #{inventoryCheckId}</if>
|
||||||
|
<if test="materialId != null "> and material_id = #{materialId}</if>
|
||||||
|
<if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if>
|
||||||
|
<if test="materialBatch != null and materialBatch != ''"> and material_batch = #{materialBatch}</if>
|
||||||
|
<if test="stockType != null and stockType != ''"> and stock_type = #{stockType}</if>
|
||||||
|
<if test="stockAmount != null "> and stock_amount = #{stockAmount}</if>
|
||||||
|
<if test="realAmount != null "> and real_amount = #{realAmount}</if>
|
||||||
|
<if test="checkStatus != null and checkStatus != ''"> and check_status = #{checkStatus}</if>
|
||||||
|
<if test="inventoryTime != null "> and inventory_time = #{inventoryTime}</if>
|
||||||
|
<if test="erpStatus != null and erpStatus != ''"> and erp_status = #{erpStatus}</if>
|
||||||
|
<if test="erpAmount != null "> and erp_amount = #{erpAmount}</if>
|
||||||
|
<if test="checkStatusStr != null and checkStatusStr!= ''"> and check_status in (${checkStatusStr})</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectWmsInventoryCheckDetailByInventoryCheckDetailId" parameterType="Long" resultMap="WmsInventoryCheckDetailResult">
|
||||||
|
<include refid="selectWmsInventoryCheckDetailVo"/>
|
||||||
|
where inventory_check_detail_id = #{inventoryCheckDetailId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertWmsInventoryCheckDetail" parameterType="WmsInventoryCheckDetail" useGeneratedKeys="true" keyProperty="inventoryCheckDetailId">
|
||||||
|
insert into wms_inventory_check_detail
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="inventoryCheckId != null">inventory_check_id,</if>
|
||||||
|
<if test="materialId != null">material_id,</if>
|
||||||
|
<if test="locationCode != null and locationCode != ''">location_code,</if>
|
||||||
|
<if test="materialBatch != null and materialBatch != ''">material_batch,</if>
|
||||||
|
<if test="stockType != null">stock_type,</if>
|
||||||
|
<if test="stockId != null">stock_id,</if>
|
||||||
|
<if test="stockAmount != null">stock_amount,</if>
|
||||||
|
<if test="realAmount != null">real_amount,</if>
|
||||||
|
<if test="checkStatus != null and checkStatus != ''">check_status,</if>
|
||||||
|
<if test="inventoryTime != null">inventory_time,</if>
|
||||||
|
<if test="erpStatus != null">erp_status,</if>
|
||||||
|
<if test="erpAmount != null">erp_amount,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createDate != null">create_date,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateDate != null">update_date,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="inventoryCheckId != null">#{inventoryCheckId},</if>
|
||||||
|
<if test="materialId != null">#{materialId},</if>
|
||||||
|
<if test="locationCode != null and locationCode != ''">#{locationCode},</if>
|
||||||
|
<if test="materialBatch != null and materialBatch != ''">#{materialBatch},</if>
|
||||||
|
<if test="stockType != null">#{stockType},</if>
|
||||||
|
<if test="stockId != null">#{stockId},</if>
|
||||||
|
<if test="stockAmount != null">#{stockAmount},</if>
|
||||||
|
<if test="realAmount != null">#{realAmount},</if>
|
||||||
|
<if test="checkStatus != null and checkStatus != ''">#{checkStatus},</if>
|
||||||
|
<if test="inventoryTime != null">#{inventoryTime},</if>
|
||||||
|
<if test="erpStatus != null">#{erpStatus},</if>
|
||||||
|
<if test="erpAmount != null">#{erpAmount},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createDate != null">#{createDate},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateDate != null">#{updateDate},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateWmsInventoryCheckDetail" parameterType="WmsInventoryCheckDetail">
|
||||||
|
update wms_inventory_check_detail
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="inventoryCheckId != null">inventory_check_id = #{inventoryCheckId},</if>
|
||||||
|
<if test="materialId != null">material_id = #{materialId},</if>
|
||||||
|
<if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
|
||||||
|
<if test="materialBatch != null and materialBatch != ''">material_batch = #{materialBatch},</if>
|
||||||
|
<if test="stockType != null">stock_type = #{stockType},</if>
|
||||||
|
<if test="stockId != null">stock_id = #{stockId},</if>
|
||||||
|
<if test="stockAmount != null">stock_amount = #{stockAmount},</if>
|
||||||
|
<if test="realAmount != null">real_amount = #{realAmount},</if>
|
||||||
|
<if test="checkStatus != null and checkStatus != ''">check_status = #{checkStatus},</if>
|
||||||
|
<if test="inventoryTime != null">inventory_time = #{inventoryTime},</if>
|
||||||
|
<if test="erpStatus != null">erp_status = #{erpStatus},</if>
|
||||||
|
<if test="erpAmount != null">erp_amount = #{erpAmount},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createDate != null">create_date = #{createDate},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateDate != null">update_date = #{updateDate},</if>
|
||||||
|
</trim>
|
||||||
|
where inventory_check_detail_id = #{inventoryCheckDetailId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteWmsInventoryCheckDetailByInventoryCheckDetailId" parameterType="Long">
|
||||||
|
delete from wms_inventory_check_detail where inventory_check_detail_id = #{inventoryCheckDetailId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteWmsInventoryCheckDetailByInventoryCheckDetailIds" parameterType="String">
|
||||||
|
delete from wms_inventory_check_detail where inventory_check_detail_id in
|
||||||
|
<foreach item="inventoryCheckDetailId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{inventoryCheckDetailId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectCountOfCheckDetailByCheckIdAndLocation">
|
||||||
|
select count(1) from wms_inventory_check_detail
|
||||||
|
where inventory_check_id = #{inventoryCheckId} and location_code = #{locationCode}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<sql id="selectWmsInventoryCheckDetailJoinVo">
|
||||||
|
select wicd.inventory_check_detail_id, wicd.inventory_check_id, wicd.material_id, wicd.material_batch,
|
||||||
|
wicd.stock_type, wicd.stock_id, wicd.stock_amount, wicd.real_amount, wicd.check_status, wicd.inventory_time,
|
||||||
|
mbmi.material_code,mbmi.material_name
|
||||||
|
from wms_inventory_check_detail wicd left join mes_base_material_info mbmi on wicd.material_id = mbmi.material_id
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectWmsInventoryCheckDetailJoinList" parameterType="WmsInventoryCheckDetail" resultMap="WmsInventoryCheckDetailResult">
|
||||||
|
<include refid="selectWmsInventoryCheckDetailJoinVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="inventoryCheckId != null "> and wicd.inventory_check_id = #{inventoryCheckId}</if>
|
||||||
|
<if test="materialId != null "> and wicd.material_id = #{materialId}</if>
|
||||||
|
<if test="locationCode != null and locationCode != ''"> and wicd.location_code = #{locationCode}</if>
|
||||||
|
<if test="materialBatch != null and materialBatch != ''"> and wicd.material_batch = #{materialBatch}</if>
|
||||||
|
<if test="stockType != null and stockType != ''"> and wicd.stock_type = #{stockType}</if>
|
||||||
|
<if test="checkStatus != null and checkStatus != ''"> and wicd.check_status = #{checkStatus}</if>
|
||||||
|
<if test="checkStatusStr != null and checkStatusStr!= ''"> and wicd.check_status in (${checkStatusStr})</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue