server/system_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -157,6 +157,7 @@ public static final String OVER_NOTICE_WX = "OVER_NOTICE_WX"; public static final String PRESSURE_LEVEL_UNIT = "PRESSURE_LEVEL_UNIT"; public static final String LIQUID_LEVEL_UNIT ="LIQUID_LEVEL_UNIT" ; public static final String OUT_HY_LOT_TOTAL ="OUT_HY_LOT_TOTAL" ; public static boolean DEALING_HK_SYNCPRIVILEGE= false; public static boolean DEALING_HK_SYNCDEVICE = false; server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
@@ -1733,11 +1733,22 @@ } public static Date getFirstThisYearDate() { try { return sdfShort.parse( getNowShortDate().substring(0, 4) + "0101"); return sdfLong.parse( getNowShortDate().substring(0, 4) + "-01-01"); } catch (Exception e) { return null; } } public static Date getFirstThisMonthDate() { try { return sdfLong.parse( getNowFormateDate().substring(0, 7) + "-01"); } catch (Exception e) { return null; } } public static String getFirstDayCurrentMonth() { try { return getDateLong(new Date()).substring(0, 7) + "-01"; @@ -2931,8 +2942,9 @@ // Date date1 = getISO8601DateByStr("2024-06-14T08:46:36.014+08:00"); // System.out.println(DateUtil.afterMinutesDate(-5)); System.out.println(DateUtil.getFirstThisMonthDate()); System.out.println(getPlusTime2(DateUtil.addMonthToDate(new Date(),-1))); // System.out.println(getPlusTime2(DateUtil.addMonthToDate(new Date(),-1))); // System.out.println(DateUtil.getBeforMonthStr(new Date(),12)); // List<Date> list =getThisMonthDateList(); server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/FightingAdminController.java
@@ -2,6 +2,8 @@ import com.doumee.api.BaseController; import com.doumee.config.annotation.LoginNoRequired; import com.doumee.dao.admin.response.PCWorkPlatformDataVO; import com.doumee.service.business.VisitsService; import com.doumee.service.business.third.model.ApiResponse; import com.doumee.core.utils.Constants; import com.doumee.dao.web.response.platformReport.*; @@ -30,6 +32,9 @@ @Autowired private BoardService boardService; @Autowired private VisitsService visitsService; @LoginNoRequired @ApiOperation("中心数据") @GetMapping("/centerData") @@ -39,11 +44,16 @@ } /** * * @param type 0/null = 当天;1=当月;2=当年 * @return */ @LoginNoRequired @ApiOperation("报警信息") @GetMapping("/alarmData") public ApiResponse<AlarmDataVO> alarmDataSumByCate() { AlarmDataVO alarmDataVO = boardService.alarmDataSumByCate(); public ApiResponse<AlarmDataVO> alarmDataSumByCate(Integer type) { AlarmDataVO alarmDataVO = boardService.alarmDataSumByCate(type); return ApiResponse.success(alarmDataVO); } @LoginNoRequired @@ -88,6 +98,13 @@ return ApiResponse.success(list); } @LoginNoRequired @ApiOperation("实时在场人员分布") @GetMapping("/inParkUser") public ApiResponse<PCWorkPlatformDataVO> inParkUser() { PCWorkPlatformDataVO pcWorkPlatformDataVO = visitsService.getPcWorkPlatformData(Constants.ONE,null); return ApiResponse.success(pcWorkPlatformDataVO); } } server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/SecurityBoardVO.java
@@ -5,6 +5,7 @@ import java.math.BigDecimal; import java.util.List; import java.util.Map; /** * 安防管控大屏 @@ -21,9 +22,18 @@ @ApiModelProperty(value = "剩余车位数量") private int freeParkingLot; @ApiModelProperty(value = "车位使用率") private BigDecimal parkingUseRate; @ApiModelProperty(value = "外协货运车位总数") private int outHyLotTotal; @ApiModelProperty(value = "在园车辆信息列表") private List<Map<String,Object>> inParkCarList; @ApiModelProperty(value = "员工车辆") private int internalCarTotal; server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/HiddenDangerServiceImpl.java
@@ -870,7 +870,6 @@ hiddenDangerDataVO.setCateList(cateGeneralDataList); } //全部隐患区域部门数据 List<HiddenDangerCompanyVO> hiddenDangerCompanyVOList = hiddenDangerAllList.stream(). filter(i->DateUtil.formatDate(i.getCreateDate(),"yyyy-MM").equals(nowDate.substring(0,7))) .map(i->new HiddenDangerCompanyVO(i.getAreaName(),i.getAreaCompanyId())).collect(Collectors.toList()); @@ -889,7 +888,8 @@ if(optionalCompany.isPresent()){ GeneralDataVO generalDataVO = new GeneralDataVO(); Company company = optionalCompany.get(); Integer total = hiddenDangerAllList.stream().filter(i->DateUtil.formatDate(i.getCreateDate(),"yyyy-MM").equals(nowDate.substring(0,7))&&Constants.equalsInteger(i.getAreaCompanyId(),company.getId())).collect(Collectors.toList()).size(); Integer total = hiddenDangerAllList.stream().filter(i->DateUtil.formatDate(i.getCreateDate(),"yyyy-MM"). equals(nowDate.substring(0,7))&&Constants.equalsInteger(i.getAreaCompanyId(),company.getId())).collect(Collectors.toList()).size(); generalDataVO.setName(company.getName()); generalDataVO.setTotal(total); generalDataVO.setCategoryName(hiddenDangerCompanyVO.getCategoryName()); @@ -898,18 +898,43 @@ } hiddenDangerDataVO.setDepartmentList(companyGeneralDataList); } if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(hiddenDangerDataVO.getDepartmentList())){ List<GeneralDataVO> topList = hiddenDangerDataVO.getDepartmentList(); Collections.sort(topList, new Comparator<GeneralDataVO>() { @Override public int compare(GeneralDataVO o1, GeneralDataVO o2) { // 返回值为int类型,大于0表示正序,小于0表示逆序 return o2.getTotal() - o1.getTotal(); // if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(hiddenDangerDataVO.getDepartmentList())){ // List<GeneralDataVO> topList = hiddenDangerDataVO.getDepartmentList(); // Collections.sort(topList, new Comparator<GeneralDataVO>() { // @Override // public int compare(GeneralDataVO o1, GeneralDataVO o2) { // // 返回值为int类型,大于0表示正序,小于0表示逆序 // return o2.getTotal() - o1.getTotal(); // } // }); // hiddenDangerDataVO.setDepartmentSortList(topList); // } } }); List<Map<String,Object>> mapList = hiddenDangerMapper.selectJoinMaps(new MPJLambdaWrapper<HiddenDanger>() .select(" t1.name as cateName,t2.name as companyName , count(1) total ") .leftJoin(HiddenDangerParam.class,HiddenDangerParam::getId,HiddenDanger::getCateId) .leftJoin(Company.class,Company::getId,HiddenDangerParam::getCompanyId) .eq(HiddenDanger::getIsdeleted,Constants.ZERO) .apply(" DATE_FORMAT(t.CREATE_DATE, '%Y%M') = DATE_FORMAT(now(), '%Y%M') ") .groupBy("t1.name , t2.name") .orderByDesc(" count(1) ") ); if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(mapList)){ List<GeneralDataVO> topList = new ArrayList<>(); for (Map<String,Object> map:mapList) { GeneralDataVO generalDataVO = new GeneralDataVO(); generalDataVO.setTotal(Integer.valueOf(map.get("total").toString())); generalDataVO.setName(map.get("companyName").toString()); generalDataVO.setCategoryName(map.get("cateName").toString()); topList.add(generalDataVO); } hiddenDangerDataVO.setDepartmentSortList(topList); } } return hiddenDangerDataVO; } server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
@@ -93,7 +93,8 @@ private TmsService tmsService; @Autowired private PlatformDeviceMapper platformDeviceMapper; @Autowired private CategoryMapper categoryMapper; @Value("${debug_model}") private Boolean isDebug; /** @@ -620,6 +621,9 @@ if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,海康同步数据失败~"); } if(Objects.nonNull(response.getData().getList())){ return data; } for(FindHomeAlarmInfoPageResponse r : response.getData().getList()){ AlarmEventDataVO t = new AlarmEventDataVO(); BeanUtils.copyProperties(r,t); @@ -1000,13 +1004,21 @@ /** * 【消防管控】看板-告警信息集合 * * @param type 0/null = 当天;1=当月;2=当年 * @return * */ @Override public AlarmDataVO alarmDataSumByCate(){ AlarmDataVO alarmDataVO = getAlertDataByStartEndTime(DateUtil.getPlusTime2(Utils.Date.getStart(new Date())) public AlarmDataVO alarmDataSumByCate(Integer type){ Date startDate = Utils.Date.getStart(new Date()); if(Objects.nonNull(type)){ if(Constants.equalsInteger(type,Constants.TWO)){ startDate = Utils.Date.getStart(DateUtil.getFirstThisYearDate()); }else if(Constants.equalsInteger(type,Constants.ONE)){ startDate = Utils.Date.getStart(DateUtil.getFirstThisMonthDate()); } } AlarmDataVO alarmDataVO = getAlertDataByStartEndTime(DateUtil.getPlusTime2(startDate) ,(DateUtil.getPlusTime2(new Date()))); return alarmDataVO; } @@ -2052,7 +2064,7 @@ data.setInParkCarTotal( (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.THREE)).count() ); //在园车辆 //当前在园货车司机总数 data.setInParkCarUserTotal( (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.FIVE)).count() ); @@ -2087,8 +2099,44 @@ &&Constants.equalsInteger(i.getCarType(),Constants.RetentionCarType.wxysCar)).count() ); data.setVideoPluginUrl(getVideoUrl()); data.setOutHyLotTotal(Integer.valueOf(systemDictDataBiz.queryByCode(Constants.WMS_PARAM,Constants.OUT_HY_LOT_TOTAL).getCode())); data.setInParkCarList(this.getInParkCars(data)); return data; } public List<Map<String,Object>> getInParkCars(SecurityBoardVO securityBoardVO){ List<Map<String,Object>> mapList = categoryMapper.selectJoinMaps(new MPJLambdaWrapper<Category>() .select(Category::getName) .select(" ( select count(1) from retention r where r.isdeleted = 0 and r.CATEGORY_PARENT_ID = t.id and r.TYPE = 3 ) as total ") .eq(Category::getType,Constants.ONE) .eq(Category::getIsdeleted,Constants.ZERO) .isNull(Category::getParentId) .groupBy(Category::getName) ); if(CollectionUtils.isEmpty(mapList)){ mapList = new ArrayList<>(); } Map<String,Object> map = new HashMap<>(); map.put("name","未知车辆"); map.put("total", retentionMapper.selectCount( new MPJLambdaWrapper<Retention>() .eq(Retention::getIsdeleted,Constants.ZERO) .isNull(Retention::getCategoryId) .eq(Retention::getCarType,Constants.SIX) ) ); mapList.add(map); return mapList; } private String getVideoUrl() { return systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode()+"plugin/VideoWebPlugin.exe"; @@ -3102,7 +3150,6 @@ } } return r ; } server/visits/dmvisit_service/src/main/java/com/doumee/service/business/third/BoardService.java
@@ -75,7 +75,7 @@ List<AlarmEventDataVO> fightingAdminAlertList(); AlarmDataVO alarmDataSumByCate(); AlarmDataVO alarmDataSumByCate(Integer type); List<AlarmDataVO> fightingAlarmHandleData();