This commit is contained in:
parent
48fdebbb5b
commit
90a7ec357f
|
|
@ -108,6 +108,17 @@ public class RepairController extends BaseController {
|
|||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取维修任务机具列表--三级页面详情列表
|
||||
*/
|
||||
@ApiOperation(value = "获取维修物资设备列表---不分页")
|
||||
//@RequiresPermissions(value = "repair:manage:list")
|
||||
@GetMapping("/getAppRepairMaTypeListByTaskIdAndTypeId")
|
||||
public AjaxResult getAppRepairMaTypeListByTaskIdAndTypeId(RepairTaskDetails bean) {
|
||||
List<RepairDeviceVO> list = service.getAppRepairMaTypeListByTaskIdAndTypeId(bean);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取维修任务机具列表--三级页面详情列表--编码
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -362,4 +362,11 @@ public interface RepairMapper {
|
|||
* @return
|
||||
*/
|
||||
RepairTask selectInfo(RepairTask repairTask);
|
||||
|
||||
/**
|
||||
* 查询机具列表--三级页面详情列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<RepairDeviceVO> getAppRepairMaTypeListByTaskIdAndTypeId(RepairTaskDetails bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,4 +139,11 @@ public interface RepairService {
|
|||
* @return
|
||||
*/
|
||||
List<RepairTaskDetails> getTestRecordData(RepairTaskDetails bean);
|
||||
|
||||
/**
|
||||
* 获取维修任务机具列表--app
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<RepairDeviceVO> getAppRepairMaTypeListByTaskIdAndTypeId(RepairTaskDetails bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1598,6 +1598,16 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RepairDeviceVO> getAppRepairMaTypeListByTaskIdAndTypeId(RepairTaskDetails bean) {
|
||||
try {
|
||||
return repairMapper.getAppRepairMaTypeListByTaskIdAndTypeId(bean);
|
||||
} catch (Exception e) {
|
||||
log.error("查询修试查询-维修配件查询列表", e.getMessage());
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询修试查询-维修配件查询列表
|
||||
* @param dto
|
||||
|
|
|
|||
|
|
@ -1055,6 +1055,71 @@
|
|||
ORDER BY create_time
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="getAppRepairMaTypeListByTaskIdAndTypeId"
|
||||
resultType="com.bonus.material.repair.domain.vo.RepairDeviceVO">
|
||||
<![CDATA[
|
||||
select
|
||||
rad.id as id,
|
||||
rad.task_id as taskId,
|
||||
rad.ma_id as maId,
|
||||
mt2.type_name as typeName,
|
||||
mt2.type_id as typeNameId,
|
||||
mt.type_name as type,
|
||||
mt.unit_name as unitName,
|
||||
mt.manage_type as manageType,
|
||||
mm.ma_code as code,
|
||||
ifnull(rad.repair_num, 0) as repairNum,
|
||||
sum(ifnull(rad.repaired_num,0) + ifnull(rad.this_repaired_num,0)) as repairedNum,
|
||||
sum(ifnull(rad.scrap_num,0) + ifnull(rad.this_scrap_num,0)) as scrapNum,
|
||||
rad.status as status,
|
||||
su.nick_name as repairer,
|
||||
rad.update_time as updateTime,
|
||||
rad.type_id as typeId,
|
||||
rad.back_id as backId,
|
||||
rad.level as level,
|
||||
rad.parent_id as parentId,
|
||||
rad.create_time,
|
||||
bai.CODE AS backCode,
|
||||
mt4.type_id AS firstId,
|
||||
( SELECT COUNT(*) FROM repair_cost rc WHERE rc.repair_id = rad.id ) AS totalCostRecords,
|
||||
( SELECT COALESCE(SUM(rc.costs), 0) FROM repair_cost rc WHERE rc.repair_id = rad.id ) AS totalCost,
|
||||
rad2.`status` as dataStatus,
|
||||
mt.unit_value AS unitValue
|
||||
from
|
||||
repair_apply_details rad
|
||||
left join ma_type mt on rad.type_id = mt.type_id
|
||||
left join ma_machine mm on mm.ma_id = rad.ma_id
|
||||
left join sys_user su on rad.repairer = su.user_id
|
||||
left join ma_type mt2 on mt.parent_id = mt2.type_id
|
||||
LEFT JOIN back_apply_info bai ON rad.back_id = bai.id
|
||||
left join ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.del_flag = '0'
|
||||
left join ma_type mt4 ON mt3.parent_id = mt4.type_id and mt4.del_flag = '0'
|
||||
left join repair_apply_details rad2 on rad2.task_id=rad.task_id and rad2.ma_id <=> rad.ma_id and rad2.type_id=rad.type_id and rad2.is_ds='1'
|
||||
]]>
|
||||
<if test="userId != null">
|
||||
JOIN ma_type_repair mtr
|
||||
ON mtr.type_id = rad.type_id
|
||||
AND mtr.user_id = #{userId}
|
||||
</if>
|
||||
where
|
||||
rad.task_id = #{taskId}
|
||||
and rad.type_id=#{typeId}
|
||||
and rad.is_ds=0
|
||||
<if test="companyId != null and companyId != ''">
|
||||
and rad.company_id = #{companyId}
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
and mm.ma_code like CONCAT('%', #{keyword}, '%')
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
AND mt.type_id = #{type}
|
||||
</if>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
AND mt2.type_id = #{typeName}
|
||||
</if>
|
||||
GROUP BY rad.id
|
||||
order by rad.create_time desc
|
||||
</select>
|
||||
|
||||
<update id="updateRepairedAndScrapNum">
|
||||
update
|
||||
|
|
|
|||
Loading…
Reference in New Issue