Skip to content

Commit

Permalink
Merge pull request #46 from lianluoyi/dev
Browse files Browse the repository at this point in the history
V1.34.0版本更新
  • Loading branch information
lianluoyi committed Nov 3, 2023
2 parents d0b0b16 + 0440f2b commit 9556c76
Show file tree
Hide file tree
Showing 69 changed files with 2,494 additions and 810 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public AjaxResult<CustomerOverviewDateVO> exportCustomerTagsView(@RequestBody @V
@ApiOperation("获取客户概况-数据总览-日期维度")
public TableDataInfo<CustomerOverviewDateVO> getCustomerOverViewOfDate(@RequestBody @Validated CustomerOverviewDTO dto) {
dto.setCorpId(LoginTokenService.getLoginUser().getCorpId());
return getDataTable(weUserCustomerMessageStatisticsService.getCustomerOverViewOfDate(dto));
return getDataTable(weUserCustomerMessageStatisticsService.getCustomerOverViewOfDate(dto), dto.getTotal());
}

@PreAuthorize("@ss.hasPermi('statistic:customerContact:export')")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import com.easyink.common.core.domain.AjaxResult;
import com.easyink.common.core.page.TableDataInfo;
import com.easyink.common.enums.BusinessType;
import com.easyink.common.utils.PageInfoUtil;
import com.easyink.common.utils.poi.ExcelUtil;
import com.easyink.wecom.domain.WeChatContactMapping;
import com.easyink.wecom.domain.WeCustomer;
import com.easyink.wecom.domain.dto.WeChatMappingDTO;
import com.easyink.wecom.login.util.LoginTokenService;
import com.easyink.wecom.service.WeChatContactMappingService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -39,14 +39,14 @@ public class WeChatContactMappingController extends BaseController {
// @PreAuthorize("@ss.hasPermi('chat:mapping:list')")
@ApiOperation(value = "查询聊天关系映射列表", httpMethod = "GET")
@GetMapping("/list")
public TableDataInfo<WeChatContactMapping> list(WeChatContactMapping weChatContactMapping) {
startPage();
public TableDataInfo<WeChatContactMapping> list(WeChatMappingDTO weChatMappingDTO) {
String corpId = LoginTokenService.getLoginUser().getCorpId();
if (StringUtils.isBlank(corpId)) {
return getDataTable(new ArrayList<>());
}
weChatContactMapping.setCorpId(corpId);
List<WeChatContactMapping> list = weChatContactMappingService.selectWeChatContactMappingList(weChatContactMapping);
PageInfoUtil.setPage();
weChatMappingDTO.setCorpId(corpId);
List<WeChatContactMapping> list = weChatContactMappingService.selectWeChatContactMappingListV2(weChatMappingDTO);
return getDataTable(list);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public TableDataInfo<WeEmpleCodeVO> list(FindWeEmpleCodeDTO weEmpleCode) {
startPage();
weEmpleCode.setCorpId(LoginTokenService.getLoginUser().getCorpId());
weEmpleCode.setSource(EmployCodeSourceEnum.NEW_GROUP.getSource());
List<WeEmpleCodeVO> list = weEmpleCodeService.selectWeEmpleCodeList(weEmpleCode);
List<WeEmpleCodeVO> list = weEmpleCodeService.selectGroupWeEmpleCodeList(weEmpleCode);
return getDataTable(list);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,19 @@ public TableDataInfo<WeCustomerVO> listV2(@RequestBody WeCustomerSearchDTO weCus
*/
@GetMapping("/listDistinct")
@ApiOperation("会话存档客户检索客户列表")
public TableDataInfo<WeCustomerVO> listDistinct(WeCustomer weCustomer) {
startPage();
public TableDataInfo<SessionArchiveCustomerVO> listDistinct(WeCustomer weCustomer) {
weCustomer.setCorpId(LoginTokenService.getLoginUser().getCorpId());
List<WeCustomerVO> list = weCustomerService.selectWeCustomerListDistinct(weCustomer);
List<SessionArchiveCustomerVO> list = weCustomerService.selectWeCustomerListDistinctV2(weCustomer);
return getDataTable(list);
}

@GetMapping("/listDistinct/count")
@ApiOperation("会话存档客户检索客户列表-去重后的客户总数")
public AjaxResult<WeCustomerSumVO> listDistinctCount(WeCustomer weCustomer) {
weCustomer.setCorpId(LoginTokenService.getLoginUser().getCorpId());
return AjaxResult.success(weCustomerService.customerCount(weCustomer));
}

@PostMapping("/sum")
@ApiOperation("查询企业客户统计数据")
public AjaxResult<WeCustomerSumVO> sum(@RequestBody WeCustomerSearchDTO weCustomerSearchDTO) {
Expand Down
2 changes: 1 addition & 1 deletion easyink-admin/src/main/resources/logback-file.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</providers>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_PATH:-/log}${LOG_NAME:-/wecom.log}.%d{yyyy-MM-dd}(%i)%d{HH.mm.ss}.gz</fileNamePattern>
<fileNamePattern>${LOG_PATH:-/log}${LOG_NAME:-/wecom.log}.%d{yyyy-MM-dd}.%i.%d{HH.mm.ss}.gz</fileNamePattern>
<maxHistory>${LOG_MAX_HISTORY:-15}</maxHistory> <!-- 保留15天 -->
<maxFileSize>${LOG_MAX_SIZE:-100MB}</maxFileSize>
</rollingPolicy>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,4 +311,12 @@ public static Long[] getInitMenuList(){
* 群发发送人/群名称的分隔符
*/
public static final String CUSTOMER_PUSH_MESSAGE_SEPARATOR = "、";

/**
* 创建群发任务,企微返回的errmsg中,不存在的员工id的标识
* 示例: result:{"errcode":60111,"errmsg":"invalid string value `XXXXXX`. userid not found, hint: [XXXXXXXXXXXX],
* from ip: XXX.XXX.XXX.XXX, more info at https://open.work.weixin.qq.com/devtool/query?e=60111","fail_list":[]}
* 如示例所示,员工id被``包围,通过``来定位员工id
*/
public static final String CUSTOMER_PUSH_MESSAGE_NOT_EXIST_USER_MARK = "`";
}
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,10 @@ public static String getContactSeqKey(String corpId) {
//表示所在部门是否为上级,0-否,1-是,顺序与Department字段的部门逐一对应
//激活状态:1=已激活 2=已禁用 4=未激活 已激活代表已激活企业微信或已关注微工作台(原企业号) 5=成员退出
public enum corpUserEnum {
USER_SEX_TYPE_UNKNOWN(0,"未知性别"),
USER_SEX_TYPE_MAN(1, "男性"),
USER_SEX_TYPE_WEMAN(2, "女性"),
USER_SEX_TYPE_ALL(3, "所有性别"),

IS_DEPARTMENT_SUPERIOR_YES(1, "是"),
IS_DEPARTMENT_SUPERIOR_NO(0, "否"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ public static class RadarCustomerClickRecord {
public static String getRecordText(String customerName, String userName, String detail, int type, String channelName) {
String msg = "客户“" + customerName + "”" + "点击了员工“" + userName + "”" + "在【" + RadarChannelEnum.getChannelByType(type) + REPlACE_WORD + "】发出的雷达链接";
if (RadarChannelEnum.CUSTOMIZE.getTYPE().equals(type)) {
return msg.replace(REPlACE_WORD, "-{" + channelName + "}");
return msg.replace(REPlACE_WORD, "-" + channelName);
}
if (StringUtils.isNotBlank(detail)
&& !RadarChannelEnum.MOMENT.getTYPE().equals(type)
&& !RadarChannelEnum.SIDE_BAR.getTYPE().equals(type)
&& !RadarChannelEnum.WELCOME_MSG.getTYPE().equals(type)) {
return msg.replace(REPlACE_WORD, "-{" + detail + "}");
return msg.replace(REPlACE_WORD, "-" + detail);
} else {
return msg.replace(REPlACE_WORD, StringUtils.EMPTY);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public enum AddWayEnum {
EMAIL(9, "搜索邮箱"),
VIDEO_OFFICIAL(10, "视频号主页添加"),
CUSTOMER_ACQUISITION(16, "通过获客链接添加"),
ALL_ADD_WAY(17, "所有来源"),
INNER_USER_SHARE(201, "内部成员共享"),
TRANSFER(202, "管理员/负责人分配");
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public enum MessageStatusEnum {
* (当员工对群群发时只选择了部分群,剩余群未发送)
*/
NOT_SEND_GROUP("7", "未发送"),
PARAM_ERROR("8", "创建失败,群发内容异常");
PARAM_ERROR("8", "创建失败,群发内容异常"),
NOT_EXIST_USER("9", "创建失败,员工不存在");


private final String name;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.easyink.common.enums.chat;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* 聊天类型枚举
*
* @author lichaoyu
* @date 2023/10/23 20:50
*/
@AllArgsConstructor
@Getter
public enum ChatTypeEnum {

//是否为客户 0-内部 1-外部 2-群聊
/**
* 内部聊天(员工聊天)
*/
INSIDE_CHAT(0),
/**
* 外部聊天(客户聊天)
*/
OUTSIDE_CHAT(1),
/**
* 群聊聊天
*/
GROUP_CHAT(2);

/**
* 聊天类型
*/
private Integer type;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.easyink.common.enums.wemsgtlp;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* 过滤条件关联逻辑判断枚举
*
* @author lichaoyu
* @date 2023/10/26 9:22
*/
@AllArgsConstructor
@Getter
public enum LogicTypeEnum {

/**
* 逻辑判断 或
*/
OR(0),
/**
* 逻辑判断 且
*/
AND(1);

/**
* 判断类型
*/
private final Integer type;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.easyink.common.enums.wemsgtlp;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
* 欢迎语客户筛选类型枚举
*
* @author lichaoyu
* @date 2023/10/25 18:02
*/
@AllArgsConstructor
@Getter
public enum WeMsgTlpFilterEnum {

/**
* 来源
*/
SOURCE(0, "来源"),
/**
* 性别
*/
GENDER(1, "性别");

/**
* 类型
*/
private final Integer type;

/**
* 描述
*/
private final String name;

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.easyink.common.core.page.TableDataInfo;
import com.easyink.common.core.page.TableSupport;
import com.easyink.common.enums.ResultTip;
import com.easyink.common.utils.sql.SqlUtil;
import com.easyink.common.exception.CustomException;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

Expand Down Expand Up @@ -173,6 +173,52 @@ public static void setPage(Integer pageNum, Integer pageSize) {
ServletUtils.getRequest().setAttribute(PAGE_SIZE, pageSize);
}

/**
* 获取分页起始位置
*
* @return 分页起始位置
*/
public static Integer getStartIndex() {
Integer pageSize = getPageSize();
Integer pageNum = getPageNum();
if (pageNum == null || pageSize == null) {
throw new CustomException(ResultTip.TIP_PARAM_MISSING);
}
return (pageNum - 1) * pageSize;
}

/**
* 获取分页起始位置
*
* @return 分页起始位置
*/
public static Integer getStartIndex(Integer pageNum, Integer pageSize) {
if (pageNum == null || pageSize == null) {
throw new CustomException(ResultTip.TIP_PARAM_MISSING);
}
return (pageNum - 1) * pageSize;
}

/**
* 获取分页页数
*
* @return 分页页数
*/
public static Integer getPageNum() {
PageDomain pageDomain = TableSupport.buildPageRequest();
return pageDomain.getPageNum();
}

/**
* 获取分页大小
*
* @return 分页大小
*/
public static Integer getPageSize() {
PageDomain pageDomain = TableSupport.buildPageRequest();
return pageDomain.getPageSize();
}

/**
* 预设置分页参数
*/
Expand All @@ -194,6 +240,18 @@ public static void startPage() {
PageHelper.startPage((Integer)pageNum, (Integer)pageSize);
}

/**
* 开始分页,但不使用count查询,从session获取分页参数
*/
public static void startPageNoCount() {
Object pageNum = ServletUtils.getRequest().getAttribute(PAGE_NUM);
Object pageSize = ServletUtils.getRequest().getAttribute(PAGE_SIZE);
if(pageNum == null || pageSize == null) {
return;
}
PageHelper.startPage((Integer)pageNum, (Integer)pageSize, false);
}

/**
* 清理分页的线程变量
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ public class WeMsgTlp {
@TableField("exist_special_flag")
private Boolean existSpecialFlag;

@ApiModelProperty(value = "是否存在有过滤条件(存在则关联we_msg_tlp_filter表)0:不存在,1:存在")
@TableField("exist_filter_flag")
private Boolean existFilterFlag;

@ApiModelProperty(value = "多个筛选条件间的关联,0:或;1:且(仅存在过滤条件有效)")
@TableField("multi_filter_association")
private Integer multiFilterAssociation;

@ApiModelProperty(value = "入群欢迎语返回的模板id", hidden = true)
@TableField("template_id")
private String templateId;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.easyink.wecom.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* 欢迎语筛选条件表对象 we_msg_tlp_filter_rule
*
* @author lichaoyu
* @date 2023/10/25 14:25
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("we_msg_tlp_filter_rule")
@ApiModel("欢迎语筛选条件表对象")
public class WeMsgTlpFilterRule {

private static final long serialVersionUID = 1L;

@ApiModelProperty(value = "主键id")
@TableId
@TableField("id")
private Long id;

@ApiModelProperty(value = "欢迎语模板id")
@TableField("msg_tlp_id")
private Long msgTlpId;

@ApiModelProperty(value = "筛选类型,0:来源;1:性别")
@TableField("filter_type")
private Integer filterType;

@ApiModelProperty(value = "筛选条件,0:不是;1:是")
@TableField("filter_condition")
private Boolean filterCondition;

@ApiModelProperty(value = "筛选值,来源见:AddWayEnum类,性别见:WeConstans.corpUserEnum")
@TableField("filter_value")
private String filterValue;


/**
* 为筛选条件构建企业信息和欢迎语关联信息
*
* @param msgTlpId 欢迎语模板ID
*/
public void builderMsgTlpInfo(Long msgTlpId) {
this.msgTlpId = msgTlpId;
}
}
Loading

0 comments on commit 9556c76

Please sign in to comment.