wangfei
2024-08-23 051613aa73be3e75af5a6dfdb86a722bcb5af094
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
package com.mes.temperingglass.controller;
import com.mes.damage.entity.Damage;
import com.mes.damage.service.DamageService;
import com.mes.temperingglass.service.TemperingGlassInfoService;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.utils.Result;
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
 */
@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("查询进炉中的钢化等片中的版图信息,状态全为1的为已到。")
//    @GetMapping("/selectIntoGlass") // 查询进炉中的钢化等片中的版图信息,状态全为1的为已到。
//    public Result <List<TemperingGlassInfo>> selectIntoGlass() {
//        List<TemperingGlassInfo> glass = temperingAgoService.selectIntoGlass();
//        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) {
        damageService.insertDamage(damage);
        TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo();
        temperingGlassInfo.setState(damage.getStatus());
        temperingGlassInfo.setGlassId(damage.getGlassId());
        int result=temperingGlassInfoService.updateTemperingState(temperingGlassInfo);
        return Result.build(200, "破损成功", result);
    }
 
 
}