| | |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.entity.DamagePrint; |
| | | import com.mes.damage.entity.dto.DamageDTO; |
| | | import com.mes.damage.entity.request.DamageRequest; |
| | | import com.mes.damage.entity.vo.FlowCardDamageVO; |
| | | import com.mes.damage.entity.vo.GlassDamageVO; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.opctask.entity.LoadGlassDeviceTaskHistory; |
| | | 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.*; |
| | | |
| | |
| | | @RestController |
| | | @RequestMapping("/damage") |
| | | @ResponseBody |
| | | @Slf4j |
| | | public class DamageController { |
| | | |
| | | @Autowired(required = true) |
| | |
| | | return Result.build(200, "查询成功", ""); |
| | | } |
| | | |
| | | @ApiOperation("自动报工测试") |
| | | @PostMapping("/submitReport") |
| | | public Result submitReport() { |
| | | // for (int i = 0; i < 50; i++) { |
| | | Damage damage = new Damage(); |
| | | damage.setProcessId("NG25110702A004"); |
| | | damage.setWorkingProcedure("磨边"); |
| | | damage.setOrderNumber(2); |
| | | damage.setTechnologyNumber(2); |
| | | damageService.submitReport(damage); |
| | | // log.info("当前循环次数{}", i); |
| | | // try { |
| | | // // 方式1:使用Thread.sleep(推荐,直观) |
| | | // Thread.sleep(5000); // 10000毫秒 = 10秒 |
| | | // // 方式2:使用TimeUnit(语义更清晰,可选) |
| | | // // TimeUnit.SECONDS.sleep(10); |
| | | // } catch (InterruptedException e) { |
| | | // // 捕获中断异常,恢复线程中断状态(避免后续逻辑异常) |
| | | // Thread.currentThread().interrupt(); |
| | | // // 日志记录中断信息 |
| | | // // 可选:中断后是否退出循环(根据业务需求调整) |
| | | // // break; // 中断则退出循环 |
| | | // // continue; // 中断则跳过当前等待,继续下一次循环 |
| | | // } |
| | | // } |
| | | return Result.build(200, "查询成功", ""); |
| | | } |
| | | |
| | | @ApiOperation("玻璃进度查询") |
| | | @PostMapping("/queryProgress") |
| | | public Result<List<GlassDamageVO>> queryProgress(@RequestBody DamageRequest damageRequest) { |
| | | return Result.build(200, "查询成功", damageService.queryProgress(damageRequest)); |
| | | } |
| | | |
| | | @ApiOperation("流程卡进度查询") |
| | | @PostMapping("/queryFlowCardIdProgress") |
| | | public Result<List<FlowCardDamageVO>> queryFlowCardIdProgress(@RequestBody DamageRequest damageRequest) { |
| | | return Result.build(200, "查询成功", damageService.queryFlowCardIdProgress(damageRequest)); |
| | | } |
| | | } |
| | | |