zhanghl
2025-05-19 8cd4e3664cc33705b9c68ac278f40e40cf258ecb
aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelinePredictionController.java
对比新文件
@@ -0,0 +1,127 @@
package com.aps.core.controller.mainPlan;
import java.util.List;
import com.aps.common.core.web.page.TableDataInfo;
import com.aps.core.domain.ApsGasPipelineMo;
import com.aps.core.domain.ApsGasPipelinePrediction;
import com.aps.core.service.IApsGasPipelinePredictionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.aps.common.log.annotation.Log;
import com.aps.common.log.enums.BusinessType;
import com.aps.common.security.annotation.RequiresPermissions;
import com.aps.common.core.web.controller.BaseController;
import com.aps.common.core.web.domain.AjaxResult;
import com.aps.common.core.utils.poi.ExcelUtil;
import org.springframework.web.multipart.MultipartFile;
/**
 * 绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁Controller
 *
 * @author ruoyi
 * @date 2025-05-19
 */
@Tag(name = "绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁", description = "绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁鎺ュ彛")
@RestController
@RequestMapping("/gasPipelinePrediction")
public class ApsGasPipelinePredictionController extends BaseController
{
    @Autowired
    private IApsGasPipelinePredictionService apsGasPipelinePredictionService;
    /**
     * 鏌ヨ绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁鍒楄〃
     */
    @Operation(summary = "鏌ヨ绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁鍒楄〃", description = "鍒嗛〉鏌ヨ")
    @RequiresPermissions("gasPipeline:prediction:list")
    @GetMapping("/list")
    public TableDataInfo list(ApsGasPipelinePrediction apsGasPipelineMo)
    {
        startPage();
        List<ApsGasPipelinePrediction> list = apsGasPipelinePredictionService.selectApsGasPipelinePredictionList(apsGasPipelineMo);
        return getDataTable(list);
    }
    @Operation(summary = "瀵煎叆鎵嬪伐姘斾綋棰勬祴鏁版嵁", description = "鎵归噺瀵煎叆")
    @Log(title = "瀵煎叆鎵嬪伐姘斾綋棰勬祴鏁版嵁", businessType = BusinessType.IMPORT)
    @RequiresPermissions("gasPipeline:mo:import")
    @PostMapping("/importData")
    public AjaxResult importData(MultipartFile file) throws Exception {
        int i = apsGasPipelinePredictionService.batchInsertApsGasPipelinePrediction(file);
        return  toAjax(i);
    }
    /**
     * 瀵煎嚭绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁鍒楄〃
     */
    @Operation(summary = "瀵煎嚭绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁鍒楄〃", description = "瀵煎嚭")
    @RequiresPermissions("gasPipeline:prediction:export")
    @Log(title = "绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ApsGasPipelinePrediction apsGasPipelinePrediction)
    {
        List<ApsGasPipelinePrediction> list = apsGasPipelinePredictionService.selectApsGasPipelinePredictionList(apsGasPipelinePrediction);
        ExcelUtil<ApsGasPipelinePrediction> util = new ExcelUtil<ApsGasPipelinePrediction>(ApsGasPipelinePrediction.class);
        util.exportExcel(response, list, "绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁鏁版嵁");
    }
    /**
     * 鑾峰彇绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁璇︾粏淇℃伅
     */
    @Operation(summary = "鑾峰彇绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁璇︾粏淇℃伅", description = "鏍规嵁id鑾峰彇")
    @RequiresPermissions("gasPipeline:prediction:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(apsGasPipelinePredictionService.selectApsGasPipelinePredictionById(id));
    }
    /**
     * 鏂板绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁
     */
    @Operation(summary = "鏂板绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁", description = "鍗曚釜鏂板")
    @RequiresPermissions("gasPipeline:prediction:add")
    @Log(title = "绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ApsGasPipelinePrediction apsGasPipelinePrediction)
    {
        return toAjax(apsGasPipelinePredictionService.insertApsGasPipelinePrediction(apsGasPipelinePrediction));
    }
    /**
     * 淇敼绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁
     */
    @Operation(summary = "淇敼绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁", description = "鍗曚釜淇敼")
    @RequiresPermissions("gasPipeline:prediction:edit")
    @Log(title = "绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ApsGasPipelinePrediction apsGasPipelinePrediction)
    {
        return toAjax(apsGasPipelinePredictionService.updateApsGasPipelinePrediction(apsGasPipelinePrediction));
    }
    /**
     * 鍒犻櫎绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁
     */
    @Operation(summary = "鍒犻櫎绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁", description = "鎵归噺鍒犻櫎")
    @RequiresPermissions("gasPipeline:prediction:remove")
    @Log(title = "绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁", businessType = BusinessType.DELETE)
   @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(apsGasPipelinePredictionService.deleteApsGasPipelinePredictionByIds(ids));
    }
}