|
@@ -2,6 +2,7 @@ package com.zy.bms.controller.pc;
|
|
|
|
|
|
import com.zy.bms.common.ServerResponse;
|
|
|
import com.zy.bms.common.io.pc.GroupIO;
|
|
|
+import com.zy.bms.model.Group;
|
|
|
import com.zy.bms.service.IGroupService;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -24,11 +25,47 @@ public class GroupController {
|
|
|
private IGroupService groupService;
|
|
|
|
|
|
/**
|
|
|
- * 分页查询所有项目
|
|
|
+ * 分页查询所有项目组
|
|
|
*/
|
|
|
@PostMapping("listPage")
|
|
|
public ServerResponse listPage(GroupIO io) {
|
|
|
return ServerResponse.createBySuccess(groupService.listPage(io));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 添加项目组
|
|
|
+ */
|
|
|
+ @PostMapping("save.do")
|
|
|
+ public ServerResponse save(Group group) {
|
|
|
+ if (groupService.checkRepeat(group.getCode())) return ServerResponse.createByWarning("添加失败:项目组编号重复");
|
|
|
+ return ServerResponse.createBySuccess(groupService.save(group));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 禁用项目组
|
|
|
+ */
|
|
|
+ @PostMapping("forbidden.do")
|
|
|
+ public ServerResponse forbidden(Integer id) {
|
|
|
+ groupService.updateStatus(id, 0);
|
|
|
+ return ServerResponse.createBySuccess();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 启用项目组
|
|
|
+ */
|
|
|
+ @PostMapping("permit.do")
|
|
|
+ public ServerResponse permit(Integer id) {
|
|
|
+ groupService.updateStatus(id, 1);
|
|
|
+ return ServerResponse.createBySuccess();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新项目组信息
|
|
|
+ */
|
|
|
+ @PostMapping("update.do")
|
|
|
+ public ServerResponse update(Group group) {
|
|
|
+ groupService.updateById(group);
|
|
|
+ return ServerResponse.createBySuccess();
|
|
|
+ }
|
|
|
+
|
|
|
}
|