设备故障接口新增

dev
liuguijing 1 year ago
parent 07fc9ce119
commit 4fc371fe84

@ -1,5 +1,6 @@
package com.shxy.xymanager_admin.controller;
import cn.hutool.core.date.DateTime;
import com.shxy.xymanager_common.annotation.Log;
import com.shxy.xymanager_common.base.BaseController;
import com.shxy.xymanager_common.base.ResponseReult;
@ -244,6 +245,19 @@ public class TerminalController extends BaseController {
}
}
@ApiOperation(value = "工作状态历史", notes = "工作状态历史", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getWorkingStatusHistory")
@Log(title = "工作状态历史", type = "查询")
public ResponseReult<TerminalStatusInfoModel> getWorkingStatusHistory(TermFaultsVo vo) {
ServiceBody<TerminalStatusInfoModel> serviceBody = terminalService.getWorkingStatusHistory(vo);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
@ApiOperation(value = "装置统计", notes = "装置统计", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getTermStatistics")
@ -347,9 +361,9 @@ public class TerminalController extends BaseController {
@ApiOperation(value = "导出设备故障列表Excel", notes = "导出设备列表Excel", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getTermFaultsExcel")
@GetMapping("/getTermFaultsExcel")
@Log(title = "获取设备列表", type = "查询")
public void getTermFaultsExcel(HttpServletResponse response,@RequestBody TermFaultsVo vo) throws IOException {
public void getTermFaultsExcel(HttpServletResponse response, TermFaultsVo vo) throws IOException {
ServiceBody<TableDataInfo<TerminalFaults>> serviceBody = terminalService.getTermFaults(vo);
EasyExcelUtil.createExcel(response, "设备故障列表", serviceBody.getData().getList(), TerminalFaults.class);
}

@ -1,5 +1,6 @@
package com.shxy.xymanager_common.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import io.swagger.annotations.ApiModelProperty;
@ -10,9 +11,10 @@ import java.math.BigInteger;
import java.util.Date;
@Data
public class TerminalFaults implements Serializable {
@ExcelIgnore
@ApiModelProperty(value = "线路名称", example = "123456")
private BigInteger id;
@ExcelIgnore
@ApiModelProperty(value = "线路名称", example = "123456")
private Integer termId;
@ -28,13 +30,13 @@ public class TerminalFaults implements Serializable {
@ColumnWidth(20)
@ExcelProperty("故障编号")
@ApiModelProperty(value = "线路名称", example = "123456")
@ApiModelProperty(value = "故障编号", example = "123456")
private Integer faultCode;
@ExcelProperty("故障名称")
@ApiModelProperty(value = "线路名称", example = "123456")
@ApiModelProperty(value = "故障名称", example = "123456")
private String msg;
@ExcelIgnore
@ApiModelProperty(value = "线路名称", example = "123456")
private Date createTime;

@ -4,11 +4,13 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.shxy.xymanager_common.bean.PermissionDetail;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.TermChannelAndMapperDto;
import com.shxy.xymanager_common.entity.*;
import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.DyLineTreeListModel;
import com.shxy.xymanager_common.model.LineAndGtAndChannelListModel;
import com.shxy.xymanager_common.page.PageUtils;
import com.shxy.xymanager_common.page.TableDataInfo;
@ -16,6 +18,7 @@ import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.*;
import com.shxy.xymanager_service.service.CacheService;
import com.shxy.xymanager_service.service.LineService;
import com.shxy.xymanager_service.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -53,6 +56,12 @@ public class LineServiceImpl implements LineService {
@Autowired
private CacheService cacheService;
@Autowired
private UserService userService;
@Autowired
private View_Dy_Line_Tower_TerminalsDao view_dy_line_tower_terminalsDao;
/**
* 线
*
@ -77,11 +86,11 @@ public class LineServiceImpl implements LineService {
List<DyLevel> dyLevels = dyLevelDao.selectByExample(new DyLevelExample());
HashMap<Integer, DyLevel> map = new HashMap<>();
if (CollectionUtil.isNotEmpty(dyLevels)) {
for (DyLevel item:dyLevels) {
for (DyLevel item : dyLevels) {
map.put(item.getId(), item);
}
}
for (Lines litem:lines) {
for (Lines litem : lines) {
Integer dyLevelId = litem.getDyLevelId();
if (BeanUtil.isNotEmpty(dyLevelId)) {
DyLevel dyLevel = map.get(dyLevelId);
@ -171,6 +180,38 @@ public class LineServiceImpl implements LineService {
*/
@Override
public ServiceBody<LineAndGtAndChannelListModel> getLineAndGt(LineAndGtAndChannelVo vo) {
// PermissionDetail permissionDetail = new PermissionDetail();
// try {
// permissionDetail = userService.getPermissionList();
// } catch (Exception e) {
// Asserts.fail("权限解析错误");
// e.printStackTrace();
// }
//
// List<Integer> dypList = permissionDetail.getDypList();
// List<Integer> linepList = permissionDetail.getLinepList();
// List<Integer> towerpList = permissionDetail.getTowerpList();
// List<Integer> termpList = permissionDetail.getTermpList();
// Integer aSuper = permissionDetail.getIsSuper();
// Integer uid = permissionDetail.getUid();
//
// View_Dy_Line_Tower_TerminalsExample example = new View_Dy_Line_Tower_TerminalsExample();
// View_Dy_Line_Tower_TerminalsExample.Criteria criteria = example.createCriteria();
// if (BeanUtil.isNotEmpty(dyid) && dyid.intValue() != -1) {
// criteria.andDyIdEqualTo(dyid);
// }
// if (BeanUtil.isNotEmpty(lineid) && lineid.intValue() != -1) {
// criteria.andLineIdEqualTo(lineid);
// }
// if (BeanUtil.isNotEmpty(tower) && tower.intValue() != -1) {
// criteria.andTowerIdEqualTo(tower);
// }
//
// List<View_Dy_Line_Tower_Terminals> list = view_dy_line_tower_terminalsDao.selectByExample(example);
// if ((CollectionUtil.isNotEmpty(dypList) || CollectionUtil.isNotEmpty(linepList) || CollectionUtil.isNotEmpty(towerpList) || CollectionUtil.isNotEmpty(termpList)) || CommonStatus.EFFECTIVE.value().equals(aSuper)) {
// List<DyLevel> list = dyLevelDao.selectTreeList(CommonStatus.EFFECTIVE.value(), dypList, linepList, towerpList, termpList, aSuper);
// }
LineAndGtAndChannelListModel model = new LineAndGtAndChannelListModel();
Integer id = vo.getId();
Integer type = vo.getType();
@ -180,7 +221,15 @@ public class LineServiceImpl implements LineService {
List<LineAndGtAndChannelListModel.Bean> beans = new ArrayList<>();
//查询所有
if (type == 1) {
List<DyLevel> list = dyLevelDao.selectByExample(new DyLevelExample());
DyLevelExample example = new DyLevelExample();
// if (CommonStatus.DELETE.value().equals(aSuper)) {
// if (CollectionUtil.isNotEmpty(dypList)) {
// example.createCriteria().andIdIn(dypList);
// } else {
//
// }
// }
List<DyLevel> list = dyLevelDao.selectByExample(example);
beans = BeanUtil.copyToList(list, LineAndGtAndChannelListModel.Bean.class);
} else if (type == 2) {
if (id != null) {

@ -809,9 +809,10 @@ public class TerminalServiceImpl implements TerminalService {
DateTime starttime = vo.getStarttime();
DateTime endtime = vo.getEndtime();
TerminalFaultsExample example = new TerminalFaultsExample();
example.setOrderByClause("id desc");
TerminalFaultsExample.Criteria criteria = example.createCriteria();
criteria.andTermIdEqualTo(termid);
if (BeanUtil.isNotEmpty(pageindex) && BeanUtil.isNotEmpty(pagesize)) {
if (BeanUtil.isNotEmpty(pageindex) && BeanUtil.isNotEmpty(pagesize) && pagesize > 0) {
PageUtils.SetPage(pageindex, pagesize);
}
if (starttime != null) {
@ -822,7 +823,7 @@ public class TerminalServiceImpl implements TerminalService {
}
List<TerminalFaults> list = terminalFaultsDao.selectByExample(example);
if (CollectionUtil.isNotEmpty(list)) {
for (TerminalFaults item:list) {
for (TerminalFaults item : list) {
item.setCmdid(terminalMap.get(termid).getCmdid());
}
}
@ -830,6 +831,11 @@ public class TerminalServiceImpl implements TerminalService {
return Asserts.success(dataTable);
}
@Override
public ServiceBody<TerminalStatusInfoModel> getWorkingStatusHistory(TermFaultsVo vo) {
return null;
}
}

@ -166,4 +166,10 @@ public interface TerminalService {
*/
ServiceBody<TableDataInfo<TerminalFaults>> getTermFaults(TermFaultsVo vo);
/**
*
* @param vo
* @return
*/
ServiceBody<TerminalStatusInfoModel> getWorkingStatusHistory(TermFaultsVo vo);
}

Loading…
Cancel
Save