This commit is contained in:
parent
d8663f11a8
commit
00e601dd0b
|
|
@ -71,4 +71,6 @@ public class MaterialConstants {
|
|||
/** 文件类型:合同照片 */
|
||||
public static final Integer APPENDICES_OF_CONTRACT = 20; //move to TmTaskTypeEnum
|
||||
|
||||
public static final String CACHE_MATERIAL_MALL_MESSAGE_CODE = "material-mall-message-code:";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,21 @@ public class BmMessage extends BaseEntity {
|
|||
@ApiModelProperty(value = "uuid")
|
||||
private String uuid;
|
||||
|
||||
/** 消息类型 */
|
||||
@Excel(name = "消息类型")
|
||||
@ApiModelProperty(value = "消息类型")
|
||||
private String messageType;
|
||||
|
||||
/** 消息主题 */
|
||||
@Excel(name = "消息主题")
|
||||
@ApiModelProperty(value = "消息主题")
|
||||
private String messageTopic;
|
||||
|
||||
/** 消息内容 */
|
||||
@Excel(name = "消息内容")
|
||||
@ApiModelProperty(value = "消息内容")
|
||||
private String messageContent;
|
||||
|
||||
/** 来自userId */
|
||||
@Excel(name = "来自userId")
|
||||
@ApiModelProperty(value = "来自userId")
|
||||
|
|
@ -46,16 +61,4 @@ public class BmMessage extends BaseEntity {
|
|||
@Excel(name = "发给companyId")
|
||||
@ApiModelProperty(value = "发给companyId")
|
||||
private String toCompany;
|
||||
|
||||
/** 消息内容 */
|
||||
@Excel(name = "消息内容")
|
||||
@ApiModelProperty(value = "消息内容")
|
||||
private String messageContent;
|
||||
|
||||
/** 消息类型 */
|
||||
@Excel(name = "消息类型")
|
||||
@ApiModelProperty(value = "消息类型")
|
||||
private String messageType;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,24 @@
|
|||
package com.bonus.material.basic.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.bonus.common.biz.constant.MaterialConstants;
|
||||
import com.bonus.common.core.constant.CacheConstants;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.redis.service.RedisService;
|
||||
import com.bonus.common.security.config.VerificationCodeConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.material.basic.mapper.BmMessageMapper;
|
||||
import com.bonus.material.basic.domain.BmMessage;
|
||||
import com.bonus.material.basic.service.IBmMessageService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
|
|
@ -20,6 +30,12 @@ public class BmMessageServiceImpl implements IBmMessageService {
|
|||
@Autowired
|
||||
private BmMessageMapper bmMessageMapper;
|
||||
|
||||
@Resource
|
||||
private VerificationCodeConfig verificationCodeConfig;
|
||||
|
||||
@Resource
|
||||
private RedisService redisService;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
|
|
@ -52,6 +68,9 @@ public class BmMessageServiceImpl implements IBmMessageService {
|
|||
public int insertBmMessage(BmMessage bmMessage) {
|
||||
bmMessage.setCreateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
String uuid = String.valueOf(UUID.randomUUID());
|
||||
String verifyKey = MaterialConstants.CACHE_MATERIAL_MALL_MESSAGE_CODE + StringUtils.nvl(uuid + "_" + bmMessage.getMessageTopic(), "");
|
||||
redisService.setCacheObject(verifyKey, uuid, verificationCodeConfig.getTime(), TimeUnit.MINUTES);
|
||||
return bmMessageMapper.insertBmMessage(bmMessage);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("错误信息描述");
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="toUser" column="to_user" />
|
||||
<result property="fromCompany" column="from_company" />
|
||||
<result property="toCompany" column="to_company" />
|
||||
<result property="messageContent" column="message_content" />
|
||||
<result property="messageType" column="message_type" />
|
||||
<result property="messageTopic" column="message_topic" />
|
||||
<result property="messageContent" column="message_content" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBmMessageVo">
|
||||
select id, uuid, from_user, to_user, from_company, to_company, message_content, message_type, create_time, update_time from bm_message
|
||||
select id, uuid, from_user, to_user, from_company, to_company, message_content, message_topic, message_type, create_time, update_time from bm_message
|
||||
</sql>
|
||||
|
||||
<select id="selectBmMessageList" parameterType="com.bonus.material.basic.domain.BmMessage" resultMap="BmMessageResult">
|
||||
|
|
@ -29,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="fromCompany != null and fromCompany != ''"> and from_company = #{fromCompany}</if>
|
||||
<if test="toCompany != null and toCompany != ''"> and to_company = #{toCompany}</if>
|
||||
<if test="messageContent != null and messageContent != ''"> and message_content = #{messageContent}</if>
|
||||
<if test="messageTopic != null and messageTopic != ''"> and message_topic = #{messageTopic}</if>
|
||||
<if test="messageType != null and messageType != ''"> and message_type = #{messageType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
@ -47,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="fromCompany != null">from_company,</if>
|
||||
<if test="toCompany != null">to_company,</if>
|
||||
<if test="messageContent != null">message_content,</if>
|
||||
<if test="messageTopic != null">message_topic,</if>
|
||||
<if test="messageType != null">message_type,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
|
|
@ -58,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="fromCompany != null">#{fromCompany},</if>
|
||||
<if test="toCompany != null">#{toCompany},</if>
|
||||
<if test="messageContent != null">#{messageContent},</if>
|
||||
<if test="messageTopic != null">#{messageTopic},</if>
|
||||
<if test="messageType != null">#{messageType},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
|
|
@ -73,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="fromCompany != null">from_company = #{fromCompany},</if>
|
||||
<if test="toCompany != null">to_company = #{toCompany},</if>
|
||||
<if test="messageContent != null">message_content = #{messageContent},</if>
|
||||
<if test="messageTopic != null">message_topic = #{messageTopic},</if>
|
||||
<if test="messageType != null">message_type = #{messageType},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue