Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
diyhi committed Feb 29, 2024
1 parent 8b4a8cb commit c3baf00
Show file tree
Hide file tree
Showing 104 changed files with 4,526 additions and 530 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>bbs</groupId>
<artifactId>bbs</artifactId>
<version>6.1</version>
<version>6.2</version>
<packaging>war</packaging>
<name>bbs</name>
<description/>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/cms/bean/ErrorView.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ public enum ErrorView {
_833("呢称不能和其他用户名相同"),
_834("用户类型不能为空"),
_835("用户类型错误"),
_836("呢称不能和其他账号相同"),
_837("呢称不能和员工账号相同"),
_838("呢称不能和员工呢称相同"),
_850("手机验证码错误"),
_851("手机号不能为空"),
_852("手机验证码不能为空"),
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/cms/bean/message/RemindEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ public class RemindEntity implements Serializable{
protected Long friendQuestionAnswerId;
/** 对方的问题回复Id **/
protected Long friendQuestionReplyId;

/** 内容摘要 **/
@Transient
protected String summary;

public String getId() {
return id;
Expand Down Expand Up @@ -264,6 +266,12 @@ public String getSenderAccount() {
public void setSenderAccount(String senderAccount) {
this.senderAccount = senderAccount;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}


}
40 changes: 40 additions & 0 deletions src/main/java/cms/bean/staff/PermissionMenu.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package cms.bean.staff;

import java.io.Serializable;

/**
* 权限菜单
* @author Gao
*
*/
public class PermissionMenu implements Serializable{
private static final long serialVersionUID = 1721622201354849134L;

/** 名称 **/
private String name;
/** URL **/
private String url;
/** 请求类型 **/
private String methods;

public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getMethods() {
return methods;
}
public void setMethods(String methods) {
this.methods = methods;
}


}
35 changes: 33 additions & 2 deletions src/main/java/cms/bean/staff/SysUsers.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ public class SysUsers implements UserDetails ,java.io.Serializable{
/** 安全摘要 **/
@Column(length=32)
private String securityDigest;
/** 呢称 **/
@Column(length=50)
private String nickname;
/** 头像路径 不写入数据库**/
@Transient
private String avatarPath;
/** 头像名称 **/
@Column(length=50)
private String avatarName;

/** 当前登录用户权限是否拥有本权限 **/
@Transient
Expand Down Expand Up @@ -92,7 +101,7 @@ public class SysUsers implements UserDetails ,java.io.Serializable{


public SysUsers(){}
public SysUsers(String userId, String userAccount, String fullName,
public SysUsers(String userId, String userAccount, String fullName,String nickname,String avatarName,
String userPassword, String userDesc, boolean enabled,boolean issys,String securityDigest,
String userDuty, boolean accountNonExpired,
boolean credentialsNonExpired, boolean accountNonLocked, Collection<GrantedAuthority> authorities) {
Expand All @@ -103,6 +112,8 @@ public SysUsers(String userId, String userAccount, String fullName,
this.userId = userId;
this.userAccount = userAccount;
this.fullName = fullName;
this.nickname = nickname;
this.avatarName = avatarName;
this.userPassword = userPassword;
this.userDesc = userDesc;
this.issys = issys;
Expand Down Expand Up @@ -320,13 +331,33 @@ public void setAccountNonLocked(boolean accountNonLocked) {
public void setCredentialsNonExpired(boolean credentialsNonExpired) {
this.credentialsNonExpired = credentialsNonExpired;
}

public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getSecurityDigest() {
return securityDigest;
}
public void setSecurityDigest(String securityDigest) {
this.securityDigest = securityDigest;
}
public String getAvatarPath() {
if(this.avatarPath == null || "".equals(this.avatarPath.trim())){
this.avatarPath = "file/staffAvatar/";
}
return avatarPath;
}
public void setAvatarPath(String avatarPath) {
this.avatarPath = avatarPath;
}
public String getAvatarName() {
return avatarName;
}
public void setAvatarName(String avatarName) {
this.avatarName = avatarName;
}
private static SortedSet<GrantedAuthority> sortAuthorities(Collection<GrantedAuthority> authorities) {
Assert.notNull(authorities, "Cannot pass a null GrantedAuthority collection");
// Ensure array iteration order is predictable (as per UserDetails.getAuthorities() contract and SEC-717)
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/cms/bean/user/UserDynamicEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public class UserDynamicEntity implements Serializable{
/** 回复Id -1表示默认空值 **/
protected Long replyId = -1L;


/** 是否使用Markdown **/
@Transient
protected Boolean isMarkdown;
/** 话题标题 **/
@Transient
protected String topicTitle;
Expand Down Expand Up @@ -379,5 +383,13 @@ public String getAccount() {
public void setAccount(String account) {
this.account = account;
}

public Boolean getIsMarkdown() {
return isMarkdown;
}

public void setIsMarkdown(Boolean isMarkdown) {
this.isMarkdown = isMarkdown;
}

}
5 changes: 5 additions & 0 deletions src/main/java/cms/service/message/RemindService.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public interface RemindService extends DAO<Remind>{
* @param unreadRemindIdList 提醒设Id集合
*/
public Integer updateRemindStatus(Long userId,List<String> unreadRemindIdList);
/**
* 设置全部提醒状态为已读
* @param userId 用户Id
*/
public Integer updateAllRemindStatus(Long userId);
/**
* 软删除提醒
* @param userId 用户Id
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/cms/service/message/SystemNotifyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public interface SystemNotifyService extends DAO<SystemNotify>{
* @param subscriptionSystemNotifyIdList 订阅系统通知Id集合
*/
public Integer updateSubscriptionSystemNotifyStatus(Long userId,List<String> subscriptionSystemNotifyIdList);
/**
* 设置全部订阅系统通知状态为已读
* @param userId 用户Id
*/
public Integer updateAllSubscriptionSystemNotifyStatus(Long userId);
/**
* 根据用户Id查询最早的未读系统通知Id
* @param userId 用户Id
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/cms/service/message/impl/RemindServiceBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,38 @@ public Integer updateRemindStatus(Long userId,List<String> unreadRemindIdList){
return i;


}

/**
* 设置全部提醒状态为已读
* @param userId 用户Id
*/
public Integer updateAllRemindStatus(Long userId){
int i = 0;
Long time = new Date().getTime();

//表编号
int tableNumber = remindConfig.userIdRemainder(userId);
if(tableNumber == 0){//默认对象
Query query = em.createQuery("update Remind o set o.status=:status, o.readTimeFormat=:readTimeFormat where o.receiverUserId=:receiverUserId and o.status <:status2")
.setParameter("status", 20)
.setParameter("readTimeFormat", time)
.setParameter("receiverUserId", userId)
.setParameter("status2", 20);
i += query.executeUpdate();

}else{//带下划线对象
Query query = em.createQuery("update Remind_"+tableNumber+" o set o.status=:status, o.readTimeFormat=:readTimeFormat where o.receiverUserId=:receiverUserId and o.status <:status2")
.setParameter("status", 20)
.setParameter("readTimeFormat", time)
.setParameter("receiverUserId", userId)
.setParameter("status2", 20);
i += query.executeUpdate();
}

return i;


}
/**
* 软删除提醒
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,34 @@ public Integer updateSubscriptionSystemNotifyStatus(Long userId,List<String> sub
return i;
}


/**
* 设置全部订阅系统通知状态为已读
* @param userId 用户Id
*/
public Integer updateAllSubscriptionSystemNotifyStatus(Long userId){
int i = 0;
Date time = new Date();
//表编号
int tableNumber = subscriptionSystemNotifyConfig.userIdRemainder(userId);
if(tableNumber == 0){//默认对象
Query query = em.createQuery("update SubscriptionSystemNotify o set o.status=:status, o.readTime=:readTime where o.userId=:userId and o.status <:status2")
.setParameter("status", 20)
.setParameter("readTime", time)
.setParameter("userId", userId)
.setParameter("status2", 20);
i += query.executeUpdate();

}else{//带下划线对象
Query query = em.createQuery("update SubscriptionSystemNotify_"+tableNumber+" o set o.status=:status, o.readTime=:readTime where o.userId=:userId and o.status <:status2")
.setParameter("status", 20)
.setParameter("readTime", time)
.setParameter("userId", userId)
.setParameter("status2", 20);
i += query.executeUpdate();
}

return i;
}

/**
* 根据用户Id查询最早的未读系统通知Id
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/cms/service/question/AnswerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ public interface AnswerService extends DAO<Answer>{
* @return
*/
public List<String> findAnswerContentByPage(int firstIndex, int maxResult,String userName,boolean isStaff);
/**
* 分页查询答案
* @param userName 用户名称
* @param postTime 评论发表时间
* @param firstIndex
* @param maxResult
* @return
*/
public List<Answer> findAnswerByPage(String userName,Date postTime,int firstIndex, int maxResult);
/**
* 保存答案
* @param answer
Expand Down Expand Up @@ -188,6 +197,15 @@ public int updateAdoptionAnswer(Long questionId, Long answerId,boolean changeAdo
* @return
*/
public List<AnswerReply> findByAnswerReplyIdList(List<Long> answerReplyIdList);
/**
* 分页查询回复
* @param userName 用户名称
* @param postTime 回复发表时间
* @param firstIndex
* @param maxResult
* @return
*/
public List<AnswerReply> findReplyByPage(String userName,Date postTime,int firstIndex, int maxResult);
/**
* 修改回复
* @param answerReplyId 回复Id
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/cms/service/question/QuestionService.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ public interface QuestionService extends DAO<Question>{
* @return
*/
public List<Question> findQuestionByPage(int firstIndex, int maxResult);
/**
* 分页查询问题
* @param userName用户名称
* @param postTime 问题发表时间
* @param firstIndex 开始索引
* @param maxResult 需要获取的记录数
* @return
*/
public List<Question> findQuestionByPage(String userName,Date postTime,int firstIndex, int maxResult);
/**
* 根据问题Id查询问题标签关联
* @param questionId 问题Id
Expand Down
33 changes: 27 additions & 6 deletions src/main/java/cms/service/question/impl/AnswerServiceBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,28 @@ public List<String> findAnswerContentByPage(int firstIndex, int maxResult,String
return contentList;
}


/**
* 分页查询答案
* @param userName 用户名称
* @param postTime 评论发表时间
* @param firstIndex
* @param maxResult
* @return
*/
@Transactional(readOnly=true,propagation=Propagation.NOT_SUPPORTED)
public List<Answer> findAnswerByPage(String userName,Date postTime,int firstIndex, int maxResult){
String sql = "select o from Answer o where o.userName=?1 and o.postTime>?2";
Query query = em.createQuery(sql);
query.setParameter(1, userName);
query.setParameter(2, postTime);
//索引开始,即从哪条记录开始
query.setFirstResult(firstIndex);
//获取多少条数据
query.setMaxResults(maxResult);

List<Answer> answerList = query.getResultList();
return answerList;
}

/**
* 保存答案
Expand Down Expand Up @@ -535,10 +556,10 @@ public List<AnswerReply> findByAnswerReplyIdList(List<Long> answerReplyIdList){
* @param firstIndex
* @param maxResult
* @return
*/
@Transactional(readOnly=true,propagation=Propagation.NOT_SUPPORTED)
public List<Reply> findReplyByPage(String userName,Date postTime,int firstIndex, int maxResult){
String sql = "select o from Reply o where o.userName=?1 and o.postTime>?2";
public List<AnswerReply> findReplyByPage(String userName,Date postTime,int firstIndex, int maxResult){
String sql = "select o from AnswerReply o where o.userName=?1 and o.postTime>?2";
Query query = em.createQuery(sql);
query.setParameter(1, userName);
query.setParameter(2, postTime);
Expand All @@ -547,9 +568,9 @@ public List<Reply> findReplyByPage(String userName,Date postTime,int firstIndex,
//获取多少条数据
query.setMaxResults(maxResult);

List<Reply> replyList = query.getResultList();
List<AnswerReply> replyList = query.getResultList();
return replyList;
}*/
}

/**
* 修改回复
Expand Down
Loading

0 comments on commit c3baf00

Please sign in to comment.