From b231b658ee2b84fd397d1bb6b270b4eb5c4359c1 Mon Sep 17 00:00:00 2001 From: mashuai Date: Wed, 9 Apr 2025 17:59:38 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/app/TmTaskMapper.xml | 9 +- .../resources/mapper/base/MaMachineMapper.xml | 2 +- .../mapper/base/MaSupplierInfoMapper.xml | 1 + .../PurchaseAccessoryController.java | 3 +- .../controller/RepairRecordController.java | 10 +- .../ReturnOfMaterialsInfoController.java | 4 +- .../material/domain/PurchasePartInfo.java | 98 ++++++++++++++++--- .../domain/ReturnOfMaterialsInfo.java | 3 + .../mapper/RepairAuditDetailsMapper.java | 2 + .../material/mapper/RepairRecordMapper.java | 6 ++ .../mapper/ReturnOfMaterialsInfoMapper.java | 4 +- .../service/ReturnOfMaterialsInfoService.java | 4 +- .../impl/RepairAuditDetailsServiceImpl.java | 22 ++++- .../service/impl/RepairRecordServiceImpl.java | 36 ++++++- .../ReturnOfMaterialsInfoServiceImpl.java | 4 +- .../material/PurchaseAccessoryMapper.xml | 2 +- .../material/RepairAuditDetailsMapper.xml | 22 ++++- .../mapper/material/RepairRecordMapper.xml | 46 +++++---- .../material/ReturnOfMaterialsInfoMapper.xml | 3 + 19 files changed, 220 insertions(+), 61 deletions(-) diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml index c46f5745..0e3faea1 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml @@ -1460,15 +1460,13 @@ WHEN 0 THEN IFNULL( subquery0.num, 0 ) ELSE IFNULL( mt.num, 0 ) END AS num, - subquery0.typeName, - subquery0.typeModelName as modelName + mt1.type_name AS typeName, + mt.type_name AS modelName FROM ma_type mt LEFT JOIN ( SELECT - mt.type_id, - mt2.type_name AS typeName, - mt.type_name AS typeModelName, + mt.type_id type_id, count( mm.ma_id ) num FROM ma_machine mm @@ -1480,6 +1478,7 @@ GROUP BY mt.type_id ) AS subquery0 ON subquery0.type_id = mt.type_id + LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id WHERE mt.type_id = #{typeId} diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml index da794c5e..da9f62b3 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml @@ -77,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" or mt2.type_name like concat('%',#{keyWord},'%')) - AND m.create_time between #{beginTime} and #{endTime} + AND DATE_FORMAT(m.create_time,'%Y-%m-%d') between #{beginTime} and #{endTime} order by m.ma_id desc diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaSupplierInfoMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaSupplierInfoMapper.xml index b68ca5ee..9d8a5747 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaSupplierInfoMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaSupplierInfoMapper.xml @@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and company_id = #{companyId} and status = #{status} + ORDER BY create_time DESC - + + \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairRecordMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairRecordMapper.xml index e6f540f8..ccae1406 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairRecordMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/RepairRecordMapper.xml @@ -25,35 +25,39 @@ ELSE rar.part_price END partPrice, - bpl.lot_name as proName, - bui.unit_name as unitName + rar.task_id as taskId, + rar.type_id as typeId, + rar.ma_id as maId FROM repair_apply_record rar LEFT JOIN tm_task tt on tt.task_id = rar.task_id LEFT JOIN ma_type mt on mt.type_id = rar.type_id LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id LEFT JOIN repair_part_details rpd on rpd.task_id = rar.task_id - and rpd.type_id = rar.type_id + and rpd.type_id = rar.type_id and rar.ma_id = rpd.ma_id and rar.repair_type = '1' LEFT JOIN ma_part_type mpt on mpt.pa_id = rpd.part_id LEFT JOIN ma_part_type mpt2 on mpt2.pa_id = mpt.parent_id - LEFT JOIN repair_apply_details rad on rad.task_id = rar.task_id and rad.type_id = rar.type_id - LEFT JOIN back_apply_info bai on bai.id = rad.back_id - LEFT JOIN tm_task_agreement tta on tta.task_id = bai.task_id - LEFT JOIN bm_agreement_info baif on baif.agreement_id = tta.agreement_id - LEFT JOIN bm_project_lot bpl on bpl.lot_id = baif.project_id - LEFT JOIN bm_unit_info bui on bui.unit_id = baif.unit_id - where 1 = 1 - - and (tt.`code` like concat('%',#{keyWord},'%') or - mt2.type_name like concat('%',#{keyWord},'%') or - mt.type_name like concat('%',#{keyWord},'%')) - - - and bui.unit_id = #{unitId} - - - and bpl.lot_id = #{proId} - + ORDER BY rar.create_time DESC + + \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ReturnOfMaterialsInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ReturnOfMaterialsInfoMapper.xml index ec548ac1..51540ea7 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ReturnOfMaterialsInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ReturnOfMaterialsInfoMapper.xml @@ -43,6 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"