|
|
@@ -0,0 +1,118 @@
|
|
|
+package com.xjrsoft.module.oa.controller;
|
|
|
+
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import cn.dev33.satoken.stp.StpUtil;
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.xjrsoft.common.annotation.XjrLog;
|
|
|
+import com.xjrsoft.common.enums.DeleteMark;
|
|
|
+import com.xjrsoft.common.model.result.RT;
|
|
|
+import com.xjrsoft.common.page.ConventPage;
|
|
|
+import com.xjrsoft.common.page.PageOutput;
|
|
|
+import com.xjrsoft.module.oa.dto.AddOfficialDocumentReceivedHandleDto;
|
|
|
+import com.xjrsoft.module.oa.dto.OfficialDocumentReceivedHandlePageDto;
|
|
|
+import com.xjrsoft.module.oa.dto.AddOfficialDocumentReceivedHandleAlertSetDto;
|
|
|
+import com.xjrsoft.module.oa.entity.OfficialDocumentReceivedHandle;
|
|
|
+import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedHandleService;
|
|
|
+import com.xjrsoft.module.oa.vo.LastOfficialDocumentReceivedHandleAlertVo;
|
|
|
+import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedHandlePageVo;
|
|
|
+import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedHandleVo;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+* @title: 公文收文-承办表
|
|
|
+* @Author dzx
|
|
|
+* @Date: 2025-04-14
|
|
|
+* @Version 1.0
|
|
|
+*/
|
|
|
+@RestController
|
|
|
+@RequestMapping("/oa" + "/officialDocumentReceivedHandle")
|
|
|
+@Api(value = "/oa" + "/officialDocumentReceivedHandle",tags = "公文收文-承办表代码")
|
|
|
+@AllArgsConstructor
|
|
|
+public class OfficialDocumentReceivedHandleController {
|
|
|
+
|
|
|
+ private final IOfficialDocumentReceivedHandleService officialDocumentReceivedHandleService;
|
|
|
+
|
|
|
+ @GetMapping(value = "/page")
|
|
|
+ @ApiOperation(value="公文收文-承办表列表(分页)")
|
|
|
+ @SaCheckPermission("officialdocumentreceivedhandle:detail")
|
|
|
+ @XjrLog(value = "公文收文-承办表列表(分页)")
|
|
|
+ public RT<PageOutput<OfficialDocumentReceivedHandlePageVo>> page(@Valid OfficialDocumentReceivedHandlePageDto dto){
|
|
|
+ Page<OfficialDocumentReceivedHandlePageVo> page = officialDocumentReceivedHandleService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
+ PageOutput<OfficialDocumentReceivedHandlePageVo> pageOutput = ConventPage.getPageOutput(page, OfficialDocumentReceivedHandlePageVo.class);
|
|
|
+ return RT.ok(pageOutput);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/info")
|
|
|
+ @ApiOperation(value="根据id查询公文收文-承办表信息")
|
|
|
+ @SaCheckPermission("officialdocumentreceivedhandle:detail")
|
|
|
+ @XjrLog(value = "根据id查询公文收文-承办表信息")
|
|
|
+ public RT<OfficialDocumentReceivedHandleVo> info(@RequestParam Long id){
|
|
|
+ OfficialDocumentReceivedHandle officialDocumentReceivedHandle = officialDocumentReceivedHandleService.getById(id);
|
|
|
+ if (officialDocumentReceivedHandle == null) {
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
+ }
|
|
|
+ return RT.ok(BeanUtil.toBean(officialDocumentReceivedHandle, OfficialDocumentReceivedHandleVo.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value = "last-alert-time")
|
|
|
+ @ApiOperation(value = "新增公文收文-承办表-最新提醒时间")
|
|
|
+ @SaCheckPermission("officialdocumentreceivedhandle:add")
|
|
|
+ @XjrLog(value = "新增公文收文-承办表-最新提醒时间")
|
|
|
+ public RT<LastOfficialDocumentReceivedHandleAlertVo> lastAlertTime(@RequestParam Long id){
|
|
|
+ List<OfficialDocumentReceivedHandle> list = officialDocumentReceivedHandleService.list(
|
|
|
+ new QueryWrapper<OfficialDocumentReceivedHandle>().lambda()
|
|
|
+ .eq(OfficialDocumentReceivedHandle::getDeleteMark, DeleteMark.NODELETE.getCode())
|
|
|
+ .eq(OfficialDocumentReceivedHandle::getIsTransfer, 0)
|
|
|
+ .eq(OfficialDocumentReceivedHandle::getOfficialDocumentReceivedId, id)
|
|
|
+ .eq(OfficialDocumentReceivedHandle::getReceiveUserId, StpUtil.getLoginIdAsLong())
|
|
|
+ .orderByDesc(OfficialDocumentReceivedHandle::getId)
|
|
|
+
|
|
|
+ );
|
|
|
+ if(!list.isEmpty()){
|
|
|
+ OfficialDocumentReceivedHandle receivedHandle = list.get(0);
|
|
|
+ LastOfficialDocumentReceivedHandleAlertVo alertVo = BeanUtil.toBean(receivedHandle, LastOfficialDocumentReceivedHandleAlertVo.class);
|
|
|
+ alertVo.setId(receivedHandle.getOfficialDocumentReceivedId());
|
|
|
+ return RT.ok(alertVo);
|
|
|
+ }
|
|
|
+ return RT.ok(new LastOfficialDocumentReceivedHandleAlertVo());
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value = "alert-set")
|
|
|
+ @ApiOperation(value = "新增公文收文-承办表-提醒设置")
|
|
|
+ @SaCheckPermission("officialdocumentreceivedhandle:add")
|
|
|
+ @XjrLog(value = "新增公文收文-承办表-提醒设置")
|
|
|
+ public RT<Boolean> alertSet(@Valid @RequestBody AddOfficialDocumentReceivedHandleAlertSetDto dto){
|
|
|
+ return RT.ok(officialDocumentReceivedHandleService.addAlertTime(dto));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping(value = "handle")
|
|
|
+ @ApiOperation(value = "新增公文收文-承办表-处理")
|
|
|
+ @SaCheckPermission("officialdocumentreceivedhandle:add")
|
|
|
+ @XjrLog(value = "新增公文收文-承办表-处理")
|
|
|
+ public RT<Boolean> handle(@Valid @RequestBody AddOfficialDocumentReceivedHandleDto dto){
|
|
|
+ return RT.ok(officialDocumentReceivedHandleService.handle(dto));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value = "transfer")
|
|
|
+ @ApiOperation(value = "新增公文收文-承办表-转办")
|
|
|
+ @SaCheckPermission("officialdocumentreceivedhandle:add")
|
|
|
+ @XjrLog(value = "新增公文收文-承办表-转办")
|
|
|
+ public RT<Boolean> transfer(@Valid @RequestBody AddOfficialDocumentReceivedHandleDto dto){
|
|
|
+ return RT.ok(officialDocumentReceivedHandleService.transfer(dto));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|