zhanghl
2025-05-23 6da289fff756eaecc600422d77c4afff1ddebab0
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
package com.aps.core.controller.mainPlan;
 
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.common.security.utils.SecurityUtils;
import com.aps.core.domain.mainPlan.ApsWeldSeamStatisticsV2;
import com.aps.core.service.mainPlan.IApsWeldSeamStatisticsV2Service;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.io.IOException;
import java.util.List;
 
/**
 * 焊缝统计v2Controller
 *
 * @author wwj
 * @date 2025-04-09
 */
@RestController
@RequestMapping("/weldSeamStatisticsV2")
public class ApsWeldSeamStatisticsV2Controller extends BaseController {
 
    @Autowired
    private IApsWeldSeamStatisticsV2Service apsWeldSeamStatisticsV2Service;
 
    /**
     * 查询焊缝统计表V2列表
     */
    @RequiresPermissions("weldSeamStatistics:weldSeamStatisticsV2:list")
    @GetMapping("/list")
    public TableDataInfo list(ApsWeldSeamStatisticsV2 apsWeldSeamStatisticsV2)
    {
        // 不需要分页
        // startPage(); 
        List<ApsWeldSeamStatisticsV2> list = apsWeldSeamStatisticsV2Service.selectApsWeldSeamStatisticsV2List(apsWeldSeamStatisticsV2);
        return getDataTable(list);
    }
 
    /**
     * 导出焊缝统计表V2列表
     */
    @RequiresPermissions("weldSeamStatistics:weldSeamStatisticsV2:export")
    @Log(title = "焊缝统计表V2", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ApsWeldSeamStatisticsV2 apsWeldSeamStatisticsV2) throws IOException {
        apsWeldSeamStatisticsV2Service.exportWeldSeamStatistics(response);
    }
 
    /**
     * 修改焊缝统计表V2
     */
    @RequiresPermissions("weldSeamStatistics:weldSeamStatisticsV2:edit")
    @Log(title = "焊缝统计表V2", businessType = BusinessType.UPDATE)
    @PostMapping("/update")
    public AjaxResult edit(@RequestBody ApsWeldSeamStatisticsV2 apsWeldSeamStatisticsV2)
    {
        ApsWeldSeamStatisticsV2 updatedRecord = apsWeldSeamStatisticsV2Service.updateApsWeldSeamStatisticsV2(apsWeldSeamStatisticsV2);
        return AjaxResult.success("修改成功", updatedRecord);
    }
 
    /**
     * 刷新焊缝统计表V2数据
     */
    @RequiresPermissions("weldSeamStatistics:weldSeamStatisticsV2:refresh")
    @Log(title = "焊缝统计表V2", businessType = BusinessType.OTHER)
    @PostMapping("/refresh")
    public AjaxResult refreshStatistics() {
        String username = SecurityUtils.getUsername();
        int count = apsWeldSeamStatisticsV2Service.refreshWeldSeamStatistics(username);
        return success("刷新焊缝统计表成功,共更新 " + count + " 条记录");
    }
}