| | |
| | | package com.mes.temperingglass.controller; |
| | | import com.mes.temperingglass.service.TemperingAgoService; |
| | | 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.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; |
| | | |
| | |
| | | public class TemperingGlassInfoController { |
| | | |
| | | @Autowired |
| | | private TemperingAgoService 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("//钢化后显示出炉的版图信息。") |
| | | @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 <Integer> updateTemperingState(@RequestBody Damage damage) { |
| | | damageService.insertDamage(damage); |
| | | TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); |
| | | if(damage.getStatus()==2){ |
| | | temperingGlassInfo.setState(5); |
| | | |
| | | } |
| | | temperingGlassInfo.setGlassId(damage.getGlassId()); |
| | | int result=temperingGlassInfoService.updateTemperingState(temperingGlassInfo); |
| | | return Result.build(200, "破损成功", result); |
| | | } |
| | | |
| | | |
| | | } |