| | |
| | | import com.ycl.platform.mapper.DynamicColumnMapper; |
| | | import com.ycl.platform.mapper.TMonitorMapper; |
| | | import com.ycl.platform.mapper.WorkOrderMapper; |
| | | import com.ycl.platform.mapper.YwPointMapper; |
| | | import com.ycl.platform.service.ITMonitorService; |
| | | import com.ycl.system.Result; |
| | | import com.ycl.system.entity.SysDictData; |
| | |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import pojo.ExcelExp; |
| | | import utils.poi.ExcelUtilManySheet; |
| | |
| | | public class TMonitorServiceImpl extends ServiceImpl<TMonitorMapper, TMonitor> implements ITMonitorService { |
| | | @Autowired |
| | | private TMonitorMapper tMonitorMapper; |
| | | @Autowired |
| | | private YwPointMapper pointMapper; |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | @Autowired |
| | |
| | | */ |
| | | @Override |
| | | public Map<String, Object> home(HomeQuery monitorQuery) { |
| | | |
| | | System.out.println(monitorQuery + "~~~~~~~~~~~~~打印"); |
| | | Map<String, Object> dataMap = new HashMap<>(); |
| | | Map<String, Object> monthMap1 = new HashMap<>(); |
| | | Map<String, Object> monthMap2 = new HashMap<>(); |
| | | List<Map<String, Object>> home = baseMapper.home(monitorQuery); |
| | | if (ObjectUtils.isNotEmpty(home)) { |
| | | //拿到数据库 循环查询 |
| | | System.out.println(home + "~~~~~~~~~~~~~打印"); |
| | | for (Map<String, Object> map : home) { |
| | | //得到map的 months键的值 num1键的值 组装为新对象 |
| | | monthMap1.put(map.get("months").toString(), map.get("num1")); |
| | | //得到map的 months键的值 num2键的值 组装为新对象 |
| | | monthMap2.put(map.get("months").toString(), map.get("num2")); |
| | | } |
| | | //home 的下标0的 map的 name键的值 |
| | | dataMap.put("name", home.get(0).get("name")); |
| | | dataMap.put("state", monthMap1); |
| | | dataMap.put("state2", monthMap2); |
| | |
| | | )) |
| | | .append("loseCount", new Document("$sum", |
| | | new Document("$cond", Arrays.asList( |
| | | new Document("$eq", Arrays.asList("$recordStatus", -1)), |
| | | new Document("$in", Arrays.asList("$recordStatus", Arrays.asList(-1, 0))), |
| | | 1, |
| | | 0 |
| | | )) |
| | |
| | | util.exportExcel(response, monitors, sheetName); |
| | | } |
| | | |
| | | /** |
| | | * 清理一机一档 |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result clearMonitor() { |
| | | tMonitorMapper.clearMonitor(); |
| | | pointMapper.clearMonitor(); |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public Result assetManagementCount(DataCenterQuery query) { |
| | | Map<String, String> map =tMonitorMapper.assetManagementCount(); |
| | | return Result.ok().data(map); |
| | | } |
| | | |
| | | |
| | | //首页车辆报表 |
| | | @Override |