|
|
@@ -1,27 +1,28 @@
|
|
|
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.UpdateOfficialDocumentReceivedHandleDto;
|
|
|
+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.service.IOfficialDocumentReceivedService;
|
|
|
+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.DeleteMapping;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.PutMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
@@ -66,35 +67,52 @@ public class OfficialDocumentReceivedHandleController {
|
|
|
return RT.ok(BeanUtil.toBean(officialDocumentReceivedHandle, OfficialDocumentReceivedHandleVo.class));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- @PostMapping
|
|
|
- @ApiOperation(value = "新增公文收文-承办表")
|
|
|
+ @PostMapping(value = "last-alert-time")
|
|
|
+ @ApiOperation(value = "新增公文收文-承办表-最新提醒时间")
|
|
|
@SaCheckPermission("officialdocumentreceivedhandle:add")
|
|
|
- @XjrLog(value = "新增公文收文-承办表")
|
|
|
- public RT<Boolean> add(@Valid @RequestBody AddOfficialDocumentReceivedHandleDto dto){
|
|
|
- OfficialDocumentReceivedHandle officialDocumentReceivedHandle = BeanUtil.toBean(dto, OfficialDocumentReceivedHandle.class);
|
|
|
- boolean isSuccess = officialDocumentReceivedHandleService.save(officialDocumentReceivedHandle);
|
|
|
- return RT.ok(isSuccess);
|
|
|
+ @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());
|
|
|
}
|
|
|
|
|
|
- @PutMapping
|
|
|
- @ApiOperation(value = "修改公文收文-承办表")
|
|
|
- @SaCheckPermission("officialdocumentreceivedhandle:edit")
|
|
|
- @XjrLog(value = "修改公文收文-承办表")
|
|
|
- public RT<Boolean> update(@Valid @RequestBody UpdateOfficialDocumentReceivedHandleDto dto){
|
|
|
+ @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));
|
|
|
+ }
|
|
|
|
|
|
- OfficialDocumentReceivedHandle officialDocumentReceivedHandle = BeanUtil.toBean(dto, OfficialDocumentReceivedHandle.class);
|
|
|
- return RT.ok(officialDocumentReceivedHandleService.updateById(officialDocumentReceivedHandle));
|
|
|
|
|
|
+ @PostMapping(value = "handle")
|
|
|
+ @ApiOperation(value = "新增公文收文-承办表-处理")
|
|
|
+ @SaCheckPermission("officialdocumentreceivedhandle:add")
|
|
|
+ @XjrLog(value = "新增公文收文-承办表-处理")
|
|
|
+ public RT<Boolean> handle(@Valid @RequestBody AddOfficialDocumentReceivedHandleDto dto){
|
|
|
+ return RT.ok(officialDocumentReceivedHandleService.handle(dto));
|
|
|
}
|
|
|
|
|
|
- @DeleteMapping
|
|
|
- @ApiOperation(value = "删除公文收文-承办表")
|
|
|
- @SaCheckPermission("officialdocumentreceivedhandle:delete")
|
|
|
- @XjrLog(value = "删除公文收文-承办表")
|
|
|
- public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
- return RT.ok(officialDocumentReceivedHandleService.removeBatchByIds(ids));
|
|
|
-
|
|
|
+ @PostMapping(value = "transfer")
|
|
|
+ @ApiOperation(value = "新增公文收文-承办表-转办")
|
|
|
+ @SaCheckPermission("officialdocumentreceivedhandle:add")
|
|
|
+ @XjrLog(value = "新增公文收文-承办表-转办")
|
|
|
+ public RT<Boolean> transfer(@Valid @RequestBody AddOfficialDocumentReceivedHandleDto dto){
|
|
|
+ return RT.ok(officialDocumentReceivedHandleService.transfer(dto));
|
|
|
}
|
|
|
|
|
|
}
|