Commit bfb69aad by 徐高华

Merge branch 'feature-content2' into 'feature/自建应用验证'

Feature content2

See merge request !1194
parents eda27d91 25cb43ea
......@@ -177,12 +177,6 @@
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-sharding-sdk</artifactId>
<version>4.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-store-goods-api</artifactId>
<version>${gic-store-goods-api}</version>
</dependency>
......
......@@ -34,6 +34,7 @@ import com.gic.wechat.api.dto.qywx.group.QywxGroupMsgSendResultDTO;
import com.gic.wechat.api.dto.qywx.group.QywxMomentRespDTO;
import com.gic.wechat.api.dto.qywx.group.QywxMomentSendResultRespDTO;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
......@@ -344,10 +345,13 @@ public class GroupMessageServiceImpl implements GroupMessageService {
log.info("处理导购群发朋友圈触达客户日志, 成员无好友. staffId:{}", clerkShareLogBo.getStaffId());
return;
}
List<TriggerCustomerDetailBO> customerDetailBos = externalUserIds.stream()
.map(item -> this.convertCustomerDetailLog(clerkShareLogBo, item))
.collect(Collectors.toList());
triggerCustomerDetailService.batchSave(customerDetailBos);
List<List<String>> partition = Lists.partition(externalUserIds, 1000);
for (List<String> userIds : partition) {
List<TriggerCustomerDetailBO> customerDetailBos = userIds.stream()
.map(item -> this.convertCustomerDetailLog(clerkShareLogBo, item))
.collect(Collectors.toList());
triggerCustomerDetailService.batchSave(customerDetailBos);
}
}
}
......@@ -551,11 +555,14 @@ public class GroupMessageServiceImpl implements GroupMessageService {
if (CollectionUtils.isEmpty(groupMsgSendResultInfos)) {
return;
}
List<TriggerCustomerDetailBO> customerDetailBos = groupMsgSendResultInfos
.stream()
.map(item -> this.convertCustomerDetailLog(clerkShareLogBO, item.getExternalUserId()))
.collect(Collectors.toList());
triggerCustomerDetailService.batchSave(customerDetailBos);
List<List<QywxGroupMsgSendResultDTO.GroupMsgSendResultInfo>> partition = Lists.partition(groupMsgSendResultInfos, 1000);
for (List<QywxGroupMsgSendResultDTO.GroupMsgSendResultInfo> msgSendResultInfos : partition) {
List<TriggerCustomerDetailBO> customerDetailBos = msgSendResultInfos
.stream()
.map(item -> this.convertCustomerDetailLog(clerkShareLogBO, item.getExternalUserId()))
.collect(Collectors.toList());
triggerCustomerDetailService.batchSave(customerDetailBos);
}
}
/**
......@@ -569,11 +576,14 @@ public class GroupMessageServiceImpl implements GroupMessageService {
if (CollectionUtils.isEmpty(groupChatUserBos)) {
return;
}
List<TriggerCustomerDetailBO> customerDetailBos = groupChatUserBos
.stream()
.map(item -> this.convertCustomerDetailLog(clerkShareLogBO, item.getUserId()))
.collect(Collectors.toList());
triggerCustomerDetailService.batchSave(customerDetailBos);
List<List<GroupChatUserBO>> partition = Lists.partition(groupChatUserBos, 1000);
for (List<GroupChatUserBO> groupChatUserBOS : partition) {
List<TriggerCustomerDetailBO> customerDetailBos = groupChatUserBOS
.stream()
.map(item -> this.convertCustomerDetailLog(clerkShareLogBO, item.getUserId()))
.collect(Collectors.toList());
triggerCustomerDetailService.batchSave(customerDetailBos);
}
}
private TriggerCustomerDetailBO convertCustomerDetailLog(ClerkShareLogBO clerkShareLogBO, String externalUserId) {
......
......@@ -77,6 +77,10 @@ public class MaterialReportServiceImpl implements MaterialReportService {
.build();
// 获取成员关联的导购
materialReportBuilder.buildStaffRelationClerk(context);
if (CollectionUtils.isEmpty(context.getStaffClerkRelations())) {
log.info("处理成员周报月报数据, 成员{}未绑定导购", staffId);
return;
}
// 判断是区经还是 店长/导购 填充主门店
materialReportBuilder.fillMainStore(context);
// 获取素材数据
......
......@@ -19,6 +19,7 @@ import com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService;
import com.gic.wechat.api.dto.qywx.QywxTemplateCardSendMessageDTO;
import org.apache.commons.collections.CollectionUtils;
......@@ -170,6 +171,8 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
logger.info("商户未关联好办或都已停用enterpriseId={}", enterpriseId);
return ServiceResponse.success();
}
List<TabHaobanWxEnterprise> wxEnterpriseList = wxEnterpriseRelatedService.listByEnterpriseId(enterpriseId);
List<String> wxEnterpriseIdList = wxEnterpriseList.stream().map(TabHaobanWxEnterprise::getWxEnterpriseId).collect(Collectors.toList());
List<String> clerkIdList = clerkService.getclerkListByStoreIds(storeIdList);
if (CollectionUtils.isEmpty(clerkIdList)) {
logger.info("门店导购列表为空");
......@@ -186,7 +189,7 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
return ServiceResponse.success();
}
notifyMessageBatchQDTO.setTemplateCode(messageTypeEnum.getTemplateCode());
Map<String, List<StaffClerkRelationDTO>> map = relationList.stream().collect(Collectors.groupingBy(StaffClerkRelationDTO::getWxEnterpriseId));
Map<String, List<StaffClerkRelationDTO>> map = relationList.stream().filter(x->wxEnterpriseIdList.contains(x.getWxEnterpriseId())).collect(Collectors.groupingBy(StaffClerkRelationDTO::getWxEnterpriseId));
map.forEach((wxEnterpriseId,v)->{
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
if (qwDTO == null) {
......
......@@ -9,7 +9,6 @@
<import resource="classpath:dubbo-haoban-manage-service.xml" />
<import resource="classpath:dubbo-setting-test.xml"/>
<import resource="classpath:jdbc-haoban-manage-service.xml" />
<!-- <import resource="classpath*:jdbc-haoban-manage-service-sharding.xml" />-->
<import resource="classpath*:log-record-init.xml" />
<import resource="classpath*:kafka-setting-data.xml" />
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
<context:annotation-config />
<!-- <import resource="classpath*:applicationContext-db-only-with-emoji.xml"/>-->
<import resource="classpath*:applicationContext-sharding-db.xml" />
<bean class="com.gic.haoban.common.init.HaobanSqlSessionFactoryBean" id="sqlSessionFactory">
<property name="dataSource" ref="dataSource" />
<property name="typeAliasesPackage" value="com.gic.haoban.**.entity,com.gic.haoban.*.entity" />
<property name="mapperLocations" value="classpath*:mapper/**/*.xml" />
<property name="plugins">
<array>
<bean class="com.github.pagehelper.PageHelper">
<property name="properties">
<value>
dialect=mysql
</value>
</property>
</bean>
</array>
</property>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.gic.haoban.**.dao.mapper,com.gic.haoban.*.mapper" />
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>
<bean class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- 事务管理器 -->
<bean id="txManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<tx:annotation-driven transaction-manager="txManager" />
</beans>
\ No newline at end of file
......@@ -39,7 +39,7 @@
<value>haoban_gic_clerk</value>
<value>haoban_gic_store</value>
<value>haoban_gic_store_group</value>
<value>tab_haoban_member_order_event</value>
<value>tab_haoban_member_order_event_prod</value>
<value>haoban_gic_order</value>
</list>
</constructor-arg>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment