Browse Source

fix bug:调用关系计算接口参数必填

lijie 3 years ago
parent
commit
0074b53642
1 changed files with 29 additions and 20 deletions
  1. 29 20
      src/main/java/com/persagy/proxy/adm/controller/AdmRelCalController.java

+ 29 - 20
src/main/java/com/persagy/proxy/adm/controller/AdmRelCalController.java

@@ -46,8 +46,9 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"bd2sp","fl2sp","sh2bd"})
-    public AdmResponse archSubsetCalcRelation(@RequestParam("objectTypes") String objectTypeStr,
-                                              @RequestParam("relationType") String relationTypeStr, HttpServletRequest request) {
+    public AdmResponse archSubsetCalcRelation(@RequestParam(value = "objectTypes",required = false) String objectTypeStr,
+                                              @RequestParam(value = "relationType",required = false) String relationTypeStr,
+                                              HttpServletRequest request) {
         admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),CollUtil.newArrayList(getAdmRelationTypeEnum(request)),null);
         return AdmResponse.success(new ArrayList<>());
     }
@@ -71,8 +72,9 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"eq2bd","eq2fl","eq2sh","eq2sp_in","sy2bd","sy2fl","sy2sh","sy2sp"})
-    public AdmResponse mechInArchCalcRelation(@RequestParam("objectTypes") String objectTypeStr,
-                                              @RequestParam("relationType") String relationTypeStr, HttpServletRequest request) {
+    public AdmResponse mechInArchCalcRelation(@RequestParam(value = "objectTypes",required = false) String objectTypeStr,
+                                              @RequestParam(value = "relationType",required = false) String relationTypeStr,
+                                              HttpServletRequest request) {
         admRelCalService.calcRelation(AdmContextUtil.toDmpContext(), CollUtil.newArrayList(getAdmRelationTypeEnum(request)),null);
         return AdmResponse.success(new ArrayList<>());
     }
@@ -92,8 +94,8 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"pe2bd","pe2fl","pe2sh","pe2sp"})
-    public AdmResponse propertyInArchCalcRelation(@RequestParam("objectTypes") String objectTypeStr,
-                                                  @RequestParam("relationType") String relationTypeStr) {
+    public AdmResponse propertyInArchCalcRelation(@RequestParam(value = "objectTypes",required = false) String objectTypeStr,
+                                                  @RequestParam(value = "relationType",required = false) String relationTypeStr) {
         // 资产暂时未引入,直接返回成功
         // 组装上下文条件
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
@@ -112,8 +114,8 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"eq2sp_for"})
-    public AdmResponse mechForArchCalcRelation(@RequestParam("objectTypes") String objectTypeStr,
-                                               @RequestParam("relationType") String relationTypeStr) {
+    public AdmResponse mechForArchCalcRelation(@RequestParam(value = "objectTypes",required = false) String objectTypeStr,
+                                               @RequestParam(value = "relationType",required = false) String relationTypeStr) {
         // 资产暂时未引入,直接返回成功
         // 组装上下文条件
         InstanceUrlParam context = AdmContextUtil.toDmpContext();
@@ -132,10 +134,11 @@ public class AdmRelCalController {
      * Update By lijie 2021/8/31 12:10
      */
     @PostMapping(value = {"sp2sp"})
-    public AdmResponse archForArchCalcRelation( @RequestParam("buildingId") String buildingId,
-                                                @RequestParam("objectType") String objectType,
-                                                @RequestParam("type") String type) {
-        admRelCalService.calcRelationForArchForArchSpToSp(AdmContextUtil.toDmpContext(),buildingId,objectType,type,AdmRelationTypeEnum.SP2SP_ARCHFORARCH);
+    public AdmResponse archForArchCalcRelation( @RequestParam(value = "buildingId",required = false) String buildingId,
+                                                @RequestParam(value = "objectType",required = false) String objectType,
+                                                @RequestParam(value = "type",required = false) String type) {
+        admRelCalService.calcRelationForArchForArchSpToSp(AdmContextUtil.toDmpContext(),buildingId,objectType,type,
+                AdmRelationTypeEnum.SP2SP_ARCHFORARCH);
         return AdmResponse.success(new ArrayList<>());
     }
     /***
@@ -148,7 +151,8 @@ public class AdmRelCalController {
      */
     @PostMapping(value = {"eq2sp_SensorRelationship_ss2sp"})
     public AdmResponse sensorRelationshipCalcRelation() {
-        admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),CollUtil.newArrayList(AdmRelationTypeEnum.EQ2SP_SENSORRELATIONSHIP_SS2SP),"AirConditioningZone");
+        admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),
+                CollUtil.newArrayList(AdmRelationTypeEnum.EQ2SP_SENSORRELATIONSHIP_SS2SP),"AirConditioningZone");
         return AdmResponse.success(new ArrayList<>());
     }
     /***
@@ -161,7 +165,8 @@ public class AdmRelCalController {
      */
     @PostMapping(value = {"sp2sp_ConvectionNetwork_1"})
     public AdmResponse convectionNetworkCalcRelation() {
-        admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),CollUtil.newArrayList(AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_1),null);
+        admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),
+                CollUtil.newArrayList(AdmRelationTypeEnum.SP2SP_CONVECTIONNETWORK_1),null);
         return AdmResponse.success(new ArrayList<>());
     }
     /***
@@ -174,7 +179,8 @@ public class AdmRelCalController {
      */
     @PostMapping(value = {"sp2sp_RadiationNetwork_1"})
     public AdmResponse radiationNetworkCalcRelation() {
-        admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),CollUtil.newArrayList(AdmRelationTypeEnum.SP2SP_RADIATIONNETWORK_1),null);
+        admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),
+                CollUtil.newArrayList(AdmRelationTypeEnum.SP2SP_RADIATIONNETWORK_1),null);
         return AdmResponse.success(new ArrayList<>());
     }
     /***
@@ -187,7 +193,8 @@ public class AdmRelCalController {
      */
     @PostMapping(value = {"sp2sp_SpaceNeighborhood_5"})
     public AdmResponse spaceNeighborhoodCalcRelation() {
-        admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),CollUtil.newArrayList(AdmRelationTypeEnum.SP2SP_SPACENEIGHBORHOOD_5),null);
+        admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),
+                CollUtil.newArrayList(AdmRelationTypeEnum.SP2SP_SPACENEIGHBORHOOD_5),null);
         return AdmResponse.success(new ArrayList<>());
     }
     /***
@@ -219,7 +226,8 @@ public class AdmRelCalController {
      */
     @PostMapping(value = {"sp2sp_TrafficNetwork_1"})
     public AdmResponse trafficNetworkCalcRelation() {
-        admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),CollUtil.newArrayList(AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_1),null);
+        admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),
+                CollUtil.newArrayList(AdmRelationTypeEnum.SP2SP_TRAFFICNETWORK_1),null);
         return AdmResponse.success(new ArrayList<>());
     }
     /***
@@ -233,7 +241,8 @@ public class AdmRelCalController {
      */
     @PostMapping(value = {"fl2fl","sh2sh"})
     public AdmResponse throughRelationshipCalcRelation(HttpServletRequest request) {
-        admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),CollUtil.newArrayList(getAdmRelationTypeEnum(request)),null);
+        admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),
+                CollUtil.newArrayList(getAdmRelationTypeEnum(request)),null);
         return AdmResponse.success(new ArrayList<>());
     }
 
@@ -251,8 +260,8 @@ public class AdmRelCalController {
      */
     @PostMapping(value = {"sign"})
     public AdmResponse changeSign( @PathVariable("relType") String relType,
-                                     @QueryParam("objectTypes") String objectTypeStr,
-                                     @QueryParam("relationType") String relationTypeStr) {
+                                   @RequestParam(value = "objectTypes",required = false) String objectTypeStr,
+                                   @RequestParam(value = "relationType",required = false) String relationTypeStr) {
         // 资产暂时未引入,直接返回成功
         // 组装上下文条件
         InstanceUrlParam context = AdmContextUtil.toDmpContext();