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 > selectWaitingGlass() { List glass = temperingGlassInfoService.selectWaitingGlass(); log.info("等待中的玻璃信息{}",glass); return Result.build(200, "", glass); } @ApiOperation("//钢化后显示出炉的版图信息。") @GetMapping("/selectOutGlass") //钢化后显示出炉的版图信息 public Result > selectOutGlass() { List glass = temperingGlassInfoService.selectOutGlass(); log.info("钢化出炉后的玻璃信息{}",glass); return Result.build(200, "", glass); } @ApiOperation("//钢化破损拿走放回") @PostMapping("/updateTemperingState") //钢化后显示出炉的版图信息 public Result 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); } }