开发消息通知功能
This commit is contained in:
parent
14050af858
commit
3ba2d600c2
@ -1,7 +1,7 @@
|
||||
|
||||
**线上预览:**
|
||||
> ### 移动端 **[http://8.146.211.120:8081/](http://8.146.211.120:8081/)**
|
||||
> ### 管理端 **[http://8.146.211.120:8086/](http://8.146.211.120:8086/)**
|
||||
> ### 管理端 **[http://8.146.211.120:8088/](http://8.146.211.120:8088/)**
|
||||
|
||||
小红书凭借优秀的产品体验 和超高人气 目前成为笔记类产品佼佼者
|
||||
此项目将详细介绍如何使用Vue.js和Spring Boot 集合uniapp
|
||||
|
@ -11,6 +11,7 @@ import com.dd.admin.business.file.service.FileService;
|
||||
import com.dd.admin.business.follow.service.FollowService;
|
||||
import com.dd.admin.business.note.service.NoteService;
|
||||
import com.dd.admin.business.noteImg.service.NoteImgService;
|
||||
import com.dd.admin.business.receive.service.ReceiveService;
|
||||
import com.dd.admin.business.reply.service.ReplyService;
|
||||
import com.dd.admin.business.starNotes.service.StarNotesService;
|
||||
import com.dd.admin.business.upNotes.service.UpNotesService;
|
||||
@ -48,6 +49,8 @@ public class AuthChatApi {
|
||||
ReplyService replyService;
|
||||
@Autowired
|
||||
FollowService followService;
|
||||
@Autowired
|
||||
ReceiveService receiveService;
|
||||
|
||||
@ApiOperation(value = "获取消息列表")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@ -135,8 +138,9 @@ public class AuthChatApi {
|
||||
Integer starNotesUnReadCount = starNotesService.selectUnReadCount(loginId);
|
||||
Integer replyUnReadCount = replyService.selectUnReadCount(loginId);
|
||||
Integer followUnReadCount = followService.selectUnReadCount(loginId);
|
||||
Integer receiveUnReadCount = receiveService.selectUnReadCount(loginId);
|
||||
Integer totalUnReadCount = 0;
|
||||
UnReadCountBean unReadCountBean = new UnReadCountBean(chatUnReadCount,upNotesUnReadCount,starNotesUnReadCount,replyUnReadCount,followUnReadCount,totalUnReadCount);
|
||||
UnReadCountBean unReadCountBean = new UnReadCountBean(chatUnReadCount,upNotesUnReadCount,starNotesUnReadCount,replyUnReadCount,followUnReadCount,receiveUnReadCount,totalUnReadCount);
|
||||
unReadCountBean.calculateTotalUnReadCount();
|
||||
return ResultBean.success(unReadCountBean);
|
||||
};
|
||||
|
96
src/main/java/com/dd/admin/business/api/AuthNoticeApi.java
Normal file
96
src/main/java/com/dd/admin/business/api/AuthNoticeApi.java
Normal file
@ -0,0 +1,96 @@
|
||||
package com.dd.admin.business.api;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.dd.admin.business.author.entity.Author;
|
||||
import com.dd.admin.business.author.service.AuthorService;
|
||||
import com.dd.admin.business.chat.domain.AuthorParam;
|
||||
import com.dd.admin.business.file.entity.File;
|
||||
import com.dd.admin.business.file.service.FileService;
|
||||
import com.dd.admin.business.follow.entity.Follow;
|
||||
import com.dd.admin.business.follow.service.FollowService;
|
||||
import com.dd.admin.business.note.domain.NoteDto;
|
||||
import com.dd.admin.business.note.domain.NoteVo;
|
||||
import com.dd.admin.business.note.domain.ReplayMeVo;
|
||||
import com.dd.admin.business.note.domain.UpMeVo;
|
||||
import com.dd.admin.business.note.entity.Note;
|
||||
import com.dd.admin.business.note.service.NoteService;
|
||||
import com.dd.admin.business.noteImg.entity.NoteImg;
|
||||
import com.dd.admin.business.noteImg.service.NoteImgService;
|
||||
import com.dd.admin.business.receive.domain.ReceiveDto;
|
||||
import com.dd.admin.business.receive.domain.ReceiveVo;
|
||||
import com.dd.admin.business.receive.entity.Receive;
|
||||
import com.dd.admin.business.receive.service.ReceiveService;
|
||||
import com.dd.admin.business.reply.domain.ReplyDto;
|
||||
import com.dd.admin.business.reply.domain.ReplyVo;
|
||||
import com.dd.admin.business.reply.service.ReplyService;
|
||||
import com.dd.admin.common.aop.operationLog.aop.OperLog;
|
||||
import com.dd.admin.common.aop.operationLog.aop.OperType;
|
||||
import com.dd.admin.common.model.result.ResultBean;
|
||||
import com.dd.admin.common.utils.AddressUtils;
|
||||
import com.dd.admin.common.utils.CommonUtil;
|
||||
import com.dd.admin.common.utils.IPUtils;
|
||||
import com.dd.admin.common.utils.StringUtil;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ApiModel("笔记相关Api")
|
||||
@RestController
|
||||
public class AuthNoticeApi {
|
||||
@Autowired
|
||||
HttpServletRequest request;
|
||||
@Autowired
|
||||
ReceiveService receiveService;
|
||||
|
||||
@ApiOperation(value = "读取系统消息")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@PostMapping("/api/auth/readAuthorReceive")
|
||||
@OperLog(operModule = "读取系统消息", operType = OperType.OTHER, operDesc = "读取系统消息")
|
||||
public ResultBean readAuthorReceive() {
|
||||
String authorId = String.valueOf(request.getAttribute("authorId"));
|
||||
receiveService.readMessage(authorId);
|
||||
return ResultBean.success();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "获取所有系统消息")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@GetMapping("/api/auth/getReceivePage")
|
||||
@OperLog(operModule = "获取所有系统消息", operType = OperType.QUERY, operDesc = "获取所有系统消息")
|
||||
public ResultBean<IPage<ReceiveVo>> getReceivePage() {
|
||||
String authorId = String.valueOf(request.getAttribute("authorId"));
|
||||
ReceiveDto receiveDto = new ReceiveDto();
|
||||
receiveDto.setAuthorId(authorId);
|
||||
// 1. 通过noteService根据传入的NoteDto参数查询笔记的分页信息,获取包含笔记数据的分页对象
|
||||
IPage<ReceiveVo> receiveVoIPage = receiveService.selectReceivePage(receiveDto);
|
||||
// 20. 将处理好的包含笔记信息(已设置点赞状态和点赞数量)的分页对象包装在ResultBean中返回,以便前端或其他调用方获取处理后的结果数据
|
||||
return ResultBean.success(receiveVoIPage);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "获取最后一条系统消息")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@GetMapping("/api/auth/getReceiveLast")
|
||||
@OperLog(operModule = "获取最后一条系统消息", operType = OperType.QUERY, operDesc = "获取最后一条系统消息")
|
||||
public ResultBean<ReceiveVo> getReceiveLast() {
|
||||
String authorId = String.valueOf(request.getAttribute("authorId"));
|
||||
// 1. 通过noteService根据传入的NoteDto参数查询笔记的分页信息,获取包含笔记数据的分页对象
|
||||
ReceiveVo lastReceive = receiveService.selectReceiveLast(authorId);
|
||||
// 20. 将处理好的包含笔记信息(已设置点赞状态和点赞数量)的分页对象包装在ResultBean中返回,以便前端或其他调用方获取处理后的结果数据
|
||||
return ResultBean.success(lastReceive);
|
||||
}
|
||||
}
|
@ -13,6 +13,7 @@ public class UnReadCountBean {
|
||||
private Integer starNotesUnReadCount;
|
||||
private Integer replyUnReadCount;
|
||||
private Integer followUnReadCount;
|
||||
private Integer receiveUnReadCount;
|
||||
private Integer totalUnReadCount;
|
||||
|
||||
// 自定义方法,用于计算总数量(也可以在构造函数等其他地方调用此方法来计算总和)
|
||||
@ -22,7 +23,8 @@ public class UnReadCountBean {
|
||||
int starNotesCount = starNotesUnReadCount!= null? starNotesUnReadCount : 0;
|
||||
int replyCount = replyUnReadCount!= null? replyUnReadCount : 0;
|
||||
int followCount = followUnReadCount!= null? followUnReadCount : 0;
|
||||
int receiveCount = receiveUnReadCount!= null? receiveUnReadCount : 0;
|
||||
|
||||
totalUnReadCount = chatCount + upNotesCount + starNotesCount + replyCount + followCount;
|
||||
totalUnReadCount = chatCount + upNotesCount + starNotesCount + replyCount + followCount + receiveCount;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,126 @@
|
||||
package com.dd.admin.business.notice.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.dd.admin.business.author.entity.Author;
|
||||
import com.dd.admin.business.note.service.NoteService;
|
||||
import com.dd.admin.business.notice.domain.SendNoticeDto;
|
||||
import com.dd.admin.business.receive.entity.Receive;
|
||||
import com.dd.admin.business.receive.service.ReceiveService;
|
||||
import com.dd.admin.common.exception.ApiException;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.dd.admin.common.model.UpdateGroup;
|
||||
import com.dd.admin.common.model.result.ResultBean;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import com.dd.admin.business.notice.entity.Notice;
|
||||
import com.dd.admin.business.notice.domain.NoticeVo;
|
||||
import com.dd.admin.business.notice.domain.NoticeDto;
|
||||
import com.dd.admin.business.notice.service.NoticeService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 通知公告表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
@Api(tags = "通知公告表")
|
||||
@RestController
|
||||
public class NoticeController {
|
||||
|
||||
@Autowired
|
||||
NoticeService noticeService;
|
||||
|
||||
@Autowired
|
||||
ReceiveService receiveService;
|
||||
|
||||
@ApiOperation(value = "通知公告表-添加")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@PostMapping("/admin/notice/sendNotice")
|
||||
public ResultBean<Notice> sendNotice(@RequestBody @Validated SendNoticeDto sendNoticeDto) {
|
||||
System.out.println(sendNoticeDto);
|
||||
if(CollectionUtil.isNotEmpty(sendNoticeDto.getAuthorList())){
|
||||
Notice notice = noticeService.getById(sendNoticeDto.getNoticeId());
|
||||
List<Author> authorList = sendNoticeDto.getAuthorList();
|
||||
|
||||
List<Receive> receiveList = new ArrayList<>();
|
||||
authorList.stream().forEach(author -> {
|
||||
Receive receive = new Receive();
|
||||
receive.setNoticeId(notice.getNoticeId());
|
||||
receive.setAuthorId(author.getAuthorId());
|
||||
receive.setAuthorName(author.getAuthorName());
|
||||
receiveList.add(receive);
|
||||
});
|
||||
|
||||
receiveService.saveBatch(receiveList);
|
||||
|
||||
}else{
|
||||
throw new ApiException("请选择发送对象~");
|
||||
}
|
||||
|
||||
return ResultBean.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通知公告表-分页列表")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@GetMapping("/admin/notice/page")
|
||||
public ResultBean<IPage<NoticeVo>> page(NoticeDto noticeDto) {
|
||||
IPage<NoticeVo> pageInfo = noticeService.selectNoticePage(noticeDto);
|
||||
return ResultBean.success(pageInfo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通知公告表-列表")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@GetMapping("/admin/notice/list")
|
||||
public ResultBean<List<NoticeVo>> list(NoticeDto noticeDto) {
|
||||
List<NoticeVo> list = noticeService.selectNoticeList(noticeDto);
|
||||
return ResultBean.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通知公告表-添加")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@PostMapping("/admin/notice/add")
|
||||
public ResultBean<Notice> add(@RequestBody @Validated NoticeDto noticeDto) {
|
||||
Notice notice = BeanUtil.copyProperties(noticeDto, Notice.class);
|
||||
noticeService.save(notice);
|
||||
return ResultBean.success(notice);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通知公告表-查询")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@GetMapping("/admin/notice/{noticeId}")
|
||||
public ResultBean<NoticeVo> get(@PathVariable @NotBlank String noticeId) {
|
||||
Notice notice = noticeService.getById(noticeId);
|
||||
NoticeVo noticeVo = BeanUtil.copyProperties(notice,NoticeVo.class);
|
||||
return ResultBean.success(noticeVo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通知公告表-修改")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@PostMapping("/admin/notice/update")
|
||||
public ResultBean<Notice> update(@RequestBody @Validated(UpdateGroup.class) NoticeDto noticeDto) {
|
||||
Notice notice = BeanUtil.copyProperties(noticeDto, Notice.class);
|
||||
noticeService.updateById(notice);
|
||||
return ResultBean.success(notice);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通知公告表-删除")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@GetMapping("/admin/notice/delete/{noticeId}")
|
||||
public ResultBean<Notice> delete(@PathVariable @NotBlank String noticeId) {
|
||||
Boolean b = noticeService.removeById(noticeId);
|
||||
return ResultBean.success(b);
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.dd.admin.business.notice.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import com.dd.admin.common.model.UpdateGroup;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 通知公告表返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="通知公告表接收对象")
|
||||
public class NoticeDto {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "通知id")
|
||||
private String noticeId;
|
||||
|
||||
@ApiModelProperty(value = "通知标题")
|
||||
private String noticeTitle;
|
||||
|
||||
@ApiModelProperty(value = "通知内容")
|
||||
private String noticeContent;
|
||||
|
||||
@ApiModelProperty(value = "跳转url")
|
||||
private String redirectUrl;
|
||||
|
||||
@ApiModelProperty(value = "乐观锁字段")
|
||||
private Long version;
|
||||
|
||||
@ApiModelProperty(value = "0正常 1删除")
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "门店id")
|
||||
private String shopId;
|
||||
|
||||
@ApiModelProperty(value = "门店名")
|
||||
private String shopName;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "创建人id")
|
||||
private String createId;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "修改人")
|
||||
private String updateName;
|
||||
|
||||
@ApiModelProperty(value = "修改人id")
|
||||
private String updateId;
|
||||
|
||||
@ApiModelProperty(value = "通知类型")
|
||||
private Integer noticeType;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.dd.admin.business.notice.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 通知公告表返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="通知公告表返回对象")
|
||||
public class NoticeVo {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "通知id")
|
||||
private String noticeId;
|
||||
|
||||
@ApiModelProperty(value = "通知标题")
|
||||
private String noticeTitle;
|
||||
|
||||
@ApiModelProperty(value = "通知内容")
|
||||
private String noticeContent;
|
||||
|
||||
@ApiModelProperty(value = "跳转url")
|
||||
private String redirectUrl;
|
||||
|
||||
@ApiModelProperty(value = "乐观锁字段")
|
||||
private Long version;
|
||||
|
||||
@ApiModelProperty(value = "0正常 1删除")
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "门店id")
|
||||
private String shopId;
|
||||
|
||||
@ApiModelProperty(value = "门店名")
|
||||
private String shopName;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "创建人id")
|
||||
private String createId;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "修改人")
|
||||
private String updateName;
|
||||
|
||||
@ApiModelProperty(value = "修改人id")
|
||||
private String updateId;
|
||||
|
||||
@ApiModelProperty(value = "通知类型")
|
||||
private Integer noticeType;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.dd.admin.business.notice.domain;
|
||||
|
||||
import com.dd.admin.business.author.entity.Author;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 通知公告表返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="通知公告表接收对象")
|
||||
public class SendNoticeDto {
|
||||
|
||||
@ApiModelProperty(value = "通知id")
|
||||
private String noticeId;
|
||||
|
||||
@ApiModelProperty(value = "作者集合 没有则全部发布")
|
||||
private List<Author> authorList;
|
||||
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.dd.admin.business.notice.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 通知公告表
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("business_notice")
|
||||
@ApiModel(value="Notice对象", description="通知公告表")
|
||||
public class Notice implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "通知id")
|
||||
@TableId(value = "NOTICE_ID", type = IdType.ASSIGN_UUID)
|
||||
private String noticeId;
|
||||
|
||||
@ApiModelProperty(value = "通知标题")
|
||||
@TableField("NOTICE_TITLE")
|
||||
private String noticeTitle;
|
||||
|
||||
@ApiModelProperty(value = "通知内容")
|
||||
@TableField("NOTICE_CONTENT")
|
||||
private String noticeContent;
|
||||
|
||||
@ApiModelProperty(value = "跳转url")
|
||||
@TableField("REDIRECT_URL")
|
||||
private String redirectUrl;
|
||||
|
||||
@ApiModelProperty(value = "乐观锁字段")
|
||||
@TableField("VERSION")
|
||||
@Version
|
||||
private Long version;
|
||||
|
||||
@ApiModelProperty(value = "0正常 1删除")
|
||||
@TableField("DELETED")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "门店id")
|
||||
@TableField(value = "SHOP_ID", fill = FieldFill.INSERT)
|
||||
private String shopId;
|
||||
|
||||
@ApiModelProperty(value = "门店名")
|
||||
@TableField(value = "SHOP_NAME", fill = FieldFill.INSERT)
|
||||
private String shopName;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@TableField(value = "CREATE_NAME", fill = FieldFill.INSERT)
|
||||
private String createName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "创建人id")
|
||||
@TableField(value = "CREATE_ID", fill = FieldFill.INSERT)
|
||||
private String createId;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "修改人")
|
||||
@TableField(value = "UPDATE_NAME", fill = FieldFill.UPDATE)
|
||||
private String updateName;
|
||||
|
||||
@ApiModelProperty(value = "修改人id")
|
||||
@TableField(value = "UPDATE_ID", fill = FieldFill.UPDATE)
|
||||
private String updateId;
|
||||
|
||||
@ApiModelProperty(value = "通知类型")
|
||||
@TableField("NOTICE_TYPE")
|
||||
private Integer noticeType;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.dd.admin.business.notice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.dd.admin.business.notice.entity.Notice;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dd.admin.business.notice.domain.NoticeVo;
|
||||
import com.dd.admin.business.notice.domain.NoticeDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 通知公告表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
@Mapper
|
||||
public interface NoticeMapper extends BaseMapper<Notice> {
|
||||
|
||||
IPage<NoticeVo> selectNoticePage(Page<NoticeVo> page, @Param("noticeDto") NoticeDto noticeDto);
|
||||
|
||||
List<NoticeVo> selectNoticeList(@Param("noticeDto") NoticeDto noticeDto);
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dd.admin.business.notice.mapper.NoticeMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.dd.admin.business.notice.entity.Notice">
|
||||
<result column="NOTICE_ID" property="noticeId" />
|
||||
<result column="NOTICE_TITLE" property="noticeTitle" />
|
||||
<result column="NOTICE_CONTENT" property="noticeContent" />
|
||||
<result column="REDIRECT_URL" property="redirectUrl" />
|
||||
<result column="VERSION" property="version" />
|
||||
<result column="DELETED" property="deleted" />
|
||||
<result column="SHOP_ID" property="shopId" />
|
||||
<result column="SHOP_NAME" property="shopName" />
|
||||
<result column="CREATE_NAME" property="createName" />
|
||||
<result column="CREATE_TIME" property="createTime" />
|
||||
<result column="CREATE_ID" property="createId" />
|
||||
<result column="UPDATE_TIME" property="updateTime" />
|
||||
<result column="UPDATE_NAME" property="updateName" />
|
||||
<result column="UPDATE_ID" property="updateId" />
|
||||
<result column="NOTICE_TYPE" property="noticeType" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
NOTICE_ID, NOTICE_TITLE, NOTICE_CONTENT, REDIRECT_URL, VERSION, DELETED, SHOP_ID, SHOP_NAME, CREATE_NAME, CREATE_TIME, CREATE_ID, UPDATE_TIME, UPDATE_NAME, UPDATE_ID, NOTICE_TYPE
|
||||
</sql>
|
||||
|
||||
<select id="selectNoticePage" resultType="com.dd.admin.business.notice.domain.NoticeVo">
|
||||
select
|
||||
*
|
||||
from business_notice where 1 = 1
|
||||
</select>
|
||||
|
||||
<select id="selectNoticeList" resultType="com.dd.admin.business.notice.domain.NoticeVo">
|
||||
select
|
||||
*
|
||||
from business_notice where 1 = 1
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,26 @@
|
||||
package com.dd.admin.business.notice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.dd.admin.business.notice.entity.Notice;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dd.admin.business.notice.domain.NoticeVo;
|
||||
import com.dd.admin.business.notice.domain.NoticeDto;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 通知公告表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
public interface NoticeService extends IService<Notice> {
|
||||
|
||||
//通知公告表-分页列表
|
||||
IPage<NoticeVo> selectNoticePage(NoticeDto noticeDto);
|
||||
|
||||
//通知公告表-列表
|
||||
List<NoticeVo> selectNoticeList(NoticeDto noticeDto);
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.dd.admin.business.notice.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.dd.admin.business.chat.entity.Chat;
|
||||
import com.dd.admin.common.model.PageFactory;
|
||||
import com.dd.admin.business.notice.entity.Notice;
|
||||
import com.dd.admin.business.notice.mapper.NoticeMapper;
|
||||
import com.dd.admin.business.notice.service.NoticeService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.dd.admin.business.notice.domain.NoticeVo;
|
||||
import com.dd.admin.business.notice.domain.NoticeDto;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 通知公告表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
@Service
|
||||
public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements NoticeService {
|
||||
|
||||
@Override
|
||||
public IPage<NoticeVo> selectNoticePage(NoticeDto noticeDto) {
|
||||
Page page = PageFactory.defaultPage();
|
||||
return baseMapper.selectNoticePage(page,noticeDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NoticeVo> selectNoticeList(NoticeDto noticeDto) {
|
||||
return baseMapper.selectNoticeList(noticeDto);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package com.dd.admin.business.receive.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.dd.admin.business.chat.domain.AuthorParam;
|
||||
import com.dd.admin.common.aop.operationLog.aop.OperLog;
|
||||
import com.dd.admin.common.aop.operationLog.aop.OperType;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.dd.admin.common.model.UpdateGroup;
|
||||
import com.dd.admin.common.model.result.ResultBean;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import com.dd.admin.business.receive.entity.Receive;
|
||||
import com.dd.admin.business.receive.domain.ReceiveVo;
|
||||
import com.dd.admin.business.receive.domain.ReceiveDto;
|
||||
import com.dd.admin.business.receive.service.ReceiveService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 接收消息表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
@Api(tags = "接收消息表")
|
||||
@RestController
|
||||
public class ReceiveController {
|
||||
|
||||
@Autowired
|
||||
ReceiveService receiveService;
|
||||
|
||||
@ApiOperation(value = "接收消息表-分页列表")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@GetMapping("/admin/receive/page")
|
||||
public ResultBean<IPage<ReceiveVo>> page(ReceiveDto receiveDto) {
|
||||
IPage<ReceiveVo> pageInfo = receiveService.selectReceivePage(receiveDto);
|
||||
return ResultBean.success(pageInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "接收消息表-列表")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@GetMapping("/admin/receive/list")
|
||||
public ResultBean<List<ReceiveVo>> list(ReceiveDto receiveDto) {
|
||||
List<ReceiveVo> list = receiveService.selectReceiveList(receiveDto);
|
||||
return ResultBean.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "接收消息表-添加")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@PostMapping("/admin/receive/add")
|
||||
public ResultBean<Receive> add(@RequestBody @Validated ReceiveDto receiveDto) {
|
||||
Receive receive = BeanUtil.copyProperties(receiveDto, Receive.class);
|
||||
receiveService.save(receive);
|
||||
return ResultBean.success(receive);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "接收消息表-查询")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@GetMapping("/admin/receive/{receiveId}")
|
||||
public ResultBean<ReceiveVo> get(@PathVariable @NotBlank String receiveId) {
|
||||
Receive receive = receiveService.getById(receiveId);
|
||||
ReceiveVo receiveVo = BeanUtil.copyProperties(receive,ReceiveVo.class);
|
||||
return ResultBean.success(receiveVo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "接收消息表-修改")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@PostMapping("/admin/receive/update")
|
||||
public ResultBean<Receive> update(@RequestBody @Validated(UpdateGroup.class) ReceiveDto receiveDto) {
|
||||
Receive receive = BeanUtil.copyProperties(receiveDto, Receive.class);
|
||||
receiveService.updateById(receive);
|
||||
return ResultBean.success(receive);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "接收消息表-删除")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@GetMapping("/admin/receive/delete/{receiveId}")
|
||||
public ResultBean<Receive> delete(@PathVariable @NotBlank String receiveId) {
|
||||
Boolean b = receiveService.removeById(receiveId);
|
||||
return ResultBean.success(b);
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.dd.admin.business.receive.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import com.dd.admin.common.model.UpdateGroup;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 接收消息表返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="接收消息表接收对象")
|
||||
public class ReceiveDto {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "接收id")
|
||||
@NotBlank(message = "接收消息表id不能为空",groups = UpdateGroup.class)
|
||||
private String receiveId;
|
||||
|
||||
@ApiModelProperty(value = "博主id")
|
||||
private String authorId;
|
||||
|
||||
@ApiModelProperty(value = "博主名")
|
||||
private String authorName;
|
||||
|
||||
@ApiModelProperty(value = "通知id")
|
||||
private String noticeId;
|
||||
|
||||
@ApiModelProperty(value = "通知标题")
|
||||
private String noticeTitle;
|
||||
|
||||
@ApiModelProperty(value = "0正常 1删除")
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "0 发送 1已读")
|
||||
private Integer receiveStatus;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.dd.admin.business.receive.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 接收消息表返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value="接收消息表返回对象")
|
||||
public class ReceiveVo {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "接收id")
|
||||
private String receiveId;
|
||||
|
||||
@ApiModelProperty(value = "博主id")
|
||||
private String authorId;
|
||||
|
||||
@ApiModelProperty(value = "博主名")
|
||||
private String authorName;
|
||||
|
||||
@ApiModelProperty(value = "通知id")
|
||||
private String noticeId;
|
||||
|
||||
@ApiModelProperty(value = "通知标题")
|
||||
private String noticeTitle;
|
||||
|
||||
@ApiModelProperty(value = "通知标题")
|
||||
private String noticeContent;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "0正常 1删除")
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "0 发送 1已读")
|
||||
private Integer receiveStatus;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.dd.admin.business.receive.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 接收消息表
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("business_receive")
|
||||
@ApiModel(value="Receive对象", description="接收消息表")
|
||||
public class Receive implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "接收id")
|
||||
@TableId(value = "RECEIVE_ID", type = IdType.ASSIGN_UUID)
|
||||
private String receiveId;
|
||||
|
||||
@ApiModelProperty(value = "博主id")
|
||||
@TableField("AUTHOR_ID")
|
||||
private String authorId;
|
||||
|
||||
@ApiModelProperty(value = "博主名")
|
||||
@TableField("AUTHOR_NAME")
|
||||
private String authorName;
|
||||
|
||||
@ApiModelProperty(value = "通知id")
|
||||
@TableField("NOTICE_ID")
|
||||
private String noticeId;
|
||||
|
||||
@ApiModelProperty(value = "通知标题")
|
||||
@TableField("NOTICE_TITLE")
|
||||
private String noticeTitle;
|
||||
|
||||
@ApiModelProperty(value = "0正常 1删除")
|
||||
@TableField("DELETED")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField(value = "UPDATE_TIME", fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "0 发送 1已读")
|
||||
@TableField("RECEIVE_STATUS")
|
||||
private Integer receiveStatus;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.dd.admin.business.receive.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.dd.admin.business.receive.entity.Receive;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dd.admin.business.receive.domain.ReceiveVo;
|
||||
import com.dd.admin.business.receive.domain.ReceiveDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 接收消息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
@Mapper
|
||||
public interface ReceiveMapper extends BaseMapper<Receive> {
|
||||
|
||||
IPage<ReceiveVo> selectReceivePage(Page<ReceiveVo> page, @Param("receiveDto") ReceiveDto receiveDto);
|
||||
|
||||
List<ReceiveVo> selectReceiveList(@Param("receiveDto") ReceiveDto receiveDto);
|
||||
|
||||
ReceiveVo selectReceiveLast(@Param("authorId")String authorId);
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dd.admin.business.receive.mapper.ReceiveMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.dd.admin.business.receive.entity.Receive">
|
||||
<id column="RECEIVE_ID" property="receiveId" />
|
||||
<result column="AUTHOR_ID" property="authorId" />
|
||||
<result column="AURHOR_NAME" property="aurhorName" />
|
||||
<result column="NOTICE_ID" property="noticeId" />
|
||||
<result column="NOTICE_TITLE" property="noticeTitle" />
|
||||
<result column="DELETED" property="deleted" />
|
||||
<result column="CREATE_TIME" property="createTime" />
|
||||
<result column="UPDATE_TIME" property="updateTime" />
|
||||
<result column="RECEIVE_STATUS" property="receiveStatus" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
RECEIVE_ID, AUTHOR_ID, AURHOR_NAME, NOTICE_ID, NOTICE_TITLE, DELETED, CREATE_TIME, UPDATE_TIME, RECEIVE_STATUS
|
||||
</sql>
|
||||
|
||||
<select id="selectReceivePage" resultType="com.dd.admin.business.receive.domain.ReceiveVo">
|
||||
select
|
||||
b.notice_title,notice_content,redirect_url, a.*
|
||||
from business_receive a left join business_notice b on a.notice_id = b.notice_id where 1=1
|
||||
<if test="receiveDto.authorId!= null and receiveDto.authorId!= ''">
|
||||
and a.author_id = #{receiveDto.authorId}
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectReceiveList" resultType="com.dd.admin.business.receive.domain.ReceiveVo">
|
||||
select
|
||||
*
|
||||
from business_receive where 1 = 1
|
||||
</select>
|
||||
<select id="selectReceiveLast" resultType="com.dd.admin.business.receive.domain.ReceiveVo"
|
||||
parameterType="java.lang.String">
|
||||
select
|
||||
b.notice_title,notice_content,redirect_url, a.*
|
||||
from business_receive a left join business_notice b on a.notice_id = b.notice_id where 1=1
|
||||
<if test="authorId!= null and authorId!= ''">
|
||||
and a.author_id = #{authorId}
|
||||
</if>
|
||||
order by create_time desc limit 1
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,32 @@
|
||||
package com.dd.admin.business.receive.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.dd.admin.business.receive.entity.Receive;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dd.admin.business.receive.domain.ReceiveVo;
|
||||
import com.dd.admin.business.receive.domain.ReceiveDto;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 接收消息表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
public interface ReceiveService extends IService<Receive> {
|
||||
|
||||
//接收消息表-分页列表
|
||||
IPage<ReceiveVo> selectReceivePage(ReceiveDto receiveDto);
|
||||
|
||||
//接收消息表-列表
|
||||
List<ReceiveVo> selectReceiveList(ReceiveDto receiveDto);
|
||||
|
||||
Integer selectUnReadCount(String authorId);
|
||||
|
||||
ReceiveVo selectReceiveLast(String authorId);
|
||||
|
||||
public void readMessage(String authorId);
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.dd.admin.business.receive.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.dd.admin.business.chat.entity.Chat;
|
||||
import com.dd.admin.business.follow.entity.Follow;
|
||||
import com.dd.admin.business.notice.entity.Notice;
|
||||
import com.dd.admin.common.model.PageFactory;
|
||||
import com.dd.admin.business.receive.entity.Receive;
|
||||
import com.dd.admin.business.receive.mapper.ReceiveMapper;
|
||||
import com.dd.admin.business.receive.service.ReceiveService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.dd.admin.business.receive.domain.ReceiveVo;
|
||||
import com.dd.admin.business.receive.domain.ReceiveDto;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 接收消息表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 727869402@qq.com
|
||||
* @since 2025-01-14
|
||||
*/
|
||||
@Service
|
||||
public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, Receive> implements ReceiveService {
|
||||
|
||||
@Override
|
||||
public IPage<ReceiveVo> selectReceivePage(ReceiveDto receiveDto) {
|
||||
Page page = PageFactory.defaultPage();
|
||||
return baseMapper.selectReceivePage(page,receiveDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ReceiveVo> selectReceiveList(ReceiveDto receiveDto) {
|
||||
return baseMapper.selectReceiveList(receiveDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer selectUnReadCount(String authorId) {
|
||||
LambdaQueryWrapper<Receive> queryWrapper = new LambdaQueryWrapper();
|
||||
queryWrapper.eq(Receive::getAuthorId,authorId);
|
||||
queryWrapper.eq(Receive::getReceiveStatus,0);
|
||||
return baseMapper.selectCount(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReceiveVo selectReceiveLast(String authorId) {
|
||||
return baseMapper.selectReceiveLast(authorId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readMessage(String authorId) {
|
||||
LambdaUpdateWrapper<Receive> queryWrapper = new LambdaUpdateWrapper();
|
||||
queryWrapper.eq(Receive::getAuthorId,authorId);
|
||||
queryWrapper.set(Receive::getReceiveStatus,1);
|
||||
this.update(queryWrapper);
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ import com.dd.admin.business.api.domain.UnReadCountBean;
|
||||
import com.dd.admin.business.author.service.AuthorService;
|
||||
import com.dd.admin.business.chat.service.ChatService;
|
||||
import com.dd.admin.business.follow.service.FollowService;
|
||||
import com.dd.admin.business.receive.service.ReceiveService;
|
||||
import com.dd.admin.business.reply.service.ReplyService;
|
||||
import com.dd.admin.business.starNotes.service.StarNotesService;
|
||||
import com.dd.admin.business.upNotes.service.UpNotesService;
|
||||
@ -32,6 +33,8 @@ public class GetApiReadCountMessageHandler implements MsgHandlerInterface {
|
||||
ReplyService replyService;
|
||||
@Autowired
|
||||
FollowService followService;
|
||||
@Autowired
|
||||
ReceiveService receiveService;
|
||||
@Override
|
||||
public Object handler(Map map, ChannelContext context) {
|
||||
String authorId = String.valueOf(map.get("authorId"));
|
||||
@ -40,8 +43,10 @@ public class GetApiReadCountMessageHandler implements MsgHandlerInterface {
|
||||
Integer starNotesUnReadCount = starNotesService.selectUnReadCount(authorId);
|
||||
Integer replyUnReadCount = replyService.selectUnReadCount(authorId);
|
||||
Integer followUnReadCount = followService.selectUnReadCount(authorId);
|
||||
Integer receiveUnReadCount = receiveService.selectUnReadCount(authorId);
|
||||
|
||||
Integer totalUnReadCount = 0;
|
||||
UnReadCountBean unReadCountBean = new UnReadCountBean(chatUnReadCount,upNotesUnReadCount,starNotesUnReadCount,replyUnReadCount,followUnReadCount,totalUnReadCount);
|
||||
UnReadCountBean unReadCountBean = new UnReadCountBean(chatUnReadCount,upNotesUnReadCount,starNotesUnReadCount,replyUnReadCount,followUnReadCount,receiveUnReadCount,totalUnReadCount);
|
||||
unReadCountBean.calculateTotalUnReadCount();
|
||||
|
||||
TioUtil.sendChatMessageToUser(context.getGroupContext(),authorId,"9",unReadCountBean);
|
||||
|
@ -3,7 +3,8 @@ ENV = 'development'
|
||||
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'http://127.0.0.1:8080'
|
||||
VUE_APP_WEBSOCKET_API = 'ws://192.168.10.98:9326'
|
||||
#VUE_APP_WEBSOCKET_API = 'ws://192.168.10.98:9326'
|
||||
VUE_APP_WEBSOCKET_API = 'ws://192.168.1.136:9326'
|
||||
|
||||
# system name
|
||||
VUE_APP_SYSTEM_NAME = '小红书社区后台管理系统'
|
||||
|
@ -23,6 +23,7 @@
|
||||
"element-ui": "2.15.14",
|
||||
"js-cookie": "2.2.0",
|
||||
"lemon-imui": "^1.8.0",
|
||||
"mavon-editor": "^2.10.4",
|
||||
"normalize.css": "7.0.0",
|
||||
"nprogress": "0.2.0",
|
||||
"path-to-regexp": "2.4.0",
|
||||
|
48
web/src/api/business/notice/notice.js
Normal file
48
web/src/api/business/notice/notice.js
Normal file
@ -0,0 +1,48 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getNoticePage(params) {
|
||||
return request({
|
||||
url: '/admin/notice/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getNoticeList(params) {
|
||||
return request({
|
||||
url: '/admin/notice/list',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function addNotice(data) {
|
||||
return request({
|
||||
url: '/admin/notice/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function editNotice(data) {
|
||||
return request({
|
||||
url: '/admin/notice/update',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteNotice(noticeId) {
|
||||
return request({
|
||||
url: '/admin/notice/delete/' + noticeId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function sendNotice(data) {
|
||||
return request({
|
||||
url: '/admin/notice/sendNotice',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
41
web/src/api/business/receive/receive.js
Normal file
41
web/src/api/business/receive/receive.js
Normal file
@ -0,0 +1,41 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getReceivePage(params) {
|
||||
return request({
|
||||
url: '/admin/receive/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getReceiveList(params) {
|
||||
return request({
|
||||
url: '/admin/receive/list',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function addReceive(data) {
|
||||
return request({
|
||||
url: '/admin/receive/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function editReceive(data) {
|
||||
return request({
|
||||
url: '/admin/receive/update',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteReceive(receiveId) {
|
||||
return request({
|
||||
url: '/admin/receive/delete/' + receiveId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ export default {
|
||||
pageSizes: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [10, 20, 30, 50]
|
||||
return [10, 20, 30, 50,200]
|
||||
}
|
||||
},
|
||||
layout: {
|
||||
|
@ -32,6 +32,13 @@ import '@/permission' // permission control
|
||||
import LemonIMUI from 'lemon-imui';
|
||||
import 'lemon-imui/dist/index.css';
|
||||
Vue.use(LemonIMUI);
|
||||
|
||||
//引入markdown
|
||||
import mavonEditor from 'mavon-editor'
|
||||
import 'mavon-editor/dist/css/index.css'
|
||||
// use markdown
|
||||
Vue.use(mavonEditor)
|
||||
|
||||
// set ElementUI lang to EN
|
||||
Vue.use(ElementUI, { locale })
|
||||
// 如果想要中文版 element-ui,按如下方式声明
|
||||
|
142
web/src/views/business/notice/addNotice.vue
Normal file
142
web/src/views/business/notice/addNotice.vue
Normal file
@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
top="8vh"
|
||||
width="40%"
|
||||
:visible.sync="dialogVisible"
|
||||
center
|
||||
@close="handleCancel"
|
||||
>
|
||||
<div class="el-dialog-div">
|
||||
<el-form
|
||||
:rules="rules"
|
||||
ref="dataForm"
|
||||
:model="temp"
|
||||
label-position="right"
|
||||
label-width="120px"
|
||||
style="height: 90%;"
|
||||
>
|
||||
<el-form-item label="通知标题" prop="noticeTitle" class="is-required">
|
||||
<el-input v-model="temp.noticeTitle" placeholder="通知标题" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="通知内容" prop="noticeContent" class="is-required">
|
||||
<mavon-editor
|
||||
ref="md"
|
||||
placeholder="请输入文档内容..."
|
||||
:boxShadow="false"
|
||||
style="z-index:1;border: 1px solid #d9d9d9;height:50vh"
|
||||
v-model="temp.noticeContent"
|
||||
:toolbars="toolbars"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="跳转url" prop="redirectUrl" class="is-required">
|
||||
<el-input v-model="temp.redirectUrl" placeholder="跳转url" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleCancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addNotice} from "@/api/business/notice/notice";
|
||||
import {setRequiredFields} from "@/utils";
|
||||
const requiredFields = []
|
||||
export default {
|
||||
name: "addForm",
|
||||
data() {
|
||||
return {
|
||||
rules: setRequiredFields(requiredFields),
|
||||
dialogVisible: false,
|
||||
temp: {
|
||||
noticeId:'',
|
||||
noticeTitle:'',
|
||||
noticeContent:'',
|
||||
redirectUrl:'',
|
||||
version:'',
|
||||
deleted:'',
|
||||
shopId:'',
|
||||
shopName:'',
|
||||
createName:'',
|
||||
createTime:'',
|
||||
createId:'',
|
||||
updateTime:'',
|
||||
updateName:'',
|
||||
updateId:'',
|
||||
},
|
||||
toolbars: {
|
||||
bold: true, // 粗体
|
||||
italic: true, // 斜体
|
||||
header: true, // 标题
|
||||
underline: true, // 下划线
|
||||
strikethrough: true, // 中划线
|
||||
mark: true, // 标记
|
||||
superscript: true, // 上角标
|
||||
subscript: true, // 下角标
|
||||
quote: true, // 引用
|
||||
ol: true, // 有序列表
|
||||
ul: true, // 无序列表
|
||||
link: true, // 链接
|
||||
// imagelink: true, // 图片链接
|
||||
code: true, // code
|
||||
table: true, // 表格
|
||||
fullscreen: true, // 全屏编辑
|
||||
readmodel: true, // 沉浸式阅读
|
||||
htmlcode: true, // 展示html源码
|
||||
help: true, // 帮助
|
||||
/* 1.3.5 */
|
||||
undo: true, // 上一步
|
||||
redo: true, // 下一步
|
||||
trash: true, // 清空
|
||||
save: false, // 保存(触发events中的save事件)
|
||||
/* 1.4.2 */
|
||||
navigation: true, // 导航目录
|
||||
/* 2.1.8 */
|
||||
alignleft: true, // 左对齐
|
||||
aligncenter: true, // 居中
|
||||
alignright: true, // 右对齐
|
||||
/* 2.2.1 */
|
||||
subfield: true, // 单双栏模式
|
||||
preview: true // 预览
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
addNotice(this.temp).then(response =>{
|
||||
this.handleCancel()
|
||||
this.$emit('ok', response.data)
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleCancel() {
|
||||
//初始化
|
||||
this.temp = this.$options.data().temp
|
||||
this.dialogVisible = false
|
||||
this.$refs['dataForm'].resetFields();
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
467
web/src/views/business/notice/authorList.vue
Normal file
467
web/src/views/business/notice/authorList.vue
Normal file
@ -0,0 +1,467 @@
|
||||
<template>
|
||||
<div class="app" style="height: 80vh">
|
||||
|
||||
<div class="filter-container">
|
||||
<el-input
|
||||
v-model="listQuery.keyword"
|
||||
size="small"
|
||||
placeholder="请输入关键词"
|
||||
clearable
|
||||
class="filter-item"
|
||||
style="width: 200px;margin-left: 10px;"
|
||||
/>
|
||||
<el-button-group style="margin-left: 10px;">
|
||||
<el-button
|
||||
size="small"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="search"
|
||||
>
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-refresh"
|
||||
@click="refresh"
|
||||
>
|
||||
重置
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table
|
||||
:row-class-name="rowClassName"
|
||||
@row-click="handleRowClick"
|
||||
v-loading="listLoading"
|
||||
:data="list"
|
||||
element-loading-text="Loading"
|
||||
border
|
||||
fit
|
||||
height="70%"
|
||||
class="table-container"
|
||||
highlight-current-row
|
||||
>
|
||||
|
||||
<el-table-column label="选择" width="60px" align="center" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-radio
|
||||
:label="scope.$index"
|
||||
v-model="tableRadio"
|
||||
style="margin-left: 10px;">{{''}}</el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="序号"
|
||||
width="80"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.$index+1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="小红书号"
|
||||
width="150"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.authorNo }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="昵称"
|
||||
width="120"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.authorName }}
|
||||
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="账号"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.phoneNumber }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="头像"
|
||||
width="130"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-avatar shape="circle" :size="80" fit="cover" :src="scope.row.avatarUrl "></el-avatar>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
<el-table-column
|
||||
label="关注数"
|
||||
width="120"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.follow }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="粉丝数"
|
||||
width="120"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.fans }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="点赞数"
|
||||
width="120"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.upCount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="收藏数"
|
||||
width="120"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.starCount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
label="简介"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.description }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.createTime }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="ip地址"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.ipAddress }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="真实ip地址"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.ipRealAddress }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="冻结状态"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.authorStatus==0?'正常':'冻结' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="删除状态"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.deleted==0?'正常':'删除' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="性别 1男 2女"
|
||||
width="120"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.sex }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="生日"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.birth }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="职业"
|
||||
width="120"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.job }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="地区"
|
||||
width="120"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.area }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="学校"
|
||||
width="120"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.school }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column
|
||||
label="真实姓名"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.realName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="身份证号"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.idCard }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <el-table-column-->
|
||||
<!-- fixed="right"-->
|
||||
<!-- label="操作"-->
|
||||
<!-- width="200"-->
|
||||
<!-- align="center"-->
|
||||
<!-- >-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-button-group>-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="edit(scope)"-->
|
||||
<!-- >-->
|
||||
<!-- 修改-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="del(scope)"-->
|
||||
<!-- >-->
|
||||
<!-- 删除-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-button-group>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.limit"
|
||||
@pagination="fetchData"
|
||||
/>
|
||||
|
||||
|
||||
<div class="div-border" style="height: 29%;margin-top:15px;">
|
||||
<el-alert
|
||||
type="warning"
|
||||
:closable="false">
|
||||
<template slot="title">
|
||||
已选择的作者:{{authorList.length}}个
|
||||
<el-button style="margin-left: 15px;"
|
||||
@click="chooseDone"
|
||||
icon="el-icon-check"
|
||||
type="danger">选好了</el-button>
|
||||
</template>
|
||||
</el-alert>
|
||||
|
||||
<div class="tag-view">
|
||||
<el-tag
|
||||
v-for="(tag,index) in authorList"
|
||||
:key="tag.authorId"
|
||||
closable
|
||||
size="medium"
|
||||
effect="dark"
|
||||
@close="authorList.splice(index,1)"
|
||||
>
|
||||
{{tag.authorName}}
|
||||
</el-tag>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<add-form ref="addForm" @ok="addOk" />
|
||||
<edit-form ref="editForm" @ok="editOk" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getAuthorPage,deleteAuthor} from "@/api/business/author/author";
|
||||
import {deepClone,success,error} from "@/utils";
|
||||
|
||||
import confirm from "@/utils/confirm";
|
||||
import Pagination from '@/components/Pagination'
|
||||
import addForm from "@/views/business/author/addAuthor";
|
||||
import editForm from "@/views/business/author/editAuthor";
|
||||
|
||||
export default {
|
||||
name: 'noticeAuthor',
|
||||
components: {addForm,editForm,Pagination},
|
||||
data() {
|
||||
return {
|
||||
total: 0,
|
||||
list: [],
|
||||
listLoading: true,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 50,
|
||||
keyword: ''
|
||||
},
|
||||
temp: {},
|
||||
authorList:[],
|
||||
tableRadio:''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
//获取当前的行数
|
||||
rowClassName({row, rowIndex}) {
|
||||
//把每一行的索引放进row
|
||||
row.rowIndex = rowIndex;
|
||||
},
|
||||
handleRowClick(row) {
|
||||
let obj = row
|
||||
let array = this.authorList;
|
||||
//如果数组中不包含 则push
|
||||
if (JSON.stringify(array).indexOf(obj.authorId) == -1) {
|
||||
this.authorList.push(obj);
|
||||
}
|
||||
this.tableRadio = row.rowIndex
|
||||
},
|
||||
search() {
|
||||
this.fetchData()
|
||||
},
|
||||
refresh() {
|
||||
this.listQuery = this.$options.data().listQuery
|
||||
this.fetchData()
|
||||
},
|
||||
chooseDone(){
|
||||
if(this.authorList.length==0){
|
||||
error('还没有作者')
|
||||
return false
|
||||
}
|
||||
this.$emit('ok', this.authorList)
|
||||
},
|
||||
handleCancel() {
|
||||
//初始化
|
||||
this.authorList = this.$options.data().authorList
|
||||
this.refresh()
|
||||
},
|
||||
fetchData() {
|
||||
this.listLoading = true
|
||||
getAuthorPage(this.listQuery).then(response => {
|
||||
const { records, total } = response.data
|
||||
this.list = records
|
||||
this.total = total
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
add(){
|
||||
this.$refs.addForm.open()
|
||||
},
|
||||
addOk(){
|
||||
this.fetchData()
|
||||
},
|
||||
edit(scope) {
|
||||
const temp = deepClone(scope.row)
|
||||
this.$refs.editForm.open(temp)
|
||||
},
|
||||
editOk(){
|
||||
this.fetchData()
|
||||
},
|
||||
del(scope) {
|
||||
confirm("确定要删除吗?").then(res=>{
|
||||
if(res){
|
||||
deleteAuthor(scope.row.authorId).then(response => {
|
||||
console.log(response)
|
||||
success('删除成功')
|
||||
this.fetchData()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
46
web/src/views/business/notice/chooseAuthor.vue
Normal file
46
web/src/views/business/notice/chooseAuthor.vue
Normal file
@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false"
|
||||
top="2vh"
|
||||
width="90%"
|
||||
:visible.sync="dialogVisible"
|
||||
@close="handleCancel"
|
||||
center
|
||||
>
|
||||
<div class="el-dialog-div" style="height: 80vh;">
|
||||
<NoticeAuthor ref="authorRef" @ok="getCheckedAuthors"></NoticeAuthor>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NoticeAuthor from "@/views/business/notice/authorList";
|
||||
|
||||
export default {
|
||||
name: "chooseAuthor",
|
||||
components: {NoticeAuthor},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(id) {
|
||||
this.dialogVisible = true
|
||||
},
|
||||
getCheckedAuthors(authorList){
|
||||
this.$emit('ok', authorList)
|
||||
this.handleCancel()
|
||||
},
|
||||
handleCancel() {
|
||||
//初始化
|
||||
this.dialogVisible = false
|
||||
this.$refs.authorRef.handleCancel()
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
152
web/src/views/business/notice/editNotice.vue
Normal file
152
web/src/views/business/notice/editNotice.vue
Normal file
@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
top="8vh"
|
||||
width="40%"
|
||||
:visible.sync="dialogVisible"
|
||||
center
|
||||
@close="handleCancel"
|
||||
>
|
||||
<div class="el-dialog-div">
|
||||
<el-form
|
||||
:rules="rules"
|
||||
ref="dataForm"
|
||||
:model="temp"
|
||||
label-position="right"
|
||||
label-width="120px"
|
||||
style="height: 90%;"
|
||||
>
|
||||
|
||||
<el-form-item label="通知id" prop="noticeId" class="is-required">
|
||||
<el-input v-model="temp.noticeId" placeholder="通知id" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="通知标题" prop="noticeTitle" class="is-required">
|
||||
<el-input v-model="temp.noticeTitle" placeholder="通知标题" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="通知内容" prop="noticeContent" class="is-required">
|
||||
<el-input v-model="temp.noticeContent" placeholder="通知内容" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="跳转url" prop="redirectUrl" class="is-required">
|
||||
<el-input v-model="temp.redirectUrl" placeholder="跳转url" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="乐观锁字段" prop="version" class="is-required">
|
||||
<el-input v-model="temp.version" placeholder="乐观锁字段" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="0正常 1删除" prop="deleted" class="is-required">
|
||||
<el-input v-model="temp.deleted" placeholder="0正常 1删除" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="门店id" prop="shopId" class="is-required">
|
||||
<el-input v-model="temp.shopId" placeholder="门店id" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="门店名" prop="shopName" class="is-required">
|
||||
<el-input v-model="temp.shopName" placeholder="门店名" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="创建人" prop="createName" class="is-required">
|
||||
<el-input v-model="temp.createName" placeholder="创建人" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="创建时间" prop="createTime" class="is-required">
|
||||
<el-input v-model="temp.createTime" placeholder="创建时间" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="创建人id" prop="createId" class="is-required">
|
||||
<el-input v-model="temp.createId" placeholder="创建人id" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="修改时间" prop="updateTime" class="is-required">
|
||||
<el-input v-model="temp.updateTime" placeholder="修改时间" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="修改人" prop="updateName" class="is-required">
|
||||
<el-input v-model="temp.updateName" placeholder="修改人" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="修改人id" prop="updateId" class="is-required">
|
||||
<el-input v-model="temp.updateId" placeholder="修改人id" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="通知类型" prop="noticeType" class="is-required">
|
||||
<el-input v-model="temp.noticeType" placeholder="通知类型" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleCancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { editNotice } from "@/api/business/notice/notice";
|
||||
import {setRequiredFields} from "@/utils";
|
||||
const requiredFields = []
|
||||
|
||||
export default {
|
||||
name: "editForm",
|
||||
data() {
|
||||
return {
|
||||
rules: setRequiredFields(requiredFields),
|
||||
dialogVisible: false,
|
||||
temp: {
|
||||
noticeId:'',
|
||||
noticeTitle:'',
|
||||
noticeContent:'',
|
||||
redirectUrl:'',
|
||||
version:'',
|
||||
deleted:'',
|
||||
shopId:'',
|
||||
shopName:'',
|
||||
createName:'',
|
||||
createTime:'',
|
||||
createId:'',
|
||||
updateTime:'',
|
||||
updateName:'',
|
||||
updateId:'',
|
||||
noticeType:'',
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(row) {
|
||||
this.temp = this.$options.data().temp
|
||||
this.temp = row
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
editNotice(this.temp).then(response => {
|
||||
this.handleCancel()
|
||||
this.$emit('ok', response.data)
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleCancel() {
|
||||
//初始化
|
||||
this.temp = this.$options.data().temp
|
||||
this.dialogVisible = false
|
||||
this.$refs['dataForm'].resetFields()
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
358
web/src/views/business/notice/noticeList.vue
Normal file
358
web/src/views/business/notice/noticeList.vue
Normal file
@ -0,0 +1,358 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<div class="filter-container">
|
||||
<el-input
|
||||
v-model="listQuery.keyword"
|
||||
size="small"
|
||||
placeholder="请输入关键词"
|
||||
clearable
|
||||
class="filter-item"
|
||||
style="width: 200px;margin-left: 10px;"
|
||||
/>
|
||||
<el-button-group style="margin-left: 10px;">
|
||||
<el-button
|
||||
size="small"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="search"
|
||||
>
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-refresh"
|
||||
@click="refresh"
|
||||
>
|
||||
重置
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
<el-button
|
||||
size="small"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
style="margin-left: 10px;"
|
||||
@click="add"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="list"
|
||||
element-loading-text="Loading"
|
||||
border
|
||||
fit
|
||||
height="100%"
|
||||
class="table-container"
|
||||
highlight-current-row
|
||||
>
|
||||
|
||||
<el-table-column
|
||||
label="序号"
|
||||
width="150"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.$index+1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="通知id"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.noticeId }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="通知标题"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.noticeTitle }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="通知内容"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.noticeContent }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="跳转url"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.redirectUrl }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="乐观锁字段"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.version }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="0正常 1删除"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.deleted }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="门店id"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.shopId }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="门店名"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.shopName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="创建人"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.createName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.createTime }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="创建人id"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.createId }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="修改时间"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.updateTime }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="修改人"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.updateName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="修改人id"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.updateId }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="通知类型"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.noticeType }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
label="操作"
|
||||
width="300"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button-group>
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="sendNotice(scope)"
|
||||
>
|
||||
发送消息
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="edit(scope)"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
@click="del(scope)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.limit"
|
||||
@pagination="fetchData"
|
||||
/>
|
||||
|
||||
<add-form ref="addForm" @ok="addOk" />
|
||||
<edit-form ref="editForm" @ok="editOk" />
|
||||
|
||||
<choose-author ref="chooseAuthor" @ok="getCheckedAuthors" ></choose-author>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getNoticePage,deleteNotice,sendNotice} from "@/api/business/notice/notice";
|
||||
import {deepClone,success} from "@/utils";
|
||||
|
||||
import confirm from "@/utils/confirm";
|
||||
import Pagination from '@/components/Pagination'
|
||||
import addForm from "@/views/business/notice/addNotice";
|
||||
import editForm from "@/views/business/notice/editNotice";
|
||||
import ChooseAuthor from "@/views/business/notice/chooseAuthor";
|
||||
|
||||
export default {
|
||||
name: 'notice',
|
||||
components: {ChooseAuthor, addForm,editForm,Pagination},
|
||||
data() {
|
||||
return {
|
||||
total: 0,
|
||||
list: [],
|
||||
listLoading: true,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 50,
|
||||
keyword: ''
|
||||
},
|
||||
temp: {},
|
||||
notice: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
getCheckedAuthors(e){
|
||||
console.log('发送消息')
|
||||
console.log(e)
|
||||
sendNotice({noticeId:this.notice.noticeId
|
||||
,authorList:e}).then(res=>{
|
||||
console.log(res)
|
||||
})
|
||||
|
||||
},
|
||||
search() {
|
||||
this.fetchData()
|
||||
},
|
||||
refresh() {
|
||||
this.listQuery = this.$options.data().listQuery
|
||||
this.fetchData()
|
||||
},
|
||||
fetchData() {
|
||||
this.listLoading = true
|
||||
getNoticePage(this.listQuery).then(response => {
|
||||
const { records, total } = response.data
|
||||
this.list = records
|
||||
this.total = total
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
add(){
|
||||
this.$refs.addForm.open()
|
||||
},
|
||||
addOk(){
|
||||
this.fetchData()
|
||||
},
|
||||
sendNotice(scope){
|
||||
this.notice = scope.row
|
||||
this.$refs.chooseAuthor.open()
|
||||
},
|
||||
edit(scope) {
|
||||
const temp = deepClone(scope.row)
|
||||
this.$refs.editForm.open(temp)
|
||||
},
|
||||
editOk(){
|
||||
this.fetchData()
|
||||
},
|
||||
del(scope) {
|
||||
confirm("确定要删除吗?").then(res=>{
|
||||
if(res){
|
||||
deleteNotice(scope.row.noticeId).then(response => {
|
||||
console.log(response)
|
||||
success('删除成功')
|
||||
this.fetchData()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
121
web/src/views/business/receive/addReceive.vue
Normal file
121
web/src/views/business/receive/addReceive.vue
Normal file
@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
top="8vh"
|
||||
width="40%"
|
||||
:visible.sync="dialogVisible"
|
||||
center
|
||||
@close="handleCancel"
|
||||
>
|
||||
<div class="el-dialog-div">
|
||||
<el-form
|
||||
:rules="rules"
|
||||
ref="dataForm"
|
||||
:model="temp"
|
||||
label-position="right"
|
||||
label-width="120px"
|
||||
style="height: 90%;"
|
||||
>
|
||||
|
||||
<el-form-item label="接收id" prop="receiveId" class="is-required">
|
||||
<el-input v-model="temp.receiveId" placeholder="接收id" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="博主id" prop="authorId" class="is-required">
|
||||
<el-input v-model="temp.authorId" placeholder="博主id" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="博主名" prop="aurhorName" class="is-required">
|
||||
<el-input v-model="temp.aurhorName" placeholder="博主名" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="通知id" prop="noticeId" class="is-required">
|
||||
<el-input v-model="temp.noticeId" placeholder="通知id" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="通知标题" prop="noticeTitle" class="is-required">
|
||||
<el-input v-model="temp.noticeTitle" placeholder="通知标题" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="0正常 1删除" prop="deleted" class="is-required">
|
||||
<el-input v-model="temp.deleted" placeholder="0正常 1删除" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="创建时间" prop="createTime" class="is-required">
|
||||
<el-input v-model="temp.createTime" placeholder="创建时间" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="修改时间" prop="updateTime" class="is-required">
|
||||
<el-input v-model="temp.updateTime" placeholder="修改时间" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="0 发送 1已读" prop="receiveStatus" class="is-required">
|
||||
<el-input v-model="temp.receiveStatus" placeholder="0 发送 1已读" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleCancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addReceive} from "@/api/business/receive/receive";
|
||||
import {setRequiredFields} from "@/utils";
|
||||
const requiredFields = []
|
||||
export default {
|
||||
name: "addForm",
|
||||
data() {
|
||||
return {
|
||||
rules: setRequiredFields(requiredFields),
|
||||
dialogVisible: false,
|
||||
temp: {
|
||||
receiveId:'',
|
||||
authorId:'',
|
||||
aurhorName:'',
|
||||
noticeId:'',
|
||||
noticeTitle:'',
|
||||
deleted:'',
|
||||
createTime:'',
|
||||
updateTime:'',
|
||||
receiveStatus:'',
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
addReceive(this.temp).then(response =>{
|
||||
this.handleCancel()
|
||||
this.$emit('ok', response.data)
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleCancel() {
|
||||
//初始化
|
||||
this.temp = this.$options.data().temp
|
||||
this.dialogVisible = false
|
||||
this.$refs['dataForm'].resetFields();
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
122
web/src/views/business/receive/editReceive.vue
Normal file
122
web/src/views/business/receive/editReceive.vue
Normal file
@ -0,0 +1,122 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
top="8vh"
|
||||
width="40%"
|
||||
:visible.sync="dialogVisible"
|
||||
center
|
||||
@close="handleCancel"
|
||||
>
|
||||
<div class="el-dialog-div">
|
||||
<el-form
|
||||
:rules="rules"
|
||||
ref="dataForm"
|
||||
:model="temp"
|
||||
label-position="right"
|
||||
label-width="120px"
|
||||
style="height: 90%;"
|
||||
>
|
||||
|
||||
<el-form-item label="接收id" prop="receiveId" class="is-required">
|
||||
<el-input v-model="temp.receiveId" placeholder="接收id" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="博主id" prop="authorId" class="is-required">
|
||||
<el-input v-model="temp.authorId" placeholder="博主id" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="博主名" prop="aurhorName" class="is-required">
|
||||
<el-input v-model="temp.aurhorName" placeholder="博主名" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="通知id" prop="noticeId" class="is-required">
|
||||
<el-input v-model="temp.noticeId" placeholder="通知id" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="通知标题" prop="noticeTitle" class="is-required">
|
||||
<el-input v-model="temp.noticeTitle" placeholder="通知标题" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="0正常 1删除" prop="deleted" class="is-required">
|
||||
<el-input v-model="temp.deleted" placeholder="0正常 1删除" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="创建时间" prop="createTime" class="is-required">
|
||||
<el-input v-model="temp.createTime" placeholder="创建时间" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="修改时间" prop="updateTime" class="is-required">
|
||||
<el-input v-model="temp.updateTime" placeholder="修改时间" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="0 发送 1已读" prop="receiveStatus" class="is-required">
|
||||
<el-input v-model="temp.receiveStatus" placeholder="0 发送 1已读" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleCancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { editReceive } from "@/api/business/receive/receive";
|
||||
import {setRequiredFields} from "@/utils";
|
||||
const requiredFields = []
|
||||
|
||||
export default {
|
||||
name: "editForm",
|
||||
data() {
|
||||
return {
|
||||
rules: setRequiredFields(requiredFields),
|
||||
dialogVisible: false,
|
||||
temp: {
|
||||
receiveId:'',
|
||||
authorId:'',
|
||||
aurhorName:'',
|
||||
noticeId:'',
|
||||
noticeTitle:'',
|
||||
deleted:'',
|
||||
createTime:'',
|
||||
updateTime:'',
|
||||
receiveStatus:'',
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open(row) {
|
||||
this.temp = this.$options.data().temp
|
||||
this.temp = row
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
editReceive(this.temp).then(response => {
|
||||
this.handleCancel()
|
||||
this.$emit('ok', response.data)
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleCancel() {
|
||||
//初始化
|
||||
this.temp = this.$options.data().temp
|
||||
this.dialogVisible = false
|
||||
this.$refs['dataForm'].resetFields()
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
273
web/src/views/business/receive/receiveList.vue
Normal file
273
web/src/views/business/receive/receiveList.vue
Normal file
@ -0,0 +1,273 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<div class="filter-container">
|
||||
<el-input
|
||||
v-model="listQuery.keyword"
|
||||
size="small"
|
||||
placeholder="请输入关键词"
|
||||
clearable
|
||||
class="filter-item"
|
||||
style="width: 200px;margin-left: 10px;"
|
||||
/>
|
||||
<el-button-group style="margin-left: 10px;">
|
||||
<el-button
|
||||
size="small"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="search"
|
||||
>
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-refresh"
|
||||
@click="refresh"
|
||||
>
|
||||
重置
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
<el-button
|
||||
size="small"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
style="margin-left: 10px;"
|
||||
@click="add"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="list"
|
||||
element-loading-text="Loading"
|
||||
border
|
||||
fit
|
||||
height="100%"
|
||||
class="table-container"
|
||||
highlight-current-row
|
||||
>
|
||||
|
||||
<el-table-column
|
||||
label="序号"
|
||||
width="150"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.$index+1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="接收id"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.receiveId }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="博主id"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.authorId }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="博主名"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.aurhorName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="通知id"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.noticeId }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="通知标题"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.noticeTitle }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="0正常 1删除"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.deleted }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.createTime }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="修改时间"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.updateTime }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="0 发送 1已读"
|
||||
width="160"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.receiveStatus }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
label="操作"
|
||||
width="200"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button-group>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="edit(scope)"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
@click="del(scope)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.limit"
|
||||
@pagination="fetchData"
|
||||
/>
|
||||
|
||||
<add-form ref="addForm" @ok="addOk" />
|
||||
<edit-form ref="editForm" @ok="editOk" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getReceivePage,deleteReceive} from "@/api/business/receive/receive";
|
||||
import {deepClone,success} from "@/utils";
|
||||
|
||||
import confirm from "@/utils/confirm";
|
||||
import Pagination from '@/components/Pagination'
|
||||
import addForm from "@/views/business/receive/addReceive";
|
||||
import editForm from "@/views/business/receive/editReceive";
|
||||
|
||||
export default {
|
||||
name: 'receive',
|
||||
components: {addForm,editForm,Pagination},
|
||||
data() {
|
||||
return {
|
||||
total: 0,
|
||||
list: [],
|
||||
listLoading: true,
|
||||
listQuery: {
|
||||
page: 1,
|
||||
limit: 50,
|
||||
keyword: ''
|
||||
},
|
||||
temp: {},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.fetchData()
|
||||
},
|
||||
refresh() {
|
||||
this.listQuery = this.$options.data().listQuery
|
||||
this.fetchData()
|
||||
},
|
||||
fetchData() {
|
||||
this.listLoading = true
|
||||
getReceivePage(this.listQuery).then(response => {
|
||||
const { records, total } = response.data
|
||||
this.list = records
|
||||
this.total = total
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
add(){
|
||||
this.$refs.addForm.open()
|
||||
},
|
||||
addOk(){
|
||||
this.fetchData()
|
||||
},
|
||||
edit(scope) {
|
||||
const temp = deepClone(scope.row)
|
||||
this.$refs.editForm.open(temp)
|
||||
},
|
||||
editOk(){
|
||||
this.fetchData()
|
||||
},
|
||||
del(scope) {
|
||||
confirm("确定要删除吗?").then(res=>{
|
||||
if(res){
|
||||
deleteReceive(scope.row.receiveId).then(response => {
|
||||
console.log(response)
|
||||
success('删除成功')
|
||||
this.fetchData()
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -207,7 +207,7 @@
|
||||
</div>
|
||||
|
||||
<div style="font-weight: 500;font-size: 13px;letter-spacing: 1px;">
|
||||
<span>账号:用户名:admin 密码:111111</span><br/><br/>
|
||||
<span>账号:用户名:demo 密码:111111</span><br/><br/>
|
||||
<!-- <span>管理端账号:用户名:admin 密码:111111</span><br/><br/>-->
|
||||
<!-- <span>商业合作:qq: 7827869402 vx: MAMBA_4EVER24</span><br/><br/>-->
|
||||
<!-- <span> <a target="_blank" style="text-decoration: underline;" href="http://8.146.211.120:8086/"> 完整版演示 http://8.146.211.120:8086/</a></span><br/><br/>-->
|
||||
@ -258,7 +258,7 @@ export default {
|
||||
return {
|
||||
loginLogo: '',
|
||||
loginForm: {
|
||||
username: 'admin',
|
||||
username: 'demo',
|
||||
password: '111111'
|
||||
},
|
||||
input4:'',
|
||||
|
Loading…
x
Reference in New Issue
Block a user