package com.whyc.controller;
|
|
import com.whyc.dto.Response;
|
import com.whyc.pojo.BaoJiGroup;
|
import com.whyc.service.BaoJiGroupService;
|
import com.whyc.util.ActionUtil;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
import javax.swing.*;
|
import java.util.List;
|
|
@RestController
|
@RequestMapping("baoJiGroup")
|
@Api(tags = "用户管理-包机组")
|
public class BaoJiGroupController extends BaseController{
|
|
@Autowired
|
private BaoJiGroupService service;
|
|
@PostMapping
|
@ApiOperation(value = "新增")
|
public Response add(@RequestParam String groupName){
|
service.add(groupName);
|
return new Response().setII(1,"新增成功");
|
}
|
|
@PostMapping("update")
|
@ApiOperation(value = "修改")
|
public Response update(@RequestBody BaoJiGroup baoJiGroup){
|
service.update(baoJiGroup);
|
return new Response().setII(1,"修改成功");
|
}
|
|
@PostMapping("delete")
|
@ApiOperation(value = "删除")
|
public Response delete(@RequestParam long baoJiGroupId){
|
service.delete(baoJiGroupId);
|
return new Response().setII(1,"删除成功");
|
}
|
|
@GetMapping("list")
|
@ApiOperation(value = "包机组列表")
|
public Response<List<BaoJiGroup>> getBaoJiGroupList(){
|
List<BaoJiGroup> baoJiGroupList = service.getBaoJiGroup();
|
return new Response<List<BaoJiGroup>>().set(1,baoJiGroupList);
|
}
|
|
@PostMapping("dischargeFlag")
|
@ApiOperation("设置包机组标记,是否参与放电计划")
|
public Response updateDischargeFlag(@RequestParam Long baoJiGroupId,@RequestParam Integer flag){
|
return service.updateDischargeFlag(baoJiGroupId,flag);
|
}
|
|
@GetMapping("groupNameList")
|
@ApiOperation(value = "班组名列表")
|
public Response<List<BaoJiGroup>> getGroupNameList(){
|
List<BaoJiGroup> baoJiGroupList = service.getBaoJiGroupNameListByFlag(1);
|
return new Response<List<BaoJiGroup>>().set(1,baoJiGroupList);
|
}
|
|
@GetMapping("groupWithStationAndAlarmForScreen")
|
@ApiOperation(value = "大屏下的查询班组管理下的站点及告警")
|
public Response<List<BaoJiGroup>> getGroupWithStationAndAlarmForScreen(){
|
Long uId = ActionUtil.getUser().getUId();
|
return service.getGroupWithStationAndAlarmForScreen(uId.intValue());
|
}
|
|
@GetMapping("groupWithStationAndAlarm")
|
@ApiOperation(value = "查询班组管理下的站点及告警")
|
public Response<List<BaoJiGroup>> getGroupWithStationAndAlarm(){
|
Long uId = ActionUtil.getUser().getUId();
|
return service.getGroupWithStationAndAlarm(uId.intValue());
|
}
|
|
}
|