wangfei
2025-02-27 9212801fbac08dd12b8205c217bdeb925529ab7c
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
package com.mes.temperingglass.controller;
 
import com.mes.damage.entity.Damage;
import com.mes.damage.service.DamageService;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.entity.LoadGlassInfo;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.temperingglass.service.TemperingGlassInfoService;
import com.mes.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
 
/**
 * @author SNG-010
 */
@Api(tags = "钢化显示")
@RestController
@RequestMapping("/temperingGlassInfo")
@Slf4j
// TidyUpGlassModule 钢化模块
public class TemperingGlassInfoController {
 
    @Autowired
    private TemperingGlassInfoService temperingGlassInfoService;
    @Autowired
    private DamageService damageService;
 
 
    @ApiOperation("查询钢化等片中的版图信息,状态为1的为已到,状态为0的为等待中")
    @GetMapping("/selectWaitingGlass") // 查询钢化等片中的版图信息,状态为1的为已到,状态为0的为等待中
    public Result <List<TemperingGlassInfo>> selectWaitingGlass() {
        List<TemperingGlassInfo> glass = temperingGlassInfoService.selectWaitingGlass();
        log.info("等待中的玻璃信息{}",glass);
        return Result.build(200, "", glass);
    }
 
    @ApiOperation("//钢化后显示出炉的版图信息。")
    @GetMapping("/selectOutGlass") //钢化后显示出炉的版图信息
    public Result <List<TemperingGlassInfo>> selectOutGlass() {
        List<TemperingGlassInfo> glass = temperingGlassInfoService.selectOutGlass();
        log.info("钢化出炉后的玻璃信息{}",glass);
        return Result.build(200, "", glass);
    }
 
    @ApiOperation("//钢化破损拿走放回")
    @PostMapping("/updateTemperingState") //钢化后显示出炉的版图信息
    public Result <Integer> updateTemperingState(@RequestBody  Damage damage) {
        TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo();
        temperingGlassInfo.setState(damage.getStatus());
        temperingGlassInfo.setGlassId(damage.getGlassId());
        int result=temperingGlassInfoService.updateTemperingState(temperingGlassInfo);
        if (damage.getStatus() > 5) {
            damageService.autoSubmitReport(damage.getGlassId(), damage.getLine()
                    , damage.getWorkingProcedure(), "钢化炉", damage.getStatus());
        }
        return Result.build(200, "破损成功", result);
    }
 
    @ApiOperation("//查询当前工程号所有的炉号")
    @PostMapping("/selectTempering") //查询当前工程号所有的炉号
    public Result<GlassInfo> selectTempering(@RequestBody GlassInfo glassInfo) {
        GlassInfo glass = temperingGlassInfoService.selectTempering(glassInfo);
        return Result.build(200, "查询成功", glass);
    }
 
    @ApiOperation("//查询当前工程号的钢化版图")
    @PostMapping("/selectTemperingGlass") //查询当前工程号所有的炉号
    public Result<List<LoadGlassInfo>> selectTemperingGlass(@RequestBody GlassInfo glassInfo) {
        List<LoadGlassInfo> glass = temperingGlassInfoService.selectTemperingGlass(glassInfo);
        return Result.build(200, "查询成功", glass);
    }
 
 
}