新增物料字典模块

修改出入库单据号逻辑
新增出入库撤销和恢复功能
This commit is contained in:
2025-08-01 09:27:07 +08:00
parent 20f6be7790
commit ef833bec2f
18 changed files with 788 additions and 230 deletions

View File

@@ -74,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ri.ly_time,
ri.borrow_time, ri.return_time,
ri.xj, ri.xm_no, ri.xm_ms, ri.wl_no, ri.wl_ms,ri.xm_no_ck, ri.xm_ms_ck,
ri.gys_no, ri.gys_mc, ri.jh_amt, ri.ht_dj, ri.sap_no, ri.xh,
ri.gys_no, ri.gys_mc, ri.jh_amt, ri.ht_dj, ri.sap_no, ri.xh,ri.gys_jh_id,
ri.jh_qty, ri.ht_qty, ri.dw, ri.real_qty,
ri.pcode, ri.pcode_id, ri.tray_code, ri.entity_id,
ri.create_by, ri.create_time, ri.update_by, ri.update_time, ri.is_delete,
@@ -166,34 +166,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectRkInfoList" parameterType="RkInfo" resultMap="RkInfoResult">
<include refid="selectRkInfoVo"/>
<where>
<if test="isChuku != null and isChuku != ''">
and is_chuku = #{isChuku}
</if>
<choose>
<when test="isChukuList != null and isChukuList.size > 0">
AND ri.is_chuku IN
<foreach collection="isChukuList" item="val" open="(" separator="," close=")">
#{val}
</foreach>
</when>
<when test="isChuku != null and isChuku != ''">
AND ri.is_chuku = #{isChuku}
</when>
</choose>
<if test="keyword != null and keyword != ''">
and (
xm_no like concat('%', #{keyword}, '%')
or xm_ms like concat('%', #{keyword}, '%')
or wl_no like concat('%', #{keyword}, '%')
or wl_ms like concat('%', #{keyword}, '%')
or gys_no like concat('%', #{keyword}, '%')
or gys_mc like concat('%', #{keyword}, '%')
or sap_no like concat('%', #{keyword}, '%')
or bill_no like concat('%', #{keyword}, '%')
or bill_no_ck like concat('%', #{keyword}, '%')
or ck_type like concat('%', #{keyword}, '%')
or pcode like concat('%', #{keyword}, '%')
AND (
ri.xm_no like concat('%', #{keyword}, '%')
or ri.xm_ms like concat('%', #{keyword}, '%')
or ri.wl_no like concat('%', #{keyword}, '%')
or ri.wl_ms like concat('%', #{keyword}, '%')
or ri.gys_no like concat('%', #{keyword}, '%')
or ri.gys_mc like concat('%', #{keyword}, '%')
or ri.sap_no like concat('%', #{keyword}, '%')
or ri.bill_no like concat('%', #{keyword}, '%')
or ri.bill_no_ck like concat('%', #{keyword}, '%')
or ri.ck_type like concat('%', #{keyword}, '%')
or ri.pcode like concat('%', #{keyword}, '%')
)
</if>
<if test="rkType != null and rkType != ''">
and rk_type like concat('%', #{rkType}, '%')
AND ri.rk_type like concat('%', #{rkType}, '%')
</if>
<if test="wlType != null and wlType != ''">
and wl_type like concat('%', #{wlType}, '%')
AND ri.wl_type like concat('%', #{wlType}, '%')
</if>
<if test="cangku != null and cangku != ''">
and cangku like concat('%', #{cangku}, '%')
AND ri.cangku like concat('%', #{cangku}, '%')
</if>
<if test="ids != null and ids.size > 0">
@@ -204,100 +212,109 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
<if test="startTime != null">
<![CDATA[ and rk_time >= #{startTime} ]]>
<![CDATA[ AND ri.rk_time >= #{startTime} ]]>
</if>
<if test="endTime != null">
<![CDATA[ and rk_time <= #{endTime} ]]>
<![CDATA[ AND ri.rk_time <= #{endTime} ]]>
</if>
<if test="lyStartTime != null">
<![CDATA[ AND ri.ly_time >= #{lyStartTime} ]]>
</if>
<if test="lyEndTime != null">
<![CDATA[ AND ri.ly_time <= #{lyEndTime} ]]>
</if>
<if test="lihuoY != null and lihuoY != ''">
and lihuo_y like concat('%', #{lihuoY}, '%')
AND ri.lihuo_y like concat('%', #{lihuoY}, '%')
</if>
<if test="xj != null and xj != ''">
and xj like concat('%', #{xj}, '%')
AND ri.xj like concat('%', #{xj}, '%')
</if>
<if test="billNo != null and billNo != ''">
and bill_no like concat('%', #{billNo}, '%')
AND ri.bill_no like concat('%', #{billNo}, '%')
</if>
<if test="billNoCk != null and billNoCk != ''">
and bill_no_ck like concat('%', #{billNoCk}, '%')
AND ri.bill_no_ck like concat('%', #{billNoCk}, '%')
</if>
<if test="xmNo != null and xmNo != ''">
and xm_no like concat('%', #{xmNo}, '%')
AND ri.xm_no like concat('%', #{xmNo}, '%')
</if>
<if test="xmMs != null and xmMs != ''">
and xm_ms like concat('%', #{xmMs}, '%')
AND ri.xm_ms like concat('%', #{xmMs}, '%')
</if>
<if test="wlNo != null and wlNo != ''">
and wl_no like concat('%', #{wlNo}, '%')
AND ri.wl_no like concat('%', #{wlNo}, '%')
</if>
<if test="wlMs != null and wlMs != ''">
and wl_ms like concat('%', #{wlMs}, '%')
AND ri.wl_ms like concat('%', #{wlMs}, '%')
</if>
<if test="gysNo != null and gysNo != ''">
and gys_no like concat('%', #{gysNo}, '%')
AND ri.gys_no like concat('%', #{gysNo}, '%')
</if>
<if test="gysMc != null and gysMc != ''">
and gys_mc like concat('%', #{gysMc}, '%')
AND ri.gys_mc like concat('%', #{gysMc}, '%')
</if>
<if test="jhAmt != null">
and jh_amt = #{jhAmt}
AND ri.jh_amt = #{jhAmt}
</if>
<if test="htDj != null">
and ht_dj = #{htDj}
AND ri.ht_dj = #{htDj}
</if>
<if test="sapNo != null and sapNo != ''">
and sap_no like concat('%', #{sapNo}, '%')
AND ri.sap_no like concat('%', #{sapNo}, '%')
</if>
<if test="xh != null and xh != ''">
and xh like concat('%', #{xh}, '%')
AND ri.xh like concat('%', #{xh}, '%')
</if>
<if test="jhQty != null">
and jh_qty = #{jhQty}
AND ri.jh_qty = #{jhQty}
</if>
<if test="htQty != null">
and ht_qty = #{htQty}
AND ri.ht_qty = #{htQty}
</if>
<if test="dw != null and dw != ''">
and dw like concat('%', #{dw}, '%')
AND ri.dw like concat('%', #{dw}, '%')
</if>
<if test="realQty != null">
and real_qty = #{realQty}
AND ri.real_qty = #{realQty}
</if>
<if test="pcode != null and pcode != ''">
and pcode like concat('%', #{pcode}, '%')
AND ri.pcode like concat('%', #{pcode}, '%')
</if>
<if test="lyTime != null">
and ri.ly_time = #{lyTime}
AND ri.ly_time = #{lyTime}
</if>
<if test="returnTime != null">
and ri.return_time = #{returnTime}
AND ri.return_time = #{returnTime}
</if>
<if test="trayCode != null and trayCode != ''">
and tray_code like concat('%', #{trayCode}, '%')
AND ri.tray_code like concat('%', #{trayCode}, '%')
</if>
<if test="entityId != null and entityId != ''">
and entity_id like concat('%', #{entityId}, '%')
AND ri.entity_id like concat('%', #{entityId}, '%')
</if>
<if test="ckType != null and ckType != ''">
and ck_type like concat('%', #{ckType}, '%')
AND ri.ck_type like concat('%', #{ckType}, '%')
</if>
<if test="isDelete != null and isDelete != ''">
and ri.is_delete = #{isDelete}
</if>
<if test="isDelete == null or isDelete == ''">
and ri.is_delete = 0
</if>
<choose>
<when test="isDelete != null and isDelete != ''">
AND ri.is_delete = #{isDelete}
</when>
<otherwise>
AND ri.is_delete = 0
</otherwise>
</choose>
</where>
order by rk_time desc
ORDER BY ri.rk_time DESC
</select>
<select id="selectRkInfoById" parameterType="Long" resultMap="RkInfoResult">
<include refid="selectRkInfoVo"/>
where ri.id = #{id} and ri.is_delete = 0
@@ -470,6 +487,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND bill_no_ck = #{billNo}
</select>
<select id="selectRkInfoByIds" resultMap="RkInfoResult">
SELECT * FROM rk_info
WHERE is_delete = '0'
AND id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<update id="updateRkInfo" parameterType="RkInfo">
update rk_info
<trim prefix="SET" suffixOverrides=",">