|
|
@@ -0,0 +1,120 @@
|
|
|
+package com.xjrsoft.module.oa.controller;
|
|
|
+
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
+import com.xjrsoft.common.annotation.XjrLog;
|
|
|
+import com.xjrsoft.common.model.result.RT;
|
|
|
+import com.xjrsoft.common.page.ConventPage;
|
|
|
+import com.xjrsoft.common.page.PageOutput;
|
|
|
+import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
+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.entity.OfficialDocumentReceived;
|
|
|
+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.OfficialDocumentReceivedHandlePageVo;
|
|
|
+import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedHandleVo;
|
|
|
+import com.xjrsoft.module.workflow.entity.WorkflowFormRelation;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.camunda.bpm.engine.history.HistoricProcessInstance;
|
|
|
+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;
|
|
|
+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 IOfficialDocumentReceivedService officialDocumentReceivedService;
|
|
|
+ private final IOfficialDocumentReceivedHandleService officialDocumentReceivedHandleService;
|
|
|
+
|
|
|
+ @GetMapping(value = "/page")
|
|
|
+ @ApiOperation(value="公文收文-承办表列表(分页)")
|
|
|
+ @SaCheckPermission("officialdocumentreceivedhandle:detail")
|
|
|
+ @XjrLog(value = "公文收文-承办表列表(分页)")
|
|
|
+ public RT<PageOutput<OfficialDocumentReceivedHandlePageVo>> page(@Valid OfficialDocumentReceivedHandlePageDto dto){
|
|
|
+
|
|
|
+ MPJLambdaWrapper<OfficialDocumentReceived> queryWrapper = new MPJLambdaWrapper<>();
|
|
|
+ queryWrapper
|
|
|
+ .select(OfficialDocumentReceived::getId)
|
|
|
+ .select(OfficialDocumentReceived.class,x -> VoToColumnUtil.fieldsToColumns(OfficialDocumentReceived.class).contains(x.getProperty()))
|
|
|
+ .innerJoin(WorkflowFormRelation.class, WorkflowFormRelation::getFormKeyValue, OfficialDocumentReceived::getId)
|
|
|
+ .eq(WorkflowFormRelation::getCurrentState, HistoricProcessInstance.STATE_COMPLETED)
|
|
|
+ .eq(StrUtil.isNotEmpty(dto.getReceivedType()), OfficialDocumentReceived::getReceivedType, dto.getReceivedType())
|
|
|
+ .like(StrUtil.isNotEmpty(dto.getReceivedTitle()), OfficialDocumentReceived::getReceivedTitle, dto.getReceivedTitle())
|
|
|
+ .eq(ObjectUtil.isNotNull(dto.getIsHandle()), OfficialDocumentReceived::getIsHandle, dto.getIsHandle())
|
|
|
+ .eq(ObjectUtil.isNotNull(dto.getIsHandle()), OfficialDocumentReceived::getIsHandle, dto.getIsHandle())
|
|
|
+ .orderByDesc(OfficialDocumentReceived::getId);
|
|
|
+ IPage<OfficialDocumentReceived> page = officialDocumentReceivedService.page(ConventPage.getPage(dto), queryWrapper);
|
|
|
+ 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
|
|
|
+ @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);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation(value = "修改公文收文-承办表")
|
|
|
+ @SaCheckPermission("officialdocumentreceivedhandle:edit")
|
|
|
+ @XjrLog(value = "修改公文收文-承办表")
|
|
|
+ public RT<Boolean> update(@Valid @RequestBody UpdateOfficialDocumentReceivedHandleDto dto){
|
|
|
+
|
|
|
+ OfficialDocumentReceivedHandle officialDocumentReceivedHandle = BeanUtil.toBean(dto, OfficialDocumentReceivedHandle.class);
|
|
|
+ return RT.ok(officialDocumentReceivedHandleService.updateById(officialDocumentReceivedHandle));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping
|
|
|
+ @ApiOperation(value = "删除公文收文-承办表")
|
|
|
+ @SaCheckPermission("officialdocumentreceivedhandle:delete")
|
|
|
+ @XjrLog(value = "删除公文收文-承办表")
|
|
|
+ public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
+ return RT.ok(officialDocumentReceivedHandleService.removeBatchByIds(ids));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|