package org.jeecg.modules.eam.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.vo.Result; import org.jeecg.modules.eam.dto.EamReportRepairDto; import org.jeecg.modules.eam.dto.EchartsDto; import org.jeecg.modules.eam.entity.EamEquipment; import org.jeecg.modules.eam.entity.EamFactorySecondMaintPlan; import org.jeecg.modules.eam.entity.EamThirdMaintenanceOrder; import org.jeecg.modules.eam.service.IEamEquipmentService; import org.jeecg.modules.eam.service.IEamFactorySecondMaintPlanService; import org.jeecg.modules.eam.service.IEamReportRepairService; import org.jeecg.modules.eam.service.IEamThirdMaintenanceOrderService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @author Lyh * @Description: EAM首页接口 * @date 2024/3/13 14:27 */ @Slf4j @Api(tags = "EAM首页接口") @RestController @RequestMapping("/eam/home") public class EamHomeController { @Autowired private IEamEquipmentService iEamEquipmentService; @Autowired private IEamReportRepairService iEamReportRepairService; @Autowired private IEamThirdMaintenanceOrderService iEamThirdMaintenanceOrderService; @Autowired private IEamFactorySecondMaintPlanService iEamFactorySecondMaintPlanService; /** * 设备管理首页-技术状态与设备报修故障情况 * @param * @return */ @ApiOperation(value = "设备管理首页-技术状态与设备报修故障情况", notes = "设备管理首页-技术状态与设备报修故障情况") @GetMapping(value = "/techornology") public Result techOrNology() { //技术状态 List echartsDtoList=iEamEquipmentService.echartsList(); //设备报修故障情况 List echartsDtoList1=iEamReportRepairService.reportRepairList(); Map map=new HashMap<>(); map.put("jszt",echartsDtoList); map.put("bxqk",echartsDtoList1); return Result.ok(map); } /** * 设备管理首页-三级保养 * @param * @return */ @ApiOperation(value = "设备管理首页-三级保养", notes = "设备管理首页-三级保养") @GetMapping(value = "/maintenance") public Result maintenance() { //三级保养 List echartsDtoList = iEamThirdMaintenanceOrderService.selectList(); return Result.ok(echartsDtoList); } /** * 设备管理首页-二保列表 * @param */ @ApiOperation(value = "设备管理首页-二保列表", notes = "设备管理首页-二保列表") @GetMapping(value = "/secondmaintenance") public Result secondmaintenance() { //二级保养 List echartsDtoList = iEamFactorySecondMaintPlanService.list(); return Result.ok(echartsDtoList); } /** * 设备管理首页-设备报修故障列表 * @param code * @param pageNo * @param pageSize * @return */ @ApiOperation(value = "设备管理首页-设备报修故障列表", notes = "设备管理首页-设备报修故障列表") @GetMapping(value = "/repairList") public Result repair(@RequestParam(name = "code", required = false) String code, @RequestParam(name = "pageNo", required = false, defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", required = false, defaultValue = "10") Integer pageSize) { Page page = new Page<>(pageNo, pageSize); IPage iPage = iEamReportRepairService.reportRepairList(code,page); return Result.ok(iPage); } /** * 设备管理首页-三级保养列表 * @param code * @param pageNo * @param pageSize * @return */ @ApiOperation(value = "设备管理首页-三级保养列表", notes = "设备管理首页-三级保养列表") @GetMapping(value = "/maintenanceList") public Result maintenanceList(@RequestParam(name = "code", required = false) String code, @RequestParam(name = "pageNo", required = false, defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", required = false, defaultValue = "10") Integer pageSize) { Page page = new Page<>(pageNo, pageSize); IPage iPage = iEamThirdMaintenanceOrderService.maintenanceList(code, page); return Result.ok(iPage); } }