Commit 97c4b84f by leejoker

修改任务宝主表字段,增加海报id和欢迎语

1 parent d44b7069
......@@ -10,14 +10,14 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 任务宝对象 we_task_fission
* 任务宝主对象 we_task_fission
*
* @author leejoker
* @date 2021-01-20
* @author leejoker <1056650571@qq.com>
* @date 2021-01-27
*/
@Data
public class WeTaskFission extends BaseEntity {
private static final long serialVersionUID = -6092187482853822532L;
private static final long serialVersionUID = -3145843701063325455L;
/**
* 主键
*/
......@@ -68,10 +68,16 @@ public class WeTaskFission extends BaseEntity {
private String customerTag;
/**
* 海报id
*/
@Excel(name = "海报id")
private Long postersId;
/**
* 裂变海报路径
*/
@Excel(name = "裂变海报路径")
private String postersPath;
private String postersUrl;
/**
* 任务裂变目标员工
......@@ -101,7 +107,7 @@ public class WeTaskFission extends BaseEntity {
* 兑奖链接图片
*/
@Excel(name = "兑奖链接图片")
private String rewardImagePath;
private String rewardImageUrl;
/**
* 兑奖规则
......@@ -115,6 +121,12 @@ public class WeTaskFission extends BaseEntity {
@Excel(name = "任务裂变活动状态,1 进行中 2 已结束")
private Integer fissStatus;
/**
* 新客欢迎语
*/
@Excel(name = "新客欢迎语")
private String welcomeMsg;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
......@@ -126,14 +138,16 @@ public class WeTaskFission extends BaseEntity {
.append("overTime", getOverTime())
.append("customerTagId", getCustomerTagId())
.append("customerTag", getCustomerTag())
.append("postersPath", getPostersPath())
.append("postersId", getPostersId())
.append("postersUrl", getPostersUrl())
.append("fissStaffId", getFissStaffId())
.append("fissStaff", getFissStaff())
.append("fissStaffQrcode", getFissStaffQrcode())
.append("rewardUrl", getRewardUrl())
.append("rewardImagePath", getRewardImagePath())
.append("rewardImageUrl", getRewardImageUrl())
.append("rewardRule", getRewardRule())
.append("fissStatus", getFissStatus())
.append("welcomeMsg", getWelcomeMsg())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
......
......@@ -5,21 +5,20 @@ import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.utils.DateUtils;
import com.linkwechat.wecom.domain.*;
import com.linkwechat.wecom.domain.WeTaskFission;
import com.linkwechat.wecom.domain.WeTaskFissionStaff;
import com.linkwechat.wecom.domain.dto.message.CustomerMessagePushDto;
import com.linkwechat.wecom.domain.dto.message.LinkMessageDto;
import com.linkwechat.wecom.mapper.WeTaskFissionMapper;
import com.linkwechat.wecom.service.*;
import com.linkwechat.wecom.strategy.MessageContext;
import com.linkwechat.wecom.strategy.SendMessageToUserStrategy;
import com.linkwechat.wecom.service.IWeCustomerMessagePushService;
import com.linkwechat.wecom.service.IWeEmpleCodeService;
import com.linkwechat.wecom.service.IWeTaskFissionService;
import com.linkwechat.wecom.service.IWeTaskFissionStaffService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
......@@ -113,7 +112,7 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
public void sendWeTaskFission(Long id) {
WeTaskFission weTaskFission = selectWeTaskFissionById(id);
//海报路径
String postersPath = weTaskFission.getPostersPath();
String postersPath = weTaskFission.getPostersUrl();
//目标员工id
String fissStaffId = weTaskFission.getFissStaffId();
//目标员工活码
......@@ -134,7 +133,7 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
customerMessagePushDto.setTag(weTaskFission.getCustomerTagId());
//查询发起成员
List<WeTaskFissionStaff> weTaskFissionStaffList = weTaskFissionStaffService.selectWeTaskFissionStaffByTaskId(id);
if (CollectionUtil.isNotEmpty(weTaskFissionStaffList)){
if (CollectionUtil.isNotEmpty(weTaskFissionStaffList)) {
//获取部门id
String departmentIds = weTaskFissionStaffList.stream().filter(weTaskFissionStaff ->
WeConstans.USE_SCOP_BUSINESSID_TYPE_ORG.equals(weTaskFissionStaff.getStaffType()))
......@@ -150,7 +149,7 @@ public class WeTaskFissionServiceImpl implements IWeTaskFissionService {
weCustomerMessagePushService.addWeCustomerMessagePush(customerMessagePushDto);
} catch (JsonProcessingException e) {
e.printStackTrace();
log.error("发送任务失败》》》》》》》》》》》params:{},ex:{}", JSONObject.toJSONString(customerMessagePushDto),e);
log.error("发送任务失败》》》》》》》》》》》params:{},ex:{}", JSONObject.toJSONString(customerMessagePushDto), e);
}
......
......@@ -10,17 +10,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="fissInfo" column="fiss_info" />
<result property="fissNum" column="fiss_num" />
<result property="startTime" column="start_time" />
<result property="overTime" column="end_time" />
<result property="overTime" column="over_time" />
<result property="customerTagId" column="customer_tag_id" />
<result property="customerTag" column="customer_tag" />
<result property="postersPath" column="posters_path" />
<result property="postersId" column="posters_id" />
<result property="postersUrl" column="posters_url" />
<result property="fissStaffId" column="fiss_staff_id" />
<result property="fissStaff" column="fiss_staff" />
<result property="fissStaffQrcode" column="fiss_staff_qrcode" />
<result property="rewardUrl" column="reward_url" />
<result property="rewardImagePath" column="reward_image_path" />
<result property="rewardImageUrl" column="reward_image_url" />
<result property="rewardRule" column="reward_rule" />
<result property="fissStatus" column="fiss_status" />
<result property="welcomeMsg" column="welcome_msg" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
......@@ -28,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectWeTaskFissionVo">
select id, task_name, fiss_info, fiss_num, start_time, end_time, customer_tag_id, customer_tag, posters_path, fiss_staff_id, fiss_staff, fiss_staff_qrcode, reward_url, reward_image_path, reward_rule, fiss_status, create_by, create_time, update_by, update_time from we_task_fission
select id, task_name, fiss_info, fiss_num, start_time, over_time, customer_tag_id, customer_tag, posters_id, posters_url, fiss_staff_id, fiss_staff, fiss_staff_qrcode, reward_url, reward_image_url, reward_rule, fiss_status, welcome_msg, create_by, create_time, update_by, update_time from we_task_fission
</sql>
<select id="selectWeTaskFissionList" parameterType="WeTaskFission" resultMap="WeTaskFissionResult">
......@@ -38,17 +40,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fissInfo != null and fissInfo != ''"> and fiss_info = #{fissInfo}</if>
<if test="fissNum != null "> and fiss_num = #{fissNum}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="overTime != null "> and end_time = #{overTime}</if>
<if test="overTime != null "> and over_time = #{overTime}</if>
<if test="customerTagId != null and customerTagId != ''"> and customer_tag_id = #{customerTagId}</if>
<if test="customerTag != null and customerTag != ''"> and customer_tag = #{customerTag}</if>
<if test="postersPath != null and postersPath != ''"> and posters_path = #{postersPath}</if>
<if test="postersId != null "> and posters_id = #{postersId}</if>
<if test="postersUrl != null and postersUrl != ''"> and posters_url = #{postersUrl}</if>
<if test="fissStaffId != null and fissStaffId != ''"> and fiss_staff_id = #{fissStaffId}</if>
<if test="fissStaff != null and fissStaff != ''"> and fiss_staff = #{fissStaff}</if>
<if test="fissStaffQrcode != null and fissStaffQrcode != ''"> and fiss_staff_qrcode = #{fissStaffQrcode}</if>
<if test="rewardUrl != null and rewardUrl != ''"> and reward_url = #{rewardUrl}</if>
<if test="rewardImagePath != null and rewardImagePath != ''"> and reward_image_path = #{rewardImagePath}</if>
<if test="rewardImageUrl != null and rewardImageUrl != ''"> and reward_image_url = #{rewardImageUrl}</if>
<if test="rewardRule != null and rewardRule != ''"> and reward_rule = #{rewardRule}</if>
<if test="fissStatus != null "> and fiss_status = #{fissStatus}</if>
<if test="welcomeMsg != null and welcomeMsg != ''"> and welcome_msg = #{welcomeMsg}</if>
</where>
</select>
......@@ -64,17 +68,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fissInfo != null">fiss_info,</if>
<if test="fissNum != null">fiss_num,</if>
<if test="startTime != null">start_time,</if>
<if test="overTime != null">end_time,</if>
<if test="overTime != null">over_time,</if>
<if test="customerTagId != null and customerTagId != ''">customer_tag_id,</if>
<if test="customerTag != null">customer_tag,</if>
<if test="postersPath != null and postersPath != ''">posters_path,</if>
<if test="postersId != null">posters_id,</if>
<if test="postersUrl != null and postersUrl != ''">posters_url,</if>
<if test="fissStaffId != null and fissStaffId != ''">fiss_staff_id,</if>
<if test="fissStaff != null and fissStaff != ''">fiss_staff,</if>
<if test="fissStaffQrcode != null and fissStaffQrcode != ''">fiss_staff_qrcode,</if>
<if test="rewardUrl != null and rewardUrl != ''">reward_url,</if>
<if test="rewardImagePath != null and rewardImagePath != ''">reward_image_path,</if>
<if test="rewardImageUrl != null and rewardImageUrl != ''">reward_image_url,</if>
<if test="rewardRule != null">reward_rule,</if>
<if test="fissStatus != null">fiss_status,</if>
<if test="welcomeMsg != null">welcome_msg,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
......@@ -88,14 +94,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="overTime != null">#{overTime},</if>
<if test="customerTagId != null and customerTagId != ''">#{customerTagId},</if>
<if test="customerTag != null">#{customerTag},</if>
<if test="postersPath != null and postersPath != ''">#{postersPath},</if>
<if test="postersId != null">#{postersId},</if>
<if test="postersUrl != null and postersUrl != ''">#{postersUrl},</if>
<if test="fissStaffId != null and fissStaffId != ''">#{fissStaffId},</if>
<if test="fissStaff != null and fissStaff != ''">#{fissStaff},</if>
<if test="fissStaffQrcode != null and fissStaffQrcode != ''">#{fissStaffQrcode},</if>
<if test="rewardUrl != null and rewardUrl != ''">#{rewardUrl},</if>
<if test="rewardImagePath != null and rewardImagePath != ''">#{rewardImagePath},</if>
<if test="rewardImageUrl != null and rewardImageUrl != ''">#{rewardImageUrl},</if>
<if test="rewardRule != null">#{rewardRule},</if>
<if test="fissStatus != null">#{fissStatus},</if>
<if test="welcomeMsg != null">#{welcomeMsg},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
......@@ -110,17 +118,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="fissInfo != null">fiss_info = #{fissInfo},</if>
<if test="fissNum != null">fiss_num = #{fissNum},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="overTime != null">end_time = #{overTime},</if>
<if test="overTime != null">over_time = #{overTime},</if>
<if test="customerTagId != null and customerTagId != ''">customer_tag_id = #{customerTagId},</if>
<if test="customerTag != null">customer_tag = #{customerTag},</if>
<if test="postersPath != null and postersPath != ''">posters_path = #{postersPath},</if>
<if test="postersId != null">posters_id = #{postersId},</if>
<if test="postersUrl != null and postersUrl != ''">posters_url = #{postersUrl},</if>
<if test="fissStaffId != null and fissStaffId != ''">fiss_staff_id = #{fissStaffId},</if>
<if test="fissStaff != null and fissStaff != ''">fiss_staff = #{fissStaff},</if>
<if test="fissStaffQrcode != null and fissStaffQrcode != ''">fiss_staff_qrcode = #{fissStaffQrcode},</if>
<if test="rewardUrl != null and rewardUrl != ''">reward_url = #{rewardUrl},</if>
<if test="rewardImagePath != null and rewardImagePath != ''">reward_image_path = #{rewardImagePath},</if>
<if test="rewardImageUrl != null and rewardImageUrl != ''">reward_image_url = #{rewardImageUrl},</if>
<if test="rewardRule != null">reward_rule = #{rewardRule},</if>
<if test="fissStatus != null">fiss_status = #{fissStatus},</if>
<if test="welcomeMsg != null">welcome_msg = #{welcomeMsg},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
......
......@@ -6415,17 +6415,19 @@ CREATE TABLE `we_task_fission` (
`fiss_info` VARCHAR(255) NULL DEFAULT NULL COMMENT '裂变引导语',
`fiss_num` INTEGER NOT NULL DEFAULT 1 COMMENT '裂变客户数量',
`start_time` DATETIME NOT NULL COMMENT '活动开始时间',
`end_time` DATETIME NOT NULL COMMENT '活动结束时间',
`over_time` DATETIME NOT NULL COMMENT '活动结束时间',
`customer_tag_id` MEDIUMTEXT NOT NULL COMMENT '客户标签id列表,当为全部时保存为all',
`customer_tag` MEDIUMTEXT NULL COMMENT '客户标签名称列表,为all是可为空',
`posters_path` VARCHAR(300) NOT NULL DEFAULT 'NULL' COMMENT '裂变海报路径',
`posters_id` BIGINT NULL DEFAULT NULL COMMENT '海报id',
`posters_url` VARCHAR(300) NOT NULL DEFAULT 'NULL' COMMENT '裂变海报路径',
`fiss_staff_id` VARCHAR(64) NOT NULL DEFAULT 'NULL' COMMENT '任务裂变目标员工',
`fiss_staff` VARCHAR(100) NOT NULL DEFAULT 'NULL' COMMENT '任务裂变目标员工姓名',
`fiss_staff_qrcode` VARCHAR(500) NOT NULL DEFAULT 'NULL' COMMENT '任务裂变目标员工二维码',
`reward_url` VARCHAR(500) NOT NULL DEFAULT 'NULL' COMMENT '兑奖链接',
`reward_image_path` VARCHAR(500) NOT NULL DEFAULT 'NULL' COMMENT '兑奖链接图片',
`reward_image_url` VARCHAR(500) NOT NULL DEFAULT 'NULL' COMMENT '兑奖链接图片',
`reward_rule` MEDIUMTEXT NULL COMMENT '兑奖规则',
`fiss_status` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '任务裂变活动状态,1 进行中 2 已结束',
`welcome_msg` MEDIUMTEXT NULL COMMENT '新客欢迎语',
`create_by` VARCHAR(100) NULL DEFAULT NULL COMMENT '创建人',
`create_time` DATETIME NULL COMMENT '创建时间',
`update_by` VARCHAR(100) NULL DEFAULT NULL COMMENT '更新人',
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!