From 3f1e1e6d4450f99736fc405a76dda76054efab2f Mon Sep 17 00:00:00 2001 From: elliott <382696293@qq.com> Date: Fri, 22 Dec 2023 14:21:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=9D=E6=9C=AF=E7=AE=A1=E7=90=86-=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=A8=A1=E5=9D=97=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/domain/entity/WxScriptMessage.java | 223 ++++++++ .../core/mapper/WxScriptMessageMapper.java | 62 +++ .../mapper/WxScriptMessageMapper.xml | 134 +++++ .../controller/WxScriptMessageController.java | 106 ++++ .../service/IWxScriptMessageService.java | 62 +++ .../impl/WxScriptMessageServiceImpl.java | 100 ++++ flossom-ui/src/api/system/scriptMessage.js | 44 ++ .../src/views/system/scriptMessage/index.vue | 477 ++++++++++++++++++ 8 files changed, 1208 insertions(+) create mode 100644 flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxScriptMessage.java create mode 100644 flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxScriptMessageMapper.java create mode 100644 flossom-common/flossom-common-core/src/main/resources/mapper/WxScriptMessageMapper.xml create mode 100644 flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxScriptMessageController.java create mode 100644 flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxScriptMessageService.java create mode 100644 flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxScriptMessageServiceImpl.java create mode 100644 flossom-ui/src/api/system/scriptMessage.js create mode 100644 flossom-ui/src/views/system/scriptMessage/index.vue diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxScriptMessage.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxScriptMessage.java new file mode 100644 index 0000000..57c5f20 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxScriptMessage.java @@ -0,0 +1,223 @@ +package com.flossom.common.core.domain.entity; + +import com.flossom.common.core.annotation.Excel; +import com.flossom.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 消息模版对象 wx_script_message + * + * @author flossom + * @date 2023-12-22 + */ +public class WxScriptMessage extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 消息主键ID */ + private Long id; + + /** 消息类型 1-用户注册 2-提交留言 3-仪器绑定 */ + @Excel(name = "消息类型 1-用户注册 2-提交留言 3-仪器绑定") + private Integer messageType; + + /** 消息标题 */ + @Excel(name = "消息标题") + private String messageTitle; + + /** 仪器ID */ + @Excel(name = "仪器ID") + private Long machineId; + + /** 仪器名字 */ + @Excel(name = "仪器名字") + private String machineName; + + /** 消息内容 */ + @Excel(name = "消息内容") + private String messageContent; + + /** 0-开启 1-关闭 */ + @Excel(name = "0-开启 1-关闭") + private Integer status; + + /** 跳转类型:0无跳转、1跳转内部链接、3跳转外部链接、4跳转小程序、5导向视频号、6导向视频号直播间 */ + @Excel(name = "跳转类型:0无跳转、1跳转内部链接、3跳转外部链接、4跳转小程序、5导向视频号、6导向视频号直播间") + private Integer type; + + /** 跳转链接(跳转外部链接、跳转内部链接) */ + @Excel(name = "跳转链接", readConverterExp = "跳=转外部链接、跳转内部链接") + private String link; + + /** 跳转链接参数(跳转内部链接) */ + @Excel(name = "跳转链接参数", readConverterExp = "跳=转内部链接") + private String linkParams; + + /** 外链小程序appid(跳转小程序) */ + @Excel(name = "外链小程序appid", readConverterExp = "跳=转小程序") + private String redirectAppid; + + /** 外链小程序url(跳转小程序) */ + @Excel(name = "外链小程序url", readConverterExp = "跳=转小程序") + private String redirectUrl; + + /** 视频号(导向视频号、导向视频号直播间) */ + @Excel(name = "视频号", readConverterExp = "导=向视频号、导向视频号直播间") + private String videoNo; + + /** 视频号feedId(导向视频号) */ + @Excel(name = "视频号feedId", readConverterExp = "导=向视频号") + private String feedId; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setMessageType(Integer messageType) + { + this.messageType = messageType; + } + + public Integer getMessageType() + { + return messageType; + } + public void setMessageTitle(String messageTitle) + { + this.messageTitle = messageTitle; + } + + public String getMessageTitle() + { + return messageTitle; + } + public void setMachineId(Long machineId) + { + this.machineId = machineId; + } + + public Long getMachineId() + { + return machineId; + } + public void setMachineName(String machineName) + { + this.machineName = machineName; + } + + public String getMachineName() + { + return machineName; + } + public void setMessageContent(String messageContent) + { + this.messageContent = messageContent; + } + + public String getMessageContent() + { + return messageContent; + } + public void setStatus(Integer status) + { + this.status = status; + } + + public Integer getStatus() + { + return status; + } + public void setType(Integer type) + { + this.type = type; + } + + public Integer getType() + { + return type; + } + public void setLink(String link) + { + this.link = link; + } + + public String getLink() + { + return link; + } + public void setLinkParams(String linkParams) + { + this.linkParams = linkParams; + } + + public String getLinkParams() + { + return linkParams; + } + public void setRedirectAppid(String redirectAppid) + { + this.redirectAppid = redirectAppid; + } + + public String getRedirectAppid() + { + return redirectAppid; + } + public void setRedirectUrl(String redirectUrl) + { + this.redirectUrl = redirectUrl; + } + + public String getRedirectUrl() + { + return redirectUrl; + } + public void setVideoNo(String videoNo) + { + this.videoNo = videoNo; + } + + public String getVideoNo() + { + return videoNo; + } + public void setFeedId(String feedId) + { + this.feedId = feedId; + } + + public String getFeedId() + { + return feedId; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("messageType", getMessageType()) + .append("messageTitle", getMessageTitle()) + .append("machineId", getMachineId()) + .append("machineName", getMachineName()) + .append("messageContent", getMessageContent()) + .append("status", getStatus()) + .append("type", getType()) + .append("link", getLink()) + .append("linkParams", getLinkParams()) + .append("redirectAppid", getRedirectAppid()) + .append("redirectUrl", getRedirectUrl()) + .append("videoNo", getVideoNo()) + .append("feedId", getFeedId()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxScriptMessageMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxScriptMessageMapper.java new file mode 100644 index 0000000..29f7077 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxScriptMessageMapper.java @@ -0,0 +1,62 @@ +package com.flossom.common.core.mapper; + +import com.flossom.common.core.domain.entity.WxScriptMessage; + +import java.util.List; + +/** + * 消息模版Mapper接口 + * + * @author flossom + * @date 2023-12-22 + */ +public interface WxScriptMessageMapper +{ + /** + * 查询消息模版 + * + * @param id 消息模版主键 + * @return 消息模版 + */ + public WxScriptMessage selectWxScriptMessageById(Long id); + + /** + * 查询消息模版列表 + * + * @param wxScriptMessage 消息模版 + * @return 消息模版集合 + */ + public List selectWxScriptMessageList(WxScriptMessage wxScriptMessage); + + /** + * 新增消息模版 + * + * @param wxScriptMessage 消息模版 + * @return 结果 + */ + public int insertWxScriptMessage(WxScriptMessage wxScriptMessage); + + /** + * 修改消息模版 + * + * @param wxScriptMessage 消息模版 + * @return 结果 + */ + public int updateWxScriptMessage(WxScriptMessage wxScriptMessage); + + /** + * 删除消息模版 + * + * @param id 消息模版主键 + * @return 结果 + */ + public int deleteWxScriptMessageById(Long id); + + /** + * 批量删除消息模版 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWxScriptMessageByIds(Long[] ids); +} diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxScriptMessageMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxScriptMessageMapper.xml new file mode 100644 index 0000000..34f97d4 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxScriptMessageMapper.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, message_type, message_title, machine_id, machine_name, message_content, status, type, link, link_params, redirect_appid, redirect_url, video_no, feed_id, create_by, create_time, update_by, update_time from wx_script_message + + + + + + + + insert into wx_script_message + + id, + message_type, + message_title, + machine_id, + machine_name, + message_content, + status, + type, + link, + link_params, + redirect_appid, + redirect_url, + video_no, + feed_id, + create_by, + create_time, + update_by, + update_time, + + + #{id}, + #{messageType}, + #{messageTitle}, + #{machineId}, + #{machineName}, + #{messageContent}, + #{status}, + #{type}, + #{link}, + #{linkParams}, + #{redirectAppid}, + #{redirectUrl}, + #{videoNo}, + #{feedId}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update wx_script_message + + message_type = #{messageType}, + message_title = #{messageTitle}, + machine_id = #{machineId}, + machine_name = #{machineName}, + message_content = #{messageContent}, + status = #{status}, + type = #{type}, + link = #{link}, + link_params = #{linkParams}, + redirect_appid = #{redirectAppid}, + redirect_url = #{redirectUrl}, + video_no = #{videoNo}, + feed_id = #{feedId}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from wx_script_message where id = #{id} + + + + delete from wx_script_message where id in + + #{id} + + + diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxScriptMessageController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxScriptMessageController.java new file mode 100644 index 0000000..5aad189 --- /dev/null +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxScriptMessageController.java @@ -0,0 +1,106 @@ +package com.flossom.system.controller; + +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +import com.flossom.common.core.domain.entity.WxScriptMessage; +import com.flossom.common.core.utils.poi.ExcelUtil; +import com.flossom.common.core.web.controller.BaseController; +import com.flossom.common.core.web.domain.AjaxResult; +import com.flossom.common.core.web.page.TableDataInfo; +import com.flossom.common.log.annotation.Log; +import com.flossom.common.log.enums.BusinessType; +import com.flossom.common.security.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.flossom.system.service.IWxScriptMessageService; + +/** + * 消息模版Controller + * + * @author flossom + * @date 2023-12-22 + */ +@RestController +@RequestMapping("/scriptMessage") +public class WxScriptMessageController extends BaseController +{ + @Autowired + private IWxScriptMessageService wxScriptMessageService; + + /** + * 查询消息模版列表 + */ + @RequiresPermissions("system:scriptMessage:list") + @GetMapping("/list") + public TableDataInfo list(WxScriptMessage wxScriptMessage) + { + startPage(); + List list = wxScriptMessageService.selectWxScriptMessageList(wxScriptMessage); + return getDataTable(list); + } + + /** + * 导出消息模版列表 + */ + @RequiresPermissions("system:scriptMessage:export") + @Log(title = "消息模版", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WxScriptMessage wxScriptMessage) + { + List list = wxScriptMessageService.selectWxScriptMessageList(wxScriptMessage); + ExcelUtil util = new ExcelUtil(WxScriptMessage.class); + util.exportExcel(response, list, "消息模版数据"); + } + + /** + * 获取消息模版详细信息 + */ + @RequiresPermissions("system:scriptMessage:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(wxScriptMessageService.selectWxScriptMessageById(id)); + } + + /** + * 新增消息模版 + */ + @RequiresPermissions("system:scriptMessage:add") + @Log(title = "消息模版", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WxScriptMessage wxScriptMessage) + { + return toAjax(wxScriptMessageService.insertWxScriptMessage(wxScriptMessage)); + } + + /** + * 修改消息模版 + */ + @RequiresPermissions("system:scriptMessage:edit") + @Log(title = "消息模版", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WxScriptMessage wxScriptMessage) + { + return toAjax(wxScriptMessageService.updateWxScriptMessage(wxScriptMessage)); + } + + /** + * 删除消息模版 + */ + @RequiresPermissions("system:scriptMessage:remove") + @Log(title = "消息模版", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(wxScriptMessageService.deleteWxScriptMessageByIds(ids)); + } +} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxScriptMessageService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxScriptMessageService.java new file mode 100644 index 0000000..a3db245 --- /dev/null +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxScriptMessageService.java @@ -0,0 +1,62 @@ +package com.flossom.system.service; + +import com.flossom.common.core.domain.entity.WxScriptMessage; + +import java.util.List; + +/** + * 消息模版Service接口 + * + * @author flossom + * @date 2023-12-22 + */ +public interface IWxScriptMessageService +{ + /** + * 查询消息模版 + * + * @param id 消息模版主键 + * @return 消息模版 + */ + public WxScriptMessage selectWxScriptMessageById(Long id); + + /** + * 查询消息模版列表 + * + * @param wxScriptMessage 消息模版 + * @return 消息模版集合 + */ + public List selectWxScriptMessageList(WxScriptMessage wxScriptMessage); + + /** + * 新增消息模版 + * + * @param wxScriptMessage 消息模版 + * @return 结果 + */ + public int insertWxScriptMessage(WxScriptMessage wxScriptMessage); + + /** + * 修改消息模版 + * + * @param wxScriptMessage 消息模版 + * @return 结果 + */ + public int updateWxScriptMessage(WxScriptMessage wxScriptMessage); + + /** + * 批量删除消息模版 + * + * @param ids 需要删除的消息模版主键集合 + * @return 结果 + */ + public int deleteWxScriptMessageByIds(Long[] ids); + + /** + * 删除消息模版信息 + * + * @param id 消息模版主键 + * @return 结果 + */ + public int deleteWxScriptMessageById(Long id); +} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxScriptMessageServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxScriptMessageServiceImpl.java new file mode 100644 index 0000000..5c833e1 --- /dev/null +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxScriptMessageServiceImpl.java @@ -0,0 +1,100 @@ +package com.flossom.system.service.impl; + +import java.util.List; + +import com.flossom.common.core.domain.entity.WxScriptMessage; +import com.flossom.common.core.mapper.WxScriptMessageMapper; +import com.flossom.common.core.utils.DateUtils; +import com.flossom.common.security.utils.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.flossom.system.service.IWxScriptMessageService; + +/** + * 消息模版Service业务层处理 + * + * @author flossom + * @date 2023-12-22 + */ +@Service +public class WxScriptMessageServiceImpl implements IWxScriptMessageService +{ + @Autowired + private WxScriptMessageMapper wxScriptMessageMapper; + + /** + * 查询消息模版 + * + * @param id 消息模版主键 + * @return 消息模版 + */ + @Override + public WxScriptMessage selectWxScriptMessageById(Long id) + { + return wxScriptMessageMapper.selectWxScriptMessageById(id); + } + + /** + * 查询消息模版列表 + * + * @param wxScriptMessage 消息模版 + * @return 消息模版 + */ + @Override + public List selectWxScriptMessageList(WxScriptMessage wxScriptMessage) + { + return wxScriptMessageMapper.selectWxScriptMessageList(wxScriptMessage); + } + + /** + * 新增消息模版 + * + * @param wxScriptMessage 消息模版 + * @return 结果 + */ + @Override + public int insertWxScriptMessage(WxScriptMessage wxScriptMessage) + { + wxScriptMessage.setCreateTime(DateUtils.getNowDate()); + wxScriptMessage.setCreateBy(SecurityUtils.getUsername()); + return wxScriptMessageMapper.insertWxScriptMessage(wxScriptMessage); + } + + /** + * 修改消息模版 + * + * @param wxScriptMessage 消息模版 + * @return 结果 + */ + @Override + public int updateWxScriptMessage(WxScriptMessage wxScriptMessage) + { + wxScriptMessage.setUpdateTime(DateUtils.getNowDate()); + wxScriptMessage.setUpdateBy(SecurityUtils.getUsername()); + return wxScriptMessageMapper.updateWxScriptMessage(wxScriptMessage); + } + + /** + * 批量删除消息模版 + * + * @param ids 需要删除的消息模版主键 + * @return 结果 + */ + @Override + public int deleteWxScriptMessageByIds(Long[] ids) + { + return wxScriptMessageMapper.deleteWxScriptMessageByIds(ids); + } + + /** + * 删除消息模版信息 + * + * @param id 消息模版主键 + * @return 结果 + */ + @Override + public int deleteWxScriptMessageById(Long id) + { + return wxScriptMessageMapper.deleteWxScriptMessageById(id); + } +} diff --git a/flossom-ui/src/api/system/scriptMessage.js b/flossom-ui/src/api/system/scriptMessage.js new file mode 100644 index 0000000..188db01 --- /dev/null +++ b/flossom-ui/src/api/system/scriptMessage.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询消息模版列表 +export function listMessage(query) { + return request({ + url: '/system/scriptMessage/list', + method: 'get', + params: query + }) +} + +// 查询消息模版详细 +export function getMessage(id) { + return request({ + url: '/system/scriptMessage/' + id, + method: 'get' + }) +} + +// 新增消息模版 +export function addMessage(data) { + return request({ + url: '/system/scriptMessage', + method: 'post', + data: data + }) +} + +// 修改消息模版 +export function updateMessage(data) { + return request({ + url: '/system/scriptMessage', + method: 'put', + data: data + }) +} + +// 删除消息模版 +export function delMessage(id) { + return request({ + url: '/system/scriptMessage/' + id, + method: 'delete' + }) +} diff --git a/flossom-ui/src/views/system/scriptMessage/index.vue b/flossom-ui/src/views/system/scriptMessage/index.vue new file mode 100644 index 0000000..c9208f5 --- /dev/null +++ b/flossom-ui/src/views/system/scriptMessage/index.vue @@ -0,0 +1,477 @@ + + +