|
@@ -1,6 +1,5 @@
|
|
|
package com.zy.bms.controller;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.zy.bms.common.ServerResponse;
|
|
|
import com.zy.bms.entity.Group;
|
|
|
import com.zy.bms.pojo.io.GroupIO;
|
|
@@ -13,7 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
- * 项目组 前端控制器
|
|
|
+ * 设备组 前端控制器
|
|
|
*
|
|
|
* @author yangxiaokun
|
|
|
* @since 2021-06-03
|
|
@@ -21,11 +20,12 @@ import javax.annotation.Resource;
|
|
|
@RestController
|
|
|
@RequestMapping("/bms/api/operate/group")
|
|
|
public class GroupController {
|
|
|
+
|
|
|
@Resource
|
|
|
private IGroupService groupService;
|
|
|
|
|
|
|
|
|
- * 分页查询所有项目组
|
|
|
+ * 分页查询所有设备组
|
|
|
*/
|
|
|
@GetMapping("listPage.do")
|
|
|
public ServerResponse listPage(GroupIO io) {
|
|
@@ -33,38 +33,28 @@ public class GroupController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- * 添加项目组
|
|
|
+ * 查询所有的设备组
|
|
|
+ */
|
|
|
+ @GetMapping("listAll.do")
|
|
|
+ public ServerResponse listAll() {
|
|
|
+ return ServerResponse.success(groupService.getAllList());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 添加设备组
|
|
|
*/
|
|
|
@PostMapping("save.do")
|
|
|
public ServerResponse save(Group group) {
|
|
|
try {
|
|
|
groupService.save(group);
|
|
|
} catch (Exception e) {
|
|
|
- return ServerResponse.warning("项目组编号重复!");
|
|
|
+ return ServerResponse.warning("设备组编号重复!");
|
|
|
}
|
|
|
return ServerResponse.success();
|
|
|
}
|
|
|
|
|
|
|
|
|
- * 禁用项目组
|
|
|
- */
|
|
|
- @GetMapping("forbidden.do")
|
|
|
- public ServerResponse forbidden(Integer id) {
|
|
|
- groupService.update(new UpdateWrapper<Group>().set("status", 0).eq("id", id));
|
|
|
- return ServerResponse.success();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * 启用项目组
|
|
|
- */
|
|
|
- @GetMapping("permit.do")
|
|
|
- public ServerResponse permit(Integer id) {
|
|
|
- groupService.update(new UpdateWrapper<Group>().set("status", 1).eq("id", id));
|
|
|
- return ServerResponse.success();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * 更新项目组信息
|
|
|
+ * 修改设备组信息
|
|
|
*/
|
|
|
@PostMapping("update.do")
|
|
|
public ServerResponse update(Group group) {
|