发短信功能改成不往数据库记日志,改成log输出了
This commit is contained in:
@ -13,8 +13,7 @@ import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity.*;
|
|||||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizSendMsgLogService;
|
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizSendMsgLogService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizSendMsgTemplateService;
|
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizSendMsgTemplateService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizSmsEmailService;
|
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizSmsEmailService;
|
||||||
import com.chinaunicom.mall.ebtp.extend.crypconfigure.entity.CrypConfigure;
|
import com.chinaunicom.mall.ebtp.extend.funcswitch.dao.BizFuncSwitchConfigMapper;
|
||||||
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.BizBidTemplateWarehouse;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@ -23,11 +22,9 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对数据表 biz_send_msg_template 操作的 serviceImpl
|
* 对数据表 biz_send_msg_template 操作的 serviceImpl
|
||||||
@ -44,6 +41,8 @@ public class BizSendMsgTemplateServiceImpl extends ServiceImpl<BizSendMsgTemplat
|
|||||||
private IBaseCacheUserService cacheUserService;
|
private IBaseCacheUserService cacheUserService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private BizSendMsgLogService msgLogService;
|
private BizSendMsgLogService msgLogService;
|
||||||
|
@Autowired
|
||||||
|
private BizFuncSwitchConfigMapper funcSwitchConfigMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean sendMsg(BizSendMsgInfoVO msgInfoVO) {
|
public Boolean sendMsg(BizSendMsgInfoVO msgInfoVO) {
|
||||||
@ -160,8 +159,12 @@ public class BizSendMsgTemplateServiceImpl extends ServiceImpl<BizSendMsgTemplat
|
|||||||
.setSenderUserId(userId)
|
.setSenderUserId(userId)
|
||||||
.setSenderUserName(userName);
|
.setSenderUserName(userName);
|
||||||
log.info("sendMsgLog传入数据:"+ JsonUtils.objectToJson(msgLog));
|
log.info("sendMsgLog传入数据:"+ JsonUtils.objectToJson(msgLog));
|
||||||
|
//active使能(1:是;0:否)
|
||||||
|
int active =funcSwitchConfigMapper.selectByType("send-sms-record-log");
|
||||||
|
if (active==1) {
|
||||||
msgLogService.save(msgLog);
|
msgLogService.save(msgLog);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private String generateMsgFromTemplete(String msg, Map<String, String> params) {
|
private String generateMsgFromTemplete(String msg, Map<String, String> params) {
|
||||||
for (Map.Entry<String, String> param : params.entrySet()) {
|
for (Map.Entry<String, String> param : params.entrySet()) {
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.chinaunicom.mall.ebtp.extend.funcswitch.dao;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.chinaunicom.mall.ebtp.process.funcswitch.entity.BizFuncSwitchConfig;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface BizFuncSwitchConfigMapper extends BaseMapper<BizFuncSwitchConfig> {
|
||||||
|
|
||||||
|
Integer selectByType(String type);
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
<?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.chinaunicom.mall.ebtp.process.funcswitch.dao.BizFuncSwitchConfigMapper">
|
||||||
|
<resultMap id="BaseResultMap"
|
||||||
|
type="com.chinaunicom.mall.ebtp.process.funcswitch.entity.BizFuncSwitchConfig">
|
||||||
|
<result column="id" jdbcType="BIGINT" property="id"/>
|
||||||
|
<result column="type" jdbcType="VARCHAR" property="type"/>
|
||||||
|
<result column="active" jdbcType="VARCHAR" property="active"/>
|
||||||
|
<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
|
||||||
|
</resultMap>
|
||||||
|
<select id="selectByType"
|
||||||
|
resultType="java.lang.Integer">
|
||||||
|
SELECT active FROM biz_func_switch_config WHERE `type` = #{type}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -0,0 +1,47 @@
|
|||||||
|
package com.chinaunicom.mall.ebtp.extend.funcswitch.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实体类 BizSendMsgLog
|
||||||
|
*
|
||||||
|
* @auto.generated
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel
|
||||||
|
@TableName(value = "biz_func_switch_config", autoResultMap = true)
|
||||||
|
public class BizFuncSwitchConfig implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "主键ID")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 唯一标签
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "唯一标签")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使能(1:是;0:否)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "使能(1:是;0:否)")
|
||||||
|
private Integer active;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "说明")
|
||||||
|
private String remarks;
|
||||||
|
}
|
Reference in New Issue
Block a user