whyclxw
2024-04-28 b25b814a949d2065a61fd3167206ffb51a57af65
src/main/java/com/whyc/controller/BaoJiGroupController.java
@@ -3,18 +3,20 @@
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 {
@Api(tags = "用户管理-包机组")
public class BaoJiGroupController extends BaseController{
    @Autowired
    private BaoJiGroupService service;
@@ -26,14 +28,14 @@
        return new Response().setII(1,"新增成功");
    }
    @PutMapping
    @PostMapping("update")
    @ApiOperation(value = "修改")
    public Response update(@RequestBody BaoJiGroup baoJiGroup){
        service.update(baoJiGroup);
        return new Response().setII(1,"修改成功");
    }
    @DeleteMapping
    @PostMapping("delete")
    @ApiOperation(value = "删除")
    public Response delete(@RequestParam long baoJiGroupId){
        service.delete(baoJiGroupId);
@@ -47,4 +49,31 @@
        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());
    }
}