功能重构开发

This commit is contained in:
2026-01-23 17:15:20 +08:00
parent 9b2b142347
commit 268e5f21fa
19 changed files with 577 additions and 301 deletions

View File

@@ -189,6 +189,65 @@
</foreach>
</select>
<select id="selectStockStatisticByCondition"
parameterType="com.zg.project.wisdom.domain.RkInfo"
resultType="com.zg.project.wisdom.domain.vo.StockStatisticVO">
SELECT
IFNULL(SUM(ri.real_qty * ri.ht_dj), 0) AS total_amount,
COUNT(DISTINCT ri.pcode) AS location_count,
IFNULL(SUM(ri.real_qty), 0) AS total_quantity
FROM rk_info ri
<where>
ri.exec_status = 1
AND ri.is_chuku = 0
AND ri.is_delete = 0
<if test="operationType != null and operationType != ''">
AND ri.operation_type LIKE CONCAT('%', #{operationType}, '%')
</if>
<if test="sapNo != null and sapNo != ''">
AND ri.sap_no LIKE CONCAT('%', #{sapNo}, '%')
</if>
<if test="xmNo != null and xmNo != ''">
AND ri.xm_no LIKE CONCAT('%', #{xmNo}, '%')
</if>
<if test="xmMs != null and xmMs != ''">
AND ri.xm_ms LIKE CONCAT('%', #{xmMs}, '%')
</if>
<if test="wlNo != null and wlNo != ''">
AND ri.wl_no LIKE CONCAT('%', #{wlNo}, '%')
</if>
<if test="wlMs != null and wlMs != ''">
AND ri.wl_ms LIKE CONCAT('%', #{wlMs}, '%')
</if>
<if test="gysMc != null and gysMc != ''">
AND ri.gys_mc LIKE CONCAT('%', #{gysMc}, '%')
</if>
<if test="pcode != null and pcode != ''">
AND ri.pcode LIKE CONCAT('%', #{pcode}, '%')
</if>
<if test="bizType != null and bizType != ''">
AND ri.biz_type LIKE CONCAT('%', #{bizType}, '%')
</if>
<if test="wlType != null and wlType != ''">
AND ri.wl_type LIKE CONCAT('%', #{wlType}, '%')
</if>
<if test="cangku != null and cangku != ''">
AND ri.cangku LIKE CONCAT('%', #{cangku}, '%')
</if>
<if test="billNo != null and billNo != ''">
AND ri.bill_no LIKE CONCAT('%', #{billNo}, '%')
</if>
<if test="startDate != null">
AND ri.operation_time &gt;= #{startDate}
</if>
<if test="endDate != null">
AND ri.operation_time &lt;= #{endDate}
</if>
</where>
</select>
<!-- ========================= 删除 ========================= -->
<delete id="deleteRkInfoById" parameterType="Long">
DELETE FROM rk_info WHERE id = #{id}
@@ -327,6 +386,7 @@
return_time = #{returnTime},
update_time = NOW()
WHERE id = #{id}
AND is_delete = '0'
</update>

View File

@@ -61,6 +61,7 @@
<result property="trayCode" column="tray_code"/>
<result property="entityId" column="entity_id"/>
<result property="teamCode" column="team_code"/>
<result property="teamName" column="team_name"/>
<result property="borrowTime" column="borrow_time"/>
<result property="returnTime" column="return_time"/>
@@ -101,7 +102,8 @@
/* 仓库信息:小仓/大仓 */
wh.warehouse_name,
wh.parent_warehouse_code,
wh.parent_warehouse_name
wh.parent_warehouse_name,
ct.team_name AS team_name
FROM rk_record rr
LEFT JOIN sys_user su
ON rr.operator = su.user_id
@@ -113,6 +115,9 @@
ON rr.operation_type = sot.type_code
LEFT JOIN warehouse_info wh
ON rr.cangku = wh.warehouse_code
LEFT JOIN construction_team ct
ON rr.team_code = ct.team_code
AND ct.is_delete = '0'
</sql>
<!-- ===================== 查询列表 ===================== -->
@@ -193,7 +198,10 @@
<if test="wlMs != null and wlMs != ''">
AND rr.wl_ms LIKE concat('%', #{wlMs}, '%')
</if>
<!-- 是否借料 -->
<if test="isBorrowed != null and isBorrowed != ''">
AND rr.is_borrowed = #{isBorrowed}
</if>
<!-- 默认不查删除 -->
<if test="isDelete == null">
AND (rr.is_delete = '0' OR rr.is_delete = 0 OR rr.is_delete IS NULL)
@@ -528,4 +536,102 @@
</foreach>
</delete>
<!-- 入库统计 -->
<select id="selectInRecordStatistic"
parameterType="com.zg.project.wisdom.domain.RkRecord"
resultType="com.zg.project.wisdom.domain.vo.StockStatisticVO">
SELECT
IFNULL(SUM(rr.real_qty * rr.ht_dj), 0) AS total_amount,
COUNT(DISTINCT rr.pcode) AS location_count,
IFNULL(SUM(rr.real_qty), 0) AS total_quantity
FROM rk_record rr
<where>
rr.is_delete = 0
AND rr.exec_status = 1
AND rr.biz_type = 0 <!-- 入库 -->
<if test="operationType != null and operationType != ''">
AND rr.operation_type LIKE CONCAT('%', #{operationType}, '%')
</if>
<if test="xmNo != null and xmNo != ''">
AND rr.xm_no LIKE CONCAT('%', #{xmNo}, '%')
</if>
<if test="wlNo != null and wlNo != ''">
AND rr.wl_no LIKE CONCAT('%', #{wlNo}, '%')
</if>
<if test="pcode != null and pcode != ''">
AND rr.pcode LIKE CONCAT('%', #{pcode}, '%')
</if>
<if test="cangku != null and cangku != ''">
AND rr.cangku LIKE CONCAT('%', #{cangku}, '%')
</if>
<if test="startDate != null">
AND rr.operation_time &gt;= #{startDate}
</if>
<if test="endDate != null">
AND rr.operation_time &lt;= #{endDate}
</if>
</where>
</select>
<!-- 出库统计 -->
<select id="selectOutRecordStatistic"
parameterType="com.zg.project.wisdom.domain.RkRecord"
resultType="com.zg.project.wisdom.domain.vo.StockStatisticVO">
SELECT
IFNULL(SUM(rr.real_qty * rr.ht_dj), 0) AS total_amount,
COUNT(DISTINCT rr.pcode) AS location_count,
IFNULL(SUM(rr.real_qty), 0) AS total_quantity
FROM rk_record rr
<where>
rr.is_delete = 0
AND rr.exec_status = 1
AND rr.biz_type = 1 <!-- 出库 -->
<if test="operationType != null and operationType != ''">
AND rr.operation_type LIKE CONCAT('%', #{operationType}, '%')
</if>
<if test="xmNo != null and xmNo != ''">
AND rr.xm_no LIKE CONCAT('%', #{xmNo}, '%')
</if>
<if test="wlNo != null and wlNo != ''">
AND rr.wl_no LIKE CONCAT('%', #{wlNo}, '%')
</if>
<if test="pcode != null and pcode != ''">
AND rr.pcode LIKE CONCAT('%', #{pcode}, '%')
</if>
<if test="cangku != null and cangku != ''">
AND rr.cangku LIKE CONCAT('%', #{cangku}, '%')
</if>
<if test="startDate != null">
AND rr.operation_time &gt;= #{startDate}
</if>
<if test="endDate != null">
AND rr.operation_time &lt;= #{endDate}
</if>
</where>
</select>
<select id="countPreInRecordByBillNo" resultType="int">
SELECT COUNT(1)
FROM rk_record
WHERE bill_no = #{billNo}
AND exec_status = '0'
AND is_delete = '0'
</select>
<update id="updateBorrowReturnRecordById">
UPDATE rk_record
SET
is_borrowed = #{isBorrowed},
return_time = #{returnTime},
update_by = #{updateBy},
update_time = #{updateTime}
WHERE id = #{id}
AND is_delete = '0'
</update>
</mapper>