| @@ -36,6 +36,7 @@ public class WxMsgController extends BaseController { | |||||
| public ResultData list(@ModelAttribute WxMsg wxMsg, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxMsg wxMsg, Integer pageNum, Integer pageSize) { | ||||
| if (null == wxMsg) wxMsg = new WxMsg(); | if (null == wxMsg) wxMsg = new WxMsg(); | ||||
| wxMsg.setTenantId(getTenantId()); | wxMsg.setTenantId(getTenantId()); | ||||
| //wxMsg.setWay(EnumSendWay.TAG.getCode()); | |||||
| wxMsg.setSortColumns(WxMsg.Field.Createtime_DESC); | wxMsg.setSortColumns(WxMsg.Field.Createtime_DESC); | ||||
| final PageInfo<WxMsg> page = wxMsgService.listAsPage(wxMsg, pageNum, pageSize); | final PageInfo<WxMsg> page = wxMsgService.listAsPage(wxMsg, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| @@ -1,6 +1,9 @@ | |||||
| package com.iformall.schedule; | package com.iformall.schedule; | ||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxCUser; | |||||
| import com.iformall.domain.po.WxMsg; | import com.iformall.domain.po.WxMsg; | ||||
| import com.iformall.domain.po.WxMsgConfig; | import com.iformall.domain.po.WxMsgConfig; | ||||
| import com.iformall.mapper.WxMsgConfigMapper; | import com.iformall.mapper.WxMsgConfigMapper; | ||||
| @@ -45,6 +48,9 @@ public class MsgSendingSchedule { | |||||
| } | } | ||||
| public void sendmsg(WxMsg wxMsg){ | public void sendmsg(WxMsg wxMsg){ | ||||
| //从短信配置中查询密钥 bid 等信息 | //从短信配置中查询密钥 bid 等信息 | ||||
| WxMsgConfig wxMsgConfig = new WxMsgConfig(); | WxMsgConfig wxMsgConfig = new WxMsgConfig(); | ||||
| wxMsgConfig.setTenantId(wxMsg.getTenantId()); | wxMsgConfig.setTenantId(wxMsg.getTenantId()); | ||||
| @@ -52,6 +58,17 @@ public class MsgSendingSchedule { | |||||
| if (wxMsgConfigs.size() == 0) return; | if (wxMsgConfigs.size() == 0) return; | ||||
| wxMsgConfig = wxMsgConfigs.get(0); | wxMsgConfig = wxMsgConfigs.get(0); | ||||
| if(wxMsgConfig.getRemains()==0){ | |||||
| logger.info("短信数量为0"); | |||||
| return; | |||||
| } | |||||
| if(wxMsgConfig.getRemains()<wxMsg.getExpectSendNumber()){ | |||||
| logger.info("短信数量不足"); | |||||
| return; | |||||
| } | |||||
| String secret = wxMsgConfig.getSecret(); | String secret = wxMsgConfig.getSecret(); | ||||
| String bid = wxMsgConfig.getBid(); | String bid = wxMsgConfig.getBid(); | ||||
| String publickey = wxMsgConfig.getPublickey(); | String publickey = wxMsgConfig.getPublickey(); | ||||
| @@ -213,6 +213,9 @@ public enum ErrorCode{ | |||||
| MSG_METHOD_REQUEST_ERROR(12108,"接口请求错误"), | MSG_METHOD_REQUEST_ERROR(12108,"接口请求错误"), | ||||
| MSG_PHONE_NOT_FOUND(12109,"请输入手机号"), | MSG_PHONE_NOT_FOUND(12109,"请输入手机号"), | ||||
| MSG_SEND_WAY_CHOOSE_ERROR(12110,"请确定发送的方式"), | MSG_SEND_WAY_CHOOSE_ERROR(12110,"请确定发送的方式"), | ||||
| MSG_SUM_ZERO(12111,"短信数量为0"), | |||||
| MSG_SUM_INSUFFICENT(12112,"短信数量不足"), | |||||
| /** | /** | ||||
| * 会员 | * 会员 | ||||
| @@ -2,12 +2,12 @@ package com.iformall.domain.po; | |||||
| import com.iformall.domain.vo.WxChooseTagVo; | import com.iformall.domain.vo.WxChooseTagVo; | ||||
| import javax.persistence.*; | |||||
| import java.util.*; | |||||
| import javax.persistence.Transient; | |||||
| import java.util.List; | |||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import javax.persistence.Table; | |||||
| import javax.persistence.Transient; | |||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| @Table(name = "coupon_inject") | @Table(name = "coupon_inject") | ||||
| public class CouponInject implements Serializable { | public class CouponInject implements Serializable { | ||||
| @@ -84,8 +84,7 @@ public class CouponInject implements Serializable { | |||||
| /*发送人群标签**/ | /*发送人群标签**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="发送人群标签",name="tags") | @io.swagger.annotations.ApiModelProperty(value="发送人群标签",name="tags") | ||||
| private String tags; | private String tags; | ||||
| /*短信模板id**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="短信模板id",name="modelId") | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="modelId") | |||||
| private Long modelId; | private Long modelId; | ||||
| /*创建时间**/ | /*创建时间**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") | @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") | ||||
| @@ -93,6 +92,10 @@ public class CouponInject implements Serializable { | |||||
| /*修改时间**/ | /*修改时间**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="修改时间",name="updateTime") | @io.swagger.annotations.ApiModelProperty(value="修改时间",name="updateTime") | ||||
| private Date updateTime; | private Date updateTime; | ||||
| @io.swagger.annotations.ApiModelProperty(value="短信id",name="msgId") | |||||
| private Long msgId; | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| } | } | ||||
| @@ -200,7 +203,21 @@ public class CouponInject implements Serializable { | |||||
| this.sendTimeEnd = sendTimeEnd; | this.sendTimeEnd = sendTimeEnd; | ||||
| } | } | ||||
| public Long getmUserId() { | |||||
| return mUserId; | |||||
| } | |||||
| public void setmUserId(Long mUserId) { | |||||
| this.mUserId = mUserId; | |||||
| } | |||||
| public Long getMsgId() { | |||||
| return msgId; | |||||
| } | |||||
| public void setMsgId(Long msgId) { | |||||
| this.msgId = msgId; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| @@ -92,6 +92,9 @@ public class WxMsg implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value="状态0未发送 1已发送 2草稿箱",name="status") | @io.swagger.annotations.ApiModelProperty(value="状态0未发送 1已发送 2草稿箱",name="status") | ||||
| private Integer status; | private Integer status; | ||||
| @io.swagger.annotations.ApiModelProperty(value="1标签短信2精准投放",name="way") | |||||
| private Integer way; | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| } | } | ||||
| @@ -201,6 +204,14 @@ public class WxMsg implements Serializable { | |||||
| this.status = status; | this.status = status; | ||||
| } | } | ||||
| public Integer getWay() { | |||||
| return way; | |||||
| } | |||||
| public void setWay(Integer way) { | |||||
| this.way = way; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| @@ -0,0 +1,37 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * Created by Stormeye on 2018/08/09. | |||||
| */ | |||||
| public enum EnumSendWay { | |||||
| // 1、标签短信 2:精准发券 | |||||
| TAG(1,"标签短信"), | |||||
| COUPON(2, "精准发券") | |||||
| ; | |||||
| public static EnumSendWay getEnum(Integer code) { | |||||
| for (EnumSendWay value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumSendWay(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -3,6 +3,8 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.WxMsgConfig; | import com.iformall.domain.po.WxMsgConfig; | ||||
| import java.util.List; | |||||
| public interface WxMsgConfigService { | public interface WxMsgConfigService { | ||||
| /** | /** | ||||
| @@ -36,12 +38,7 @@ public interface WxMsgConfigService { | |||||
| * @param id | * @param id | ||||
| */ | */ | ||||
| void deleteById(Long id); | void deleteById(Long id); | ||||
| WxMsgConfig findObject(WxMsgConfig wxMsgConfig); | |||||
| } | } | ||||
| @@ -34,6 +34,13 @@ public class CouponInjectServiceImpl implements CouponInjectService { | |||||
| WxCUserTagsService wxCUserTagsService; | WxCUserTagsService wxCUserTagsService; | ||||
| @Autowired | @Autowired | ||||
| WxCouponActionLogService wxCouponActionLogService; | WxCouponActionLogService wxCouponActionLogService; | ||||
| @Autowired | |||||
| WxMsgService wxMsgService; | |||||
| @Autowired | |||||
| WxMsgModelService wxMsgModelService; | |||||
| @Autowired | |||||
| WxMsgConfigService wxMsgConfigService; | |||||
| @Override | @Override | ||||
| @@ -113,9 +120,84 @@ public class CouponInjectServiceImpl implements CouponInjectService { | |||||
| if(record.getSendType().equals(EnumCouponInjectSendType.IMMEDIATE.getCode())) { | if(record.getSendType().equals(EnumCouponInjectSendType.IMMEDIATE.getCode())) { | ||||
| sendNow(wxCoupon,cUsers,record.getId()); | sendNow(wxCoupon,cUsers,record.getId()); | ||||
| } | } | ||||
| //发送短信 | |||||
| sendMsg(record,cUsers); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| private void sendMsg(CouponInject record, List<WxCUser> cUsers) { | |||||
| //根据模板ID查询短信信息 | |||||
| WxMsgModel model = wxMsgModelService.getById(record.getModelId()); | |||||
| if(model==null){ | |||||
| return; | |||||
| } | |||||
| WxMsg wxmsg=new WxMsg(); | |||||
| wxmsg.setTenantId(record.getTenantId()); | |||||
| WxMsgConfig wxMsgConfig = new WxMsgConfig(); | |||||
| wxMsgConfig.setTenantId(wxmsg.getTenantId()); | |||||
| wxMsgConfig = wxMsgConfigService.findObject(wxMsgConfig); | |||||
| if (wxMsgConfig==null){ | |||||
| logger.info("您还未接入短信运营商,请联系平台管理员"); | |||||
| return; | |||||
| } | |||||
| if(wxMsgConfig.getRemains()==0){ | |||||
| logger.info("短信数量为0"); | |||||
| return; | |||||
| } | |||||
| wxmsg.setExpectSendNumber(cUsers.size());//预计发送数量 | |||||
| if(wxMsgConfig.getRemains()<cUsers.size()){ | |||||
| logger.info("短信数量不足"); | |||||
| return; | |||||
| } | |||||
| //获取手机号 | |||||
| if(cUsers.size()==0){ | |||||
| logger.info("没有要发送的手机号"); | |||||
| return; | |||||
| } | |||||
| StringBuffer sb=new StringBuffer(); | |||||
| for(WxCUser user:cUsers){ | |||||
| String phone = user.getPhone(); | |||||
| if(null!=phone && !phone.equals("")) | |||||
| sb.append(phone).append(","); | |||||
| } | |||||
| wxmsg.setPhones(sb.deleteCharAt(sb.length()-1).toString()); | |||||
| wxmsg.setLabel(""); | |||||
| if(wxmsg.getPhones().equals("")){ | |||||
| logger.info("手机号未发现"); | |||||
| return; | |||||
| } | |||||
| if(record.getSendType()==1){//定时发送 | |||||
| wxmsg.setIsright(record.getSendType()==1?0:1);//值是相反的 | |||||
| wxmsg.setSendtime(com.iformall.utils.DateUtils.date2String(record.getSendTime(),"yyyy-MM-dd HH:mm:ss")); | |||||
| wxmsg.setStatus(EnumMsgStatus.MSG_STATUS_NOT_SEND.getCode()); | |||||
| }else{ | |||||
| wxmsg.setIsright(EnumMsgStatus.MSG_SEND_IMMEDIATELY.getCode());//立即发送 | |||||
| wxmsg.setStatus(EnumMsgStatus.MSG_STATUS_SENDED.getCode()); | |||||
| wxmsg.setSendtime(com.iformall.utils.DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss")); | |||||
| } | |||||
| wxmsg.setModelId(record.getModelId()); | |||||
| wxmsg.setMsg(model.getContent()); | |||||
| wxmsg.setName(model.getName()); | |||||
| wxmsg.setSignature(model.getSignature()); | |||||
| wxmsg.setSuccessNumber(0); | |||||
| wxmsg.setErrorNumber(0); | |||||
| wxmsg.setWay(EnumSendWay.COUPON.getCode());//1、标签短信2、精准发券 | |||||
| ResultData resultData = wxMsgService.saveOrUpdate(wxmsg); | |||||
| if(resultData.data!=null){ | |||||
| //更新MSG_ID | |||||
| record.setMsgId((Long)resultData.data); | |||||
| couponInjectMapper.updateByPrimaryKeySelective(record); | |||||
| } | |||||
| } | |||||
| private void sendNow(WxCoupon wxCoupon,List<WxCUser> cUsers,Long couponInjectId){ | private void sendNow(WxCoupon wxCoupon,List<WxCUser> cUsers,Long couponInjectId){ | ||||
| //查询标签用户 | //查询标签用户 | ||||
| @@ -11,6 +11,8 @@ import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import java.util.List; | |||||
| @Service | @Service | ||||
| public class WxMsgConfigServiceImpl implements WxMsgConfigService { | public class WxMsgConfigServiceImpl implements WxMsgConfigService { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @@ -45,12 +47,11 @@ public class WxMsgConfigServiceImpl implements WxMsgConfigService { | |||||
| public void deleteById(Long id) { | public void deleteById(Long id) { | ||||
| wxMsgConfigMapper.deleteByPrimaryKey(id); | wxMsgConfigMapper.deleteByPrimaryKey(id); | ||||
| } | } | ||||
| @Override | |||||
| public WxMsgConfig findObject(WxMsgConfig wxMsgConfig) { | |||||
| return wxMsgConfigMapper.selectOne(wxMsgConfig); | |||||
| } | |||||
| } | } | ||||
| @@ -18,10 +18,7 @@ import com.iformall.mapper.WxMsgConfigMapper; | |||||
| import com.iformall.mapper.WxMsgMapper; | import com.iformall.mapper.WxMsgMapper; | ||||
| import com.iformall.service.WxCUserTagsService; | import com.iformall.service.WxCUserTagsService; | ||||
| import com.iformall.service.WxMsgService; | import com.iformall.service.WxMsgService; | ||||
| import com.iformall.utils.AesUtil; | |||||
| import com.iformall.utils.HMACSHA256; | |||||
| import com.iformall.utils.HttpUtil; | |||||
| import com.iformall.utils.RsaUtil; | |||||
| import com.iformall.utils.*; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -113,7 +110,7 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| for(String phone:phoneSet){ | for(String phone:phoneSet){ | ||||
| sb.append(phone).append(","); | sb.append(phone).append(","); | ||||
| } | } | ||||
| wxMsg.setPhones(sb.toString()); | |||||
| wxMsg.setPhones(sb.deleteCharAt(sb.length()-1).toString()); | |||||
| //新增记录 | //新增记录 | ||||
| if (wxMsg.getId() == null) { | if (wxMsg.getId() == null) { | ||||
| @@ -130,14 +127,16 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| //是否立即发送 | //是否立即发送 | ||||
| if (wxMsg.getIsright() == 1) { | if (wxMsg.getIsright() == 1) { | ||||
| wxMsg.setStatus(EnumMsgStatus.MSG_STATUS_SENDED.getCode()); | wxMsg.setStatus(EnumMsgStatus.MSG_STATUS_SENDED.getCode()); | ||||
| sendmsg(wxMsg); | |||||
| wxMsg.setSendtime(DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss")); | |||||
| return sendmsg(wxMsg); | |||||
| } else { | } else { | ||||
| wxMsg.setStatus(EnumMsgStatus.MSG_STATUS_NOT_SEND.getCode()); | wxMsg.setStatus(EnumMsgStatus.MSG_STATUS_NOT_SEND.getCode()); | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| wxMsg.setId(idWorker.nextId()); | |||||
| long id = idWorker.nextId(); | |||||
| wxMsg.setId(id); | |||||
| wxMsg.setCreatetime(new Date()); | wxMsg.setCreatetime(new Date()); | ||||
| wxMsgMapper.insertSelective(wxMsg); | wxMsgMapper.insertSelective(wxMsg); | ||||
| return new ResultData(Result.SUCCESS, "短信会在预设时间发送"); | |||||
| return new ResultData(Result.SUCCESS, "短信会在预设时间发送",id); | |||||
| } | } | ||||
| } else { | } else { | ||||
| @@ -150,7 +149,7 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| //是否立即发送 | //是否立即发送 | ||||
| if (wxMsg.getIsright() == 1) { | if (wxMsg.getIsright() == 1) { | ||||
| wxMsg.setStatus(EnumMsgStatus.MSG_STATUS_SENDED.getCode()); | wxMsg.setStatus(EnumMsgStatus.MSG_STATUS_SENDED.getCode()); | ||||
| sendmsg(wxMsg); | |||||
| return sendmsg(wxMsg); | |||||
| } else { | } else { | ||||
| //定时 | //定时 | ||||
| wxMsg.setStatus(EnumMsgStatus.MSG_STATUS_NOT_SEND.getCode()); | wxMsg.setStatus(EnumMsgStatus.MSG_STATUS_NOT_SEND.getCode()); | ||||
| @@ -159,8 +158,6 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| } | } | ||||
| } | } | ||||
| return new ResultData(); | |||||
| } | } | ||||
| private String parselabel(String tenantId, WxMsg wxmsg) { | private String parselabel(String tenantId, WxMsg wxmsg) { | ||||
| @@ -197,6 +194,17 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| if (wxMsgConfigs.size() == 0) return new ResultData(ErrorCode.MSG_SERVER_NOT_FIND, "您还未接入短信运营商,请联系平台管理员"); | if (wxMsgConfigs.size() == 0) return new ResultData(ErrorCode.MSG_SERVER_NOT_FIND, "您还未接入短信运营商,请联系平台管理员"); | ||||
| wxMsgConfig = wxMsgConfigs.get(0); | wxMsgConfig = wxMsgConfigs.get(0); | ||||
| if(wxMsgConfig.getRemains()==0){ | |||||
| logger.info("短信数量为0"); | |||||
| return new ResultData(ErrorCode.MSG_SEND_ERROR.MSG_SUM_ZERO); | |||||
| } | |||||
| if(wxMsgConfig.getRemains()<wxMsg.getExpectSendNumber()){ | |||||
| logger.info("短信数量不足"); | |||||
| return new ResultData(ErrorCode.MSG_SUM_INSUFFICENT); | |||||
| } | |||||
| String secret = wxMsgConfig.getSecret(); | String secret = wxMsgConfig.getSecret(); | ||||
| String bid = wxMsgConfig.getBid(); | String bid = wxMsgConfig.getBid(); | ||||
| String publickey = wxMsgConfig.getPublickey(); | String publickey = wxMsgConfig.getPublickey(); | ||||
| @@ -248,9 +256,10 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| wxMsg.setSendstatus(EnumMsgStatus.MSG_SEND_FAIL.getCode()); | wxMsg.setSendstatus(EnumMsgStatus.MSG_SEND_FAIL.getCode()); | ||||
| } | } | ||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| long id = idWorker.nextId(); | |||||
| if (wxMsg.getId() == null) { | if (wxMsg.getId() == null) { | ||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| wxMsg.setId(idWorker.nextId()); | |||||
| wxMsg.setId(id); | |||||
| wxMsg.setCreatetime(new Date()); | wxMsg.setCreatetime(new Date()); | ||||
| wxMsgMapper.insertSelective(wxMsg); | wxMsgMapper.insertSelective(wxMsg); | ||||
| } else { | } else { | ||||
| @@ -260,7 +269,7 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| logger.info("发送短信结束..."); | logger.info("发送短信结束..."); | ||||
| if (ret.equals("1")) { | if (ret.equals("1")) { | ||||
| addMsgCallback(wxMsg,batchNo); | addMsgCallback(wxMsg,batchNo); | ||||
| return new ResultData(Result.SUCCESS, "短信发送中,您可在短信明细中查看发送状态"); | |||||
| return new ResultData(Result.SUCCESS, "短信发送中,您可在短信明细中查看发送状态",id); | |||||
| } else { | } else { | ||||
| return new ResultData(ErrorCode.MSG_SEND_ERROR.getCode(), "短信发送发败"); | return new ResultData(ErrorCode.MSG_SEND_ERROR.getCode(), "短信发送发败"); | ||||
| } | } | ||||
| @@ -14,13 +14,14 @@ | |||||
| <result column="status" jdbcType="INTEGER" property="status" /> | <result column="status" jdbcType="INTEGER" property="status" /> | ||||
| <result column="error_msg" jdbcType="VARCHAR" property="errorMsg" /> | <result column="error_msg" jdbcType="VARCHAR" property="errorMsg" /> | ||||
| <result column="tags" jdbcType="VARCHAR" property="tags" /> | <result column="tags" jdbcType="VARCHAR" property="tags" /> | ||||
| <result column="msg_id" jdbcType="BIGINT" property="msgId" /> | |||||
| <result column="model_id" jdbcType="BIGINT" property="modelId" /> | <result column="model_id" jdbcType="BIGINT" property="modelId" /> | ||||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | ||||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> | <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> | ||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`name`,`m_user_id`,`send_type`,`coupon_id`,`coupon_name`,`send_time`,`send_amount`,`status`,`error_msg`,`tags`,`model_id`,`create_time`,`update_time` | |||||
| `id`,`tenant_id`,`name`,`m_user_id`,`send_type`,`coupon_id`,`coupon_name`,`send_time`,`send_amount`,`status`,`error_msg`,`tags`,`msg_id`,`create_time`,`update_time`,`model_id` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -32,7 +33,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id`= #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -98,7 +99,11 @@ | |||||
| <if test=" null != updateTime "> | <if test=" null != updateTime "> | ||||
| and `update_time` = #{updateTime} | and `update_time` = #{updateTime} | ||||
| </if> | |||||
| </if> | |||||
| <if test=" null != msgId "> | |||||
| and `msg_id` = #{msgId} | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -22,7 +22,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -21,7 +21,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -28,7 +28,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -23,7 +23,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -30,7 +30,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != appId "> | <if test=" null != appId "> | ||||
| @@ -21,7 +21,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -21,7 +21,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -25,7 +25,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -44,7 +44,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id`= #{tenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != openId "> | <if test=" null != openId "> | ||||
| @@ -23,7 +23,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -35,7 +35,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -24,7 +24,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -24,7 +24,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -30,7 +30,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != merchantId "> | <if test=" null != merchantId "> | ||||
| @@ -42,7 +42,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != merchantId "> | <if test=" null != merchantId "> | ||||
| @@ -29,7 +29,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -48,7 +48,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -43,7 +43,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| @@ -24,7 +24,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -24,7 +24,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -25,7 +25,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -27,7 +27,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -24,7 +24,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -20,11 +20,12 @@ | |||||
| <result column="excelpath" jdbcType="VARCHAR" property="excelpath" /> | <result column="excelpath" jdbcType="VARCHAR" property="excelpath" /> | ||||
| <result column="label" jdbcType="VARCHAR" property="label" /> | <result column="label" jdbcType="VARCHAR" property="label" /> | ||||
| <result column="status" jdbcType="INTEGER" property="status" /> | <result column="status" jdbcType="INTEGER" property="status" /> | ||||
| <result column="way" jdbcType="INTEGER" property="way" /> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`model_id`,`msg`,`sendtime`,`createtime`,`expect_send_number`,`success_number`,`error_number`,`return_result`,`phones`,`signature`,`isright`,`name`,`sendstatus`,`excelpath`,`label`,`status` | |||||
| `id`,`tenant_id`,`model_id`,`msg`,`sendtime`,`createtime`,`expect_send_number`,`success_number`,`error_number`,`return_result`,`phones`,`signature`,`isright`,`name`,`sendstatus`,`excelpath`,`label`,`status`,`way` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -108,6 +109,9 @@ | |||||
| and `status` = #{status} | and `status` = #{status} | ||||
| </if> | </if> | ||||
| <if test=" null != way "> | |||||
| and `way` = #{way} | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -36,7 +36,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -29,7 +29,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -34,7 +34,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != createTime "> | <if test=" null != createTime "> | ||||
| @@ -33,7 +33,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -26,7 +26,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -29,7 +29,7 @@ | |||||
| and `id` = #{id} | and `id` = #{id} | ||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != loginCount "> | <if test=" null != loginCount "> | ||||
| and `login_count` = #{loginCount} | and `login_count` = #{loginCount} | ||||
| @@ -22,7 +22,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -34,7 +34,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| @@ -23,7 +23,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | <if test=" null != tenantId "> | ||||
| and `tenant_id` like concat('%', #{tenantId},'%') | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||