package com.persagy.proxy.report.controller; import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSONObject; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.persagy.proxy.adm.constant.AdmCommonConstant; import com.persagy.proxy.adm.constant.AdmObjectType; import com.persagy.proxy.adm.constant.AdmRelationTypeEnum; import com.persagy.proxy.adm.constant.SpaceTypeEnum; import com.persagy.proxy.adm.request.AdmCountResponse; import com.persagy.proxy.adm.request.AdmQueryCriteria; import com.persagy.proxy.adm.request.AdmResponse; import com.persagy.proxy.adm.utils.AdmContextUtil; import com.persagy.proxy.common.entity.InstanceUrlParam; import com.persagy.proxy.object.model.AdmEquipment; import com.persagy.proxy.object.model.AdmShaft; import com.persagy.proxy.object.service.IAdmEquipmentService; import com.persagy.proxy.object.service.IAdmShaftService; import com.persagy.proxy.report.service.IRelationReportService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.List; import java.util.Map; /** * 统计接口 * * @version 1.0.0 * @company persagy * @author zhangqiankun * @date 2021年9月8日 下午7:51:56 */ @RestController @RequestMapping("/statistics") public class ComponentStatisticsController { @Autowired private IRelationReportService relationReportService; @Autowired private IAdmShaftService shaftService; /** * 台账中待删除的对象 *
条件:"filters": "taskState = -1"
* @param request * @return */ @RequestMapping(value = "/object-delete-count") public AdmCountResponse objectDeleteCount(@RequestBody JSONObject params, HttpServletRequest request) { return AdmCountResponse.success(0L); } /** * 不能同步到物理世界的关系数据 * @param request * @return */ @RequestMapping(value = "/unsyn-relation-count") public AdmCountResponse unsynRelationCount(HttpServletRequest request) { return AdmCountResponse.success(0L); } /** * 岗位和关联的资产信息点值不一致 * * @param request * @return */ @RequestMapping(value = "/eq2pe-count") public AdmCountResponse eq2peCount(HttpServletRequest request) { return AdmCountResponse.success(0L); } /** * 岗位和关联的资产信息点值不一致的数据 * * @param request * @return */ @RequestMapping(value = "/eq2pe-different") public AdmCountResponse eq2peDifferent(HttpServletRequest request) { return AdmCountResponse.success(0L); } /** * 设备-未关联资产的设备,这里返回所有的设备 * @param request * @return */ @RequestMapping(value = "/uneq2pe-count") public AdmCountResponse uneq2peCount(HttpServletRequest request) { String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER); String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER); long count = this.relationReportService.countObject(groupCode, projectId, AdmObjectType.EQUIPMENT.getIndex(), null); return AdmCountResponse.success(count); } /** * 业务空间-各分区占比 * @param request * @return */ @RequestMapping(value = "/sp-objecttype-count") public AdmResponse spObjectTypeCount(HttpServletRequest request) { String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER); List