#update
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.maibu.core.controller.BaseController;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.domain.map.SiteMapInfo;
|
||||
import com.maibu.service.SiteMapInfoService;
|
||||
|
||||
/**
|
||||
* 区域/场站
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/siteMapInfo")
|
||||
public class SiteMapInfoController extends BaseController {
|
||||
@Autowired
|
||||
private SiteMapInfoService siteMapInfoService;
|
||||
|
||||
/**
|
||||
* 新增或者修改组织
|
||||
*/
|
||||
|
||||
@PostMapping("/save")
|
||||
public AjaxResult save(@RequestBody SiteMapInfo siteMapInfo) {
|
||||
try {
|
||||
return AjaxResult.success(siteMapInfoService.save(siteMapInfo));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("新增修改场站出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询场站详情
|
||||
*/
|
||||
|
||||
@GetMapping("/selectById")
|
||||
public AjaxResult selectById(@RequestParam Long id) {
|
||||
try {
|
||||
return AjaxResult.success(siteMapInfoService.selectById(id));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("查询场站详情出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询组织下所有的区域场站
|
||||
*/
|
||||
|
||||
@GetMapping("/selectBySiteId")
|
||||
public AjaxResult selectBySiteId(@RequestParam Long siteId) {
|
||||
try {
|
||||
return AjaxResult.success(siteMapInfoService.selectBySiteId(siteId));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("查询组织下所有场站出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +1,19 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.maibu.core.controller.BaseController;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.domain.entity.SysRegion;
|
||||
import com.maibu.core.domain.entity.SysSite;
|
||||
import com.maibu.core.page.TableDataInfo;
|
||||
import com.maibu.service.SysRegionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 区域/场站
|
||||
@@ -23,20 +26,6 @@ public class SysRegionController extends BaseController {
|
||||
@Autowired
|
||||
private SysRegionService sysRegionService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询组织列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysRegion region) {
|
||||
try {
|
||||
startPage();
|
||||
return getDataTable(sysRegionService.list(region));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或者修改组织
|
||||
*/
|
||||
@@ -81,9 +70,9 @@ public class SysRegionController extends BaseController {
|
||||
*/
|
||||
|
||||
@GetMapping("/selectBySiteId")
|
||||
public AjaxResult selectBySiteId(@RequestParam Long id) {
|
||||
public AjaxResult selectBySiteId(@RequestParam Long siteId) {
|
||||
try {
|
||||
return AjaxResult.success(sysRegionService.selectBySiteId(id));
|
||||
return AjaxResult.success(sysRegionService.selectBySiteId(siteId));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user