Bladeren bron

移除通知公告发布状态

master
牧羊人 4 jaren geleden
bovenliggende
commit
ca0921bd6c
4 gewijzigde bestanden met toevoegingen van 4 en 90 verwijderingen
  1. +0
    -11
      src/main/java/com/taauav/front/entity/UserNotice.java
  2. +4
    -25
      src/main/java/com/taauav/front/service/impl/UserNoticeServiceImpl.java
  3. +0
    -27
      src/main/java/com/taauav/front/vo/usernotice/UserNoticeInfoVo.java
  4. +0
    -27
      src/main/java/com/taauav/front/vo/usernotice/UserNoticeListVo.java

+ 0
- 11
src/main/java/com/taauav/front/entity/UserNotice.java Bestand weergeven

@@ -45,15 +45,4 @@ public class UserNotice extends Entity {
*/
private Integer viewNum;

/**
* 发布人
*/
private Integer publishUser;

/**
* 发布时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date publishTime;
}

+ 4
- 25
src/main/java/com/taauav/front/service/impl/UserNoticeServiceImpl.java Bestand weergeven

@@ -63,17 +63,17 @@ public class UserNoticeServiceImpl extends BaseServiceImpl<UserNoticeMapper, Use
}
// 发布人
if (query.getPublishUser() != null && query.getPublishUser() > 0) {
queryWrapper.eq("publish_user", query.getPublishUser());
queryWrapper.eq("create_user", query.getPublishUser());
}
// 发布开始时间
if (!StringUtils.isEmpty(query.getStartTime())) {
Date startTime = DateUtil.parse(query.getStartTime(), "yyyy-MM-dd HH:mm:ss");
queryWrapper.ge("publish_time", startTime);
queryWrapper.ge("create_time", startTime);
}
// 发布结束时间
if (!StringUtils.isEmpty(query.getEndTime())) {
Date endTime = DateUtil.parse(query.getEndTime(), "yyyy-MM-dd HH:mm:ss");
queryWrapper.le("publish_time", endTime);
queryWrapper.le("create_time", endTime);
}
queryWrapper.eq("mark", 1);

@@ -87,13 +87,6 @@ public class UserNoticeServiceImpl extends BaseServiceImpl<UserNoticeMapper, Use
UserNoticeListVo userNoticeListVo = new UserNoticeListVo();
// 拷贝属性
BeanUtils.copyProperties(item, userNoticeListVo);
// 发布人名称
UserAdmin userAdmin = userAdminMapper.selectById(item.getPublishUser());
if (userAdmin != null) {
userNoticeListVo.setPublishUserName(userAdmin.getRealname());
}
// 通知状态
userNoticeListVo.setStatusName(UserNoticeConstant.USER_NOTICE_STATUS_LIST.get(item.getStatus()));
// 通知类型
userNoticeListVo.setTypeName(UserNoticeConstant.USER_NOTICE_TYPE_LIST.get(item.getType()));
userNoticeListVoList.add(userNoticeListVo);
@@ -120,11 +113,6 @@ public class UserNoticeServiceImpl extends BaseServiceImpl<UserNoticeMapper, Use
if (entity == null) {
return response.failure("实体对象不能为空");
}
// 设置发布人和发布时间
if (entity.getStatus() == 1) {
entity.setPublishUser(ShiroUtils.getAdminId());
entity.setPublishTime(DateUtil.now());
}
boolean result = this.addData(entity);
if (!result) {
return response.failure("添加失败");
@@ -146,11 +134,6 @@ public class UserNoticeServiceImpl extends BaseServiceImpl<UserNoticeMapper, Use
if (entity.getId() == null && entity.getId() < 0) {
return response.failure("记录ID不能为空");
}
// 设置发布人和发布时间
if (entity.getStatus() == 1) {
entity.setPublishUser(ShiroUtils.getAdminId());
entity.setPublishTime(DateUtil.now());
}
boolean result = this.editData(entity);
if (!result) {
return response.failure("编辑失败");
@@ -173,12 +156,8 @@ public class UserNoticeServiceImpl extends BaseServiceImpl<UserNoticeMapper, Use
// 拷贝属性
UserNoticeInfoVo userNoticeInfoVo = new UserNoticeInfoVo();
if (info != null) {
// 拷贝属性
BeanUtils.copyProperties(info, userNoticeInfoVo);
// 发布人
UserAdmin userAdmin = userAdminMapper.selectById(info.getPublishUser());
if (userAdmin != null) {
userNoticeInfoVo.setPublishUserName(userAdmin.getRealname());
}
}
return response.success(userNoticeInfoVo);
}

+ 0
- 27
src/main/java/com/taauav/front/vo/usernotice/UserNoticeInfoVo.java Bestand weergeven

@@ -44,31 +44,4 @@ public class UserNoticeInfoVo {
*/
private Integer viewNum;

/**
* 发布状态:1已发布 2未发布
*/
private Integer status;

/**
* 状态描述
*/
private String statusName;

/**
* 发布人
*/
private Integer publishUser;

/**
* 发布人名称
*/
private String publishUserName;

/**
* 发布时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date publishTime;

}

+ 0
- 27
src/main/java/com/taauav/front/vo/usernotice/UserNoticeListVo.java Bestand weergeven

@@ -44,31 +44,4 @@ public class UserNoticeListVo {
*/
private Integer viewNum;

/**
* 发布状态:1已发布 2未发布
*/
private Integer status;

/**
* 状态描述
*/
private String statusName;

/**
* 发布人
*/
private Integer publishUser;

/**
* 发布人名称
*/
private String publishUserName;

/**
* 发布时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date publishTime;

}

Laden…
Annuleren
Opslaan