zhanghl
2025-05-23 adfb74a1245076531a8d5d057e638bf2d0402bb2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
package com.aps.core.controller;
 
import com.aps.common.core.utils.poi.ExcelUtil;
import com.aps.common.core.web.controller.BaseController;
import com.aps.common.core.web.domain.AjaxResult;
import com.aps.common.core.web.page.TableDataInfo;
import com.aps.common.log.annotation.Log;
import com.aps.common.log.enums.BusinessType;
import com.aps.common.security.annotation.RequiresPermissions;
import com.aps.core.domain.ApsGasPipingRouteStat;
import com.aps.core.service.IApsGasPipingRouteStatService;
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.*;
 
import java.util.List;
import java.util.Map;
 
/**
 * 气体管路产能负载统计Controller
 * 
 * @author hjy
 * @date 2025-04-24
 */
 
@Tag(name = "气体管路产能负载统计", description = "气体管路产能负载统计接口")
@RestController
@RequestMapping("/apsGasPipingRouteStat")
public class ApsGasPipingRouteStatController extends BaseController
{
    @Autowired
    private IApsGasPipingRouteStatService apsGasPipingRouteStatService;
 
    /**
     * 查询气体管路产能负载统计列表
     */
    @Operation(summary = "查询气体管路产能负载统计列表", description = "分页查询")
    @RequiresPermissions("aps:apsGasPipingRouteStat:list")
    @GetMapping("/list")
    public TableDataInfo list(@RequestBody ApsGasPipingRouteStat apsGasPipingRouteStat)
    {
        startPage();
        List<ApsGasPipingRouteStat> list = apsGasPipingRouteStatService.selectApsGasPipingRouteStatList(apsGasPipingRouteStat);
        return getDataTable(list);
    }
 
    /**
     * 导出气体管路产能负载统计列表
     */
    @Operation(summary = "导出气体管路产能负载统计列表", description = "导出")
    @RequiresPermissions("aps:apsGasPipingRouteStat:export")
    @Log(title = "气体管路产能负载统计", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ApsGasPipingRouteStat apsGasPipingRouteStat)
    {
        List<ApsGasPipingRouteStat> list = apsGasPipingRouteStatService.selectApsGasPipingRouteStatList(apsGasPipingRouteStat);
        ExcelUtil<ApsGasPipingRouteStat> util = new ExcelUtil<ApsGasPipingRouteStat>(ApsGasPipingRouteStat.class);
        util.exportExcel(response, list, "气体管路产能负载统计数据");
    }
 
    /**
     * 获取气体管路产能负载统计详细信息
     */
    @Operation(summary = "获取气体管路产能负载统计详细信息", description = "根据ID查询")
    @RequiresPermissions("aps:apsGasPipingRouteStat:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(apsGasPipingRouteStatService.selectApsGasPipingRouteStatById(id));
    }
 
    /**
     * 新增气体管路产能负载统计
     */
    @Operation(summary = "新增气体管路产能负载统计", description = "新增")
    @RequiresPermissions("aps:apsGasPipingRouteStat:add")
    @Log(title = "气体管路产能负载统计", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ApsGasPipingRouteStat apsGasPipingRouteStat)
    {
        return toAjax(apsGasPipingRouteStatService.insertApsGasPipingRouteStat(apsGasPipingRouteStat));
    }
 
    /**
     * 修改气体管路产能负载统计
     */
    @Operation(summary = "修改气体管路产能负载统计", description = "修改")
    @RequiresPermissions("aps:apsGasPipingRouteStat:edit")
    @Log(title = "气体管路产能负载统计", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ApsGasPipingRouteStat apsGasPipingRouteStat)
    {
        return toAjax(apsGasPipingRouteStatService.updateApsGasPipingRouteStat(apsGasPipingRouteStat));
    }
 
    /**
     * 删除气体管路产能负载统计
     */
    @Operation(summary = "删除气体管路产能负载统计", description = "删除")
    @RequiresPermissions("aps:apsGasPipingRouteStat:remove")
    @Log(title = "气体管路产能负载统计", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(apsGasPipingRouteStatService.deleteApsGasPipingRouteStatByIds(ids));
    }
    
    /**
     * 生成气体管路产能负载统计数据
     */
    @Operation(summary = "生成气体管路产能负载统计数据", description = "根据预测数据和工单数据生成统计数据")
    @RequiresPermissions("aps:apsGasPipingRouteStat:generate")
    @Log(title = "气体管路产能负载统计", businessType = BusinessType.INSERT)
    @PostMapping("/generate")
    public AjaxResult generateGasPipingRouteStatData()
    {
        return toAjax(apsGasPipingRouteStatService.generateGasPipingRouteStatData());
    }
    
    /**
     * 聚合气体管路产能负载统计数据
     */
    @Operation(summary = "聚合气体管路产能负载统计数据", description = "聚合统计数据,支持动态选择行维度(rowGroupBy)进行聚合,如按工序名称、车间、工厂、专业等")
    @RequiresPermissions("aps:apsGasPipingRouteStat:aggregate")
    @PostMapping("/aggregate")
    public AjaxResult aggregateGasPipingRouteStat(@RequestBody Map<String, Object> params)
    {
        return success(apsGasPipingRouteStatService.aggregateGasPipingRouteStat(params));
    }
 
    @Operation(summary = "计算气体管路产能负载统计", description = "计算")
    @PostMapping("/computeCapacity")
    @RequiresPermissions("aps:apsGasPipingRouteStat:computeCapacity")
    public AjaxResult computeCapacity()
    {
        try {
            apsGasPipingRouteStatService.saveGasPipingRoutStateList();
            return AjaxResult.success();
        } catch (Exception e) {
            logger.error(e.getMessage());
           return AjaxResult.error("更新失败!");
        }
    }
 
    @Operation(summary = "获取气体管路产能负载统计", description = "计算")
    @PostMapping("/getCapacityPlanData")
   // @RequiresPermissions("aps:apsGasPipingRouteStat:getCapacityPlanData")
    public AjaxResult getCapacityPlanData(@RequestBody ApsGasPipingRouteStat apsGasPipingRouteStat)
    {
        return AjaxResult.success(apsGasPipingRouteStatService.getCapacityPlanData(apsGasPipingRouteStat));
    }
 
    @Operation(summary = "导出气体管路产能负载统计Excel表", description = "导出")
    @RequiresPermissions("aps:apsGasPipingRouteStat:exportExcel")
    @PostMapping("/exportExcel")
    public void exportExcel(ApsGasPipingRouteStat apsGasPipingRouteStat, HttpServletResponse response)
    {
        apsGasPipingRouteStatService.exportExcel(response, apsGasPipingRouteStat);
    }
 
    @PostMapping("/saveGasPipingRoutStateList")
    public void saveGasPipingRoutStateList()
    {
        apsGasPipingRouteStatService.saveGasPipingRoutStateList();
    }
 
}