维修记录表修改

This commit is contained in:
hongchao 2025-10-23 17:50:34 +08:00
parent f78ce835a3
commit 9654565123
3 changed files with 68 additions and 8 deletions

View File

@ -132,4 +132,14 @@ public class PartType extends BaseEntity
private Integer flag;
private Long typeId;
/**
* 是否显示(0:不显示1显示)
*/
private Integer isShow;
/**
* 是否显示(0:不部署展示配件类1属于展示配件类)
*/
private Integer isSure;
}

View File

@ -1770,6 +1770,7 @@ public class RepairServiceImpl implements RepairService {
try {
//查询
List<RepairTaskDetails> list = repairMapper.getTestRecordDetails(bean);
if (list.size() > 0) {
for (RepairTaskDetails bean1 : list) {
bean1.setUserName(SecurityUtils.getLoginUser().getSysUser().getNickName());

View File

@ -1205,6 +1205,7 @@
LEFT JOIN ma_machine mm ON rad.ma_id = mm.ma_id
WHERE
rd.`status` = '1' and mt1.manage_type='0'
and mt2.type_id in (46,47,48)
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
<![CDATA[and DATE_FORMAT( rad.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
</if>
@ -1229,6 +1230,7 @@
rad.type_id as typeId,
mt.type_name as type,
mt2.type_name as typeName,
mt2.type_id as parentId,
CONCAT(bai.`code`, '-', rad.`level`) as `code`,
mm.ma_code as maCode,
su.nick_name as repairer,
@ -1248,19 +1250,66 @@
rad.id=#{id}
</select>
<select id="getPartDetails" resultType="com.bonus.material.ma.domain.PartType">
SELECT rar.part_id as id,
mpt2.pa_name as partName
SELECT
mpt2.pa_id as parentId,
mpt2.pa_name as partName,
1 as isShow,
1 as isSure
FROM repair_apply_record rar
LEFT JOIN repair_apply_details rad
on rad.task_id = rar.task_id and rad.type_id = rar.type_id and rad.ma_id = rar.ma_id
LEFT JOIN ma_part_type mpt on mpt.pa_id = rar.part_id
LEFT JOIN ma_part_type mpt2 on mpt2.pa_id = mpt.parent_id
LEFT JOIN ma_part_type mpt3 on mpt2.parent_id = mpt.parent_id
LEFT JOIN repair_apply_details rad ON rad.task_id = rar.task_id and rad.type_id = rar.type_id and rad.ma_id = rar.ma_id
LEFT JOIN ma_part_type mpt ON mpt.pa_id = rar.part_id
LEFT JOIN ma_part_type mpt2 ON mpt2.pa_id = mpt.parent_id
LEFT JOIN ma_part_type mpt3 ON mpt2.parent_id = mpt3.pa_id
WHERE rad.id = #{id}
and rar.is_ds = 0
and rar.part_id IS NOT NULL
and mpt2.pa_name IS NOT NULL
and mpt3.pa_name = #{typeName}
and mpt2.is_show = 1
UNION
SELECT
mpt2.pa_id as parentId,
mpt2.pa_name as partName,
0 as isShow,
0 as isSure
FROM repair_apply_record rar
LEFT JOIN repair_apply_details rad ON rad.task_id = rar.task_id and rad.type_id = rar.type_id and rad.ma_id = rar.ma_id
LEFT JOIN ma_part_type mpt ON mpt.pa_id = rar.part_id
LEFT JOIN ma_part_type mpt2 ON mpt2.pa_id = mpt.parent_id
LEFT JOIN ma_part_type mpt3 ON mpt2.parent_id = mpt3.pa_id
WHERE rad.id = #{id}
and rar.is_ds = 0
and rar.part_id IS NOT NULL
and mpt2.pa_name IS NOT NULL
and (mpt2.is_show != 1 or mpt3.pa_name != #{typeName} )
UNION
SELECT DISTINCT
mpt2.pa_id as parentId,
mpt2.pa_name as partName,
0 as isShow,
1 as isSure
FROM ma_part_type mpt
LEFT JOIN ma_part_type mpt2 ON mpt2.pa_id = mpt.parent_id
LEFT JOIN ma_part_type mpt3 ON mpt3.pa_id = mpt2.parent_id
WHERE mpt2.is_show = 1
and mpt3.pa_name = #{typeName}
-- 排除第一个UNION中已查询到的parentId
AND mpt2.pa_id NOT IN (
SELECT mpt2_inner.pa_id
FROM repair_apply_record rar_inner
LEFT JOIN repair_apply_details rad_inner ON rad_inner.task_id = rar_inner.task_id and rad_inner.type_id = rar_inner.type_id and rad_inner.ma_id = rar_inner.ma_id
LEFT JOIN ma_part_type mpt_inner ON mpt_inner.pa_id = rar_inner.part_id
LEFT JOIN ma_part_type mpt2_inner ON mpt2_inner.pa_id = mpt_inner.parent_id
LEFT JOIN ma_part_type mpt3_inner ON mpt2_inner.parent_id = mpt3_inner.pa_id
WHERE rad_inner.id = #{id}
and rar_inner.is_ds = 0
and rar_inner.part_id IS NOT NULL
and mpt2_inner.pa_name IS NOT NULL
and mpt3_inner.pa_name = #{typeName}
and mpt2_inner.is_show = 1
)
</select>
<select id="getAppRepairMaTypeListNew" resultType="com.bonus.material.repair.domain.vo.RepairDeviceVO">
<![CDATA[