#update
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* 区域/场站
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/region")
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或者修改组织
|
||||
*/
|
||||
|
||||
@PostMapping("/save")
|
||||
public AjaxResult save(@RequestBody SysRegion region) {
|
||||
try {
|
||||
return AjaxResult.success(sysRegionService.save(region));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除组织
|
||||
*/
|
||||
|
||||
@PostMapping("/delete")
|
||||
public AjaxResult delete(@RequestBody List<Long> ids) {
|
||||
try {
|
||||
return AjaxResult.success(sysRegionService.delete(ids));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询场站详情
|
||||
*/
|
||||
|
||||
@GetMapping("/selectById")
|
||||
public AjaxResult selectById(@RequestParam Long id) {
|
||||
try {
|
||||
return AjaxResult.success(sysRegionService.selectById(id));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询组织下所有的区域场站
|
||||
*/
|
||||
|
||||
@GetMapping("/selectBySiteId")
|
||||
public AjaxResult selectBySiteId(@RequestParam Long id) {
|
||||
try {
|
||||
return AjaxResult.success(sysRegionService.selectBySiteId(id));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user