设备管理
This commit is contained in:
parent
f8bea11e1c
commit
548577d50b
|
|
@ -1,12 +1,18 @@
|
|||
package com.bonus.material.ma.service.impl;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
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.web.domain.AjaxResult;
|
||||
import com.bonus.material.ma.domain.Type;
|
||||
import com.bonus.material.ma.vo.MachineVo;
|
||||
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 org.springframework.stereotype.Service;
|
||||
import com.bonus.material.ma.mapper.MachineMapper;
|
||||
import com.bonus.material.ma.domain.Machine;
|
||||
|
|
@ -26,6 +32,9 @@ public class MachineServiceImpl implements IMachineService
|
|||
@Resource
|
||||
private MachineMapper machineMapper;
|
||||
|
||||
@Resource
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
/**
|
||||
* 查询机具设备管理
|
||||
*
|
||||
|
|
@ -35,7 +44,25 @@ public class MachineServiceImpl implements IMachineService
|
|||
@Override
|
||||
public MachineVo selectMachineByMaId(Long maId)
|
||||
{
|
||||
return machineMapper.selectMachineByMaId(maId);
|
||||
MachineVo machineVo = machineMapper.selectMachineByMaId(maId);
|
||||
AjaxResult ajaxResult = remoteUserService.getInfo(machineVo.getKeeperId(), SecurityConstants.INNER);
|
||||
// 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);
|
||||
machineVo.setKeeperName(sysUser.getNickName() == null ? "" : sysUser.getNickName());
|
||||
}
|
||||
AjaxResult info = remoteUserService.getInfo(machineVo.getRepairId(), SecurityConstants.INNER);
|
||||
// ajaxResult.get("data") 返回的是 LinkedHashMap
|
||||
LinkedHashMap dataList = (LinkedHashMap) info.get("data");
|
||||
if (dataList != null) {
|
||||
SysUser sysUser = objectMapper.convertValue(dataList, SysUser.class);
|
||||
machineVo.setRepairName(sysUser.getNickName() == null ? "" : sysUser.getNickName());
|
||||
}
|
||||
|
||||
return machineVo;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -24,4 +24,19 @@ public class MachineVo extends Machine {
|
|||
@ApiModelProperty("规格型号-四级")
|
||||
private String materialModel;
|
||||
|
||||
@ApiModelProperty("库管员id")
|
||||
private Long keeperId;
|
||||
|
||||
@ApiModelProperty("库管员名称")
|
||||
private String keeperName;
|
||||
|
||||
@ApiModelProperty("维修员id")
|
||||
private Long repairId;
|
||||
|
||||
@ApiModelProperty("维修员名称")
|
||||
private String repairName;
|
||||
|
||||
@ApiModelProperty("资产属性名称")
|
||||
private String assetName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,7 +144,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ma.update_time as updateTime,
|
||||
ma.inspect_man as inspectMan,
|
||||
ma.inspect_status as inspectStatus,
|
||||
ma.phone as phone
|
||||
ma.phone as phone,
|
||||
mtk.user_id as keeperId,
|
||||
mtr.user_id as repairId,
|
||||
baa.asset_name as assetName,
|
||||
ma.remark as remark
|
||||
FROM
|
||||
ma_machine ma
|
||||
LEFT JOIN ma_type mt ON ma.type_id = mt.type_id
|
||||
|
|
@ -155,6 +159,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and mt3.`level` = '2' and mt3.del_flag = '0'
|
||||
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 ma_type_repair mtr on ma.type_id = mtr.type_id
|
||||
LEFT JOIN bm_asset_attributes baa on ma.assets_id = baa.id
|
||||
where ma.ma_id = #{maId}
|
||||
</select>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue