123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- package com.persagy.proxy.adm.controller;
- import java.util.List;
- import javax.servlet.http.HttpServletRequest;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.alibaba.fastjson.JSONObject;
- import com.fasterxml.jackson.databind.ObjectMapper;
- import com.fasterxml.jackson.databind.node.ObjectNode;
- import com.persagy.dmp.basic.model.QueryCriteria;
- import com.persagy.dmp.common.helper.SpringHelper;
- import com.persagy.dmp.common.model.response.CommonResult;
- import com.persagy.dmp.digital.client.DigitalObjectFacade;
- import com.persagy.dmp.digital.client.DigitalRelationFacade;
- import com.persagy.dmp.digital.entity.ObjectRelation;
- 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.request.AdmCountResponse;
- /**
- * 统计接口
- *
- * @version 1.0.0
- * @company persagy
- * @author zhangqiankun
- * @date 2021年9月8日 下午7:51:56
- */
- @RestController
- @RequestMapping("/statistics")
- public class ComponentStatisticsController {
- /**
- * 台账中待删除的对象
- * <p>条件:"filters": "taskState = -1"</p>
- * @param queryCriteria
- * @param request
- * @return
- */
- @RequestMapping(value = "/object-delete-count")
- public AdmCountResponse objectDeleteCount(@RequestBody JSONObject params, HttpServletRequest request) {
- return AdmCountResponse.success(0L);
- }
-
- /**
- * 不能同步到物理世界的关系数据
- *
- * @param params
- * @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 params
- * @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);
-
- QueryCriteria queryCriteria = new QueryCriteria();
- ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
- ObjectNode objectNode = objectMapper.createObjectNode();
- objectNode.put("classCode", AdmObjectType.EQUIPMENT.getIndex());
- queryCriteria.setCriteria(objectNode);
- queryCriteria.setOnlyCount(true);
- CommonResult<List<ObjectNode>> result = DigitalObjectFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
- long count = result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
- return AdmCountResponse.success(count);
- }
-
- /**
- * 业务空间-各分区占比
- *
- * @param request
- * @return
- */
- @RequestMapping(value = "/sp-objecttype-count")
- public AdmCountResponse spObjectTypeCount(HttpServletRequest request) {
- //String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
- //String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
- return AdmCountResponse.success(0L);
- }
-
- /**
- * 业务空间-默认分区功能类型占比
- *
- * @param request
- * @return
- */
- @RequestMapping(value = "/general-sp-functype-count")
- public AdmCountResponse generalSpFunctypeCount(HttpServletRequest request) {
- //String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
- //String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
- return AdmCountResponse.success(0L);
- }
-
- /**
- * 租户-关联业务空间完成度
- *
- * @param request
- * @return
- */
- @RequestMapping(value = "/tenant2sp-count")
- public AdmCountResponse tenant2spCount(HttpServletRequest request) {
- String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
- String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
-
- QueryCriteria queryCriteria = new QueryCriteria();
- ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
- ObjectNode objectNode = objectMapper.createObjectNode();
- objectNode.put("graphCode", AdmRelationTypeEnum.TN2SP.getGraphCode());
- objectNode.put("relCode", AdmRelationTypeEnum.TN2SP.getRelCode());
- queryCriteria.setCriteria(objectNode);
- queryCriteria.setOnlyCount(true);
- CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
- long count = result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
- return AdmCountResponse.success(count);
- }
-
- /**
- * 竖井-关联业务空间完成度
- *
- * @param request
- * @return
- */
- @RequestMapping(value = "/shaft2sp-count")
- public AdmCountResponse shaft2spCount(HttpServletRequest request) {
- String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
- String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
-
- QueryCriteria queryCriteria = new QueryCriteria();
- ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
- ObjectNode objectNode = objectMapper.createObjectNode();
- objectNode.put("graphCode", AdmRelationTypeEnum.SH2SP.getGraphCode());
- objectNode.put("relCode", AdmRelationTypeEnum.SH2SP.getRelCode());
- queryCriteria.setCriteria(objectNode);
- queryCriteria.setOnlyCount(true);
- CommonResult<List<ObjectRelation>> result = DigitalRelationFacade.queryPrototype(groupCode, projectId, AdmCommonConstant.APP_ID, AdmCommonConstant.USER_ID, queryCriteria);
- long count = result == null ? 0 : (result.getCount() == null ? 0 : result.getCount());
- return AdmCountResponse.success(count);
- }
-
- /**
- * 竖井-按功能类型占比
- *
- * @param request
- * @return
- */
- @RequestMapping(value = "/shaft-functype-count")
- public AdmCountResponse shaftFunctypeCount(HttpServletRequest request) {
- //String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
- //String projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
- return AdmCountResponse.success(0L);
- }
-
- }
|