Commit 23f4fc15 by linkwechat8856@163.com

Merge branch 'back_end_dev' into back_end_dev_2.0

# Conflicts:
#	linkwe-admin/src/main/resources/bootstrap.properties
2 parents f50afbbd 1486d34f
......@@ -98,15 +98,15 @@ public class WeCustomerController extends BaseController
// return util.exportExcel(list, "customer");
// }
/**
* 获取企业微信客户详细信息
*/
// @PreAuthorize("@ss.hasPermi('customerManage:customer:view')")
@GetMapping(value = "/{externalUserId}")
public AjaxResult getInfo(@PathVariable("externalUserId") String externalUserId)
{
return AjaxResult.success(weCustomerService.selectWeCustomerById(externalUserId));
}
// /**
// * 获取企业微信客户详细信息
// */
// // @PreAuthorize("@ss.hasPermi('customerManage:customer:view')")
// @GetMapping(value = "/{externalUserId}")
// public AjaxResult getInfo(@PathVariable("externalUserId") String externalUserId)
// {
// return AjaxResult.success(weCustomerService.selectWeCustomerById(externalUserId));
// }
......
......@@ -82,12 +82,8 @@ server:
# 日志配置
logging:
level:
com.ruoyi: debug
org.springframework: warn
path: ./logs
path:
log: ./logs
path:
log: ./logs
#H5地址路径
H5:
......@@ -103,11 +99,11 @@ spring:
basename: i18n/messages
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
druid:
# 主库数据源
master:
url: jdbc:mysql://127.0.0.1:3306/linkwechat?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:p6spy:mysql://127.0.0.1:3306/linkwechat?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: root
# 从库数据源
......@@ -208,8 +204,6 @@ mybatis-plus:
mapper-locations: classpath*:mapper/**/*Mapper.xml
type-aliases-package: com.linkwechat.**.domain
type-handlers-package: com.linkwechat.framework.handler.GenericTypeHandler,com.linkwechat.framework.handler.StringArrayJoinTypeHandler
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
logic-delete-field: delFlag
......
linkwechat.nacos.host=
linkwechat.nacos.port=
linkwechat.nacos.namespace=
linkwechat.nacos.username=
linkwechat.nacos.password=
\ No newline at end of file
#linkwechat.nacos.host=
#linkwechat.nacos.port=
#linkwechat.nacos.namespace=
#linkwechat.nacos.username=
#linkwechat.nacos.password=
\ No newline at end of file
......@@ -8,7 +8,7 @@
<setting name="cacheEnabled" value="true"/> <!-- 全局映射器启用缓存 -->
<setting name="useGeneratedKeys" value="true"/> <!-- 允许 JDBC 支持自动生成主键 -->
<setting name="defaultExecutorType" value="REUSE"/> <!-- 配置默认的执行器 -->
<setting name="logImpl" value="SLF4J"/> <!-- 指定 MyBatis 所用日志的具体实现 -->
<!-- <setting name="logImpl" value="SLF4J"/> --><!-- 指定 MyBatis 所用日志的具体实现 -->
<setting name="mapUnderscoreToCamelCase" value="true"/> <!-- 驼峰式命名 -->
</settings>
......
#3.2.1以上使用
modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
#3.2.1以下使用或者不配置
#modulelist=com.p6spy.engine.logging.P6LogFactory,com.p6spy.engine.outage.P6OutageFactory
# 自定义日志打印
logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger
#日志输出到控制台
appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger
# 使用日志系统记录 sql
#appender=com.p6spy.engine.spy.appender.Slf4JLogger
# 设置 p6spy driver 代理
deregisterdrivers=true
# 取消JDBC URL前缀
useprefix=true
# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset.
excludecategories=info,debug,result,commit,resultset
# 日期格式
dateformat=yyyy-MM-dd HH:mm:ss
# 实际驱动可多个
#driverlist=org.h2.Driver
# 是否开启慢SQL记录
outagedetection=true
# 慢SQL记录标准 2 秒
outagedetectioninterval=2
#开启日志过滤
filter=true
#排序sql包含QRTZ的sql
exclude=QRTZ
\ No newline at end of file
......@@ -186,6 +186,12 @@
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>p6spy</groupId>
<artifactId>p6spy</artifactId>
<version>3.9.1</version>
</dependency>
<!--动态添加属性和方法开始-->
<dependency>
<groupId>commons-beanutils</groupId>
......
......@@ -197,4 +197,7 @@ public class WeCustomer extends BaseEntity {
*/
@TableLogic
private Integer delFlag;
//添加方式
private Integer addMethod;
}
......@@ -21,7 +21,7 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
* @param externalUserId 企业微信客户ID
* @return 企业微信客户
*/
public WeCustomer selectWeCustomerById(String externalUserId);
public WeCustomer selectWeCustomerById(@Param("externalUserId") String externalUserId,@Param("userId") String userId);
/**
* 查询企业微信客户列表
......
......@@ -21,13 +21,13 @@ import java.util.List;
*/
public interface IWeCustomerService extends IService<WeCustomer>
{
/**
* 查询企业微信客户
*
* @param externalUserId 企业微信客户ID
* @return 企业微信客户
*/
public WeCustomer selectWeCustomerById(String externalUserId);
// /**
// * 查询企业微信客户
// *
// * @param externalUserId 企业微信客户ID
// * @return 企业微信客户
// */
// public WeCustomer selectWeCustomerById(String externalUserId);
// /**
// * 新增/修改企业微信客户
......
......@@ -79,16 +79,16 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
/**
* 查询企业微信客户
*
* @param externalUserId 企业微信客户ID
* @return 企业微信客户
*/
@Override
public WeCustomer selectWeCustomerById(String externalUserId) {
return this.baseMapper.selectWeCustomerById(externalUserId);
}
// /**
// * 查询企业微信客户
// *
// * @param externalUserId 企业微信客户ID
// * @return 企业微信客户
// */
// @Override
// public WeCustomer selectWeCustomerById(String externalUserId) {
// return this.baseMapper.selectWeCustomerById(externalUserId);
// }
/**
* 查询企业微信客户列表
......@@ -165,6 +165,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
Optional.ofNullable(userDetail.getFollow_info()).ifPresent(followInfo -> {
weCustomer.setFirstUserId(followInfo.getUserid());
weCustomer.setFirstAddTime(new Date(followInfo.getCreatetime() * 1000L));
weCustomer.setAddMethod(followInfo.getAdd_way());
weCustomerList.add(weCustomer);
List<String> tags = Stream.of(followInfo.getTag_id()).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(tags)) {
......
......@@ -6,19 +6,14 @@ import com.linkwechat.common.utils.DateUtils;
import com.linkwechat.wecom.domain.WeCustomer;
import com.linkwechat.wecom.domain.WeFlowerCustomerRel;
import com.linkwechat.wecom.domain.WeFlowerCustomerTagRel;
import com.linkwechat.wecom.mapper.WeCustomerMapper;
import com.linkwechat.wecom.mapper.WeCustomerTagRelMapper;
import com.linkwechat.wecom.mapper.WeFlowerCustomerRelMapper;
import com.linkwechat.wecom.mapper.WeFlowerCustomerTagRelMapper;
import com.linkwechat.wecom.service.IWeCustomerService;
import com.linkwechat.wecom.service.IWeCustomerTagRelService;
import com.linkwechat.wecom.service.IWeFlowerCustomerRelService;
import com.linkwechat.wecom.service.IWeFlowerCustomerTagRelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;
......
......@@ -256,7 +256,7 @@ public class WePresTagGroupTaskServiceImpl extends ServiceImpl<WePresTagGroupTas
if (StringUtils.isNotEmpty(resultDto.getDetail_list())) {
for (DetailMessageStatusResultDto detail : resultDto.getDetail_list()) {
WePresTagGroupTaskStatVo statVo = new WePresTagGroupTaskStatVo();
WeCustomer customer = customerMapper.selectWeCustomerById(detail.getExternal_userid());
WeCustomer customer = customerMapper.selectWeCustomerById(detail.getExternal_userid(),detail.getUserid());
statVo.setCustomerName(customer.getName());
statVo.setStatus(detail.getStatus());
statVo.setInGroup(externalIdList.contains(detail.getExternal_userid()));
......
......@@ -118,10 +118,15 @@ public class WeSensitiveActHitServiceImpl extends ServiceImpl<WeSensitiveActHitM
}
} else if (WeConstans.ID_TYPE_EX.equals(type)) {
//获取外部联系人信息
WeCustomer weCustomer = weCustomerMapper.selectWeCustomerById(userId);
if (weCustomer != null) {
return weCustomer.getName();
// WeCustomer weCustomer = weCustomerMapper.selectWeCustomerById(userId);
List<WeCustomer> weCustomers = weCustomerMapper.selectList(new LambdaQueryWrapper<WeCustomer>()
.eq(WeCustomer::getExternalUserid, userId));
if(CollectionUtils.isNotEmpty(weCustomers)){
return weCustomers.stream().findFirst().get().getName();
}
// if (weCustomer != null) {
// return weCustomer.getName();
// }
} else if (WeConstans.ID_TYPE_MACHINE.equals(type)) {
//拉去机器人信息暂不处理
}
......
......@@ -301,8 +301,13 @@ public class WeTaskFissionServiceImpl extends ServiceImpl<WeTaskFissionMapper, W
List<WeTaskFissionRecord> weTaskFissionRecords = weTaskFissionRecordService.list(new LambdaQueryWrapper<WeTaskFissionRecord>().eq(WeTaskFissionRecord::getTaskFissionId, fissionId));
if(CollectionUtil.isNotEmpty(weTaskFissionRecords)){
weTaskFissionRecords.forEach(record -> {
WeCustomer weCustomer = weCustomerService.selectWeCustomerById(record.getCustomerId());
customerList.add(weCustomer);
// WeCustomer weCustomer = weCustomerService.selectWeCustomerById(record.getCustomerId());
// customerList.add(weCustomer);
customerList.addAll(
weCustomerService.list(new LambdaQueryWrapper<WeCustomer>()
.eq(WeCustomer::getExternalUserid,record.getCustomerId()))
);
});
}
} else {
......
......@@ -323,7 +323,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWeCustomerById" parameterType="String" resultType="WeCustomer">
<include refid="selectWeCustomerVo"/>
where external_userid = #{externalUserId}
where external_userid = #{externalUserId} and first_user_id=#{userId}
</select>
<insert id="insertWeCustomer" parameterType="WeCustomer">
......@@ -589,12 +589,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qq,
email,
address,
phone
phone,
add_method
) values
<foreach collection="weCustomers" item="item" index="index" separator=",">
(#{item.externalUserid},#{item.name},#{item.avatar},#{item.type},#{item.gender}, #{item.unionid},#{item.birthday},
#{item.corpName},#{item.corpFullName},#{item.position},#{item.isOpenChat}, #{item.createTime},
#{item.createBy},#{item.firstUserId},#{item.firstAddTime},#{item.qq},#{item.email},#{item.address},#{item.phone}
#{item.createBy},#{item.firstUserId},#{item.firstAddTime},#{item.qq},#{item.email},#{item.address},#{item.phone},#{item.addMethod}
)
</foreach>
ON DUPLICATE KEY UPDATE
......@@ -613,7 +614,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qq=IF(we_customer.qq != null, VALUES(qq), we_customer.qq),
email=IF(we_customer.email != null, VALUES(email), we_customer.email),
address=IF(we_customer.address != null, VALUES(address), we_customer.address),
phone=IF(we_customer.phone != null, VALUES(phone), we_customer.phone);
phone=IF(we_customer.phone != null, VALUES(phone), we_customer.phone),
add_method=IF(we_customer.add_method != null, VALUES(add_method), we_customer.add_method);
</insert>
......
......@@ -120,20 +120,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getUserAddCustomerStat" parameterType="WeFlowerCustomerRel" resultType="java.util.HashMap">
select
left(wfcr.create_time,10) as createTime , count(1) as total
from
we_flower_customer_rel wfcr
<where>
<if test="userId != null and userId != ''">and wfcr.user_id = #{userId}</if>
<if test="addWay != null and addWay != ''">and wfcr.add_way = #{addWay}</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
AND date_format(wfcr.create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(wfcr.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
group by
left(wfcr.create_time,10)
left(wfcr.first_add_time,10) as createTime , count(1) as total
from
we_customer wfcr
<where>
<if test="userId != null and userId != ''">and wfcr.first_user_id = #{userId}</if>
<if test="addWay != null and addWay != ''">and wfcr.add_method = #{addWay}</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
AND date_format(wfcr.first_add_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(wfcr.first_add_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
group by
left(wfcr.first_add_time,10)
</select>
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!