From bdcbca45630145f51f309b37fde934f743338090 Mon Sep 17 00:00:00 2001 From: mashuai Date: Tue, 24 Dec 2024 10:05:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E8=BF=BD=E6=BA=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ma/service/impl/MachineServiceImpl.java | 30 ------------------- .../material/basic/BmAgreementInfoMapper.xml | 5 +++- .../mapper/material/ma/MachineMapper.xml | 6 ++-- 3 files changed, 8 insertions(+), 33 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java index defa1a4b..20a7c289 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java @@ -1,13 +1,9 @@ package com.bonus.material.ma.service.impl; -import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.function.Consumer; - import com.alibaba.nacos.common.utils.CollectionUtils; import com.bonus.common.biz.enums.HttpCodeEnum; -import com.bonus.common.core.constant.SecurityConstants; import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.StringUtils; import com.bonus.common.core.web.domain.AjaxResult; @@ -15,9 +11,6 @@ import com.bonus.material.ma.domain.Type; import com.bonus.material.ma.domain.vo.MachineVo; import com.bonus.material.purchase.config.RemoteConfig; import com.bonus.system.api.RemoteUserService; -import com.bonus.system.api.domain.SysUser; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import com.bonus.material.ma.mapper.MachineMapper; @@ -39,9 +32,6 @@ public class MachineServiceImpl implements IMachineService @Resource private MachineMapper machineMapper; - @Resource - private RemoteUserService remoteUserService; - @Resource private RemoteConfig remoteConfig; @@ -55,8 +45,6 @@ public class MachineServiceImpl implements IMachineService public MachineVo selectMachineByMaId(Long maId) { MachineVo machineVo = machineMapper.selectMachineByMaId(maId); - setUserName(machineVo.getKeeperId(), machineVo::setKeeperName); - setUserName(machineVo.getRepairId(), machineVo::setRepairName); Map machineStatus = remoteConfig.getDictValue("ma_machine_status"); if (StringUtils.isNotBlank(machineVo.getMaStatus())) { machineVo.setStatusName(StringUtils.isBlank(machineStatus.get(machineVo.getMaStatus())) ? "" : machineStatus.get(machineVo.getMaStatus())); @@ -64,24 +52,6 @@ public class MachineServiceImpl implements IMachineService return machineVo; } - private void setUserName(Long userId, Consumer setNameFunction) { - try { - AjaxResult ajaxResult = remoteUserService.getInfo(userId, SecurityConstants.INNER); - if (ajaxResult.isSuccess()) { - // ajaxResult.get("data") 返回的是 LinkedHashMap - LinkedHashMap rawDataList = (LinkedHashMap) ajaxResult.get("data"); - ObjectMapper objectMapper = new ObjectMapper(); - objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - if (rawDataList != null) { - SysUser sysUser = objectMapper.convertValue(rawDataList, SysUser.class); - setNameFunction.accept(sysUser.getNickName() == null ? "" : sysUser.getNickName()); - } - } - } catch (IllegalArgumentException e) { - log.error("远程调用查询失败:", e.getMessage()); - } - } - /** * 查询机具设备管理列表 * diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml index 3689a98f..17e04d9f 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmAgreementInfoMapper.xml @@ -38,7 +38,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and (bai.contract_code like concat('%', #{keyWord}, '%') or bai.agreement_code like concat('%', #{keyWord}, '%') or auth_person like concat('%', #{keyWord}, '%') or - phone like concat('%', #{keyWord}, '%')) + phone like concat('%', #{keyWord}, '%') or + bu.unit_name like concat('%', #{keyWord}, '%') or + bp.pro_name like concat('%', #{keyWord}, '%') + ) diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml index 908b0887..dac66b2f 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml @@ -158,8 +158,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ma.inspect_man as inspectMan, ma.inspect_status as inspectStatus, ma.phone as phone, - mtk.user_id as keeperId, - mtr.user_id as repairId, + GROUP_CONCAT( DISTINCT su1.nick_name ORDER BY su1.nick_name SEPARATOR ', ' ) AS keeperName, + GROUP_CONCAT( DISTINCT su2.nick_name ORDER BY su2.nick_name SEPARATOR ', ' ) AS repairName, baa.asset_name as assetName, ma.assets_id as assetsId, ma.remark as remark @@ -174,7 +174,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id and mt4.`level` = '1' and mt4.del_flag = '0' LEFT JOIN ma_type_keeper mtk on ma.type_id = mtk.type_id + LEFT JOIN sys_user su1 on mtk.user_id = su1.user_id LEFT JOIN ma_type_repair mtr on ma.type_id = mtr.type_id + LEFT JOIN sys_user su2 on mtr.user_id = su2.user_id LEFT JOIN bm_asset_attributes baa on ma.assets_id = baa.id where ma.ma_id = #{maId}