wu
2024-10-09 25ada1bd189cc1e6eb12756cf0e967a9cf1c319f
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
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("//钢化后显示出炉的版图信息。")
    @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) {
//            damage.setType(damage.getStatus());
//            damage.setStatus(1);
//            damageService.insertDamage(damage);
//        }
        return Result.build(200, "破损成功", result);
    }
 
 
}