fanxp 1 year ago
parent
commit
3ccb758351

+ 3 - 1
src/main/java/com/xjrsoft/module/liteflow/node/WfOaPullNode.java

@@ -1,6 +1,7 @@
 package com.xjrsoft.module.liteflow.node;
 
 import afu.org.checkerframework.checker.oigj.qual.O;
+import cn.hutool.core.convert.Convert;
 import com.xjrsoft.module.oa.service.IFileReceiveService;
 import com.xjrsoft.module.oa.service.IWfOaPullService;
 import com.yomahub.liteflow.core.NodeComponent;
@@ -23,7 +24,8 @@ public class WfOaPullNode extends NodeComponent {
     public void process() throws Exception {
         // 获取表单中数据编号
         Map<String, Object> params = this.getFirstContextBean();
-        Long formId = util.getFormDataId(params);
+        Object value = util.getFormDatKey(params,"id");
+        Long formId = Convert.toLong(value);
         if (formId != null) {
             // 数据处理
             fileReceiveService.pullDataCache(formId);

+ 3 - 1
src/main/java/com/xjrsoft/module/liteflow/node/WfOaPushNode.java

@@ -1,5 +1,6 @@
 package com.xjrsoft.module.liteflow.node;
 
+import cn.hutool.core.convert.Convert;
 import com.xjrsoft.module.oa.service.IFileReceiveService;
 import com.yomahub.liteflow.core.NodeComponent;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,7 +19,8 @@ public class WfOaPushNode extends NodeComponent {
     public void process() throws Exception {
         // 获取表单中数据编号
         Map<String, Object> params = this.getFirstContextBean();
-        Long formId = util.getFormDataId(params);
+        Object value = util.getFormDatKey(params,"id");
+        Long formId = Convert.toLong(value);
         if (formId != null) {
             // 数据处理
             fileReceiveService.pushDataCache(formId);

+ 2 - 3
src/main/java/com/xjrsoft/module/liteflow/node/util.java

@@ -10,11 +10,10 @@ public class util {
      *
      * @return
      */
-    public static Long getFormDataId(Map<String, Object> params) {
+    public static Object getFormDatKey(Map<String, Object> params,String key) {
         Map<String, Object> formData = getFormData(params);
         if (formData != null) {
-            Long id = (Long) formData.get("id");
-            return id;
+           return  formData.get(key);
         }
         return null;
     }

+ 50 - 4
src/main/java/com/xjrsoft/module/oa/controller/FileReceiveController.java

@@ -17,18 +17,23 @@ import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.authority.vo.DataAuthListVo;
 import com.xjrsoft.module.oa.dto.AddFileReceiveDto;
 import com.xjrsoft.module.oa.dto.FileReceivePullPageDto;
+import com.xjrsoft.module.oa.dto.FileReceivePushPageDto;
 import com.xjrsoft.module.oa.dto.UpdateFileReceiveDto;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 
 import com.xjrsoft.module.oa.entity.FileReceive;
 import com.xjrsoft.module.oa.entity.Message;
 import com.xjrsoft.module.oa.entity.WfOaPull;
+import com.xjrsoft.module.oa.entity.WfOaPush;
 import com.xjrsoft.module.oa.service.IFileReceiveService;
 
 import com.xjrsoft.module.oa.service.IWfOaPullService;
 import com.xjrsoft.module.oa.service.IWfOaPushService;
 import com.xjrsoft.module.oa.vo.FileReceivePullPageVo;
 import com.xjrsoft.module.oa.vo.FileReceivePullVo;
+import com.xjrsoft.module.oa.vo.FileReceivePushPageVo;
+import com.xjrsoft.module.oa.vo.FileReceivePushVo;
+import com.xjrsoft.module.organization.entity.Department;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.system.entity.File;
 import com.xjrsoft.module.system.service.IFileService;
@@ -63,7 +68,7 @@ public class FileReceiveController {
 
     private final IFileService fileService;
 
-    @GetMapping(value = "/pullpage")
+    @GetMapping(value = "/pull-page")
     @ApiOperation(value = "收文查询(分页)")
     @SaCheckPermission("filereceive:detail")
     public RT<PageOutput<FileReceivePullPageVo>> pullPage(@Valid FileReceivePullPageDto dto) {
@@ -73,7 +78,7 @@ public class FileReceiveController {
         MPJLambdaWrapper<FileReceive> queryWrapper = new MPJLambdaWrapper<>();
         queryWrapper
                 .innerJoin(WfOaPull.class, WfOaPull::getId, FileReceive::getDataId)
-                .leftJoin(XjrUser.class,XjrUser::getId,WfOaPull::getPersonName,ext -> ext.selectAs(XjrUser::getName, FileReceivePullPageVo::getUserName))
+                .leftJoin(User.class,User::getId,WfOaPull::getPersonName,ext -> ext.selectAs(User::getName, FileReceivePullPageVo::getUserNameCn))
                 .eq(FileReceive::getFileType, 2)
                 .eq(FileReceive::getReceiverUserId, userId)
                 .select(WfOaPull::getId)
@@ -84,13 +89,13 @@ public class FileReceiveController {
         return RT.ok(pageOutput);
     }
 
-    @GetMapping(value = "/pullinfo")
+    @GetMapping(value = "/pull-info")
     @ApiOperation(value = "根据id查询文件接收管理信息")
     @SaCheckPermission("filereceive:detail")
     public RT<FileReceivePullVo> pullInfo(@RequestParam Long id) {
         MPJLambdaWrapper<WfOaPull> queryWrapper = new MPJLambdaWrapper<>();
         queryWrapper
-                .leftJoin(XjrUser.class,XjrUser::getId,WfOaPull::getPersonName,ext -> ext.selectAs(XjrUser::getName, FileReceivePullPageVo::getUserName))
+                .leftJoin(User.class,User::getId,WfOaPull::getPersonName,ext -> ext.selectAs(User::getName, FileReceivePullVo::getUserNameCn))
                 .eq(WfOaPull::getId, id)
                 .select(WfOaPull::getId)
                 .select(WfOaPull.class, x -> VoToColumnUtil.fieldsToColumns(FileReceivePullVo.class).contains(x.getProperty()));
@@ -104,4 +109,45 @@ public class FileReceiveController {
         return RT.ok(BeanUtil.toBean(fileReceive, FileReceivePullVo.class));
     }
 
+    @GetMapping(value = "/push-page")
+    @ApiOperation(value = "发文查询(分页)")
+    @SaCheckPermission("filereceive:detail")
+    public RT<PageOutput<FileReceivePushPageVo>> pushPage(@Valid FileReceivePushPageDto dto) {
+        //获取用户id
+        Long userId =  StpUtil.getLoginIdAsLong();
+
+        MPJLambdaWrapper<FileReceive> queryWrapper = new MPJLambdaWrapper<>();
+        queryWrapper
+                .innerJoin(WfOaPush.class, WfOaPush::getId, FileReceive::getDataId)
+                .leftJoin(Department.class,Department::getId,WfOaPush::getUserName,ext -> ext.selectAs(Department::getName, FileReceivePushPageVo::getOrgName))
+                .eq(FileReceive::getFileType, 1)
+                .eq(FileReceive::getReceiverUserId, userId)
+                .select(WfOaPush::getId)
+                .select(WfOaPush.class, x -> VoToColumnUtil.fieldsToColumns(FileReceivePushPageVo.class).contains(x.getProperty()));
+
+        IPage<FileReceivePushPageVo> page = fileReceiveService.selectJoinListPage(ConventPage.getPage(dto),FileReceivePushPageVo.class, queryWrapper);
+        PageOutput<FileReceivePushPageVo> pageOutput = ConventPage.getPageOutput(page);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/push-info")
+    @ApiOperation(value = "根据id查询文件发送管理信息")
+    @SaCheckPermission("filereceive:detail")
+    public RT<FileReceivePushVo> pushInfo(@RequestParam Long id) {
+        MPJLambdaWrapper<WfOaPush> queryWrapper = new MPJLambdaWrapper<>();
+        queryWrapper
+                .leftJoin(Department.class,Department::getId,WfOaPush::getUserName, ext -> ext.selectAs(Department::getName, FileReceivePushVo::getOrgName))
+                .eq(WfOaPush::getId, id)
+                .select(WfOaPush::getId)
+                .select(WfOaPush.class, x -> VoToColumnUtil.fieldsToColumns(FileReceivePushVo.class).contains(x.getProperty()));
+
+        FileReceivePushVo fileReceive = wfOaPushService.selectJoinOne(FileReceivePushVo.class,queryWrapper);
+        if (fileReceive == null) {
+            return RT.error("找不到此数据!");
+        }
+        // 获取文件列表
+        fileReceive.setFileInfos(fileService.list(Wrappers.<File>query().lambda().eq(File::getFolderId,fileReceive.getFiles())));
+        return RT.ok(BeanUtil.toBean(fileReceive, FileReceivePushVo.class));
+    }
+
 }

+ 19 - 0
src/main/java/com/xjrsoft/module/oa/dto/FileReceivePushPageDto.java

@@ -0,0 +1,19 @@
+package com.xjrsoft.module.oa.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+/**
+* @title: 发文管理分页查询入参
+* @Author fanxp
+* @Date: 2023-11-03
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class FileReceivePushPageDto extends PageInput {
+
+
+}

+ 10 - 4
src/main/java/com/xjrsoft/module/oa/entity/WfOaPush.java

@@ -14,17 +14,18 @@ import java.time.LocalTime;
 import java.time.LocalDateTime;
 import java.math.BigDecimal;
 import java.util.List;
+import java.util.Date;
 
 
 /**
-* @title: 公文发
+* @title: 公文发
 * @Author fanxp
-* @Date: 2023-11-02
+* @Date: 2023-11-06
 * @Version 1.0
 */
 @Data
 @TableName("wf_oa_push")
-@ApiModel(value = "公文发布对象", description = "公文发布")
+@ApiModel(value = "公文发文对象", description = "公文发文")
 public class WfOaPush implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -109,7 +110,12 @@ public class WfOaPush implements Serializable {
     * 印发日期
     */
     @ApiModelProperty("印发日期")
-    private LocalDateTime dateOfIssue;
+    private Date dateOfIssue;
+    /**
+    * 附件
+    */
+    @ApiModelProperty("附件")
+    private String files;
     /**
     * 隐藏组件
     */

+ 1 - 1
src/main/java/com/xjrsoft/module/oa/vo/FileReceivePullPageVo.java

@@ -76,7 +76,7 @@ public class FileReceivePullPageVo {
      * 收文人
      */
     @ApiModelProperty("收文人")
-    private String userName;
+    private String userNameCn;
     /**
      * 公文附件
      */

+ 1 - 1
src/main/java/com/xjrsoft/module/oa/vo/FileReceivePullVo.java

@@ -77,7 +77,7 @@ public class FileReceivePullVo {
      * 收文人
      */
     @ApiModelProperty("收文人")
-    private String userName;
+    private String userNameCn;
     /**
      * 公文附件
      */

+ 105 - 0
src/main/java/com/xjrsoft/module/oa/vo/FileReceivePushPageVo.java

@@ -0,0 +1,105 @@
+package com.xjrsoft.module.oa.vo;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+/**
+* @title: 文件发送管理分页列表出参
+* @Author fanxp
+* @Date: 2023-11-03
+* @Version 1.0
+*/
+@Data
+public class FileReceivePushPageVo {
+    /**
+     *
+     */
+    @ApiModelProperty("")
+    @TableId
+    private Long id;
+    /**
+     * 发文名称
+     */
+    @ApiModelProperty("发文名称")
+    private String name;
+    /**
+     * 发文人
+     */
+    @ApiModelProperty("发文人")
+    private String userName;
+    /**
+     * 说明
+     */
+    @ApiModelProperty("说明")
+    private String remark;
+    /**
+     * 发文字号
+     */
+    @ApiModelProperty("发文字号")
+    private String number;
+    /**
+     * 拟稿人
+     */
+    @ApiModelProperty("拟稿人")
+    private String drafters;
+    /**
+     * 接收人
+     */
+    @ApiModelProperty("接收人")
+    private String recipients;
+    /**
+     * 发文单位意见
+     */
+    @ApiModelProperty("发文单位意见")
+    private String institution;
+    /**
+     * 会办单位意见
+     */
+    @ApiModelProperty("会办单位意见")
+    private String backOpinion;
+    /**
+     * 主题词
+     */
+    @ApiModelProperty("主题词")
+    private String tags;
+    /**
+     * 秘密等级
+     */
+    @ApiModelProperty("秘密等级")
+    private String secretLevel;
+    /**
+     * 保密期限
+     */
+    @ApiModelProperty("保密期限")
+    private String confidentialityPeriod;
+    /**
+     * 印发机关
+     */
+    @ApiModelProperty("印发机关")
+    private String issuingAuthority;
+    /**
+     * 紧急程度
+     */
+    @ApiModelProperty("紧急程度")
+    private String urgency;
+    /**
+     * 打印份数
+     */
+    @ApiModelProperty("打印份数")
+    private Double printNumber;
+    /**
+     * 印发日期
+     */
+    @ApiModelProperty("印发日期")
+    private LocalDateTime dateOfIssue;
+
+    /**
+     * 发文部门
+     */
+    @ApiModelProperty("发文部门")
+    private String orgName;
+
+}

+ 118 - 0
src/main/java/com/xjrsoft/module/oa/vo/FileReceivePushVo.java

@@ -0,0 +1,118 @@
+package com.xjrsoft.module.oa.vo;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.xjrsoft.module.system.entity.File;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+/**
+* @title: 文件发送管理表单出参
+* @Author fanxp
+* @Date: 2023-11-03
+* @Version 1.0
+*/
+@Data
+public class FileReceivePushVo {
+
+    /**
+     *
+     */
+    @ApiModelProperty("")
+    @TableId
+    private Long id;
+    /**
+     * 发文名称
+     */
+    @ApiModelProperty("发文名称")
+    private String name;
+    /**
+     * 发文人
+     */
+    @ApiModelProperty("发文人")
+    private String userName;
+    /**
+     * 说明
+     */
+    @ApiModelProperty("说明")
+    private String remark;
+    /**
+     * 发文字号
+     */
+    @ApiModelProperty("发文字号")
+    private String number;
+    /**
+     * 拟稿人
+     */
+    @ApiModelProperty("拟稿人")
+    private String drafters;
+    /**
+     * 接收人
+     */
+    @ApiModelProperty("接收人")
+    private String recipients;
+    /**
+     * 发文单位意见
+     */
+    @ApiModelProperty("发文单位意见")
+    private String institution;
+    /**
+     * 会办单位意见
+     */
+    @ApiModelProperty("会办单位意见")
+    private String backOpinion;
+    /**
+     * 主题词
+     */
+    @ApiModelProperty("主题词")
+    private String tags;
+    /**
+     * 秘密等级
+     */
+    @ApiModelProperty("秘密等级")
+    private String secretLevel;
+    /**
+     * 保密期限
+     */
+    @ApiModelProperty("保密期限")
+    private String confidentialityPeriod;
+    /**
+     * 印发机关
+     */
+    @ApiModelProperty("印发机关")
+    private String issuingAuthority;
+    /**
+     * 紧急程度
+     */
+    @ApiModelProperty("紧急程度")
+    private String urgency;
+    /**
+     * 打印份数
+     */
+    @ApiModelProperty("打印份数")
+    private Double printNumber;
+    /**
+     * 印发日期
+     */
+    @ApiModelProperty("印发日期")
+    private LocalDateTime dateOfIssue;
+    /**
+     * 附件
+     */
+    @ApiModelProperty("附件")
+    private String files;
+
+    /**
+     * 发文部门
+     */
+    @ApiModelProperty("发文部门")
+    private String orgName;
+
+    /**
+     * 公文附件列表
+     */
+    @ApiModelProperty("公文附件列表")
+    private List<File> fileInfos;
+}