Ver Fonte

收文文号自动生成
压缩包下载中文名乱码

大数据与最优化研究所 há 1 ano atrás
pai
commit
5a273e73de

+ 31 - 0
src/main/java/com/xjrsoft/module/liteflow/node/OfficialDocumentReceivedNode.java

@@ -0,0 +1,31 @@
+package com.xjrsoft.module.liteflow.node;
+
+import cn.hutool.core.convert.Convert;
+import com.xjrsoft.module.ledger.service.IWfSubscriptionService;
+import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedService;
+import com.yomahub.liteflow.core.NodeComponent;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+/**
+ * 收文文号
+ */
+@Component("official_document_received_node")
+public class OfficialDocumentReceivedNode extends NodeComponent {
+    @Autowired
+    private IOfficialDocumentReceivedService officialDocumentReceivedService;
+
+    @Override
+    public void process() throws Exception {
+        // 获取表单中数据编号
+        Map<String, Object> params = this.getFirstContextBean();
+        Object value = util.getFormDatKey(params,"id");
+        Long formId = Convert.toLong(value);
+        if (formId != null) {
+            // 数据处理
+            officialDocumentReceivedService.dataHandle(formId);
+        }
+    }
+}

+ 1 - 6
src/main/java/com/xjrsoft/module/material/controller/MaterialTaskController.java

@@ -71,15 +71,10 @@ import java.util.List;
 @Api(value = "/material"  + "/materialtask",tags = "材料提交任务代码")
 @AllArgsConstructor
 public class MaterialTaskController {
-
-
     private final IMaterialTaskService materialTaskService;
 
-
     private final IMaterialTaskAssignService materialTaskAssignService;
 
-    private  final IMaterialTaskAppendixService materialTaskAppendixService;
-
     @GetMapping(value = "/page")
     @ApiOperation(value = "材料提交任务列表(分页 我发布的)")
     @SaCheckPermission("materialtask:detail")
@@ -155,7 +150,7 @@ public class MaterialTaskController {
     public RT<Long> add(@Valid @RequestBody AddMaterialTaskDto dto) {
         Long materialTaskId = materialTaskService.add(dto);
         //当返回了id表示成功添加了且需要发送通知
-        if(materialTaskId != null && materialTaskId > 0 && dto.getSendMessage() == 1){;
+        if(materialTaskId != null && materialTaskId > 0 && dto.getSendMessage() != null && dto.getSendMessage() == 1){;
             materialTaskService.sendMessage(materialTaskId);
         }
 

+ 102 - 0
src/main/java/com/xjrsoft/module/oa/controller/OfficialDocumentReceivedController.java

@@ -0,0 +1,102 @@
+package com.xjrsoft.module.oa.controller;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.xjrsoft.common.constant.GlobalConstant;
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.xjrsoft.common.page.ConventPage;
+import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.oa.dto.AddOfficialDocumentReceivedDto;
+import com.xjrsoft.module.oa.dto.UpdateOfficialDocumentReceivedDto;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+import com.xjrsoft.module.oa.dto.OfficialDocumentReceivedPageDto;
+import com.xjrsoft.module.oa.entity.OfficialDocumentReceived;
+import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedService;
+import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedPageVo;
+
+import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+* @title: 公文收文
+* @Author szs
+* @Date: 2024-03-13
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/oa" + "/officialDocumentReceived")
+@Api(value = "/oa"  + "/officialDocumentReceived",tags = "公文收文代码")
+@AllArgsConstructor
+public class OfficialDocumentReceivedController {
+
+
+    private final IOfficialDocumentReceivedService officialDocumentReceivedService;
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="公文收文列表(分页)")
+    @SaCheckPermission("officialdocumentreceived:detail")
+    public RT<PageOutput<OfficialDocumentReceivedPageVo>> page(@Valid OfficialDocumentReceivedPageDto dto){
+
+        LambdaQueryWrapper<OfficialDocumentReceived> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper
+                    .orderByDesc(OfficialDocumentReceived::getId)
+                .select(OfficialDocumentReceived.class,x -> VoToColumnUtil.fieldsToColumns(OfficialDocumentReceivedPageVo.class).contains(x.getProperty()));
+        IPage<OfficialDocumentReceived> page = officialDocumentReceivedService.page(ConventPage.getPage(dto), queryWrapper);
+        PageOutput<OfficialDocumentReceivedPageVo> pageOutput = ConventPage.getPageOutput(page, OfficialDocumentReceivedPageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/info")
+    @ApiOperation(value="根据id查询公文收文信息")
+    @SaCheckPermission("officialdocumentreceived:detail")
+    public RT<OfficialDocumentReceivedVo> info(@RequestParam Long id){
+        OfficialDocumentReceived officialDocumentReceived = officialDocumentReceivedService.getById(id);
+        if (officialDocumentReceived == null) {
+           return RT.error("找不到此数据!");
+        }
+        return RT.ok(BeanUtil.toBean(officialDocumentReceived, OfficialDocumentReceivedVo.class));
+    }
+
+
+    @PostMapping
+    @ApiOperation(value = "新增公文收文")
+    @SaCheckPermission("officialdocumentreceived:add")
+    public RT<Boolean> add(@Valid @RequestBody AddOfficialDocumentReceivedDto dto){
+        OfficialDocumentReceived officialDocumentReceived = BeanUtil.toBean(dto, OfficialDocumentReceived.class);
+        boolean isSuccess = officialDocumentReceivedService.save(officialDocumentReceived);
+    return RT.ok(isSuccess);
+    }
+
+    @PutMapping
+    @ApiOperation(value = "修改公文收文")
+    @SaCheckPermission("officialdocumentreceived:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateOfficialDocumentReceivedDto dto){
+
+        OfficialDocumentReceived officialDocumentReceived = BeanUtil.toBean(dto, OfficialDocumentReceived.class);
+        return RT.ok(officialDocumentReceivedService.updateById(officialDocumentReceived));
+
+    }
+
+    @DeleteMapping
+    @ApiOperation(value = "删除公文收文")
+    @SaCheckPermission("officialdocumentreceived:delete")
+    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
+        return RT.ok(officialDocumentReceivedService.removeBatchByIds(ids));
+
+    }
+
+}

+ 83 - 0
src/main/java/com/xjrsoft/module/oa/dto/AddOfficialDocumentReceivedDto.java

@@ -0,0 +1,83 @@
+package com.xjrsoft.module.oa.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+
+
+/**
+* @title: 公文收文
+* @Author szs
+* @Date: 2024-03-13
+* @Version 1.0
+*/
+@Data
+public class AddOfficialDocumentReceivedDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 收文标题
+    */
+    @ApiModelProperty("收文标题")
+    private String receivedTitle;
+    /**
+    * 收文文号
+    */
+    @ApiModelProperty("收文文号")
+    private String receivedNumber;
+    /**
+    * 收文时间
+    */
+    @ApiModelProperty("收文时间")
+    private Date receivedDate;
+    /**
+    * 来文机构
+    */
+    @ApiModelProperty("来文机构")
+    private String communicationOrg;
+    /**
+    * 来文文号
+    */
+    @ApiModelProperty("来文文号")
+    private String communicationNumber;
+    /**
+    * 办结时间
+    */
+    @ApiModelProperty("办结时间")
+    private Date checkoutTime;
+    /**
+    * 文件密级(xjr_dictionary_item[document_level])
+    */
+    @ApiModelProperty("文件密级(xjr_dictionary_item[document_level])")
+    private String documentLevel;
+    /**
+    * 紧急程度(xjr_dictionary_item[emergency_level])
+    */
+    @ApiModelProperty("紧急程度(xjr_dictionary_item[emergency_level])")
+    private String emergencyLevel;
+    /**
+    * 收文类型(xjr_dictionary_item[received_type])
+    */
+    @ApiModelProperty("收文类型(xjr_dictionary_item[received_type])")
+    private String receivedType;
+    /**
+    * 附件文件id
+    */
+    @ApiModelProperty("附件文件id")
+    private Long fileId;
+
+}

+ 26 - 0
src/main/java/com/xjrsoft/module/oa/dto/OfficialDocumentReceivedPageDto.java

@@ -0,0 +1,26 @@
+package com.xjrsoft.module.oa.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.Date;
+
+
+/**
+* @title: 公文收文分页查询入参
+* @Author szs
+* @Date: 2024-03-13
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class OfficialDocumentReceivedPageDto extends PageInput {
+
+
+}

+ 32 - 0
src/main/java/com/xjrsoft/module/oa/dto/UpdateOfficialDocumentReceivedDto.java

@@ -0,0 +1,32 @@
+package com.xjrsoft.module.oa.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.List;
+import java.util.Date;
+
+
+
+/**
+* @title: 公文收文
+* @Author szs
+* @Date: 2024-03-13
+* @Version 1.0
+*/
+@Data
+public class UpdateOfficialDocumentReceivedDto extends AddOfficialDocumentReceivedDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+}

+ 133 - 0
src/main/java/com/xjrsoft/module/oa/entity/OfficialDocumentReceived.java

@@ -0,0 +1,133 @@
+package com.xjrsoft.module.oa.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.github.yulichang.annotation.EntityMapping;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+
+/**
+* @title: 公文收文
+* @Author szs
+* @Date: 2024-03-13
+* @Version 1.0
+*/
+@Data
+@TableName("official_document_received")
+@ApiModel(value = "official_document_received", description = "公文收文")
+public class OfficialDocumentReceived implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    @TableId
+    private Long id;
+    /**
+    * 创建人
+    */
+    @ApiModelProperty("创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty("创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ApiModelProperty("修改人")
+    @TableField(fill = FieldFill.UPDATE)
+    private Long modifyUserId;
+    /**
+    * 修改时间
+    */
+    @ApiModelProperty("修改时间")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ApiModelProperty("删除标记")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+    * 有效标志
+    */
+    @ApiModelProperty("有效标志")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer enabledMark;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 收文标题
+    */
+    @ApiModelProperty("收文标题")
+    private String receivedTitle;
+    /**
+    * 收文文号
+    */
+    @ApiModelProperty("收文文号")
+    private String receivedNumber;
+    /**
+    * 收文时间
+    */
+    @ApiModelProperty("收文时间")
+    private Date receivedDate;
+    /**
+    * 来文机构
+    */
+    @ApiModelProperty("来文机构")
+    private String communicationOrg;
+    /**
+    * 来文文号
+    */
+    @ApiModelProperty("来文文号")
+    private String communicationNumber;
+    /**
+    * 办结时间
+    */
+    @ApiModelProperty("办结时间")
+    private Date checkoutTime;
+    /**
+    * 文件密级(xjr_dictionary_item[document_level])
+    */
+    @ApiModelProperty("文件密级(xjr_dictionary_item[document_level])")
+    private String documentLevel;
+    /**
+    * 紧急程度(xjr_dictionary_item[emergency_level])
+    */
+    @ApiModelProperty("紧急程度(xjr_dictionary_item[emergency_level])")
+    private String emergencyLevel;
+    /**
+    * 收文类型(xjr_dictionary_item[received_type])
+    */
+    @ApiModelProperty("收文类型(xjr_dictionary_item[received_type])")
+    private String receivedType;
+    /**
+    * 附件文件id
+    */
+    @ApiModelProperty("附件文件id")
+    private Long fileId;
+
+
+}

+ 17 - 0
src/main/java/com/xjrsoft/module/oa/mapper/OfficialDocumentReceivedMapper.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.oa.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.oa.entity.OfficialDocumentReceived;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 公文收文
+* @Author szs
+* @Date: 2024-03-13
+* @Version 1.0
+*/
+@Mapper
+public interface OfficialDocumentReceivedMapper extends MPJBaseMapper<OfficialDocumentReceived> {
+
+}

+ 18 - 0
src/main/java/com/xjrsoft/module/oa/service/IOfficialDocumentReceivedService.java

@@ -0,0 +1,18 @@
+package com.xjrsoft.module.oa.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.oa.entity.OfficialDocumentReceived;
+import lombok.Data;
+import java.util.List;
+
+/**
+* @title: 公文收文
+* @Author szs
+* @Date: 2024-03-13
+* @Version 1.0
+*/
+
+public interface IOfficialDocumentReceivedService extends MPJBaseService<OfficialDocumentReceived> {
+    Boolean dataHandle(Long formId);
+}

+ 68 - 0
src/main/java/com/xjrsoft/module/oa/service/impl/OfficialDocumentReceivedServiceImpl.java

@@ -0,0 +1,68 @@
+package com.xjrsoft.module.oa.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.ledger.entity.WfSubscription;
+import com.xjrsoft.module.oa.entity.OfficialDocumentReceived;
+import com.xjrsoft.module.oa.mapper.OfficialDocumentReceivedMapper;
+import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+
+/**
+* @title: 公文收文
+* @Author szs
+* @Date: 2024-03-13
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class OfficialDocumentReceivedServiceImpl extends MPJBaseServiceImpl<OfficialDocumentReceivedMapper, OfficialDocumentReceived> implements IOfficialDocumentReceivedService {
+    @Override
+    public Boolean dataHandle(Long formId) {
+        OfficialDocumentReceived officialDocumentReceived = this.getById(formId);
+
+        if (officialDocumentReceived != null) {
+
+            Date receivedDate = officialDocumentReceived.getReceivedDate();
+            LocalDate localDate = receivedDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
+
+            String year = String.valueOf(localDate.getYear());
+
+            //获取当前内存中的最大编号
+            LambdaQueryWrapper<OfficialDocumentReceived> officialDocumentReceivedLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            officialDocumentReceivedLambdaQueryWrapper
+                    .select(OfficialDocumentReceived.class, x -> VoToColumnUtil.fieldsToColumns(OfficialDocumentReceived.class).contains(x.getProperty()))
+                    .likeRight(OfficialDocumentReceived::getReceivedNumber, year)
+                    .orderByDesc(OfficialDocumentReceived::getReceivedNumber)
+                    .last("limit 1");
+            OfficialDocumentReceived officialDocumentReceivedMax = this.getOne(officialDocumentReceivedLambdaQueryWrapper);
+
+            OfficialDocumentReceived officialDocumentReceivedNew = new OfficialDocumentReceived();
+            officialDocumentReceivedNew.setId(officialDocumentReceived.getId());
+            if (officialDocumentReceivedMax != null) {
+                String number = officialDocumentReceivedMax.getReceivedNumber();
+
+                int num = Integer.parseInt(number);
+                num = num + 1;
+
+                officialDocumentReceivedNew.setReceivedNumber(String.valueOf(num));
+            } else {
+                officialDocumentReceivedNew.setReceivedNumber(year + "001");
+            }
+            return this.updateById(officialDocumentReceivedNew);
+        }
+        return true;
+    }
+}

+ 114 - 0
src/main/java/com/xjrsoft/module/oa/vo/OfficialDocumentReceivedPageVo.java

@@ -0,0 +1,114 @@
+package com.xjrsoft.module.oa.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import com.xjrsoft.common.annotation.Trans;
+import com.xjrsoft.common.enums.TransType;
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+* @title: 公文收文分页列表出参
+* @Author szs
+* @Date: 2024-03-13
+* @Version 1.0
+*/
+@Data
+public class OfficialDocumentReceivedPageVo {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private String id;
+    /**
+    * 创建人
+    */
+    @ApiModelProperty("创建人")
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty("创建时间")
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ApiModelProperty("修改人")
+    private Long modifyUserId;
+    /**
+    * 修改时间
+    */
+    @ApiModelProperty("修改时间")
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ApiModelProperty("删除标记")
+    private Integer deleteMark;
+    /**
+    * 有效标志
+    */
+    @ApiModelProperty("有效标志")
+    private Integer enabledMark;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 收文标题
+    */
+    @ApiModelProperty("收文标题")
+    private String receivedTitle;
+    /**
+    * 收文文号
+    */
+    @ApiModelProperty("收文文号")
+    private String receivedNumber;
+    /**
+    * 收文时间
+    */
+    @ApiModelProperty("收文时间")
+    private Date receivedDate;
+    /**
+    * 来文机构
+    */
+    @ApiModelProperty("来文机构")
+    private String communicationOrg;
+    /**
+    * 来文文号
+    */
+    @ApiModelProperty("来文文号")
+    private String communicationNumber;
+    /**
+    * 办结时间
+    */
+    @ApiModelProperty("办结时间")
+    private Date checkoutTime;
+    /**
+    * 文件密级(xjr_dictionary_item[document_level])
+    */
+    @ApiModelProperty("文件密级(xjr_dictionary_item[document_level])")
+    private String documentLevel;
+    /**
+    * 紧急程度(xjr_dictionary_item[emergency_level])
+    */
+    @ApiModelProperty("紧急程度(xjr_dictionary_item[emergency_level])")
+    private String emergencyLevel;
+    /**
+    * 收文类型(xjr_dictionary_item[received_type])
+    */
+    @ApiModelProperty("收文类型(xjr_dictionary_item[received_type])")
+    private String receivedType;
+    /**
+    * 附件文件id
+    */
+    @ApiModelProperty("附件文件id")
+    private Long fileId;
+
+}

+ 84 - 0
src/main/java/com/xjrsoft/module/oa/vo/OfficialDocumentReceivedVo.java

@@ -0,0 +1,84 @@
+package com.xjrsoft.module.oa.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+/**
+* @title: 公文收文表单出参
+* @Author szs
+* @Date: 2024-03-13
+* @Version 1.0
+*/
+@Data
+public class OfficialDocumentReceivedVo {
+
+    /**
+    * 主键编号
+    */
+    @ApiModelProperty("主键编号")
+    private Long id;
+    /**
+    * 序号
+    */
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+    /**
+    * 收文标题
+    */
+    @ApiModelProperty("收文标题")
+    private String receivedTitle;
+    /**
+    * 收文文号
+    */
+    @ApiModelProperty("收文文号")
+    private String receivedNumber;
+    /**
+    * 收文时间
+    */
+    @ApiModelProperty("收文时间")
+    private Date receivedDate;
+    /**
+    * 来文机构
+    */
+    @ApiModelProperty("来文机构")
+    private String communicationOrg;
+    /**
+    * 来文文号
+    */
+    @ApiModelProperty("来文文号")
+    private String communicationNumber;
+    /**
+    * 办结时间
+    */
+    @ApiModelProperty("办结时间")
+    private Date checkoutTime;
+    /**
+    * 文件密级(xjr_dictionary_item[document_level])
+    */
+    @ApiModelProperty("文件密级(xjr_dictionary_item[document_level])")
+    private String documentLevel;
+    /**
+    * 紧急程度(xjr_dictionary_item[emergency_level])
+    */
+    @ApiModelProperty("紧急程度(xjr_dictionary_item[emergency_level])")
+    private String emergencyLevel;
+    /**
+    * 收文类型(xjr_dictionary_item[received_type])
+    */
+    @ApiModelProperty("收文类型(xjr_dictionary_item[received_type])")
+    private String receivedType;
+    /**
+    * 附件文件id
+    */
+    @ApiModelProperty("附件文件id")
+    private Long fileId;
+
+
+
+}

+ 2 - 2
src/main/java/com/xjrsoft/module/organization/dto/AddUserDto.java

@@ -57,8 +57,8 @@ public class AddUserDto implements Serializable {
     @Pattern(regexp = "1[3-9][0-9]\\d{8}",message = "手机号格式不正确!")
     private String mobile;
 
-//    @NotNull(message = "角色不能为空!")
-    @ApiModelProperty("角色Id")
+    @NotNull(message = "角色不能为空!")
+    @ApiModelProperty(value = "角色Id",required = true)
     private Long roleId;
 
     @ApiModelProperty("头像")

+ 10 - 2
src/main/java/com/xjrsoft/module/system/controller/FileController.java

@@ -46,6 +46,8 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.validation.Valid;
 import java.io.ByteArrayOutputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
@@ -230,8 +232,14 @@ public class FileController {
 
     @GetMapping("/download")
     @ApiOperation(value = "下载文件")
-    public ResponseEntity<byte[]> download(@Valid FileDownloadDto dto) {
+    public ResponseEntity<byte[]> download(@Valid FileDownloadDto dto){
         byte[] resultBtyeAry_temp = fileService.downloadFileByZip(dto.getFolderId());
-        return RT.fileStream(resultBtyeAry_temp, dto.getFileName() + ".zip");
+        String encodedFileName = "";
+        try{
+            encodedFileName = URLEncoder.encode(dto.getFileName(), "UTF-8");
+        }catch (Exception e){
+
+        }
+        return RT.fileStream(resultBtyeAry_temp, encodedFileName + ".zip");
     }
 }

+ 20 - 0
src/test/java/com/xjrsoft/module/oa/service/impl/OfficialDocumentReceivedServiceImplTest.java

@@ -0,0 +1,20 @@
+package com.xjrsoft.module.oa.service.impl;
+
+import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedService;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+@SpringBootTest
+class OfficialDocumentReceivedServiceImplTest {
+
+    @Autowired
+    private IOfficialDocumentReceivedService officialDocumentReceivedService;
+
+    @Test
+    void dataHandle() {
+        officialDocumentReceivedService.dataHandle(1742764908022394880L);
+    }
+}

+ 26 - 0
src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

@@ -2372,4 +2372,30 @@ public class FreeMarkerGeneratorTest {
         apiGeneratorService.generateCodes(params);
 
     }
+
+    @Test
+    public void gcOfficialDocumentReceived() throws IOException {
+        List<TableConfig> tableConfigs = new ArrayList<>();
+        TableConfig mainTable = new TableConfig();
+        mainTable.setTableName("official_document_received");//init_sql中的表名
+        mainTable.setIsMain(true);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        tableConfigs.add(mainTable);
+
+        ApiGenerateCodesDto params = new ApiGenerateCodesDto();
+        params.setAuthor("szs");//作者名称
+        params.setPackageName("oa");//包名
+        params.setTableConfigs(tableConfigs);
+        params.setPage(true);//是否生成分页接口
+        params.setImport(false);//是否生成导入接口
+        params.setExport(false);//是否生成导出接口
+        params.setOutMainDir(true);//是否生成在主目录,前期测试可设置成false
+        params.setDs(ds);
+
+        IApiGeneratorService apiGeneratorService = new ApiGeneratorServiceImpl();
+
+        apiGeneratorService.generateCodes(params);
+
+    }
 }