zf
2023-08-30 9ca0dc6e7833715b875cc9b6b91d5c497b2bae8b
src/main/java/com/gk/hotwork/Controller/SafetySelfInspectionController.java
@@ -4,10 +4,12 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gk.hotwork.Controller.Base.BaseController;
import com.gk.hotwork.Domain.AttachmentInfo;
import com.gk.hotwork.Domain.SafetySelfInspection;
import com.gk.hotwork.Domain.SafetySelfInspectionItem;
import com.gk.hotwork.Domain.Utils.FilterObject;
import com.gk.hotwork.Domain.Utils.Msg;
import com.gk.hotwork.Domain.dto.resp.SafetySelfInspectionRespDTO;
import com.gk.hotwork.Service.SafetySelfInspectionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -19,6 +21,8 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(tags = "安全生产标准化_自查清单")
@RestController
@@ -28,8 +32,26 @@
    @Autowired
    private SafetySelfInspectionService safetySelfInspectionService;
    @ApiOperation("分页")
    @ApiOperation("自排查分页")
    @PostMapping("/page")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageIndex",value = "当前页码"),
            @ApiImplicitParam(name = "pageSize",value = "每页行数"),
            @ApiImplicitParam(name = "inspectionName",value = "自查清单名称"),
            @ApiImplicitParam(name = "inspectorName",value = "检查人名称"),
            @ApiImplicitParam(name = "checkedCompanyName",value = "被检查公司名称"),
            @ApiImplicitParam(name = "inspectionStartTime",value = "开始时间"),
            @ApiImplicitParam(name = "inspectionEndTime",value = "结束时间"),
            @ApiImplicitParam(name = "status",value = "状态"),
    })
    public Msg selectPage(@RequestBody FilterObject filterObject) {
        Integer pageIndex = filterObject.getPageIndex();
        Integer pageSize = filterObject.getPageSize();
        IPage page = safetySelfInspectionService.selectPage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser());
        return success(page);
    }
    @ApiOperation("监管排查分页")
    @PostMapping("/supervise/page")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageIndex",value = "当前页码"),
            @ApiImplicitParam(name = "pageSize",value = "每页行数"),
@@ -40,10 +62,10 @@
            @ApiImplicitParam(name = "inspectionEndTime",value = "结束时间"),
            @ApiImplicitParam(name = "status",value = "状态"),
    })
    public Msg selectPage(@RequestBody FilterObject filterObject) {
    public Msg selectSupervisePage(@RequestBody FilterObject filterObject) {
        Integer pageIndex = filterObject.getPageIndex();
        Integer pageSize = filterObject.getPageSize();
        IPage page = safetySelfInspectionService.selectPage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser());
        IPage page = safetySelfInspectionService.selectSupervisePage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser());
        return success(page);
    }
@@ -56,7 +78,7 @@
    public Msg info(@RequestBody JSONObject jsonObject) {
        Long id = jsonObject.getLong("id");
        String unqualified = jsonObject.getString("unqualified");
        SafetySelfInspection safetySelfInspection= safetySelfInspectionService.infoOne(id,unqualified,getUser());
        SafetySelfInspectionRespDTO safetySelfInspection= safetySelfInspectionService.infoOne(id,unqualified,getUser());
        return success(safetySelfInspection);
    }
@@ -96,6 +118,24 @@
        safetySelfInspectionService.modItemInfo(param, getUser());
        return success();
    }
    @ApiOperation("/添加专家")
    @PostMapping("/add/item/expert")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "itemList",value = "检查项集合"),
    })
    public Msg addItemExpert(@RequestBody List<SafetySelfInspectionItem> itemList) {
        safetySelfInspectionService.addItemExpert(itemList, getUser());
        return success();
    }
    @ApiOperation("/添加检查清单附件")
    @PostMapping("/add/check/attachment")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attachmentList",value = "附件集合"),
    })
    public Msg addCheckAttachment(@RequestBody List<AttachmentInfo> attachmentList) {
        safetySelfInspectionService.addCheckAttachment(attachmentList, getUser());
        return success();
    }
    @ApiOperation("/新增")
@@ -108,11 +148,29 @@
            @ApiImplicitParam(name = "inspectionTime",value = "检查时间"),
            @ApiImplicitParam(name = "status",value = "状态"),
            @ApiImplicitParam(name = "itemList",value = "检查项集合"),
            @ApiImplicitParam(name = "elementAList",value = "一级要素id"),
    })
    public Msg add(@RequestBody SafetySelfInspection param) {
        safetySelfInspectionService.addOne(param, getUser());
        return success();
    }
    @ApiOperation("/新增监管排查")
    @PostMapping("/add/supervise")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "inspectionName",value = "排查清单名称"),
            @ApiImplicitParam(name = "checkedCompanyId",value = "被检查公司id"),
            @ApiImplicitParam(name = "checkedCompanyName",value = "被检查公司"),
            @ApiImplicitParam(name = "inspectionTime",value = "检查时间"),
            @ApiImplicitParam(name = "status",value = "状态"),
            @ApiImplicitParam(name = "itemList",value = "检查项集合"),
            @ApiImplicitParam(name = "elementAList",value = "一级要素id"),
            @ApiImplicitParam(name = "expertList",value = "专家用户id"),
    })
    public Msg addSupervise(@RequestBody SafetySelfInspection param) {
        safetySelfInspectionService.addSupervise(param, getUser());
        return success();
    }
    @ApiOperation("/修改")
    @PostMapping("/mod")