维修审核模块优化
This commit is contained in:
parent
f724533071
commit
ff162d0cd5
|
|
@ -0,0 +1,9 @@
|
|||
package com.bonus.common.biz.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class KeyValueVO {
|
||||
private String mapKey;
|
||||
private String mapValue;
|
||||
}
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
package com.bonus.material.repair.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.bonus.material.repair.domain.RepairAuditDetails;
|
||||
import com.bonus.material.repair.domain.RepairPart;
|
||||
import com.bonus.material.repair.domain.RepairRecord;
|
||||
import com.bonus.material.repair.domain.RepairTaskDetails;
|
||||
import com.bonus.common.biz.domain.vo.KeyValueVO;
|
||||
import com.bonus.material.repair.domain.vo.RepairAuditDetailsVO;
|
||||
import com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -89,7 +89,7 @@ public interface RepairAuditDetailsMapper {
|
|||
* 根据taskIds批量查询规格名称---批量
|
||||
* @param taskIds 任务id集合
|
||||
*/
|
||||
Map<Long, String> selectTypeNamesByTaskIds(@Param("taskIds") List<Long> taskIds);
|
||||
List<KeyValueVO> selectTypeNamesByTaskIds(@Param("taskIds") List<Long> taskIds);
|
||||
|
||||
List<RepairAuditDetails> selectRepairAuditDetailsByTaskId(Long taskId);
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.bonus.common.core.utils.DateUtils;
|
|||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.repair.domain.*;
|
||||
import com.bonus.common.biz.domain.vo.KeyValueVO;
|
||||
import com.bonus.material.repair.domain.vo.RepairAuditDetailsVO;
|
||||
import com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO;
|
||||
import com.bonus.material.repair.domain.vo.ScrapAudit;
|
||||
|
|
@ -24,6 +25,8 @@ import com.bonus.material.task.mapper.TmTaskAgreementMapper;
|
|||
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||
import com.bonus.material.task.domain.TmTask;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.material.repair.mapper.RepairAuditDetailsMapper;
|
||||
import com.bonus.material.repair.service.IRepairAuditDetailsService;
|
||||
|
|
@ -38,6 +41,7 @@ import javax.annotation.Resource;
|
|||
* @date 2024-10-16
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService {
|
||||
|
||||
@Resource
|
||||
|
|
@ -110,14 +114,14 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
.collect(Collectors.toList());
|
||||
|
||||
// 批量查询 typeName
|
||||
Map<Long, String> typeNameMap = repairAuditDetailsMapper.selectTypeNamesByTaskIds(taskIds);
|
||||
|
||||
List<KeyValueVO> keyValueList = repairAuditDetailsMapper.selectTypeNamesByTaskIds(taskIds);
|
||||
// 设置 itemType
|
||||
if (CollectionUtil.isNotEmpty(typeNameMap)) {
|
||||
if (CollectionUtil.isNotEmpty(keyValueList)) {
|
||||
Map<String, String> keyValueMap = keyValueList.stream().collect(Collectors.toMap(KeyValueVO::getMapKey, KeyValueVO::getMapValue));
|
||||
for (ScrapApplyDetailsVO scrapApplyDetailsVO : repairQuestList) {
|
||||
Long taskId = scrapApplyDetailsVO.getTaskId();
|
||||
if (taskId != null) {
|
||||
String typeName = typeNameMap.get(taskId);
|
||||
String typeName = keyValueMap.get(taskId);
|
||||
if (typeName != null) {
|
||||
scrapApplyDetailsVO.setItemType(typeName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
IFNULL(lad.pre_num,0) as pre_num,
|
||||
IFNULL(lad.audit_num,0) as audit_num,
|
||||
IFNULL(lad.al_num,0) as al_num,
|
||||
lad.status, mt.unit_name,
|
||||
IFNULL(lad.status,0) as status, mt.unit_name,
|
||||
lad.create_by, lad.create_time, lad.update_by, lad.update_time, lad.remark, lad.company_id
|
||||
from
|
||||
lease_apply_details lad
|
||||
|
|
|
|||
|
|
@ -457,21 +457,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update repair_apply_record set status = 1,update_time = now() where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectTypeNamesByTaskIds" resultType="java.util.Map">
|
||||
<if test="taskIds != null and taskIds.size() > 0">
|
||||
<select id="selectTypeNamesByTaskIds" resultType="com.bonus.common.biz.domain.vo.KeyValueVO">
|
||||
select
|
||||
task_id, GROUP_CONCAT(type_name) as typeName
|
||||
task_id as mapKey, GROUP_CONCAT(type_name) as mapValue
|
||||
from
|
||||
(select distinct rad.task_id, mt1.type_name
|
||||
from repair_audit_details rad
|
||||
left join ma_type mt on rad.type_id = mt.type_id
|
||||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
where rad.task_id in
|
||||
<foreach item="taskId" index="index" collection="taskIds" open="(" separator="," close=")">
|
||||
#{taskId}
|
||||
</foreach>
|
||||
<if test="taskIds != null and taskIds.size() > 0">
|
||||
where rad.task_id in
|
||||
<foreach item="taskId" index="index" collection="taskIds" open="(" separator="," close=")">
|
||||
#{taskId}
|
||||
</foreach>
|
||||
</if>
|
||||
) t
|
||||
GROUP BY task_id
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue