| | |
| | | package com.mes.temperingglass.controller; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.entity.LoadGlassInfo; |
| | | import com.mes.temperingglass.eneity.request.DamageRequest; |
| | | 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.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | /** |
| | | * @author SNG-010 |
| | | */ |
| | | @Api(tags = "钢化显示") |
| | | @RestController |
| | | @RequestMapping("/temperingGlassInfo") |
| | | @Slf4j |
| | |
| | | public class TemperingGlassInfoController { |
| | | |
| | | @Autowired |
| | | private TemperingGlassInfoService temperingAgoService; |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | @Autowired |
| | | private DamageService damageService; |
| | | |
| | | |
| | | @ApiOperation("查询钢化等片中的版图信息,状态为1的为已到,状态为0的为等待中") |
| | | @GetMapping("/selectWaitingGlass") // 查询钢化等片中的版图信息,状态为1的为已到,状态为0的为等待中 |
| | | public Result <List<TemperingGlassInfo>> selectWaitingGlass() { |
| | | List<TemperingGlassInfo> glass = temperingAgoService.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 = temperingAgoService.selectOutGlass(); |
| | | List<TemperingGlassInfo> glass = temperingGlassInfoService.selectOutGlass(); |
| | | log.info("钢化出炉后的玻璃信息{}",glass); |
| | | return Result.build(200, "", glass); |
| | | } |
| | | |
| | | @ApiOperation("//钢化破损拿走放回") |
| | | @PostMapping("/updateTemperingState") //钢化后显示出炉的版图信息 |
| | | public Result<List<LoadGlassInfo>> updateTemperingState(@RequestBody DamageRequest damage) { |
| | | TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); |
| | | temperingGlassInfo.setState(damage.getState()); |
| | | temperingGlassInfo.setGlassId(damage.getGlassId()); |
| | | int result=temperingGlassInfoService.updateTemperingState(temperingGlassInfo); |
| | | if (damage.getState() > 5) { |
| | | damageService.autoSubmitReport(damage.getGlassId(), damage.getLine() |
| | | , damage.getWorkingProcedure(), "钢化炉", damage.getState()); |
| | | } |
| | | GlassInfo glassInfo = new GlassInfo(); |
| | | glassInfo.setEngineerId(damage.getEngineerId()); |
| | | glassInfo.setTemperingLayoutId(damage.getTemperingLayoutId()); |
| | | List<LoadGlassInfo> glass = temperingGlassInfoService.selectTemperingGlass(glassInfo); |
| | | return Result.build(200, "破损成功", glass); |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | | |
| | | } |