| | |
| | | import com.ruoyi.requier.mapper.DeviceMapper; |
| | | import com.ruoyi.requier.pojo.*; |
| | | import com.ruoyi.requier.service.DeviceFaultService; |
| | | import com.ruoyi.system.mapper.SysDictDataMapper; |
| | | import com.ruoyi.system.mapper.SysDictTypeMapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private QrShowServiceImpl qrShowService; |
| | | |
| | | @Resource |
| | | private SysDictDataMapper sysDictDataMapper; |
| | | |
| | | @Autowired |
| | | private DeviceMaintenanceMapper deviceMaintenanceMapper; |
| | |
| | | .eq(DeviceFaultOne::getDeviceId, device.getId()) |
| | | .orderByDesc(DeviceFaultOne::getId))).orElse(new ArrayList<>()); |
| | | //查询设备状态字典 |
| | | List<SysDictData> sysDictDataList = DictUtils.getDictCache("设备状态"); |
| | | List<SysDictData> sysDictDataList = sysDictDataMapper.selectDictDataByType("device_status"); |
| | | // List<SysDictData> sysDictDataList = DictUtils.getDictCache("设备状态"); |
| | | SysDictData findEnum = sysDictDataList.stream().filter(e-> Integer.parseInt(e.getDictValue()) ==device.getDeviceStatus()).findFirst().orElse(new SysDictData()); |
| | | map.put("progress",qrShowService.calcDeviceNextCheckRatio(calibrate.getCalibrationDate(),calibrate.getNextCalibrationDate()));//距离下次校准日期的天数百分比 |
| | | map.put("deviceName",device.getDeviceName());//设备名称 |
| | |
| | | } |
| | | return map; |
| | | } |
| | | } |
| | | } |