Browse Source

通道同步定时处理 定时任务 代码提交

jingyuanchao 1 năm trước cách đây
mục cha
commit
383f122bc0

+ 2 - 2
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteMediatorService.java

@@ -13,9 +13,9 @@ import java.util.List;
  *
  * @author xunmei
  */
-@FeignClient(contextId = "remoteMediatorService", path = "/mediator", value = ServiceNameConstants.MEDIATOR_SERVICE, fallbackFactory = RemoteMediatorFallbackFactory.class)
+@FeignClient(contextId = "remoteMediatorService", value = ServiceNameConstants.MEDIATOR_SERVICE, fallbackFactory = RemoteMediatorFallbackFactory.class)
 public interface RemoteMediatorService {
 
-    @PostMapping("/channelCacheDeal")
+    @GetMapping("/mediator/channelCacheDeal")
     AjaxResult channelCacheDeal();
 }

+ 2 - 0
soc-modules/soc-modules-job/src/main/java/com/xunmei/job/SocJobApplication.java

@@ -5,7 +5,9 @@ import com.xunmei.common.security.annotation.EnableSocFeignClients;
 import com.xunmei.common.swagger.annotation.EnableCustomSwagger2;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.context.config.annotation.RefreshScope;
 
+@RefreshScope
 @EnableCustomConfig
 @EnableCustomSwagger2
 @EnableSocFeignClients

+ 0 - 6
soc-modules/soc-modules-mediator/src/main/java/com/xunmei/mediator/api/controller/DataController.java

@@ -112,12 +112,6 @@ public class DataController {
 
     }
 
-    @ApiOperation("处理缓存中的通道信息数据")
-    @GetMapping({"/mediator/channelCacheDeal"})
-    public AjaxResult channelCacheDeal() {
-        this.iotDvrChannelService.channelCacheDeal();
-        return AjaxResult.success();
-    }
 
 
     @ApiOperation(value = "传感器通用设备信息同步", notes = "直连主机传感器")

+ 12 - 54
soc-modules/soc-modules-mediator/src/main/java/com/xunmei/mediator/api/controller/MediatorController.java

@@ -1,8 +1,13 @@
 package com.xunmei.mediator.api.controller;
 
 
+import com.xunmei.common.core.web.domain.AjaxResult;
+import com.xunmei.mediator.api.service.*;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
+
 
 /**
  * @author jingyuanchao
@@ -10,64 +15,17 @@ import org.springframework.web.bind.annotation.*;
  * @date 2024/1/25 17:04
  */
 
-@RestController("/mediator")
+@RestController
 public class MediatorController {
 
-   /* @Resource
-    private EquipmentSyncService equipmentSyncService;
-    @Resource
-    private NorthStatisticsSyncService northStatisticsSyncService;
-    @Resource
-    private NorthErrorService northErrorService;
-    @Resource
-    private IMediatorCategoryService categoryService;
     @Resource
-    private IMediatorDeviceDataService deviceDataService;
-    @Resource
-    private IMediatorDeviceDataLogService deviceDataLogService;
-
-    @InnerAuth
-    @PostMapping("/isCompleted")
-    public List<DeviceReceivePageDto> isCompleted(@RequestBody DeviceReceivePageDto pageData) {
-        return equipmentSyncService.isCompleted(pageData);
-    }
-
-    @InnerAuth
-    @PostMapping("/saveDeviceData")
-    public void saveDeviceData(@RequestBody List<DeviceReceivePageDto> pageData) {
-        equipmentSyncService.saveDeviceData(pageData);
-    }
-
-    @InnerAuth
-    @GetMapping("/saveOrUpdateBaseCountByDataType")
-    public void saveOrUpdateBaseCountByDataType(@RequestParam("dataType") Integer dataType,
-                                                @RequestParam("size") int size,
-                                                @RequestParam("boo") boolean boo) {
-        northStatisticsSyncService.saveOrUpdateBaseCountByDataType(dataType, size, boo);
-    }
-
-    @InnerAuth
-    @PostMapping("/saveErrorData")
-    void saveErrorData(@RequestBody List<NorthError> errors) {
-        northErrorService.saveErrorData(errors);
-    }
+    private IIotDvrChannelService iotDvrChannelService;
 
-    @InnerAuth
-    @GetMapping("/findCategoryByCodeAndParentId")
-    MediatorCategory findCategoryByCodeAndParentId(@RequestParam String code, @RequestParam long parentId) {
-        return categoryService.findCategoryByCodeAndParentId(code, parentId);
-    }
 
-    @InnerAuth
-    @PostMapping("/saveOrUpdateDeviceData")
-    void saveOrUpdateDeviceData(@RequestBody List<MediatorDeviceData> deviceDataList) {
-        deviceDataService.saveOrUpdateBatch(deviceDataList);
+    @ApiOperation("处理缓存中的通道信息数据")
+    @GetMapping({"/mediator/channelCacheDeal"})
+    public AjaxResult channelCacheDeal() {
+        this.iotDvrChannelService.channelCacheDeal();
+        return AjaxResult.success();
     }
-
-    @InnerAuth
-    @PostMapping("/saveOrUpdateDeviceDataLog")
-    void saveOrUpdateDeviceDataLog(@RequestBody List<MediatorDeviceDataLog> deviceDataList) {
-        deviceDataLogService.saveOrUpdateBatch(deviceDataList);
-    }*/
-
 }