Kaynağa Gözat

首页-监测系统信息

sunhh 1 yıl önce
ebeveyn
işleme
df810a95f8

+ 34 - 12
vehicle-admin/src/main/java/com/ozs/web/controller/system/MonitorSystemController.java

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 import java.util.UUID;
 
 /**
@@ -31,56 +32,74 @@ public class MonitorSystemController extends BaseController {
     @Autowired
     private MonitorSystemService monitorSystemService;
 
+    /**
+     * 首页-监测系统信息
+     *
+     * @param
+     * @return
+     */
+    @Log(title = "首页-监测系统信息", businessType = BusinessType.SELECT)
+    @PostMapping("/monitorSystem")
+    @ApiOperation(value = "首页-监测系统信息")
+    public AjaxResult monitorSystem() {
+        Map<String, Object> monitorSystem = monitorSystemService.monitorSystem();
+        return AjaxResult.success(monitorSystem);
+    }
+
     /**
      * 分页查询
+     *
      * @param
      * @return
      */
     @Log(title = "监测系统-分页查询", businessType = BusinessType.SELECT)
     @PostMapping("/pageList")
     @ApiOperation(value = "监测系统分页查询")
-    public AjaxResult pageList(@RequestBody MonitorSystemVo monitorSystemVo){
-        IPage<MonitorSystemVo> page =  monitorSystemService.pageList(monitorSystemVo);
+    public AjaxResult pageList(@RequestBody MonitorSystemVo monitorSystemVo) {
+        IPage<MonitorSystemVo> page = monitorSystemService.pageList(monitorSystemVo);
         return AjaxResult.success(page);
     }
 
     /**
      * 监测系统名称查询
+     *
      * @param
      * @return
      */
     @Log(title = "监测系统-监测系统名称查询", businessType = BusinessType.SELECT)
     @GetMapping("/list")
     @ApiOperation(value = "监测系统-监测系统名称查询")
-    public AjaxResult list(){
+    public AjaxResult list() {
         LambdaQueryWrapper<MonitorSystem> wrapper = new LambdaQueryWrapper<MonitorSystem>();
-        wrapper.eq(MonitorSystem::getStatus,1);
+        wrapper.eq(MonitorSystem::getStatus, 1);
         List<MonitorSystem> list = monitorSystemService.list(wrapper);
         return AjaxResult.success(list);
     }
 
     /**
      * 详情查看
+     *
      * @param
      * @return
      */
     @Log(title = "监测系统-详情查看", businessType = BusinessType.SELECT)
     @GetMapping("/{id}")
     @ApiOperation(value = "监测系统-详情查看")
-    public AjaxResult detail(@PathVariable Long id){
+    public AjaxResult detail(@PathVariable Long id) {
         MonitorSystem monitorSystem = monitorSystemService.getMonitorSystem(id);
         return AjaxResult.success(monitorSystem);
     }
 
     /**
      * 新增
+     *
      * @param
      * @return
      */
     @Log(title = "监测系统-新增", businessType = BusinessType.INSERT)
     @PostMapping("/add")
     @ApiOperation(value = "监测系统-新增")
-    public AjaxResult add(@RequestBody MonitorSystem monitorSystem){
+    public AjaxResult add(@RequestBody MonitorSystem monitorSystem) {
         if (UserConstants.NOT_UNIQUE.equals(monitorSystemService.checkClientIdUnique(monitorSystem))) {
             return error("监测系统新增'" + monitorSystem.getClientId() + "'失败,客户端编码已存在");
         }
@@ -90,26 +109,28 @@ public class MonitorSystemController extends BaseController {
 
     /**
      * 删除
+     *
      * @param
      * @return
      */
     @Log(title = "监测系统-删除", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     @ApiOperation(value = "监测系统-删除")
-    public AjaxResult delete(@PathVariable Long[] ids){
-         monitorSystemService.deleteByIds(ids);
-         return AjaxResult.success();
+    public AjaxResult delete(@PathVariable Long[] ids) {
+        monitorSystemService.deleteByIds(ids);
+        return AjaxResult.success();
     }
 
     /**
      * 修改
+     *
      * @param
      * @return
      */
     @Log(title = "监测系统-修改", businessType = BusinessType.UPDATE)
     @PutMapping
     @ApiOperation(value = "监测系统-修改")
-    public AjaxResult update(@RequestBody MonitorSystem monitorSystem){
+    public AjaxResult update(@RequestBody MonitorSystem monitorSystem) {
         if (UserConstants.EXCEPTION.equals(monitorSystemService.checkSystemOnline(monitorSystem))) {
             return error("监测系统修改'" + monitorSystem.getClientId() + "'失败,该系统正在使用中,无法修改");
         }
@@ -120,15 +141,16 @@ public class MonitorSystemController extends BaseController {
 
     /**
      * 生成密钥
+     *
      * @param
      * @return
      */
     @Log(title = "监测系统-生成密钥", businessType = BusinessType.SELECT)
     @GetMapping("/getSecret")
     @ApiOperation(value = "监测系统-生成密钥")
-    public AjaxResult getSecret(){
+    public AjaxResult getSecret() {
         UUID id = UUID.randomUUID();
         String[] idd = id.toString().split("-");
-        return AjaxResult.success(idd[0]+idd[1]+idd[2]);
+        return AjaxResult.success(idd[0] + idd[1] + idd[2]);
     }
 }