| | |
| | | import com.ycl.platform.service.UYErrorTypeCheckService; |
| | | import com.ycl.platform.service.WorkOrderService; |
| | | import com.ycl.utils.uuid.IdUtils; |
| | | import constant.ApiConstants; |
| | | import enumeration.ErrorType; |
| | | import enumeration.general.WorkOrderStatusEnum; |
| | | import lombok.Data; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | public void osdCheck(List<PyOsdResult> dataList) { |
| | | public void osdCheck(List<OsdCheckResult> dataList) { |
| | | Date now = new Date(); |
| | | List<WorkOrder> workOrderList = dataList.stream().map(item -> { |
| | | WorkOrder workOrder = new WorkOrder(); |
| | | // osd时间 |
| | | if (!item.getCheckTime().equals(item.getSetTime())) { |
| | | if (!ApiConstants.OSD_Correct.equals(item.getOsdTimeCorrect())) { |
| | | this.genWorkOrder(workOrder, ErrorType.CLOCK_SKEW, item.getDeviceNo()); |
| | | } |
| | | // osd信息 |
| | | if (!"设置正确".equals(item.getOsd1Province()) |
| | | || (!"设置正确".equals(item.getOsd1City())) |
| | | || (!"设置正确".equals(item.getOsd1Part())) |
| | | || (!"设置正确".equals(item.getOsd1TimeFormat())) |
| | | || (!"设置正确".equals(item.getOsd1OSD())) |
| | | if (!ApiConstants.OSD_Correct.equals(item.getOsdProvinceCorrect()) |
| | | || (!ApiConstants.OSD_Correct.equals(item.getOsdCityCorrect())) |
| | | || (!ApiConstants.OSD_Correct.equals(item.getOsdPartCorrect())) |
| | | || (!ApiConstants.OSD_Correct.equals(item.getOsdNameCorrect())) |
| | | ) { |
| | | this.genWorkOrder(workOrder, ErrorType.OSD_ERROR, item.getDeviceNo()); |
| | | } |
| | |
| | | * @param serialNumber 国标码 |
| | | */ |
| | | private void genWorkOrder(WorkOrder workOrder, ErrorType errorType, String serialNumber) { |
| | | if (! StringUtils.hasText(workOrder.getWorkOrderNo())) { |
| | | workOrder.setWorkOrderNo(IdUtils.randomNO()); |
| | | } |
| | | if (CollectionUtils.isEmpty(workOrder.getErrorTypeList())) { |
| | | workOrder.setErrorTypeList(new ArrayList<>()); |
| | | workOrder.getErrorTypeList().add(errorType.getValue()); |