From c19de84fa332a00c651f28e3a52292fd14f143a1 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 23 九月 2025 17:30:07 +0800
Subject: [PATCH] 陆常丽反应软件系统财务对账时而数据不准确,分析源码,找到bug原因是,财务对账统计只有用户点击后才会触发统计功能,把历史上及当天进行了统计,如果当天统计时未下班,例如是中午触发统计了,而下午又进行了充值售水,但下班后未再点击触发对账统计,那么今天的对账统计完成了但数据不对。编写自动任务,在下半夜进行对账统计。
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIntakeOperateMapper.xml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIntakeOperateMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIntakeOperateMapper.xml
index ab8bc1a..6dc8edc 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIntakeOperateMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIntakeOperateMapper.xml
@@ -155,4 +155,53 @@
set command_result = #{commandResult}, failure_factors = #{failureFactors}
where command_id = #{commandId}
</update>
+
+ <!--鏍规嵁涓婚敭淇敼鍛戒护ID-->
+ <update id="updateCommandId">
+ update ir_intake_operate
+ set command_id = #{commandId}
+ where id = #{id}
+ </update>
+
+ <!--鏍规嵁璁″垝ID鑾峰彇寰呯粓姝㈢殑鍙栨按鍙D锛堝凡鍙戝竷寮�鍙戝懡浠わ紝鏃犺鏄惁鎴愬姛锛�-->
+ <select id="getToTerminateIntakeIds" resultType="java.lang.Long">
+ SELECT
+ intake_id AS intakeId
+ FROM ir_intake_operate
+ WHERE operate_type = 1 AND plan_id = #{planId}
+ </select>
+
+ <!--鏍规嵁璁″垝ID鑾峰彇寰呯粓姝㈢殑鍛戒护ID-->
+ <select id="getTerminateCommandIds" resultType="java.lang.Long">
+ SELECT command_id AS commandId FROM ir_intake_operate WHERE operate_type = 1 AND plan_id = #{planId}
+ </select>
+
+ <!--鏍规嵁璁″垝ID鑾峰彇寰呯粓姝㈢殑鍙栨按鍙e垪琛紙寮�闃�鎴愬姛鐨勶級-->
+ <select id="getToTerminateIntakes" resultType="com.dy.pipIrrGlobal.voIr.VoToTerminateIntakes">
+ SELECT
+ command_id AS commandId,
+ intake_id AS intakeId,
+ start_time AS startTime
+ FROM ir_intake_operate
+ WHERE operate_type = 1 AND command_result = 1 AND plan_id = #{planId}
+ </select>
+
+ <!--鏍规嵁璁″垝ID鍙婄杞粍ID鑾峰彇鍙栨按鍙e彂甯冨彂甯冪粨鏋�-->
+ <select id="getIntakeResult" resultType="com.dy.pipIrrGlobal.voIr.VoIntakeResult">
+ SELECT
+ IF(io.command_result = 1, 0, 1) AS code,
+ (SELECT name FROM pr_intake WHERE id = io.intake_id) AS intakeName,
+ io.failure_factors AS result
+ FROM ir_intake_operate io
+ inner JOIN ir_group_intake gi ON gi.intake_id = io.intake_id
+ WHERE io.plan_id = #{planId} AND gi.group_id = #{groupId} AND operate_type = 1;
+ </select>
+
+ <!--鏍规嵁璁″垝ID鑾峰彇鍙栨按鍙e懡浠ゅ彂甯冨け璐ユ暟閲忥紝鐏屾簤璁″垝璇︽儏椤典娇鐢�-->
+ <select id="getFailureCount" resultType="java.lang.Integer">
+ SELECT
+ COUNT(1) AS failureCount
+ FROM ir_intake_operate
+ WHERE operate_type = 1 AND command_result != 1 AND plan_id = #{planId}
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0