From 1093b185322515aebcccee208018346e7f9edbb3 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期二, 14 十月 2025 16:51:25 +0800
Subject: [PATCH] 资产盘点任务接口

---
 ruoyi-system/src/main/resources/mapper/system/AssetInventoryTaskMapper.xml |   46 +++++++++++++++++++++++++++++++---------------
 1 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/AssetInventoryTaskMapper.xml b/ruoyi-system/src/main/resources/mapper/system/AssetInventoryTaskMapper.xml
index 61d57b7..0c7a40f 100644
--- a/ruoyi-system/src/main/resources/mapper/system/AssetInventoryTaskMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/AssetInventoryTaskMapper.xml
@@ -36,37 +36,45 @@
             am.measurement_unit,
             am.quantity,
             am.unit_price,
-            ( am.quantity * am.unit_price ) AS total_value,
+            am.total_value,
             am.accounting_voucher_no,
             am.accounting_subject,
             am.accounting_status,
             am.accounting_amount,
             am.accounting_date,
             am.asset_status,
-            od.dept_name AS ownership_dept_name,
+            td.dept_name AS ownership_dept_name,
             am.ownership_dept_id,
             am.asset_type_id,
             am.address_type,
+            am.address,
             am.use_dept_id,
             am.warehouse_id,
-            od2.dept_name AS use_dept_name,
-            su.nick_name AS user_name,
+            am.user_name,
+            aw.warehouse_name,
+            td2.dept_name AS use_dept_name,
+            su.nick_name AS check_user_name,
             aiti.result_status AS inventory_status,
             aiti.real_dept_name,
-            aiti.real_user_name
+            aiti.real_user_name,
+            aiti.id AS asset_inventory_task_item_id,
+            aiti.exception_explain
         FROM
             asset_inventory_task_item aiti
         INNER JOIN
             asset_main am ON aiti.asset_main_id = am.id
         LEFT JOIN
-            asset_type at2 ON am.asset_type_id = at.id
+            asset_type at2 ON am.asset_type_id = at2.id
         LEFT JOIN
             asset_type at1 ON at1.id = (CASE WHEN at2.level = 2 THEN at2.parent_id ELSE at2.id END)
         LEFT JOIN
-            sys_dept od ON am.ownership_dept_id = od.dept_id
+            t_dept td ON am.ownership_dept_id = td.id
         LEFT JOIN
             sys_user su ON aiti.user_id = su.user_id
-        LEFT JOIN sys_dept od2 ON am.address_type = 0 AND am.use_dept_id = od2.id
+        LEFT JOIN
+            t_dept td2 ON am.address_type = 0 AND am.use_dept_id = td2.id
+        LEFT JOIN
+            asset_warehouse aw ON am.address_type = 1 AND am.warehouse_id = aw.id
         WHERE
             aiti.inventory_task_id = #{taskId}
         ORDER BY
@@ -99,24 +107,29 @@
         am.measurement_unit,
         am.quantity,
         am.unit_price,
-        ( am.quantity * am.unit_price ) AS total_value,
+        am.total_value,
         am.accounting_voucher_no,
         am.accounting_subject,
         am.accounting_status,
         am.accounting_amount,
         am.accounting_date,
         am.asset_status,
-        od.dept_name AS ownership_dept_name,
+        td.dept_name AS ownership_dept_name,
         am.ownership_dept_id,
         am.asset_type_id,
         am.address_type,
+        am.address,
         am.use_dept_id,
         am.warehouse_id,
-        od2.dept_name AS use_dept_name,
-        su.nick_name AS user_name,
+        am.user_name,
+        aw.warehouse_name,
+        td2.dept_name AS use_dept_name,
+        su.nick_name AS check_user_name,
         aiti.result_status AS inventory_status,
         aiti.real_dept_name,
-        aiti.real_user_name
+        aiti.real_user_name,
+        aiti.id AS asset_inventory_task_item_id,
+        aiti.exception_explain
         FROM
         asset_inventory_task_item aiti
         INNER JOIN
@@ -124,10 +137,13 @@
         LEFT JOIN
         asset_type at ON am.asset_type_id = at.id
         LEFT JOIN
-        sys_dept od ON am.ownership_dept_id = od.dept_id
+        t_dept td ON am.ownership_dept_id = td.id
         LEFT JOIN
         sys_user su ON aiti.user_id = su.user_id
-        LEFT JOIN sys_dept od2 ON am.address_type = 0 AND am.use_dept_id = od2.id
+        LEFT JOIN
+            t_dept td2 ON am.address_type = 0 AND am.use_dept_id = td2.id
+        LEFT JOIN
+            asset_warehouse aw ON am.address_type = 1 AND am.warehouse_id = aw.id
         <where>
             aiti.inventory_task_id = #{query.id}
             <if test="query.keyword != null and query.keyword != ''">

--
Gitblit v1.7.1