| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private final WorkOrderYwConditionRecordMapper workOrderYwConditionRecordMapper; |
| | | private final NotifyService notifyService; |
| | | private final WorkOrderDistributeRecordMapper workOrderDistributeRecordMapper; |
| | | private final TMonitorMapper monitorMapper; |
| | | private final WorkOrderErrorTypeMapper workOrderErrorTypeMapper; |
| | | private final SysConfigMapper configMapper; |
| | | private final ServerConfig serverConfig; |
| | | private final ReportMapper reportMapper; |
| | |
| | | Date now = new Date(); |
| | | entity.setCreateTime(now); |
| | | entity.setUpdateTime(now); |
| | | entity.setErrorType(form.getErrorType().stream().map(ErrorTypeEnum::getValue).collect(Collectors.joining(","))); |
| | | List<WorkOrderErrorType> workOrderErrorTypes = form.getErrorType().stream().map(errorType -> new WorkOrderErrorType(entity.getWorkOrderNo(), errorType.getValue())).toList(); |
| | | workOrderErrorTypeMapper.insertWorkOrderErrorTypeList(workOrderErrorTypes); |
| | | if(baseMapper.insert(entity) > 0) { |
| | | return Result.ok("添加成功"); |
| | | } |
| | |
| | | */ |
| | | public synchronized Boolean getDistributeLock() { |
| | | if (Objects.isNull(redisCache.getCacheObject(DISTRIBUTE_LOCK_KEY))) { |
| | | redisCache.setCacheObject(DISTRIBUTE_LOCK_KEY, "1"); |
| | | redisCache.setCacheObject(DISTRIBUTE_LOCK_KEY, "1", 30, TimeUnit.SECONDS); |
| | | return true; |
| | | } else { |
| | | return false; |