Browse Source

优化:优化/graphic/downloads/project/equip/count接口

lijie 3 years ago
parent
commit
4c331a8e89
39 changed files with 113 additions and 71 deletions
  1. 8 4
      src/main/java/com/persagy/proxy/adm/handler/RelationReportHandler.java
  2. 6 5
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/AbstractRelationObject.java
  3. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/ArchForArchSh2BdRelationObject.java
  4. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/ArchForArchSh2FlRelationObject.java
  5. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/ArchForArchSh2ShRelationObject.java
  6. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/ArchForArchSh2SpRelationObject.java
  7. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/ArchForArchSp2BdRelationObject.java
  8. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/ArchForArchSp2FlRelationObject.java
  9. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/ArchSubsetBd2FlRelationObject.java
  10. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/ConvectionNetworkMixMechRelationObject.java
  11. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/ConvectionNetworkNaturalRelationObject.java
  12. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/ConvectionNetworkOnewayMechRelationObject.java
  13. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/DeafultRelationObject.java
  14. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/EquipPowerEqBackupRelationObject.java
  15. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/EquipPowerEqNormalRelationObject.java
  16. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/EquipPowerSyBackupRelationObject.java
  17. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/EquipPowerSyNormalRelationObject.java
  18. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechForArchEq2BdRelationObject.java
  19. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechForArchEq2FlRelationObject.java
  20. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechForArchEq2ShRelationObject.java
  21. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechForArchSy2BdRelationObject.java
  22. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechForArchSy2FlRelationObject.java
  23. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechForArchSy2ShRelationObject.java
  24. 3 2
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechForArchSy2SpRelationObject.java
  25. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechInArchEq2BdRelationObject.java
  26. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechInArchEq2FlRelationObject.java
  27. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechInArchEq2SpRelationObject.java
  28. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/RadiationNetworkConnectRelationObject.java
  29. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/RadiationNetworkTransparentRelationObject.java
  30. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/SensorRelationshipSs2EqRelationObject.java
  31. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/SensorRelationshipSs2SpRelationObject.java
  32. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/SensorRelationshipSs2SyRelationObject.java
  33. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/TrafficNetworkFFCloseRelationObject.java
  34. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/TrafficNetworkFFOpenRelationObject.java
  35. 2 1
      src/main/java/com/persagy/proxy/adm/strategy/relationdata/TrafficNetworkNormalRelationObject.java
  36. 5 0
      src/main/java/com/persagy/proxy/common/service/impl/EmsAuthServiceImpl.java
  37. 5 0
      src/main/java/com/persagy/proxy/common/service/impl/NoneAuthServiceImpl.java
  38. 5 7
      src/main/java/com/persagy/proxy/report/controller/RelationReportController.java
  39. 17 21
      src/main/java/com/persagy/proxy/report/service/impl/RelationReportService.java

+ 8 - 4
src/main/java/com/persagy/proxy/adm/handler/RelationReportHandler.java

@@ -8,6 +8,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import cn.hutool.core.collection.CollUtil;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
@@ -150,20 +151,23 @@ public class RelationReportHandler {
 		List<OrderItem> classCodeAsc = Arrays.asList(OrderItem.asc("classCode"));
 		
 		// 1.获取项目名称
-		List<ObjectNode> projects = this.relationReportService.queryObjects(null, groupCode, projectId, Sets.newHashSet(projectId), Sets.newHashSet(AdmObjectType.PROJECT.getIndex()), null, null);
+		List<ObjectNode> projects = this.relationReportService.queryObjects(null, groupCode, projectId,
+				Sets.newHashSet(projectId), Sets.newHashSet(AdmObjectType.PROJECT.getIndex()), null, null);
 		if (CollectionUtil.isEmpty(projects)) {
 			return Lists.newArrayList();
 		}
 		String projectName = projects.get(0).has("localName") ? projects.get(0).get("localName").asText() : null;
 		
 		// 2.获取所有的设备对象数据
-		List<ObjectNode> equipList = this.relationReportService.queryObjects(null, groupCode, projectId, null, null, Sets.newHashSet(equipment), classCodeAsc);
+		List<ObjectNode> equipList = this.relationReportService.queryObjects(null, groupCode, projectId,
+				null, null, Sets.newHashSet(equipment), classCodeAsc);
 		if (CollectionUtil.isEmpty(equipList)) {
 			return Lists.newArrayList();
 		}
 		
 		// 3.获取所有的设备、系统类定义信息
-		List<ObjectTypeDefine> classInfo = this.relationReportService.queryClassList(groupCode, projectId, null, Sets.newHashSet(equipment, AdmObjectType.SYSTEM.getIndex()), null);
+		List<ObjectTypeDefine> classInfo = this.relationReportService.queryClassList(groupCode, projectId,
+				null, Sets.newHashSet(equipment, AdmObjectType.SYSTEM.getIndex()), null);
 		/** key-equipCode, value-equipName */
 		Map<String, String> equipTemp = new HashMap<String, String>();
 		/** key-systemCode, value-systemName */
@@ -483,7 +487,7 @@ public class RelationReportHandler {
 		}
 		equipList.clear();	//即时清空
 		
-		Set<String> classCodes = classByBuild.keySet();
+		Set<String> classCodes = CollUtil.newHashSet(CollUtil.isNotEmpty(classByBuild.keySet()),classByBuild.keySet());
 		Set<String> keySet = classNotBuild.keySet();
 		classCodes.addAll(keySet);
 		

+ 6 - 5
src/main/java/com/persagy/proxy/adm/strategy/relationdata/AbstractRelationObject.java

@@ -5,6 +5,7 @@ import java.util.Set;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.dto.RequestData;
+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;
@@ -74,14 +75,14 @@ public abstract class AbstractRelationObject implements RelationObjectStrategy {
 		}
 		
 		allDigitals.addAll(infos);
-		if (count < 500) {
+		if (count < SpringHelper.getLong("persagy.common.sql.limit",500L)) {
 			return;
-		} else if ((infos.size()*requestData.getPage()) > count) {
+		}
+		if ((infos.size()*requestData.getPage()) > count) {
 			return;
-		} else {
-			requestData.setPage((requestData.getPage() + 1));
-			this.queryPageRelations(allDigitals, requestData, groupCode, projectId);
 		}
+		requestData.setPage((requestData.getPage() + 1));
+		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);
 	}
 	
 	@Override

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/ArchForArchSh2BdRelationObject.java

@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.dto.RequestData;
 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.DigitalRelationFacade;
 import com.persagy.dmp.digital.entity.ObjectDigital;
@@ -58,7 +59,7 @@ public class ArchForArchSh2BdRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);
 		return allDigitals;

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/ArchForArchSh2FlRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class ArchForArchSh2FlRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);
 		return allDigitals;

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/ArchForArchSh2ShRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class ArchForArchSh2ShRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/ArchForArchSh2SpRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class ArchForArchSh2SpRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/ArchForArchSp2BdRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class ArchForArchSp2BdRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/ArchForArchSp2FlRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class ArchForArchSp2FlRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/ArchSubsetBd2FlRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -62,7 +63,7 @@ public class ArchSubsetBd2FlRelationObject extends AbstractRelationObject {
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/ConvectionNetworkMixMechRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -63,7 +64,7 @@ public class ConvectionNetworkMixMechRelationObject extends AbstractReportRelati
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/ConvectionNetworkNaturalRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -63,7 +64,7 @@ public class ConvectionNetworkNaturalRelationObject extends AbstractReportRelati
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/ConvectionNetworkOnewayMechRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -63,7 +64,7 @@ public class ConvectionNetworkOnewayMechRelationObject extends AbstractReportRel
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/DeafultRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -62,7 +63,7 @@ public class DeafultRelationObject extends AbstractReportRelationObject {
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/EquipPowerEqBackupRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -63,7 +64,7 @@ public class EquipPowerEqBackupRelationObject extends AbstractReportRelationObje
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/EquipPowerEqNormalRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -63,7 +64,7 @@ public class EquipPowerEqNormalRelationObject extends AbstractReportRelationObje
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/EquipPowerSyBackupRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -63,7 +64,7 @@ public class EquipPowerSyBackupRelationObject extends AbstractReportRelationObje
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/EquipPowerSyNormalRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -63,7 +64,7 @@ public class EquipPowerSyNormalRelationObject extends AbstractReportRelationObje
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechForArchEq2BdRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class MechForArchEq2BdRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechForArchEq2FlRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class MechForArchEq2FlRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechForArchEq2ShRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class MechForArchEq2ShRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechForArchSy2BdRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class MechForArchSy2BdRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechForArchSy2FlRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class MechForArchSy2FlRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechForArchSy2ShRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class MechForArchSy2ShRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 3 - 2
src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechForArchSy2SpRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,8 +65,8 @@ public class MechForArchSy2SpRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
-		
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
+
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);
 		return allDigitals;

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechInArchEq2BdRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class MechInArchEq2BdRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechInArchEq2FlRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class MechInArchEq2FlRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/MechInArchEq2SpRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class MechInArchEq2SpRelationObject extends AbstractReportRelationObject
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/RadiationNetworkConnectRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -63,7 +64,7 @@ public class RadiationNetworkConnectRelationObject extends AbstractReportRelatio
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/RadiationNetworkTransparentRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -63,7 +64,7 @@ public class RadiationNetworkTransparentRelationObject extends AbstractReportRel
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/SensorRelationshipSs2EqRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -63,7 +64,7 @@ public class SensorRelationshipSs2EqRelationObject extends AbstractReportRelatio
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/SensorRelationshipSs2SpRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -64,7 +65,7 @@ public class SensorRelationshipSs2SpRelationObject extends AbstractReportRelatio
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/SensorRelationshipSs2SyRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -63,7 +64,7 @@ public class SensorRelationshipSs2SyRelationObject extends AbstractReportRelatio
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/TrafficNetworkFFCloseRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -63,7 +64,7 @@ public class TrafficNetworkFFCloseRelationObject extends AbstractReportRelationO
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);	

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/TrafficNetworkFFOpenRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -63,7 +64,7 @@ public class TrafficNetworkFFOpenRelationObject extends AbstractReportRelationOb
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 2 - 1
src/main/java/com/persagy/proxy/adm/strategy/relationdata/TrafficNetworkNormalRelationObject.java

@@ -4,6 +4,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 
+import com.persagy.dmp.common.helper.SpringHelper;
 import org.springframework.stereotype.Component;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -63,7 +64,7 @@ public class TrafficNetworkNormalRelationObject extends AbstractReportRelationOb
 			requestData.setSlaveContent(slaveContent);
 		}
 		requestData.setPage(1L);
-		requestData.setSize(500L);
+		requestData.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		
 		List<ObjectDigital> allDigitals = new ArrayList<ObjectDigital>();
 		this.queryPageRelations(allDigitals, requestData, groupCode, projectId);

+ 5 - 0
src/main/java/com/persagy/proxy/common/service/impl/EmsAuthServiceImpl.java

@@ -91,5 +91,10 @@ public class EmsAuthServiceImpl extends AbstractAuthServiceImpl {
         if(StrUtil.isBlank(userId)) {
             context.setAccountId(CommonConstant.DEFAULT_ID);
         }
+        // 无项目id时,尝试从请求URL中获取
+        if (StrUtil.isBlank(request.getHeader("projectId"))
+                && StrUtil.isNotBlank(request.getParameter(CommonConstant.QUERY_PROJECTID))){
+            context.setProjectId(request.getParameter(CommonConstant.QUERY_PROJECTID));
+        }
     }
 }

+ 5 - 0
src/main/java/com/persagy/proxy/common/service/impl/NoneAuthServiceImpl.java

@@ -40,5 +40,10 @@ public class NoneAuthServiceImpl extends AbstractAuthServiceImpl {
         if(StrUtil.isBlank(groupCode)) {
             context.setGroupCode(SpringHelper.getString(AdmCommonConstant.MIDDLEWARE_GROUP_CODE));
         }
+        // 无项目id时,尝试从请求URL中获取
+        if (StrUtil.isBlank(request.getHeader("projectId"))
+                && StrUtil.isNotBlank(request.getParameter(CommonConstant.QUERY_PROJECTID))){
+            context.setProjectId(request.getParameter(CommonConstant.QUERY_PROJECTID));
+        }
     }
 }

+ 5 - 7
src/main/java/com/persagy/proxy/report/controller/RelationReportController.java

@@ -277,20 +277,18 @@ public class RelationReportController {
 	 * @return
 	 */
 	@RequestMapping("/graphic/downloads/project/equip/count")
-	public void downloadsProjectEquipPoint(@RequestParam(required = false) String projectId, HttpServletRequest request, HttpServletResponse response) {
-		String groupCode = request.getHeader(AdmCommonConstant.GROUP_CODE_HEADER);
-		if (StrUtil.isBlank(projectId)) {
-			projectId = request.getHeader(AdmCommonConstant.PROJECT_ID_HEADER);
-		}
+	public void downloadsProjectEquipPoint(HttpServletRequest request, HttpServletResponse response) {
 		try {
-            response.setContentType("application/vnd.ms-excel");
+            // response.setContentType("application/vnd.ms-excel");
+            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
             String encode = StandardCharsets.UTF_8.name();
             response.setCharacterEncoding(encode);
             // 防止中文乱码
             String fileName = URLEncoder.encode("equipment", encode);
             response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
             
-            List<EquipmentCountExcel> equipmentCountExcel = this.relationReportHandler.countClassCodeEquip(groupCode, projectId);
+            List<EquipmentCountExcel> equipmentCountExcel = relationReportHandler
+					.countClassCodeEquip(AppContext.getContext().getGroupCode(), AppContext.getContext().getProjectId());
             EasyExcel.write(response.getOutputStream(), EquipmentCountExcel.class).sheet(0).doWrite(equipmentCountExcel);
 		} catch(Exception e) {
 			log.error("设备数据导出异常", e);

+ 17 - 21
src/main/java/com/persagy/proxy/report/service/impl/RelationReportService.java

@@ -86,7 +86,7 @@ public class RelationReportService implements IRelationReportService {
 			classCriteria.setOrders(orderItems);
 		}
 		classCriteria.setPage(1L);
-		classCriteria.setSize(500L);
+		classCriteria.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		List<ObjectTypeDefine> all = new ArrayList<ObjectTypeDefine>();
 		this.queryPageClass(all, classCriteria, groupCode, projectId);
 		return all;
@@ -387,7 +387,7 @@ public class RelationReportService implements IRelationReportService {
 		}
 		criteria.put("valid", 1);
 		objectCriteria.setPage(1L);
-		objectCriteria.setSize(500L);
+		objectCriteria.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		objectCriteria.setCriteria(criteria);
 		if (CollectionUtil.isNotEmpty(orderItem)) {
 			objectCriteria.setOrders(orderItem);
@@ -453,7 +453,7 @@ public class RelationReportService implements IRelationReportService {
 		condition.put("valid", 1);
 		queryCriteria.setCriteria(condition);
 		queryCriteria.setPage(1L);
-		queryCriteria.setSize(500L);
+		queryCriteria.setSize(SpringHelper.getLong("persagy.common.sql.limit",500L));
 		List<ObjectInfoDefine> all = new ArrayList<ObjectInfoDefine>();
 		this.queryPageFunids(all, queryCriteria, groupCode, projectId);
 		return all;
@@ -811,14 +811,14 @@ public class RelationReportService implements IRelationReportService {
 		
 		all.addAll(infos);
 		
-		if (count < 500) {
+		if (count < SpringHelper.getLong("persagy.common.sql.limit",500L)) {
 			return;
-		} else if ((infos.size()*classCriteria.getPage()) > count) {
+		}
+		if ((infos.size()*classCriteria.getPage()) > count) {
 			return;
-		} else {
-			classCriteria.setPage((classCriteria.getPage() + 1));
-			this.queryPageClass(all, classCriteria, groupCode, projectId);
 		}
+		classCriteria.setPage((classCriteria.getPage() + 1));
+		this.queryPageClass(all, classCriteria, groupCode, projectId);
 	}
 	
 	/**
@@ -836,17 +836,13 @@ public class RelationReportService implements IRelationReportService {
 		if (count == null || CollectionUtil.isEmpty(infos)) {
 			return;
 		}
-		
 		all.addAll(infos);
-		
-		if (count < 500) {
-			return;
-		} else if ((infos.size()*objectCriteria.getPage()) > count) {
+		if ((count < SpringHelper.getLong("persagy.common.sql.limit",500L))
+				|| ((infos.size()*objectCriteria.getPage()) > count)) {
 			return;
-		} else {
-			objectCriteria.setPage((objectCriteria.getPage() + 1));
-			this.queryPageObjects(all, objectCriteria, groupCode, projectId);
 		}
+		objectCriteria.setPage((objectCriteria.getPage() + 1));
+		this.queryPageObjects(all, objectCriteria, groupCode, projectId);
 	}
 
 	/**
@@ -895,14 +891,14 @@ public class RelationReportService implements IRelationReportService {
 		
 		all.addAll(infos);
 		
-		if (count < 500) {
+		if (count < SpringHelper.getLong("persagy.common.sql.limit",500L)) {
 			return;
-		} else if ((infos.size()*queryCriteria.getPage()) > count) {
+		}
+		if ((infos.size()*queryCriteria.getPage()) > count) {
 			return;
-		} else {
-			queryCriteria.setPage((queryCriteria.getPage() + 1));
-			this.queryPageFunids(all, queryCriteria, groupCode, projectId);
 		}
+		queryCriteria.setPage((queryCriteria.getPage() + 1));
+		this.queryPageFunids(all, queryCriteria, groupCode, projectId);
 	}
 	
 }