Commit a541fbf5 by linkwechat8856@163.com

Merge branch 'master' into back_end_dev

2 parents d11dc7ea 1f8f5258
...@@ -197,4 +197,7 @@ public class WeCustomer extends BaseEntity { ...@@ -197,4 +197,7 @@ public class WeCustomer extends BaseEntity {
*/ */
@TableLogic @TableLogic
private Integer delFlag; private Integer delFlag;
//添加方式
private Integer addMethod;
} }
...@@ -21,7 +21,7 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer> ...@@ -21,7 +21,7 @@ public interface WeCustomerMapper extends BaseMapper<WeCustomer>
* @param externalUserId 企业微信客户ID * @param externalUserId 企业微信客户ID
* @return 企业微信客户 * @return 企业微信客户
*/ */
public WeCustomer selectWeCustomerById(String externalUserId); public WeCustomer selectWeCustomerById(@Param("externalUserId") String externalUserId,@Param("userId") String userId);
/** /**
* 查询企业微信客户列表 * 查询企业微信客户列表
......
...@@ -165,6 +165,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -165,6 +165,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
Optional.ofNullable(userDetail.getFollow_info()).ifPresent(followInfo -> { Optional.ofNullable(userDetail.getFollow_info()).ifPresent(followInfo -> {
weCustomer.setFirstUserId(followInfo.getUserid()); weCustomer.setFirstUserId(followInfo.getUserid());
weCustomer.setFirstAddTime(new Date(followInfo.getCreatetime() * 1000L)); weCustomer.setFirstAddTime(new Date(followInfo.getCreatetime() * 1000L));
weCustomer.setAddMethod(followInfo.getAdd_way());
weCustomerList.add(weCustomer); weCustomerList.add(weCustomer);
List<String> tags = Stream.of(followInfo.getTag_id()).collect(Collectors.toList()); List<String> tags = Stream.of(followInfo.getTag_id()).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(tags)) { if (CollectionUtil.isNotEmpty(tags)) {
......
...@@ -256,7 +256,7 @@ public class WePresTagGroupTaskServiceImpl extends ServiceImpl<WePresTagGroupTas ...@@ -256,7 +256,7 @@ public class WePresTagGroupTaskServiceImpl extends ServiceImpl<WePresTagGroupTas
if (StringUtils.isNotEmpty(resultDto.getDetail_list())) { if (StringUtils.isNotEmpty(resultDto.getDetail_list())) {
for (DetailMessageStatusResultDto detail : resultDto.getDetail_list()) { for (DetailMessageStatusResultDto detail : resultDto.getDetail_list()) {
WePresTagGroupTaskStatVo statVo = new WePresTagGroupTaskStatVo(); 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.setCustomerName(customer.getName());
statVo.setStatus(detail.getStatus()); statVo.setStatus(detail.getStatus());
statVo.setInGroup(externalIdList.contains(detail.getExternal_userid())); statVo.setInGroup(externalIdList.contains(detail.getExternal_userid()));
......
...@@ -323,7 +323,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -323,7 +323,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWeCustomerById" parameterType="String" resultType="WeCustomer"> <select id="selectWeCustomerById" parameterType="String" resultType="WeCustomer">
<include refid="selectWeCustomerVo"/> <include refid="selectWeCustomerVo"/>
where external_userid = #{externalUserId} where external_userid = #{externalUserId} and first_user_id=#{userId}
</select> </select>
<insert id="insertWeCustomer" parameterType="WeCustomer"> <insert id="insertWeCustomer" parameterType="WeCustomer">
...@@ -589,12 +589,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -589,12 +589,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qq, qq,
email, email,
address, address,
phone phone,
add_method
) values ) values
<foreach collection="weCustomers" item="item" index="index" separator=","> <foreach collection="weCustomers" item="item" index="index" separator=",">
(#{item.externalUserid},#{item.name},#{item.avatar},#{item.type},#{item.gender}, #{item.unionid},#{item.birthday}, (#{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.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> </foreach>
ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE
...@@ -613,7 +614,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -613,7 +614,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
qq=IF(we_customer.qq != null, VALUES(qq), we_customer.qq), qq=IF(we_customer.qq != null, VALUES(qq), we_customer.qq),
email=IF(we_customer.email != null, VALUES(email), we_customer.email), email=IF(we_customer.email != null, VALUES(email), we_customer.email),
address=IF(we_customer.address != null, VALUES(address), we_customer.address), 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> </insert>
......
...@@ -120,20 +120,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -120,20 +120,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getUserAddCustomerStat" parameterType="WeFlowerCustomerRel" resultType="java.util.HashMap"> <select id="getUserAddCustomerStat" parameterType="WeFlowerCustomerRel" resultType="java.util.HashMap">
select select
left(wfcr.create_time,10) as createTime , count(1) as total left(wfcr.first_add_time,10) as createTime , count(1) as total
from from
we_flower_customer_rel wfcr we_customer wfcr
<where> <where>
<if test="userId != null and userId != ''">and wfcr.user_id = #{userId}</if> <if test="userId != null and userId != ''">and wfcr.first_user_id = #{userId}</if>
<if test="addWay != null and addWay != ''">and wfcr.add_way = #{addWay}</if> <if test="addWay != null and addWay != ''">and wfcr.add_method = #{addWay}</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 --> <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
AND date_format(wfcr.create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d') AND date_format(wfcr.first_add_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if> </if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 --> <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(wfcr.create_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d') AND date_format(wfcr.first_add_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if> </if>
</where> </where>
group by group by
left(wfcr.create_time,10) left(wfcr.first_add_time,10)
</select> </select>
</mapper> </mapper>
\ No newline at end of file \ 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!