huang
2024-11-22 84ae3182fab351c4a8ee4da94371e0e83c9a59e3
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
package com.example.erp.controller.pp;
 
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.entity.pp.OptimizeProjectMange;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.pp.GlassOptimizeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.sql.Date;
 
@RestController
@Api(value="优化管理controller",tags={"优化管理操作接口"})
@RequestMapping("/glassOptimize")
public class GlassOptimizeController {
    @Autowired
    GlassOptimizeService glassOptimizeService;
 
    //工程查询流程卡
    @ApiOperation("创建工程查询流程卡接口")
    @PostMapping  ("/getFlowCardList/{optionVal}/{radio}")
    public Result getFlowCardList(
            @PathVariable String optionVal,
            @PathVariable Integer radio){
        return Result.seccess(glassOptimizeService.getFlowCardList(optionVal,radio));
    }
 
    //工程管理查询
    @ApiOperation("工程管理查询接口")
    @PostMapping("/optimizeProjectMange/{startSelectTime}/{endSelectTime}")
    public Result optimizeProjectMange(
            @PathVariable Date startSelectTime,
            @PathVariable Date endSelectTime,
            @RequestBody OptimizeProjectMange optimizeProjectMange) {
        return Result.seccess(glassOptimizeService.OptimizeProjectMange(startSelectTime,endSelectTime,optimizeProjectMange));
    }
 
    //修改工程状态
    @ApiOperation("修改工程状态接口")
    @PostMapping("/updateProjectState/{projectNumber}/{state}")
    public Result updateProjectState(
            @PathVariable String projectNumber,
            @PathVariable Integer state
    ) {
        if (glassOptimizeService.updateProjectState(projectNumber, state)) {
            return Result.seccess();
        } else {
            throw new ServiceException(Constants.Code_500, "修改失败");
 
        }
    }
 
}