zhangyuewww 2 年 前
コミット
183a1f2c42

+ 63 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardNewsInfoService.java

@@ -0,0 +1,63 @@
+package com.iotechn.unimall.admin.api.card;
+
+
+import com.iotechn.unimall.data.domain.CardNewsInfo;
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 记录消息信息Service接口
+ * 
+ * @author jlb
+ * @date 2023-04-20
+ */
+@HttpOpenApi(group = "admin.unimall.cardNewsInfo", description = "记录消息信息")
+public interface ICardNewsInfoService{
+	@HttpMethod(description = "新增", permissionName = "记录消息信息管理")
+	public Boolean add(@NotNull @HttpParam(name = "cardNewsInfo", type = HttpParamType.COMMON, description = "记录消息信息") CardNewsInfo cardNewsInfo)throws ServiceException;
+
+	@HttpMethod(description = "列表", permissionName = "记录消息信息管理")
+	public Page<CardNewsInfo> list(
+								@HttpParam(name = "sendId", type = HttpParamType.COMMON, description = "发送消息用户id") Long sendId,
+							@HttpParam(name = "receiveId", type = HttpParamType.COMMON, description = "接收消息用户id") Long receiveId,
+							@HttpParam(name = "newsTitle", type = HttpParamType.COMMON, description = "消息标题") String newsTitle,
+							@HttpParam(name = "newsContent", type = HttpParamType.COMMON, description = "消息内容") String newsContent,
+							@HttpParam(name = "newsType", type = HttpParamType.COMMON, description = "消息类型") String newsType,
+							@HttpParam(name = "newsFlag", type = HttpParamType.COMMON, description = "已读标识(1已读)") String newsFlag,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除",permissionName = "记录消息信息管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改", permissionName = "记录消息信息管理")
+	public Boolean update(@NotNull @HttpParam(name = "cardNewsInfo", type = HttpParamType.COMMON, description = "记录消息信息") CardNewsInfo cardNewsInfo)throws ServiceException;
+
+	@HttpMethod(description = "查询",  permissionName = "记录消息信息管理")
+	public CardNewsInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表",permissionName = "记录消息信息管理")
+	public String export(
+								@HttpParam(name = "sendId", type = HttpParamType.COMMON, description = "发送消息用户id") Long sendId,
+							@HttpParam(name = "receiveId", type = HttpParamType.COMMON, description = "接收消息用户id") Long receiveId,
+							@HttpParam(name = "newsTitle", type = HttpParamType.COMMON, description = "消息标题") String newsTitle,
+							@HttpParam(name = "newsContent", type = HttpParamType.COMMON, description = "消息内容") String newsContent,
+							@HttpParam(name = "newsType", type = HttpParamType.COMMON, description = "消息类型") String newsType,
+							@HttpParam(name = "newsFlag", type = HttpParamType.COMMON, description = "已读标识(1已读)") String newsFlag,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 136 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardNewsInfoServiceImpl.java

@@ -0,0 +1,136 @@
+package com.iotechn.unimall.admin.api.card.impl;
+
+import java.util.List;
+
+import com.iotechn.unimall.admin.api.card.ICardNewsInfoService;
+import com.iotechn.unimall.data.domain.CardNewsInfo;
+import com.iotechn.unimall.data.mapper.CardNewsInfoMapper;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 记录消息信息Service业务层处理
+ * 
+ * @author jlb
+ * @date 2023-04-20
+ */
+@Service
+public class CardNewsInfoServiceImpl implements ICardNewsInfoService {
+	@Autowired
+	private CardNewsInfoMapper cardNewsInfoMapper;
+	
+	@Override
+	public Boolean add(CardNewsInfo cardNewsInfo) throws ServiceException {
+		Date now = new Date();
+		cardNewsInfo.setGmtCreate(now);
+		cardNewsInfo.setGmtUpdate(now);
+		return cardNewsInfoMapper.insert(cardNewsInfo)>0;
+	}
+
+	@Override
+	public Page<CardNewsInfo> list(Long sendId,Long receiveId,String newsTitle,String newsContent,String newsType,String newsFlag,Date gmtCreate,Date gmtUpdate,Long deleteFlag, Integer page, Integer limit)throws ServiceException {
+		Wrapper<CardNewsInfo> wrapper = new EntityWrapper<CardNewsInfo>();
+														if (!StringUtils.isEmpty(sendId)) {
+					wrapper.eq("send_id", sendId);
+				}
+												if (!StringUtils.isEmpty(receiveId)) {
+					wrapper.eq("receive_id", receiveId);
+				}
+												if (!StringUtils.isEmpty(newsTitle)) {
+					wrapper.eq("news_title", newsTitle);
+				}
+												if (!StringUtils.isEmpty(newsContent)) {
+					wrapper.eq("news_content", newsContent);
+				}
+												if (!StringUtils.isEmpty(newsType)) {
+					wrapper.eq("news_type", newsType);
+				}
+												if (!StringUtils.isEmpty(newsFlag)) {
+					wrapper.eq("news_flag", newsFlag);
+				}
+												if (!StringUtils.isEmpty(gmtCreate)) {
+					wrapper.eq("gmt_create", gmtCreate);
+				}
+												if (!StringUtils.isEmpty(gmtUpdate)) {
+					wrapper.eq("gmt_update", gmtUpdate);
+				}
+												if (!StringUtils.isEmpty(deleteFlag)) {
+					wrapper.eq("delete_flag", deleteFlag);
+				}
+							wrapper.eq("delete_flag", 0);
+		List<CardNewsInfo> list = cardNewsInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+		Integer count = cardNewsInfoMapper.selectCount(wrapper);
+		return new Page<CardNewsInfo>(list, page, limit, count);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public Boolean delete(String id) {
+		String[] ids = String.valueOf(id).split(",");
+		for (String tt:ids) {
+			CardNewsInfo tmp =  cardNewsInfoMapper.selectById(Long.parseLong(tt));
+			if(tmp != null){
+				tmp.setDeleteFlag(1l);
+				cardNewsInfoMapper.updateById(tmp);
+			}
+		}
+		return true;
+	}
+
+	@Override
+	public Boolean update(CardNewsInfo cardNewsInfo) throws ServiceException {
+		Date now = new Date();
+		cardNewsInfo.setGmtUpdate(now);
+		return cardNewsInfoMapper.updateById(cardNewsInfo)>0;
+	}
+
+	@Override
+	public CardNewsInfo get(Long id) throws ServiceException {
+		return cardNewsInfoMapper.selectById(id);
+	}
+	
+	@Override
+	public String export(Long sendId,Long receiveId,String newsTitle,String newsContent,String newsType,String newsFlag,Date gmtCreate,Date gmtUpdate,Long deleteFlag, Integer page, Integer limit)throws ServiceException {
+		Wrapper<CardNewsInfo> wrapper = new EntityWrapper<CardNewsInfo>();
+														if (!StringUtils.isEmpty(sendId)) {
+					wrapper.eq("send_id", sendId);
+				}
+												if (!StringUtils.isEmpty(receiveId)) {
+					wrapper.eq("receive_id", receiveId);
+				}
+												if (!StringUtils.isEmpty(newsTitle)) {
+					wrapper.eq("news_title", newsTitle);
+				}
+												if (!StringUtils.isEmpty(newsContent)) {
+					wrapper.eq("news_content", newsContent);
+				}
+												if (!StringUtils.isEmpty(newsType)) {
+					wrapper.eq("news_type", newsType);
+				}
+												if (!StringUtils.isEmpty(newsFlag)) {
+					wrapper.eq("news_flag", newsFlag);
+				}
+												if (!StringUtils.isEmpty(gmtCreate)) {
+					wrapper.eq("gmt_create", gmtCreate);
+				}
+												if (!StringUtils.isEmpty(gmtUpdate)) {
+					wrapper.eq("gmt_update", gmtUpdate);
+				}
+												if (!StringUtils.isEmpty(deleteFlag)) {
+					wrapper.eq("delete_flag", deleteFlag);
+				}
+							List<CardNewsInfo> list = cardNewsInfoMapper.selectList(wrapper);
+		ExcelUtil<CardNewsInfo> util = new ExcelUtil<CardNewsInfo>(CardNewsInfo.class);
+		return util.exportExcel(list, "操作日志");
+	}
+}

+ 1 - 1
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/dict/DictDataService.java

@@ -18,7 +18,7 @@ public interface DictDataService {
 			@NotNull @HttpParam(name = "dictData", type = HttpParamType.COMMON, description = "字典信息") SysDictData dictData)
 			throws ServiceException;
 
-	@HttpMethod(description = "列表", permission = "admin:dictData:list", permissionParentName = "系统管理", permissionName = "字典管理")
+	@HttpMethod(description = "列表",  permissionName = "字典管理")
 	public Page<SysDictData> list(
 			@HttpParam(name = "dictType", type = HttpParamType.COMMON, description = "字典类型") String dictType,
 			@HttpParam(name = "dictLabel", type = HttpParamType.COMMON, description = "字典标签") String dictLabel,

+ 88 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/domain/CardNewsInfo.java

@@ -0,0 +1,88 @@
+package com.iotechn.unimall.data.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.iotechn.unimall.core.framework.aspectj.lang.annotaion.Excel;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import lombok.Data;
+import com.baomidou.mybatisplus.annotations.TableField;
+import java.util.Date;
+
+/**
+ * 记录消息信息对象 card_news_info
+ * 
+ * @author jlb
+ * @date 2023-04-20
+ */
+@Data
+@TableName("card_news_info")
+public class CardNewsInfo extends SuperDO {
+    private static final long serialVersionUID = 1L;
+
+    /**  */
+    @TableId("id")
+    private Long id;
+
+    /** 发送消息用户id */
+    @Excel(name = "发送消息用户id")
+    @TableField("send_id")
+    private Long sendId;
+
+    /** 接收消息用户id */
+    @Excel(name = "接收消息用户id")
+    @TableField("receive_id")
+    private Long receiveId;
+
+    /** 消息标题 */
+    @Excel(name = "消息标题")
+    @TableField("news_title")
+    private String newsTitle;
+
+    /** 消息内容 */
+    @Excel(name = "消息内容")
+    @TableField("news_content")
+    private String newsContent;
+
+    /** 消息类型 */
+    @Excel(name = "消息类型")
+    @TableField("news_type")
+    private String newsType;
+
+    /** 已读标识(1已读) */
+    @Excel(name = "已读标识", readConverterExp = "1=已读")
+    @TableField("news_flag")
+    private String newsFlag;
+
+    /**  */
+    @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd")
+    @TableField("gmt_create")
+    private Date gmtCreate;
+
+    /**  */
+    @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd")
+    @TableField("gmt_update")
+    private Date gmtUpdate;
+
+    /** 删除标识 */
+    @Excel(name = "删除标识")
+    @TableField("delete_flag")
+    private Long deleteFlag;
+
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("sendId", getSendId())
+            .append("receiveId", getReceiveId())
+            .append("newsTitle", getNewsTitle())
+            .append("newsContent", getNewsContent())
+            .append("newsType", getNewsType())
+            .append("newsFlag", getNewsFlag())
+            .append("gmtCreate", getGmtCreate())
+            .append("gmtUpdate", getGmtUpdate())
+            .append("deleteFlag", getDeleteFlag())
+            .toString();
+    }
+}

+ 14 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/mapper/CardNewsInfoMapper.java

@@ -0,0 +1,14 @@
+package com.iotechn.unimall.data.mapper;
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.iotechn.unimall.data.domain.CardNewsInfo;
+
+/**
+ * 记录消息信息Mapper接口
+ * 
+ * @author jlb
+ * @date 2023-04-20
+ */
+public interface CardNewsInfoMapper extends BaseMapper<CardNewsInfo> {
+
+}

+ 9 - 0
unimall-data/src/main/resources/com/iotechn/unimall/data/mapper/CardNewsInfoMapper.xml

@@ -0,0 +1,9 @@
+<?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.iotechn.unimall.data.mapper.CardNewsInfoMapper">
+    
+
+
+</mapper>