出库模块开发

This commit is contained in:
2025-06-10 09:37:37 +08:00
parent 4d6d670bf4
commit 52ff615f29
18 changed files with 857 additions and 163 deletions

View File

@@ -8,12 +8,16 @@
<insert id="insertRkBill" parameterType="com.zg.project.wisdom.domain.RkBill">
INSERT INTO rk_bill (
rk_type, wl_type, cangku, rk_time, lihuo_y,
ck_type, ck_time, ck_lihuo_y, ck_remark, team_code,
bill_no, is_chuku, is_delete,
created_by, created_at
created_by, created_at,
updated_by, updated_at
) VALUES (
#{rkType}, #{wlType}, #{cangku}, #{rkTime}, #{lihuoY},
#{ckType}, #{ckTime}, #{ckLihuoY}, #{ckRemark}, #{teamCode},
#{billNo}, #{isChuku}, #{isDelete},
#{createBy}, #{createTime}
#{createBy}, #{createTime},
#{updateBy}, #{updateTime}
)
</insert>
@@ -33,15 +37,28 @@
rb.rk_time AS rkTime,
rb.bill_no AS billNo,
rb.is_chuku AS isChuku,
-- ✅ 出库相关字段(新增)
rb.ck_type AS ckType,
sot.ck_type_name AS ckTypeName,
rb.ck_time AS ckTime,
rb.ck_lihuo_y AS ckLihuoY,
rb.ck_remark AS ckRemark,
rb.team_code AS teamCode,
ct.team_name AS teamName,
rb.is_delete AS isDelete,
rb.created_by AS createBy,
rb.created_at AS createTime,
rb.updated_by AS updateBy,
rb.updated_at AS updateTime
FROM rk_bill rb
LEFT JOIN stock_in_type st ON rb.rk_type = st.type_code
LEFT JOIN material_type mt ON rb.wl_type = mt.type_code
LEFT JOIN warehouse_info wh ON rb.cangku = wh.warehouse_code
LEFT JOIN stock_out_type sot ON rb.ck_type = sot.ck_type_code
LEFT JOIN construction_team ct ON rb.team_code = ct.team_code
WHERE rb.is_delete = '0'
<if test="billNo != null and billNo != ''">
AND rb.bill_no LIKE CONCAT('%', #{billNo}, '%')
@@ -49,37 +66,85 @@
ORDER BY rb.rk_time DESC
</select>
<!-- 根据单据号查询单条 -->
<select id="selectRkBillByBillNo" resultType="com.zg.project.wisdom.domain.RkBill">
SELECT
id, rk_type, wl_type, cangku, rk_time, lihuo_y,
bill_no, is_chuku, is_delete,
created_by AS createBy, created_at AS createTime,
updated_by AS updateBy, updated_at AS updateTime,
remark
FROM rk_bill
WHERE bill_no = #{billNo}
rb.id,
rb.rk_type, st.type_name AS rkTypeName,
rb.wl_type, mt.type_name AS wlTypeName,
rb.cangku, wh.warehouse_name AS cangkuName,
rb.rk_time, rb.lihuo_y,
rb.ck_type, sot.ck_type_name AS ckTypeName,
rb.ck_time, rb.ck_lihuo_y,
rb.ck_remark, rb.team_code, ct.team_name AS teamName,
rb.bill_no, rb.is_chuku, rb.is_delete,
rb.created_by AS createBy, rb.created_at AS createTime,
rb.updated_by AS updateBy, rb.updated_at AS updateTime,
rb.remark
FROM rk_bill rb
LEFT JOIN stock_in_type st ON rb.rk_type = st.type_code
LEFT JOIN material_type mt ON rb.wl_type = mt.type_code
LEFT JOIN warehouse_info wh ON rb.cangku = wh.warehouse_code
LEFT JOIN stock_out_type sot ON rb.ck_type = sot.ck_type_code
LEFT JOIN construction_team ct ON rb.team_code = ct.team_code
WHERE rb.bill_no = #{billNo} AND rb.is_delete = '0'
LIMIT 1
</select>
<!-- 查询详情 -->
<select id="selectRkBillById" resultType="com.zg.project.wisdom.domain.RkBill">
SELECT * FROM rk_bill WHERE id = #{id} AND is_delete = '0'
SELECT
rb.id,
rb.rk_type, st.type_name AS rkTypeName,
rb.wl_type, mt.type_name AS wlTypeName,
rb.cangku, wh.warehouse_name AS cangkuName,
rb.rk_time, rb.lihuo_y,
rb.ck_type, sot.ck_type_name AS ckTypeName,
rb.ck_time, rb.ck_lihuo_y,
rb.ck_remark, rb.team_code, ct.team_name AS teamName,
rb.bill_no, rb.is_chuku, rb.is_delete,
rb.created_by AS createBy, rb.created_at AS createTime,
rb.updated_by AS updateBy, rb.updated_at AS updateTime,
rb.remark
FROM rk_bill rb
LEFT JOIN stock_in_type st ON rb.rk_type = st.type_code
LEFT JOIN material_type mt ON rb.wl_type = mt.type_code
LEFT JOIN warehouse_info wh ON rb.cangku = wh.warehouse_code
LEFT JOIN stock_out_type sot ON rb.ck_type = sot.ck_type_code
LEFT JOIN construction_team ct ON rb.team_code = ct.team_code
WHERE rb.id = #{id} AND rb.is_delete = '0'
</select>
<!-- 修改 -->
<update id="updateRkBill" parameterType="com.zg.project.wisdom.domain.RkBill">
UPDATE rk_bill
SET rk_type = #{rkType},
wl_type = #{wlType},
cangku = #{cangku},
rk_time = #{rkTime},
lihuo_y = #{lihuoY},
bill_no = #{billNo},
is_chuku = #{isChuku},
remark = #{remark},
updated_by = #{updateBy},
updated_at = #{updateTime}
<set>
<if test="rkType != null">rk_type = #{rkType},</if>
<if test="wlType != null">wl_type = #{wlType},</if>
<if test="cangku != null">cangku = #{cangku},</if>
<if test="rkTime != null">rk_time = #{rkTime},</if>
<if test="lihuoY != null">lihuo_y = #{lihuoY},</if>
<if test="ckType != null">ck_type = #{ckType},</if>
<if test="ckTime != null">ck_time = #{ckTime},</if>
<if test="ckLihuoY != null">ck_lihuo_y = #{ckLihuoY},</if>
<if test="ckRemark != null">ck_remark = #{ckRemark},</if>
<if test="teamCode != null">team_code = #{teamCode},</if>
<if test="billNo != null">bill_no = #{billNo},</if>
<if test="isChuku != null">is_chuku = #{isChuku},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null">updated_by = #{updateBy},</if>
<if test="updateTime != null">updated_at = #{updateTime},</if>
</set>
WHERE id = #{id}
</update>
@@ -93,13 +158,4 @@
</foreach>
</update>
<update id="updateOutStock" parameterType="list">
UPDATE rk_bill
SET is_chuku = '1'
WHERE id IN
<foreach collection="list" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@@ -259,19 +259,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</update>
<update id="batchUpdateOutStock" parameterType="java.util.List">
<foreach collection="list" item="item" separator=";">
UPDATE rk_info
SET
is_chuku = 1,
ck_time = #{item.ckTime},
ck_type = #{item.ckType},
team_code = #{item.teamCode},
ck_lihuo_y = #{item.ckLihuoY},
update_by = #{item.updateBy},
update_time = #{item.updateTime}
WHERE id = #{item.id} AND is_delete = 0
</foreach>
<update id="updateById" parameterType="RkInfo">
UPDATE rk_info
SET is_chuku = #{isChuku},
ck_remark = #{ckRemark},
ck_type = #{ckType},
ck_time = #{ckTime},
ck_lihuo_y = #{ckLihuoY},
team_code = #{teamCode},
update_by = #{updateBy},
update_time = #{updateTime}
WHERE id = #{id}
</update>
</mapper>