Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104

master
elliott 2 years ago
commit fc742d97c0

@ -89,6 +89,8 @@ public class WxScriptTemplate extends BaseEntity
/** 子话术 */
private List<SysTag> children = new ArrayList<SysTag>();
private List<WxScriptTemplate> scriptTemplateChildren = new ArrayList<>();
private List<Long> tagIdArray = new ArrayList<Long>();
@ -259,6 +261,14 @@ public class WxScriptTemplate extends BaseEntity
this.tagIdArray = tagIdArray;
}
public List<WxScriptTemplate> getScriptTemplateChildren() {
return scriptTemplateChildren;
}
public void setScriptTemplateChildren(List<WxScriptTemplate> scriptTemplateChildren) {
this.scriptTemplateChildren = scriptTemplateChildren;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -0,0 +1,32 @@
package com.flossom.common.core.domain.req;
public class AllChangIntegralOperateReq {
private WxUserIntegralVm wxUserIntegralVm;
private WxUserMemberVm wxUserMemberVm;
public AllChangIntegralOperateReq() {
}
public AllChangIntegralOperateReq(WxUserIntegralVm wxUserIntegralVm, WxUserMemberVm wxUserMemberVm) {
this.wxUserIntegralVm = wxUserIntegralVm;
this.wxUserMemberVm = wxUserMemberVm;
}
public WxUserIntegralVm getWxUserIntegralVm() {
return wxUserIntegralVm;
}
public void setWxUserIntegralVm(WxUserIntegralVm wxUserIntegralVm) {
this.wxUserIntegralVm = wxUserIntegralVm;
}
public WxUserMemberVm getWxUserMemberVm() {
return wxUserMemberVm;
}
public void setWxUserMemberVm(WxUserMemberVm wxUserMemberVm) {
this.wxUserMemberVm = wxUserMemberVm;
}
}

@ -0,0 +1,31 @@
package com.flossom.common.core.domain.req;
public class AllSendScriptOperateReq {
private WxUserScriptReq wxUserScriptReq;
private WxUserMemberVm wxUserMemberVm;
public AllSendScriptOperateReq() {
}
public AllSendScriptOperateReq(WxUserScriptReq wxUserScriptReq, WxUserMemberVm wxUserMemberVm) {
this.wxUserScriptReq = wxUserScriptReq;
this.wxUserMemberVm = wxUserMemberVm;
}
public WxUserScriptReq getWxUserScriptReq() {
return wxUserScriptReq;
}
public void setWxUserScriptReq(WxUserScriptReq wxUserScriptReq) {
this.wxUserScriptReq = wxUserScriptReq;
}
public WxUserMemberVm getWxUserMemberVm() {
return wxUserMemberVm;
}
public void setWxUserMemberVm(WxUserMemberVm wxUserMemberVm) {
this.wxUserMemberVm = wxUserMemberVm;
}
}

@ -20,7 +20,6 @@ public class WxUserScriptReq {
/**
* id
*/
@NotNull(message = "用户列表不能为空")
List<Long> userIdList;
/**
@ -58,8 +57,6 @@ public class WxUserScriptReq {
/**
* 013456
*/
@NotNull(message = "请选择跳转类型")
@Range(min = 0, max = 6)
private Integer type;
/**
@ -95,12 +92,12 @@ public class WxUserScriptReq {
/**
* (xxx,xxx,xxx)
*/
private String tagNames;
private List<String> tagNames;
/**
* ID(xxxx,xxxx,xxx)
*/
private String tagIds;
private List<String> tagIds;
public List<Long> getUserIdList() {
@ -215,19 +212,19 @@ public class WxUserScriptReq {
this.feedId = feedId;
}
public String getTagNames() {
public List<String> getTagNames() {
return tagNames;
}
public void setTagNames(String tagNames) {
public void setTagNames(List<String> tagNames) {
this.tagNames = tagNames;
}
public String getTagIds() {
public List<String> getTagIds() {
return tagIds;
}
public void setTagIds(String tagIds) {
public void setTagIds(List<String> tagIds) {
this.tagIds = tagIds;
}

@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import com.flossom.common.core.domain.entity.SysDept;
import com.flossom.common.core.domain.entity.SysMenu;
import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.domain.entity.WxScriptTemplate;
import java.io.Serializable;
import java.util.List;
@ -27,6 +28,11 @@ public class TreeSelect implements Serializable {
*/
private String label;
/**
*
*/
private String content;
/**
*
*/
@ -55,6 +61,13 @@ public class TreeSelect implements Serializable {
this.children = sysTag.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
}
public TreeSelect(WxScriptTemplate wxScriptTemplate) {
this.id = wxScriptTemplate.getId();
this.label = wxScriptTemplate.getTitile();
this.content = wxScriptTemplate.getContent();
this.children = wxScriptTemplate.getScriptTemplateChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
}
public Long getId() {
return id;
}
@ -78,4 +91,12 @@ public class TreeSelect implements Serializable {
public void setChildren(List<TreeSelect> children) {
this.children = children;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}

@ -75,8 +75,6 @@ public class UserMemberController extends BaseController {
throw new ServiceException("上传头像失败");
}
userMemberUpdateVo.setHeadimg(result.getData().getUrl());
} else {
userMemberUpdateVo.setHeadimg(null);
}
return R.ok(wxUserMemberService.updateUser(userMemberUpdateVo));
}

@ -4,7 +4,6 @@ import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.domain.entity.WxScriptTemplate;
import com.flossom.common.core.utils.StringUtils;
import com.flossom.common.core.utils.poi.ExcelUtil;
@ -122,4 +121,13 @@ public class WxScriptTemplateController extends BaseController
// tags.removeIf(d -> d.getId().intValue() == id || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), id + ""));
// return success(tags);
// }
/**
*
*/
@GetMapping("/scriptTree")
public AjaxResult scriptTree(WxScriptTemplate wxScriptTemplate) {
return success(wxScriptTemplateService.scriptTree(wxScriptTemplate));
}
}

@ -4,6 +4,7 @@ import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.WxUserMember;
import com.flossom.common.core.domain.req.AllChangIntegralOperateReq;
import com.flossom.common.core.domain.req.WxUserIntegralVm;
import com.flossom.common.core.domain.req.WxUserMemberVm;
import com.flossom.common.core.enums.IntegralChangeTypeEnum;
@ -111,7 +112,7 @@ public class WxUserMemberController extends BaseController {
*/
@PostMapping("/batchAddMiniProgramTag")
public R batchAddMiniProgramTag(@RequestParam("tagIdList") List<Integer> tagIdList,
@RequestParam(value = "userIdList") List<Integer> userIdList) {
@RequestParam("userIdList") List<Integer> userIdList) {
if (tagIdList == null || tagIdList.size() == 0) {
logger.error("参数有误");
throw new ServiceException("参数有误");
@ -124,7 +125,7 @@ public class WxUserMemberController extends BaseController {
*
*/
@PostMapping("/allAddMiniProgramTag")
public R allAddMiniProgramTag(@RequestParam("tagIdList") List<Integer> tagIdList, WxUserMemberVm wxUserMemberVm) {
public R allAddMiniProgramTag(@RequestParam("tagIdList") List<Integer> tagIdList, @RequestBody WxUserMemberVm wxUserMemberVm) {
if (tagIdList == null || tagIdList.size() == 0) {
logger.error("参数有误");
throw new ServiceException("参数有误");
@ -156,7 +157,7 @@ public class WxUserMemberController extends BaseController {
*
*/
@PostMapping("/allDelMiniProgramTag")
public R allDelMiniProgramTag(@RequestParam("tagIdList") List<Integer> tagIdList, WxUserMemberVm wxUserMemberVm) {
public R allDelMiniProgramTag(@RequestParam("tagIdList") List<Integer> tagIdList, @RequestBody WxUserMemberVm wxUserMemberVm) {
if (tagIdList == null || tagIdList.size() == 0) {
logger.error("参数有误");
throw new ServiceException("参数有误");
@ -173,7 +174,7 @@ public class WxUserMemberController extends BaseController {
*
*/
@PostMapping("/batchChangIntegral")
public R batchChangIntegral(@Validated WxUserIntegralVm wxUserIntegralVm, @RequestParam(value = "userIdList") List<Long> userIdList) {
public R batchChangIntegral(@Validated @RequestBody WxUserIntegralVm wxUserIntegralVm, @RequestParam(value = "userIdList") List<Long> userIdList) {
if (userIdList == null || userIdList.size() == 0
|| !IntegralChangeTypeEnum.isIntegralChangType(wxUserIntegralVm.getSource())) {
logger.error("积分操作类型选择有误");
@ -187,15 +188,15 @@ public class WxUserMemberController extends BaseController {
*
*/
@PostMapping("/allChangIntegral")
public R allChangIntegral(@Validated WxUserIntegralVm wxUserIntegralVm, WxUserMemberVm wxUserMemberVm) {
if (IntegralChangeTypeEnum.isIntegralChangType(wxUserIntegralVm.getSource())) {
public R allChangIntegral(@Validated @RequestBody AllChangIntegralOperateReq operateReq) {
if (!IntegralChangeTypeEnum.isIntegralChangType(operateReq.getWxUserIntegralVm().getSource())) {
logger.error("积分操作类型选择有误");
throw new ServiceException("积分操作类型选择有误");
}
List<WxUserMember> list = wxUserMemberService.selectWxUserMemberList(wxUserMemberVm);
List<WxUserMember> list = wxUserMemberService.selectWxUserMemberList(operateReq.getWxUserMemberVm());
if (list != null && list.size() > 0) {
List<Long> collect = list.stream().map(wxUserMember -> wxUserMember.getId()).collect(Collectors.toList());
wxUserMemberService.batchChangIntegral(wxUserIntegralVm, collect);
wxUserMemberService.batchChangIntegral(operateReq.getWxUserIntegralVm(), collect);
}
return R.ok();
}

@ -2,14 +2,18 @@ package com.flossom.system.controller;
import java.util.List;
import java.io.IOException;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.WxUserMember;
import com.flossom.common.core.domain.entity.WxUserRemark;
import com.flossom.common.core.domain.req.WxUserIntegralVm;
import com.flossom.common.core.domain.req.WxUserMemberVm;
import com.flossom.common.core.domain.req.WxUserRemarkReq;
import com.flossom.common.core.enums.IntegralChangeTypeEnum;
import com.flossom.common.core.exception.ServiceException;
import com.flossom.common.core.utils.StringUtils;
import com.flossom.common.core.utils.poi.ExcelUtil;
import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.domain.AjaxResult;
@ -17,6 +21,7 @@ import com.flossom.common.core.web.page.TableDataInfo;
import com.flossom.common.log.annotation.Log;
import com.flossom.common.log.enums.BusinessType;
import com.flossom.common.security.annotation.RequiresPermissions;
import com.flossom.system.service.IWxUserMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -34,6 +39,9 @@ public class WxUserRemarkController extends BaseController {
@Autowired
private IWxUserRemarkService wxUserRemarkService;
@Autowired
private IWxUserMemberService wxUserMemberService;
/**
*
*/
@ -101,7 +109,29 @@ public class WxUserRemarkController extends BaseController {
*/
@PostMapping("/batchAddRemark")
public R batchAddRemark(@RequestBody @Validated WxUserRemarkReq wxUserRemarkReq) {
if(wxUserRemarkReq.getUserIdList() == null || wxUserRemarkReq.getUserIdList().size() == 0) {
return R.fail("请选择用户");
}
wxUserRemarkService.batchAddRemark(wxUserRemarkReq);
return R.ok();
}
/**
*
*/
@PostMapping("/allAddRemark")
public R allAddRemark(@RequestParam("content") String content, @RequestBody WxUserMemberVm wxUserMemberVm) {
if(StringUtils.isBlank(content)) {
throw new ServiceException("请输入备注内容");
}
WxUserRemarkReq wxUserRemarkReq = new WxUserRemarkReq();
wxUserRemarkReq.setContent(content);
List<WxUserMember> list = wxUserMemberService.selectWxUserMemberList(wxUserMemberVm);
if (list != null && list.size() > 0) {
List<Long> collect = list.stream().map(wxUserMember -> wxUserMember.getId()).collect(Collectors.toList());
wxUserRemarkReq.setUserIdList(collect);
wxUserRemarkService.batchAddRemark(wxUserRemarkReq);
}
return R.ok();
}
}

@ -3,7 +3,10 @@ package com.flossom.system.controller;
import javax.servlet.http.HttpServletResponse;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.entity.WxUserMember;
import com.flossom.common.core.domain.entity.WxUserScriptLog;
import com.flossom.common.core.domain.req.AllSendScriptOperateReq;
import com.flossom.common.core.domain.req.WxUserMemberVm;
import com.flossom.common.core.domain.req.WxUserScriptReq;
import com.flossom.common.core.exception.ServiceException;
import com.flossom.common.core.utils.StringUtils;
@ -14,12 +17,14 @@ import com.flossom.common.core.web.page.TableDataInfo;
import com.flossom.common.log.annotation.Log;
import com.flossom.common.log.enums.BusinessType;
import com.flossom.common.security.annotation.RequiresPermissions;
import com.flossom.system.service.IWxUserMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.flossom.system.service.IWxUserScriptLogService;
import java.util.List;
import java.util.stream.Collectors;
/**
* Controller
@ -34,6 +39,9 @@ public class WxUserScriptLogController extends BaseController {
@Autowired
private IWxUserScriptLogService wxUserScriptLogService;
@Autowired
private IWxUserMemberService wxUserMemberService;
/**
*
*/
@ -101,8 +109,11 @@ public class WxUserScriptLogController extends BaseController {
*
* @return
*/
@PostMapping("/sendScript")
public R sendScript(@RequestBody @Validated WxUserScriptReq wxUserScriptReq) {
@PostMapping("/batchSendScript")
public R batchSendScript(@RequestBody @Validated WxUserScriptReq wxUserScriptReq) {
if (wxUserScriptReq.getUserIdList() == null || wxUserScriptReq.getUserIdList().size() == 0) {
return R.fail("请选择话术接收人");
}
if (wxUserScriptReq.getIsCustom() == 0) {
// 模板话术
if (wxUserScriptReq.getScriptTemplateId() == null || wxUserScriptReq.getScriptTemplateId() == 0) {
@ -161,4 +172,78 @@ public class WxUserScriptLogController extends BaseController {
return R.ok();
}
/**
*
*
* @return
*/
@PostMapping("/allSendScript")
public R allSendScript(@RequestBody @Validated AllSendScriptOperateReq allSendScriptOperateReq) {
WxUserScriptReq wxUserScriptReq = allSendScriptOperateReq.getWxUserScriptReq();
WxUserMemberVm wxUserMemberVm = allSendScriptOperateReq.getWxUserMemberVm();
if (wxUserScriptReq.getIsCustom() == 0) {
// 模板话术
if (wxUserScriptReq.getScriptTemplateId() == null || wxUserScriptReq.getScriptTemplateId() == 0) {
return R.fail("请选择话术模板");
}
} else if (wxUserScriptReq.getIsCustom() == 1) {
// 自定义话术
if (StringUtils.isBlank(wxUserScriptReq.getTitile())) {
return R.fail("请输入话术标题");
}
if (StringUtils.isBlank(wxUserScriptReq.getContent())) {
return R.fail("请输入话术内容");
}
// 跳转类型
if (wxUserScriptReq.getType() == 1) {
// 1跳转内部链接
if (StringUtils.isBlank(wxUserScriptReq.getLink())) {
return R.fail("请输入内部链接");
}
if (StringUtils.isBlank(wxUserScriptReq.getLinkParams())) {
return R.fail("请输入跳转参数");
}
}
if (wxUserScriptReq.getType() == 3) {
// 03跳转外部链接
if (StringUtils.isBlank(wxUserScriptReq.getLink())) {
return R.fail("请输入外部链接地址");
}
}
if (wxUserScriptReq.getType() == 4) {
// 4跳转小程序
if (StringUtils.isBlank(wxUserScriptReq.getRedirectAppid())) {
return R.fail("请输入小程序appid");
}
if (StringUtils.isBlank(wxUserScriptReq.getRedirectUrl())) {
return R.fail("请输入小程序页面地址");
}
}
if (wxUserScriptReq.getType() == 5) {
// 5导向视频号
if (StringUtils.isBlank(wxUserScriptReq.getVideoNo())) {
return R.fail("请输入视频号id");
}
if (StringUtils.isBlank(wxUserScriptReq.getFeedId())) {
return R.fail("请输入视频号feedid");
}
}
if (wxUserScriptReq.getType() == 6) {
// 6导向视频号直播间
if (StringUtils.isBlank(wxUserScriptReq.getVideoNo())) {
return R.fail("请输入视频号id");
}
}
}
List<WxUserMember> list = wxUserMemberService.selectWxUserMemberList(wxUserMemberVm);
if (list != null && list.size() > 0) {
List<Long> collect = list.stream().map(wxUserMember -> wxUserMember.getId()).collect(Collectors.toList());
wxUserScriptReq.setUserIdList(collect);
wxUserScriptLogService.sendScript(wxUserScriptReq);
}
return R.ok();
}
}

@ -3,6 +3,7 @@ package com.flossom.system.service;
import java.util.List;
import com.flossom.common.core.domain.entity.WxScriptTemplate;
import com.flossom.common.core.domain.vo.TreeSelect;
/**
* Service
@ -67,4 +68,6 @@ public interface IWxScriptTemplateService
* @return
*/
public boolean hasChildByScriptId(Long id);
public List<TreeSelect> scriptTree(WxScriptTemplate wxScriptTemplate);
}

@ -1,5 +1,7 @@
package com.flossom.system.service.impl;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@ -7,10 +9,12 @@ import java.util.stream.Collectors;
import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.domain.entity.WxScriptTag;
import com.flossom.common.core.domain.entity.WxScriptTemplate;
import com.flossom.common.core.domain.vo.TreeSelect;
import com.flossom.common.core.mapper.SysTagMapper;
import com.flossom.common.core.mapper.WxScriptTagMapper;
import com.flossom.common.core.mapper.WxScriptTemplateMapper;
import com.flossom.common.core.utils.DateUtils;
import com.flossom.common.core.utils.SpringUtils;
import com.flossom.common.core.utils.StringUtils;
import com.flossom.common.security.utils.SecurityUtils;
import org.apache.commons.compress.utils.Lists;
@ -26,14 +30,14 @@ import org.springframework.util.CollectionUtils;
* @date 2023-12-18
*/
@Service
public class WxScriptTemplateServiceImpl implements IWxScriptTemplateService
{
public class WxScriptTemplateServiceImpl implements IWxScriptTemplateService {
@Autowired
private WxScriptTemplateMapper wxScriptTemplateMapper;
@Autowired
private WxScriptTagMapper wxScriptTagMapper;
@Autowired
private SysTagMapper sysTagMapper;
/**
*
*
@ -41,8 +45,7 @@ public class WxScriptTemplateServiceImpl implements IWxScriptTemplateService
* @return
*/
@Override
public WxScriptTemplate selectWxScriptTemplateById(Long id)
{
public WxScriptTemplate selectWxScriptTemplateById(Long id) {
return wxScriptTemplateMapper.selectWxScriptTemplateById(id);
}
@ -53,8 +56,7 @@ public class WxScriptTemplateServiceImpl implements IWxScriptTemplateService
* @return
*/
@Override
public List<WxScriptTemplate> selectWxScriptTemplateList(WxScriptTemplate wxScriptTemplate)
{
public List<WxScriptTemplate> selectWxScriptTemplateList(WxScriptTemplate wxScriptTemplate) {
return wxScriptTemplateMapper.selectWxScriptTemplateList(wxScriptTemplate);
}
@ -65,8 +67,7 @@ public class WxScriptTemplateServiceImpl implements IWxScriptTemplateService
* @return
*/
@Override
public int insertWxScriptTemplate(WxScriptTemplate wxScriptTemplate)
{
public int insertWxScriptTemplate(WxScriptTemplate wxScriptTemplate) {
wxScriptTemplate.setCreateTime(DateUtils.getNowDate());
wxScriptTemplate.setCreateBy(SecurityUtils.getLoginUser().getUsername());
List<SysTag> sysTags = Lists.newArrayList();
@ -110,8 +111,7 @@ public class WxScriptTemplateServiceImpl implements IWxScriptTemplateService
* @return
*/
@Override
public int updateWxScriptTemplate(WxScriptTemplate wxScriptTemplate)
{
public int updateWxScriptTemplate(WxScriptTemplate wxScriptTemplate) {
wxScriptTemplate.setUpdateTime(DateUtils.getNowDate());
wxScriptTemplate.setUpdateBy(SecurityUtils.getLoginUser().getUsername());
wxScriptTemplate.setTagIds("");
@ -158,8 +158,7 @@ public class WxScriptTemplateServiceImpl implements IWxScriptTemplateService
* @return
*/
@Override
public int deleteWxScriptTemplateByIds(Long[] ids)
{
public int deleteWxScriptTemplateByIds(Long[] ids) {
return wxScriptTemplateMapper.deleteWxScriptTemplateByIds(ids);
}
@ -170,8 +169,7 @@ public class WxScriptTemplateServiceImpl implements IWxScriptTemplateService
* @return
*/
@Override
public int deleteWxScriptTemplateById(Long id)
{
public int deleteWxScriptTemplateById(Long id) {
// 先删除原本的关系
int i = wxScriptTagMapper.deleteWxScriptByScriptId(id);
return wxScriptTemplateMapper.deleteWxScriptTemplateById(id);
@ -182,4 +180,68 @@ public class WxScriptTemplateServiceImpl implements IWxScriptTemplateService
int result = wxScriptTemplateMapper.hasChildByScriptId(id);
return result > 0;
}
@Override
public List<TreeSelect> scriptTree(WxScriptTemplate wxScriptTemplate) {
List<WxScriptTemplate> wxScriptTemplateList = this.selectWxScriptTemplateList(wxScriptTemplate);
return buildTree(wxScriptTemplateList);
}
public List<TreeSelect> buildTree(List<WxScriptTemplate> wxScriptTemplateList) {
List<WxScriptTemplate> deptTrees = buildDeptTree(wxScriptTemplateList);
return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
}
public List<WxScriptTemplate> buildDeptTree(List<WxScriptTemplate> wxScriptTemplateList) {
List<WxScriptTemplate> returnList = new ArrayList<>();
List<Long> tempList = wxScriptTemplateList.stream().map(WxScriptTemplate::getId).collect(Collectors.toList());
for (WxScriptTemplate wxScriptTemplate : wxScriptTemplateList) {
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(wxScriptTemplate.getParentId())) {
recursionFn(wxScriptTemplateList, wxScriptTemplate);
returnList.add(wxScriptTemplate);
}
}
if (returnList.isEmpty()) {
returnList = wxScriptTemplateList;
}
return returnList;
}
/**
*
*/
private void recursionFn(List<WxScriptTemplate> list, WxScriptTemplate t) {
// 得到子节点列表
List<WxScriptTemplate> childList = getChildList(list, t);
t.setScriptTemplateChildren(childList);
for (WxScriptTemplate tChild : childList) {
if (hasChild(list, tChild)) {
recursionFn(list, tChild);
}
}
}
/**
*
*/
private List<WxScriptTemplate> getChildList(List<WxScriptTemplate> list, WxScriptTemplate t) {
List<WxScriptTemplate> tlist = new ArrayList<>();
Iterator<WxScriptTemplate> it = list.iterator();
while (it.hasNext()) {
WxScriptTemplate n = (WxScriptTemplate) it.next();
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getId().longValue()) {
tlist.add(n);
}
}
return tlist;
}
/**
*
*/
private boolean hasChild(List<WxScriptTemplate> list, WxScriptTemplate t) {
return getChildList(list, t).size() > 0 ? true : false;
}
}

@ -172,7 +172,6 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService {
List<Integer> needAddIdList = new ArrayList<>();
// 1、查询该标签下有那些用户关联
List<Integer> existedUserList = wxUserTagMapper.selectWxUserTagByTagId(tagId, TagTypeStatus.MINI_PROGRAM.getCode());
if (existedUserList != null && existedUserList.size() > 0) {
Iterator<Integer> iterator = userIdList.iterator();
while (iterator.hasNext()) {
Integer element = iterator.next();
@ -180,7 +179,6 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService {
needAddIdList.add(element);
}
}
}
// 2、添加用户与标签的关联
List<WxUserTag> list = new ArrayList<>();
@ -237,10 +235,10 @@ public class WxUserMemberServiceImpl implements IWxUserMemberService {
if (wxUserIntegralVm.getSource().equals(IntegralChangeTypeEnum.INCREASE.getCode())) {
changeUserMember.setCredit(wxUserMember.getCredit() + wxUserIntegralVm.getFloatScore().intValue());
} else if (wxUserIntegralVm.getSource().equals(IntegralChangeTypeEnum.REDUCE.getCode())) {
if (wxUserMember.getCredit() < Integer.valueOf(wxUserIntegralVm.getSource())) {
changeUserMember.setCredit(0);
} else {
if (wxUserMember.getCredit() >= wxUserIntegralVm.getFloatScore().intValue()) {
changeUserMember.setCredit(wxUserMember.getCredit() - wxUserIntegralVm.getFloatScore().intValue());
} else {
changeUserMember.setCredit(0);
}
}
changeUserMember.setId(wxUserMember.getId());

@ -99,14 +99,6 @@ public class WxUserRemarkServiceImpl implements IWxUserRemarkService {
@Override
public void batchAddRemark(WxUserRemarkReq wxUserRemarkReq) {
if (wxUserRemarkReq.getUserIdList() == null || wxUserRemarkReq.getUserIdList().size() == 0) {
List<Integer> userIdList = wxUserMemberMapper.selectWxUserMemberIdList();
if (userIdList != null && userIdList.size() > 0) {
List<Long> collect = userIdList.stream().map(Integer::longValue).collect(Collectors.toList());
wxUserRemarkReq.setUserIdList(collect);
}
}
if (wxUserRemarkReq.getUserIdList() != null && wxUserRemarkReq.getUserIdList().size() > 0) {
WxUserRemark wxUserRemark = new WxUserRemark();
for (Long userId : wxUserRemarkReq.getUserIdList()) {

@ -111,6 +111,9 @@ public class WxUserScriptLogServiceImpl implements IWxUserScriptLogService {
for (Long wxUserId : userIdList) {
WxUserScriptLog wxUserScriptLog = new WxUserScriptLog();
BeanUtils.copyProperties(wxUserScriptReq, wxUserScriptLog);
if (wxUserScriptReq.getTagIds() != null && wxUserScriptReq.getTagIds().size() > 0) {
wxUserScriptLog.setTagIds(wxUserScriptReq.getTagIds().stream().collect(Collectors.joining(",")));
}
wxUserScriptLog.setWxUserId(wxUserId);
wxUserScriptLog.setCreateBy(SecurityUtils.getUsername());
wxUserScriptLog.setCreateTime(DateUtils.getNowDate());
@ -131,9 +134,8 @@ public class WxUserScriptLogServiceImpl implements IWxUserScriptLogService {
}
if (wxUserScriptReq.getIsCustom() == 1) {
// 自定义话术
if (StringUtils.isNotBlank(wxUserScriptReq.getTagIds())) {
List<String> list = Arrays.asList(wxUserScriptReq.getTagIds().split(","));
List<Integer> tagList = list.stream().map(Integer::parseInt).collect(Collectors.toList());
if (wxUserScriptReq.getTagIds() != null && wxUserScriptReq.getTagIds().size() > 0) {
List<Integer> tagList = wxUserScriptReq.getTagIds().stream().map(Integer::parseInt).collect(Collectors.toList());
List<Integer> collect = userIdList.stream().map(Long::intValue).collect(Collectors.toList());
wxUserMemberService.batchAddMiniProgramTag(tagList, collect);
}

@ -50,6 +50,17 @@ export function selectUserCount() {
})
}
export function getMiniProgramTagsTree() {
return request({
url: '/system/tagInfo/tagTree',
method: 'get',
params:{
type: 1
}
})
}
export function getMiniProgramTags() {
return request({
url: '/system/tagInfo/getMiniProgramTags',
@ -64,6 +75,7 @@ export function getWecomTags() {
})
}
// 获取购买渠道
export function getPurchaseChannel() {
return request({
url: '/system/channelInfo/getPurchaseChannel',
@ -71,6 +83,7 @@ export function getPurchaseChannel() {
})
}
// 获取省市区
export function getRegionByPid(pid) {
return request({
url: '/system/region/getRegionByPid',
@ -80,3 +93,126 @@ export function getRegionByPid(pid) {
}
})
}
// 批量添加小程序标签
export function batchAddMiniProgramTag(tagIdList, userIdList) {
return request({
url: '/system/member/batchAddMiniProgramTag?tagIdList=' + tagIdList + '&userIdList=' + userIdList,
method: 'post',
// params: {
// "tagIdList": tagIdList,
// "userIdList": userIdList
// },
header: {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
}
})
}
// 全量添加小程序标签
export function allAddMiniProgramTag(tagIdList, data) {
return request({
url: '/system/member/allAddMiniProgramTag?tagIdList=' + tagIdList,
method: 'post',
// params: {
// tagIdList: tagIdList
// },
data: data
})
}
// 批量删除小程序标签
export function batchDelMiniProgramTag(tagIdList, userIdList) {
return request({
url: '/system/member/batchDelMiniProgramTag?tagIdList=' + tagIdList + '&userIdList=' + userIdList,
method: 'post',
// params: {
// tagIdList: tagIdList,
// userIdList: userIdList
// }
})
}
// 全量删除小程序标签
export function allDelMiniProgramTag(tagIdList, data) {
return request({
url: '/system/member/allDelMiniProgramTag?tagIdList=' + tagIdList,
method: 'post',
// params: {
// tagIdList: tagIdList,
// },
data: data
})
}
// 批量操作积分
export function batchChangIntegral(userIdList, data) {
return request({
url: '/system/member/batchChangIntegral?userIdList=' + userIdList,
method: 'post',
// params: {
// userIdList: userIdList
// },
data: data
})
}
// 全量 操作积分
export function allChangIntegral(data, user) {
return request({
url: '/system/member/allChangIntegral',
method: 'post',
data: {
wxUserIntegralVm: data,
wxUserMemberVm: user
},
})
}
// 批量发送话术
export function batchSendScript(data) {
return request({
url: '/system/userScriptLog/batchSendScript',
method: 'post',
data: data
})
}
// 全量发送话术
export function allSendScript(data, user) {
return request({
url: '/system/userScriptLog/allSendScript',
method: 'post',
data: {
wxUserScriptReq: data,
wxUserMemberVm: user
},
})
}
// 批量添加备注
export function batchAddRemark(data) {
return request({
url: '/system/wxUserRemark/batchAddRemark',
method: 'post',
data: data
})
}
// 全量添加备注
export function allAddRemark(content, user) {
return request({
url: '/system/wxUserRemark/allAddRemark?content=' + content,
method: 'post',
data: user
})
}
export function scriptTreeSelect(query) {
return request({
url: '/system/scriptTemplate/scriptTree',
method: 'get',
params: query
})
}

@ -47,7 +47,8 @@
</el-date-picker>
</el-form-item>
<el-form-item label="省" prop="provinceId">
<el-select v-model="queryParams.provinceId" @change="getCityList(queryParams.provinceId)" @keyup.enter.native="handleQuery" filterable clearable>
<el-select v-model="queryParams.provinceId" @change="getCityList(queryParams.provinceId)"
@keyup.enter.native="handleQuery" filterable clearable>
<el-option
v-for="item in provinceList"
:key="item.id"
@ -57,7 +58,8 @@
</el-select>
</el-form-item>
<el-form-item label="市" prop="cityId">
<el-select v-model="queryParams.cityId" @change="getAreaByPid(queryParams.cityId)" @keyup.enter.native="handleQuery" filterable clearable placeholder="请选择省">
<el-select v-model="queryParams.cityId" @change="getAreaByPid(queryParams.cityId)"
@keyup.enter.native="handleQuery" filterable clearable placeholder="请选择省">
<el-option
v-for="item in cityList"
:key="item.id"
@ -67,7 +69,8 @@
</el-select>
</el-form-item>
<el-form-item label="区" prop="areaId">
<el-select v-model="queryParams.areaId" @keyup.enter.native="handleQuery" filterable clearable placeholder="请选择市">
<el-select v-model="queryParams.areaId" @keyup.enter.native="handleQuery" filterable clearable
placeholder="请选择市">
<el-option
v-for="item in areaList"
:key="item.id"
@ -106,16 +109,16 @@
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="购买渠道" prop="purchaseChannels">
<el-select v-model="queryParams.purchaseChannels" multiple placeholder="请选择">
<el-option
v-for="item in purchaseChannels"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="购买渠道" prop="purchaseChannels">-->
<!-- <el-select v-model="queryParams.purchaseChannels" multiple placeholder="请选择">-->
<!-- <el-option-->
<!-- v-for="item in purchaseChannels"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="企微标签" prop="wecomTags">
<el-select v-model="queryParams.wecomTags" multiple placeholder="请选择">
<el-option
@ -144,47 +147,74 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:member:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:member:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:member:remove']"
>删除</el-button>
<el-select v-model="batchOperateValue" placeholder="批量操作" size="mini" clearable>
<el-option label="批量添加小程序标签" :value="1"></el-option>
<el-option label="批量删除小程序标签" :value="2"></el-option>
<el-option label="全量添加小程序标签" :value="3"></el-option>
<el-option label="全量删除小程序标签" :value="4"></el-option>
<el-option label="批量加减积分" :value="5"></el-option>
<el-option label="全量加减积分" :value="6"></el-option>
<el-option label="批量发送话术" :value="7"></el-option>
<el-option label="全量发送话术" :value="8"></el-option>
<el-option label="批量备注" :value="9"></el-option>
<el-option label="全量备注" :value="10"></el-option>
<el-option label="注销账号" :value="11"></el-option>
<el-option label="导出数据" :value="12"></el-option>
<el-option label="导出全量数据" :value="13"></el-option>
</el-select>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
type="primary"
plain
icon="el-icon-download"
icon="el-icon-warning"
size="mini"
@click="handleExport"
v-hasPermi="['system:member:export']"
>导出</el-button>
@click="batchOperate()"
>确认
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['system:member:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['system:member:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['system:member:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['system:member:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -220,41 +250,48 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:member:edit']"
>修改</el-button>
>查看
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:member:remove']"
>删除</el-button>
>删除
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:member:edit']"
>查看</el-button>
>查看
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
>开启打卡</el-button>
>开启打卡
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
>开启活动</el-button>
>开启活动
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
>个人信息同步</el-button>
>个人信息同步
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
>积分同步</el-button>
>积分同步
</el-button>
</template>
</el-table-column>
</el-table>
@ -342,6 +379,163 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 发送话术 -->
<el-dialog :title="title" :visible.sync="batchMiniProgramVisible" width="50%"
:before-close="cancelMiniProgramDialog">
<el-form ref="form" :model="form" label-width="150px">
<el-row>
<el-col :span="100">
<el-form-item label="小程序标签" prop="tagIdArray" label-width="90px">
<treeselect v-model="tagIdArray" :options="chatTagOptions" :multiple="true" :show-count="true"
placeholder="请选择小程序标签" :disable-branch-nodes="true"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelMiniProgramDialog(true)"> </el-button>
<el-button type="primary" @click="submitBatchOperate"> </el-button>
</div>
</el-dialog>
<!-- 积分批量操作 -->
<el-dialog :title="title" :visible.sync="batchIntegralVisible" width="50%" :before-close="cancelIntegralDialog">
<el-form ref="form" :model="integralForm" label-width="150px">
<el-form-item label="类型" prop="source">
<el-select v-model="integralForm.source" style="width: 50%">
<el-option label="增加" :value="1"></el-option>
<el-option label="减少" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="变动积分" prop="headimg">
<el-input-number v-model="integralForm.floatScore" controls-position="right" :min="1"
:max="1000"></el-input-number>
</el-form-item>
<el-form-item label="说明 " prop="username">
<el-input v-model="integralForm.remarkContent"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelIntegralDialog(true)"> </el-button>
<el-button type="primary" @click="submitBatchOperate"> </el-button>
</div>
</el-dialog>
<!-- 备注批量操作 -->
<el-dialog :title="title" :visible.sync="batchRemarkVisible" width="50%" :before-close="cancelRemarkDialog">
<el-form ref="form" :model="remarkForm" label-width="150px">
<el-form-item label="备注 " prop="content">
<el-input v-model="remarkForm.content" placeholder="请输入备注"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelRemarkDialog(true)"> </el-button>
<el-button type="primary" @click="submitBatchOperate"> </el-button>
</div>
</el-dialog>
<!-- 话术批量操作 -->
<el-dialog :title="title" :visible.sync="batchScriptVisible" width="600px" append-to-body
:before-close="cancelscriptDialog">
<el-form ref="form" :model="scriptForm" label-width="80px">
<el-row>
<el-col :span="24">
<el-form-item label="类型" prop="isCustom">
<el-select v-model="scriptForm.isCustom" @change="clearScript">
<el-option label="话术模板发送" :value="0" :key="0"></el-option>
<el-option label="自定义发送" :value="1" :key="1"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<!-- 话术模板发送 -->
<el-row v-if="scriptForm.isCustom == 0">
<el-col :span="40">
<el-form-item label="话术二级标题选择" prop="scriptTemplateId" label-width="90px">
<treeselect v-model="scriptForm.scriptTemplateId" :options="scriptOptions" :show-count="true"
@select="selectTree"
placeholder="请选择话术" :disable-branch-nodes="true"/>
</el-form-item>
</el-col>
<el-col :span="40">
<el-form-item label="话术通知内容" prop="scriptContent">
<el-input v-model="scriptForm.scriptContent"/>
</el-form-item>
</el-col>
</el-row>
<!-- 自定义发送 -->
<el-row v-if="scriptForm.isCustom == 1">
<el-col :span="24">
<el-form-item label="话术标题" prop="titile">
<el-input v-model="scriptForm.titile" placeholder="请输入话术标题"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="话术内容" prop="content">
<el-input v-model="scriptForm.content" type="textarea" placeholder="请输入话术内容"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="小程序标签" prop="tagIdArray" label-width="90px">
<treeselect v-model="tagIdArray" :options="chatTagOptions" :multiple="true" :show-count="true"
placeholder="请选择小程序标签" :disable-branch-nodes="true"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="跳转类型" prop="type">
<el-select v-model="scriptForm.type">
<el-option label="无跳转" :value="0" :key="0"></el-option>
<el-option label="跳转内部链接" :value="1" :key="1"></el-option>
<el-option label="跳转小程序" :value="4" :key="4"></el-option>
<el-option label="跳转外部链接" :value="3" :key="3"></el-option>
<el-option label="导向视频号" :value="5" :key="5"></el-option>
<el-option label="导向视频号直播间" :value="6" :key="6"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" v-if="scriptForm.type == 1">
<el-form-item label="内部链接" prop="link">
<el-input v-model="scriptForm.link" placeholder="请输入内部链接"/>
</el-form-item>
</el-col>
<el-col :span="24" v-if="scriptForm.type == 1">
<el-form-item label="跳转参数" prop="linkParams">
<el-input v-model="scriptForm.linkParams" placeholder="请输入跳转参数"/>
</el-form-item>
</el-col>
<el-col :span="24" v-if="scriptForm.type == 3">
<el-form-item label="外部链接" prop="link">
<el-input v-model="scriptForm.link" placeholder="请输入外部链接"/>
</el-form-item>
</el-col>
<el-col :span="24" v-if="scriptForm.type == 4">
<el-form-item label="小程序APPID" prop="redirectAppid">
<el-input v-model="scriptForm.redirectAppid" placeholder="请输入APPID"/>
</el-form-item>
</el-col>
<el-col :span="24" v-if="scriptForm.type == 4" label-width="90px">
<el-form-item label="小程序页面" prop="redirectUrl">
<el-input v-model="scriptForm.redirectUrl" placeholder="请输入小程序页面"/>
</el-form-item>
</el-col>
<el-col :span="24" v-if="scriptForm.type == 5 || scriptForm.type == 6">
<el-form-item label="视频号ID" prop="videoNo">
<el-input v-model="scriptForm.videoNo" placeholder="视频号id以“sph”开头的id可再视频号助手获取"/>
</el-form-item>
</el-col>
<el-col :span="24" v-if="scriptForm.type == 5" label-width="90px">
<el-form-item label="feedId" prop="feedId">
<el-input v-model="scriptForm.feedId" placeholder="请输入视频号feedId"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBatchOperate"> </el-button>
<el-button @click="cancelscriptDialog"> </el-button>
</div>
</el-dialog>
</div>
</template>
@ -357,28 +551,28 @@ import {
getWecomTags,
getPurchaseChannel,
getRegionByPid,
batchAddMiniProgramTag,
allAddMiniProgramTag,
batchDelMiniProgramTag,
allDelMiniProgramTag,
batchChangIntegral,
allChangIntegral,
batchSendScript,
allSendScript,
batchAddRemark,
allAddRemark,
getMiniProgramTagsTree,
scriptTreeSelect,
} from "@/api/system/member";
import Treeselect from "@riophae/vue-treeselect";
import {tagTreeSelect} from "@/api/system/wechatTab";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Member",
components: {Treeselect},
data() {
return {
devicesTags: [{
value: '仪器标签1',
label: '仪器标签1'
}, {
value: '仪器标签2',
label: '仪器标签2'
}, {
value: '仪器标签3',
label: '仪器标签3'
}],
miniProgramTags: [],
wecomTags: [],
purchaseChannels: null,
provinceList: null,
cityList: null,
areaList: null,
//
loading: true,
//
@ -399,11 +593,66 @@ export default {
open: false,
//
dateRange: [],
//
count: {
userNum: 0,
userRegisterNum: 0,
userDeviceNum: 0
},
//
miniProgramTags: [],
//
miniProgramTagTree: [],
//
wecomTags: [],
//
purchaseChannels: null,
//
provinceList: null,
cityList: null,
areaList: null,
//
batchOperateValue: null,
//
batchMiniProgramVisible: false,
chatTagOptions: [],
scriptOptions: [],
tagIdArray: [],
//
batchIntegralVisible: false,
integralForm: {
source: null,
floatScore: null,
remarkContent: "后台操作"
},
//
batchScriptVisible: false,
remarkForm: {
content: null,
userIdList: null,
},
//
batchRemarkVisible: null,
scriptForm: {
userIdList: null,
isCustom: null,
scriptTemplateId: null,
scriptName: null,
titile: null,
content: null,
tagType: null,
type: null,
link: null,
linkParams: null,
redirectAppid: null,
redirectUrl: null,
videoNo: null,
feedId: null,
tagNames: [],
tagIds: [],
//
scriptContent: null,
},
//
queryParams: {
pageNum: 1,
@ -447,8 +696,7 @@ export default {
//
form: {},
//
rules: {
}
rules: {}
};
},
created() {
@ -460,6 +708,9 @@ export default {
this.getTags();
//
this.getProvinceList();
//
this.getDeptTree();
this.getScriptTree();
},
methods: {
/** 查询用户列表 */
@ -491,6 +742,10 @@ export default {
getPurchaseChannel().then(Response => {
this.purchaseChannels = Response.data
})
//
getMiniProgramTagsTree().then(Response => {
this.miniProgramTagTree = Response.data
})
},
//
getProvinceList() {
@ -517,6 +772,91 @@ export default {
this.open = false;
this.reset();
},
//
cancelMiniProgramDialog(isclose) {
this.title = null;
this.tagIdArray = [];
if (isclose) {
this.batchMiniProgramVisible = false;
}
},
cancelIntegralDialog(isclose) {
this.integralForm.source = null;
this.integralForm.floatScore = null;
this.integralForm.remarkContent = "后台操作";
if (isclose) {
this.batchIntegralVisible = false;
}
},
cancelRemarkDialog(isclose) {
this.remarkForm.content = null;
if (isclose) {
this.batchRemarkVisible = false;
}
},
cancelscriptDialog(isclose) {
this.scriptForm.isCustom = null,
this.scriptForm.scriptName = null;
this.scriptForm.titile = null;
this.scriptForm.content = null;
this.scriptForm.tagType = null;
this.scriptForm.type = null;
this.scriptForm.link = null;
this.scriptForm.linkParams = null;
this.scriptForm.redirectAppid = null;
this.scriptForm.redirectUrl = null;
this.scriptForm.videoNo = null;
this.scriptForm.feedId = null;
this.scriptForm.tagNames = null;
this.scriptForm.tagIds = null;
this.scriptForm.scriptContent = null;
this.tagIdArray = [];
this.scriptForm.scriptTemplateId = null;
this.scriptForm.scriptContent = null;
if (isclose) {
this.batchScriptVisible = false;
}
},
/** 查询部门下拉树结构 */
getDeptTree() {
tagTreeSelect({type: 1}).then(response => {
this.chatTagOptions = response.data;
});
},
/** 查询话术下拉树结构 */
getScriptTree() {
scriptTreeSelect().then(response => {
this.scriptOptions = response.data;
});
},
clearScript() {
//
if (this.scriptForm.isCustom == 0) {
this.scriptForm.scriptName = null;
this.scriptForm.titile = null;
this.scriptForm.content = null;
this.scriptForm.tagType = null;
this.scriptForm.type = null;
this.scriptForm.link = null;
this.scriptForm.linkParams = null;
this.scriptForm.redirectAppid = null;
this.scriptForm.redirectUrl = null;
this.scriptForm.videoNo = null;
this.scriptForm.feedId = null;
this.scriptForm.tagNames = null;
this.scriptForm.tagIds = null;
this.scriptForm.scriptContent = null;
this.tagIdArray = [];
}
//
if (this.scriptForm.isCustom == 1) {
this.scriptForm.scriptTemplateId = null;
this.scriptForm.scriptContent = null;
}
},
selectTree(raw, instanceId) {
this.scriptForm.scriptContent = raw.content;
},
//
reset() {
this.form = {
@ -564,6 +904,137 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
/** 批量操作按钮,显示批量操作弹窗 */
batchOperate() {
if (this.batchOperateValue == null) {
this.$message({
message: '请选择要批量操作类型',
type: 'warning'
})
return
} else {
/* 批量操作 小程序标签 */
if (this.batchOperateValue == 1 || this.batchOperateValue == 2) {
if (this.ids.length == 0) {
this.$message({
message: '请选择要操作的数据',
type: 'warning'
})
return
}
if (this.batchOperateValue == 1) {
console.log("批量添加小程序标签");
this.title = "添加小程序标签";
}
if (this.batchOperateValue == 2) {
console.log("批量删除小程序标签");
this.title = "删除小程序标签";
}
this.batchMiniProgramVisible = true;
}
if (this.batchOperateValue == 3 || this.batchOperateValue == 4) {
if (this.batchOperateValue == 3) {
console.log("全量添加小程序标签");
this.title = "添加小程序标签";
}
if (this.batchOperateValue == 4) {
console.log("全量删除小程序标签");
this.title = "添加小程序标签";
}
this.batchMiniProgramVisible = true;
}
/* 批量操作:加减分 */
if (this.batchOperateValue == 5) {
console.log("批量加减积分");
if (this.ids.length == 0) {
this.$message({
message: '请选择要操作的数据',
type: 'warning'
})
return
}
this.batchIntegralVisible = true;
}
if (this.batchOperateValue == 6) {
console.log("全量加减积分");
this.batchIntegralVisible = true;
}
/* 批量操作:发送话术 */
if (this.batchOperateValue == 7) {
console.log("批量发送话术");
if (this.ids.length == 0) {
this.$message({
message: '请选择要操作的数据',
type: 'warning'
})
return
}
this.batchScriptVisible = true;
}
if (this.batchOperateValue == 8) {
console.log("全量发送话术");
this.batchScriptVisible = true;
}
/* 批量操作: 备注 */
if (this.batchOperateValue == 9) {
console.log("批量备注");
if (this.ids.length == 0) {
this.$message({
message: '请选择要操作的数据',
type: 'warning'
})
return
}
this.batchRemarkVisible = true;
}
if (this.batchOperateValue == 10) {
console.log("全量备注");
this.batchRemarkVisible = true;
}
/* 批量操作:注销账号 */
if (this.batchOperateValue == 11) {
console.log("注销账号");
if (this.ids.length == 0) {
this.$message({
message: '请选择要操作的数据',
type: 'warning'
})
return
}
this.$confirm("<span style='font-size: 18px'><strong>确定将选择的数据注销?</strong></span><br/><span style='padding-left:2em'>请谨慎操作,一旦成功将无法撤销。</span>", '注销账号', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
delMember(this.ids).then(Response => {
this.$modal.msgSuccess("批量删除会员成功");
this.cancelIntegralDialog(true);
})
}).catch(() => {
});
}
/* 批量操作:导出数据 */
if (this.batchOperateValue == 12) {
console.log("导出数据");
if (this.ids.length == 0) {
this.$message({
message: '请选择要操作的数据',
type: 'warning'
})
return
}
}
if (this.batchOperateValue == 13) {
console.log("导出全量数据");
}
}
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
@ -605,6 +1076,89 @@ export default {
}
}
});
},
/* 批量操作提交按钮 */
submitBatchOperate() {
//
if (this.batchOperateValue == 1) {
batchAddMiniProgramTag(this.tagIdArray, this.ids).then(Response => {
this.$modal.msgSuccess("批量添加小程序标签成功");
this.cancelMiniProgramDialog(true);
})
}
//
if (this.batchOperateValue == 2) {
batchDelMiniProgramTag(this.tagIdArray, this.ids).then(Response => {
this.$modal.msgSuccess("批量添加小程序标签成功");
this.cancelMiniProgramDialog(true);
})
}
//
if (this.batchOperateValue == 3) {
allAddMiniProgramTag(this.tagIdArray, this.queryParams).then(Response => {
this.$modal.msgSuccess("全量添加小程序标签成功");
this.cancelMiniProgramDialog(true);
})
}
//
if (this.batchOperateValue == 4) {
allDelMiniProgramTag(this.tagIdArray, this.queryParams).then(Response => {
this.$modal.msgSuccess("全量删除小程序标签成功");
this.cancelMiniProgramDialog(true);
})
}
//
if (this.batchOperateValue == 5) {
batchChangIntegral(this.ids, this.integralForm).then(Response => {
this.$modal.msgSuccess("批量操作积分成功");
this.cancelIntegralDialog(true);
})
}
//
if (this.batchOperateValue == 6) {
allChangIntegral(this.integralForm, this.queryParams).then(Response => {
this.$modal.msgSuccess("批量操作积分成功");
this.cancelIntegralDialog(true);
})
}
/* 批量操作:发送话术 */
if (this.batchOperateValue == 7) {
this.scriptForm.userIdList = this.ids;
this.scriptForm.tagIds = this.tagIdArray;
batchSendScript(this.scriptForm).then(Response => {
this.$modal.msgSuccess("批量发送话术成功");
this.cancelscriptDialog(true);
})
}
if (this.batchOperateValue == 8) {
this.scriptForm.tagIds = this.tagIdArray;
allSendScript(this.scriptForm, this.queryParams).then(Response => {
this.$modal.msgSuccess("全量发送话术成功");
this.cancelscriptDialog(true);
})
}
//
if (this.batchOperateValue == 9) {
console.log("批量备注");
this.remarkForm.userIdList = this.ids;
batchAddRemark(this.remarkForm).then(Response => {
this.$modal.msgSuccess("批量备注成功");
this.cancelRemarkDialog(true);
})
}
//
if (this.batchOperateValue == 10) {
console.log("全量备注");
allAddRemark(this.remarkForm.content, this.queryParams).then(Response => {
this.$modal.msgSuccess("批量备注成功");
this.cancelRemarkDialog(true);
})
}
},
/** 删除按钮操作 */
handleDelete(row) {
@ -614,7 +1168,8 @@ export default {
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
@ -623,5 +1178,6 @@ export default {
}, `member_${new Date().getTime()}.xlsx`)
}
}
};
}
;
</script>

Loading…
Cancel
Save