暂降事件
This commit is contained in:
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
||||
import com.njcn.csdevice.pojo.param.CsLedgerParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||
@@ -125,5 +126,15 @@ public class CsLedgerController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryDevDetail")
|
||||
@ApiOperation("根据设备号查询工程,项目,设备")
|
||||
@ApiImplicitParam(name = "devId", value = "查询条件", required = true)
|
||||
public HttpResult<DevDetailDTO> queryDevDetail(@RequestParam @Validated String devId){
|
||||
String methodDescribe = getMethodDescribe("queryDevDetail");
|
||||
DevDetailDTO details = csLedgerService.queryDevDetail(devId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, details, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
||||
import com.njcn.csdevice.pojo.param.CsLedgerParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||
@@ -71,4 +72,6 @@ public interface ICsLedgerService extends IService<CsLedger> {
|
||||
List<CsLedgerVO> getProjectTree();
|
||||
|
||||
List<CsLedger> queryLine(LineParamDTO lineParamdto);
|
||||
|
||||
DevDetailDTO queryDevDetail(String devId);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.njcn.csdevice.mapper.AppProjectMapper;
|
||||
import com.njcn.csdevice.mapper.AppTopologyDiagramMapper;
|
||||
import com.njcn.csdevice.mapper.CsEngineeringMapper;
|
||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||
import com.njcn.csdevice.pojo.dto.LineParamDTO;
|
||||
import com.njcn.csdevice.pojo.param.CsLedgerParam;
|
||||
import com.njcn.csdevice.pojo.po.AppProjectPO;
|
||||
@@ -213,6 +214,22 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
return lineIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DevDetailDTO queryDevDetail(String devId) {
|
||||
DevDetailDTO device = new DevDetailDTO();
|
||||
CsLedger dev = this.findDataById(devId);
|
||||
device.setEquipmentName(dev.getId());
|
||||
device.setEquipmentId(devId);
|
||||
CsLedger project = this.findDataById(dev.getPid());
|
||||
device.setProjectId(project.getId());
|
||||
device.setProjectName(project.getName());
|
||||
CsLedger engineer = this.findDataById(project.getPid());
|
||||
device.setEngineeringid(engineer.getId());
|
||||
device.setEngineeringName(engineer.getName());
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取子节点
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user