| | |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | * @date : 2025/7/29 13:19 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "设备能耗") |
| | | @Tag(name = "设备能耗") |
| | | @RequestMapping("/equipmentEnergyConsumption") |
| | | @AllArgsConstructor |
| | | public class EquipmentEnergyConsumptionController extends BaseController { |
| | | |
| | | |
| | | @Autowired |
| | | private EquipmentEnergyConsumptionService equipmentEnergyConsumptionService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("设备能耗-分页查询") |
| | | @Operation(summary = "设备能耗-分页查询") |
| | | @Log(title = "设备能耗-分页查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, EquipmentEnergyConsumption equipmentEnergyConsumption) { |
| | | IPage<EquipmentEnergyConsumption> listPage = equipmentEnergyConsumptionService.listPage(page, equipmentEnergyConsumption); |
| | |
| | | } |
| | | |
| | | @GetMapping("/deviceList") |
| | | @ApiOperation("设备台账-查询") |
| | | @Operation(summary = "设备台账-查询") |
| | | @Log(title = "设备台账-查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult deviceList(DeviceLedger deviceLedger) { |
| | | List<DeviceLedger> listPage = equipmentEnergyConsumptionService.deviceList(deviceLedger); |
| | |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("设备能耗-新增") |
| | | @Operation(summary = "设备能耗-新增") |
| | | @Log(title = "设备能耗-新增", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody EquipmentEnergyConsumption equipmentEnergyConsumption) { |
| | | boolean save = equipmentEnergyConsumptionService.save(equipmentEnergyConsumption); |
| | |
| | | } |
| | | |
| | | @PostMapping("/addBatch") |
| | | @ApiOperation("设备能耗-批量新增") |
| | | @Operation(summary = "设备能耗-批量新增") |
| | | @Log(title = "设备能耗-批量新增", businessType = BusinessType.INSERT) |
| | | public AjaxResult addBatch(@RequestBody List<EquipmentEnergyConsumption> list) { |
| | | boolean save = equipmentEnergyConsumptionService.saveBatch(list); |
| | |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("设备能耗-修改") |
| | | @Operation(summary = "设备能耗-修改") |
| | | @Log(title = "设备能耗-修改", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody EquipmentEnergyConsumption equipmentEnergyConsumption) { |
| | | boolean update = equipmentEnergyConsumptionService.updateById(equipmentEnergyConsumption); |
| | |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("设备能耗-删除") |
| | | @Operation(summary = "设备能耗-删除") |
| | | @Log(title = "设备能耗-删除", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请选择至少一条数据"); |
| | |
| | | */ |
| | | @Log(title = "导入设备能耗", businessType = BusinessType.IMPORT) |
| | | @PostMapping("/importData") |
| | | @ApiOperation("导入设备能耗") |
| | | @Operation(summary = "导入设备能耗") |
| | | public AjaxResult importData(MultipartFile file) throws Exception { |
| | | return equipmentEnergyConsumptionService.importData(file); |
| | | } |
| | |
| | | */ |
| | | @Log(title = "导出设备能耗", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @ApiOperation("导出设备能耗") |
| | | @Operation(summary = "导出设备能耗") |
| | | public void export(HttpServletResponse response) { |
| | | Page page = new Page<>(-1,-1); |
| | | EquipmentEnergyConsumption equipmentEnergyConsumption = new EquipmentEnergyConsumption(); |
| | |
| | | } |
| | | |
| | | @GetMapping("/listPageByTrend") |
| | | @ApiOperation("设备能耗-能源趋势-分页查询") |
| | | @Operation(summary = "设备能耗-能源趋势-分页查询") |
| | | @Log(title = "设备能耗-能源趋势-分页查询", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageByTrend(Page page, EquipmentEnergyConsumption equipmentEnergyConsumption) { |
| | | IPage<EquipmentEnergyConsumption> listPage = equipmentEnergyConsumptionService.listPageByTrend(page, equipmentEnergyConsumption); |
| | |
| | | */ |
| | | @Log(title = "导出能源趋势", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportTwo") |
| | | @ApiOperation("导出能源趋势") |
| | | @Operation(summary = "导出能源趋势") |
| | | public void exportTwo(HttpServletResponse response) { |
| | | Page page = new Page<>(-1,-1); |
| | | EquipmentEnergyConsumption equipmentEnergyConsumption = new EquipmentEnergyConsumption(); |