| | |
| | | package com.mes.device.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.mes.device.entity.EngineeringSequence; |
| | | import com.mes.device.entity.GlassInfo; |
| | | import com.mes.device.service.EngineeringSequenceService; |
| | |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.client.ResourceAccessException; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.*; |
| | |
| | | |
| | | // 7. 返回MES的响应 |
| | | return ResponseEntity.status(mesResp.getStatusCode()).body(mesBody); |
| | | } catch (org.springframework.web.client.ResourceAccessException e) { |
| | | } catch (ResourceAccessException e) { |
| | | // 连接超时或无法连接 |
| | | log.error("转发 MES 导入接口失败(连接问题) url={}, error={}", glassInfoService.getMesEngineeringImportUrl(), e.getMessage(), e); |
| | | errorResponse.put("code", 500); |
| | |
| | | |
| | | // 2. 删除engineering_sequence表中的工程号记录(逻辑删除) |
| | | EngineeringSequence sequence = engineeringSequenceService.getOne( |
| | | new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<EngineeringSequence>() |
| | | new LambdaQueryWrapper<EngineeringSequence>() |
| | | .eq(EngineeringSequence::getEngineeringId, engineeringId) |
| | | .eq(EngineeringSequence::getIsDeleted, 0) // 只查询未删除的记录 |
| | | .last("LIMIT 1") |