Commit 055fc758 by 284718418@qq.com

OA 讯息添加文件传阅

parent 65dcbec8
package cn.timer.api.bean.qyxx;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
/**
* 文件传阅表
*
* @author wuqingjun
* @email 284718418@qq.com
* @date 2022-06-23
*/
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "cms_content_read")
@ApiModel("文件传阅表")
public class CmsContentRead extends Model<CmsContentRead>{
private static final long serialVersionUID = -5904257321968702198L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号", example = "1")
private Integer id;
@ApiModelProperty(value = "企业讯息主表ID", example = "101")
private Integer cmsContentId;
@ApiModelProperty(value = "留言/意见反馈", example = "")
private String reviewContent;
@ApiModelProperty(value = "留言/意见反馈时间", example = "")
private Date reviewTime;
@ApiModelProperty(value = "组织机构代码", example = "1")
private Integer orgCode;
@ApiModelProperty(value = "用户ID", example = "1")
private Integer userId;
@ApiModelProperty(value = "用户姓名", example = "张三")
private String userName;
@ApiModelProperty(value = "阅读标记0.未读 1.已读", example = "0")
private Integer readStatus;
@ApiModelProperty(value = "逻辑删除标记0.未删除 1.删除", example = "0")
private Integer deleteFlag;
@ApiModelProperty(value = "创建时间", example = "")
private Date createTime;
@ApiModelProperty(value = "更新时间", example = "")
private Date updateTime;
}
...@@ -6,11 +6,13 @@ import java.util.List; ...@@ -6,11 +6,13 @@ import java.util.List;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
import cn.timer.api.bean.qyxx.*;
import cn.timer.api.utils.redis.RedisUtil; import cn.timer.api.utils.redis.RedisUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -29,10 +31,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -29,10 +31,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.timer.api.bean.qyxx.CmsAnnouncement;
import cn.timer.api.bean.qyxx.CmsContent;
import cn.timer.api.bean.qyxx.CmsContentModular;
import cn.timer.api.bean.qyxx.CmsIsRead;
import cn.timer.api.bean.yggl.YgglMainEmp; import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser; import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.annotation.UserBean;
...@@ -194,7 +192,7 @@ public class CmsController { ...@@ -194,7 +192,7 @@ public class CmsController {
// 录入时间 // 录入时间
qynr.setAddeddate(now); qynr.setAddeddate(now);
// 发布方式:1,审核通过后立即发布,2定时发布,3手动发布 // 发布方式:1,审核通过后立即发布,2定时发布,3手动发布,4立即发布
Integer fbfs = qynr.getReleasetype(); Integer fbfs = qynr.getReleasetype();
// 定时 // 定时
if (fbfs != null && fbfs == 2) { if (fbfs != null && fbfs == 2) {
...@@ -205,13 +203,31 @@ public class CmsController { ...@@ -205,13 +203,31 @@ public class CmsController {
.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum)).getName()); .eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum)).getName());
qynr.setReleasetype(fbfs); qynr.setReleasetype(fbfs);
qynr.setStatus(0); qynr.setStatus(0);
if(fbfs != null && fbfs == 4){
qynr.setReleasestate(0);
qynr.setStatus(1);
}
qynr.insertOrUpdate(); qynr.insertOrUpdate();
// 新增 文件传阅 人员数据
if(a){
if(!CollectionUtils.isEmpty(cmsContentDto.getCmsContentReads())){
for (CmsContentRead entity :cmsContentDto.getCmsContentReads() ) {
entity.setCmsContentId(qynr.getId());
entity.setOrgCode(orgCode);
entity.setReadStatus(0);
entity.setDeleteFlag(0);
entity.insert();
}
}
}
if (a) if (a){
return ResultUtil.data(qynr, "提交成功、等待管理员审核"); String msg = fbfs==4?"提交成功":"提交成功、等待管理员审核";
else return ResultUtil.data(qynr, msg);
} else {
return ResultUtil.data(qynr, "修改成功"); return ResultUtil.data(qynr, "修改成功");
} }
}
/** /**
* 删除企业OA讯息 * 删除企业OA讯息
......
package cn.timer.api.dao.qyxx;
import cn.timer.api.bean.qyxx.CmsContentRead;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* 文件传阅表
*
* @author wuqingjun
* @email 284718418@qq.com
* @date 2022-06-23
*/
@Repository
public interface CmsContentReadMapper extends BaseMapper<CmsContentRead> {
}
package cn.timer.api.dto.qyxx; package cn.timer.api.dto.qyxx;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Transient;
import cn.timer.api.bean.qyxx.CmsContentRead;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import cn.timer.api.utils.Page; import cn.timer.api.utils.Page;
...@@ -137,4 +141,9 @@ public class CmsContentDto extends Page implements Serializable{ ...@@ -137,4 +141,9 @@ public class CmsContentDto extends Page implements Serializable{
@ApiModelProperty(value = "定时发布时间", example = "101") @ApiModelProperty(value = "定时发布时间", example = "101")
private Long fixedTime;// 定时发布时间 private Long fixedTime;// 定时发布时间
/**
* 文件传阅人员
*/
@ApiModelProperty(value = "文件传阅人员")
private List<CmsContentRead> cmsContentReads;
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment