Commit 29684b70 by 徐高华

全部只发导购

parent a1203d75
......@@ -132,5 +132,7 @@ public interface TabHaobanStaffClerkRelationMapper {
*/
List<StaffClerkRelationDTO> listByWxEnterpriseIdAndStaffId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffIdList") Set<String> staffIdList);
List<StaffClerkRelationDTO> listByStaffIdsForClerk(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffIdList") Set<String> staffIdList);
List<String> listAllStaffIdByEnterpriseId(@Param("enterpriseId") String enterpriseId,@Param("wxEnterpriseId") String wxEnterpriseId);
}
\ No newline at end of file
......@@ -10,9 +10,11 @@ import java.util.stream.Collectors;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.manage.api.dto.ContentMaterialDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.chat.ChatContentDTO;
import com.gic.haoban.manage.api.dto.chat.GroupChatOwnerDTO;
import com.gic.haoban.manage.api.dto.qdto.chat.OwnerSearchQDTO;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
import com.gic.haoban.manage.service.dao.mapper.chat.GroupChatOwnerMapper;
import com.gic.haoban.manage.service.util.StreamUtils;
import com.gic.thirdparty.cloudfile.CloudFileUtil;
......@@ -113,6 +115,8 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
private EnterpriseService enterpriseService;
@Autowired
private GroupChatOwnerMapper groupChatOwnerMapper ;
@Autowired
private TabHaobanStaffClerkRelationMapper tabHaobanStaffClerkRelationMapper ;
private static GicMQClient mqClient = GICMQClientUtil.getClientInstance();
......@@ -282,6 +286,15 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
return retPage;
}
private List<String> filterNoClerk(String wxEnterpriseId,List<GroupChatOwnerDTO> list) {
Set<String> set = list.stream().map(o->o.getStaffId()).collect(Collectors.toSet());
List<StaffClerkRelationDTO> stafIdList = this.tabHaobanStaffClerkRelationMapper.listByStaffIdsForClerk(wxEnterpriseId,set) ;
if(CollectionUtils.isNotEmpty(stafIdList)) {
return stafIdList.stream().map(o->o.getStaffId()).collect(Collectors.toList());
}
return Collections.emptyList() ;
}
@Override
public void doPlan(Long planId) {
logger.info("开始群群发发送{}", planId);
......@@ -348,11 +361,14 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
if (CollectionUtils.isEmpty(list)) {
break;
}
logger.info("全部,群主数={},{}", wxEnterpriseId,list.size());
ownerPageNo++;
String staffIds = list.stream().map(o->o.getStaffId()).collect(Collectors.joining(",")) ;
totalCount = totalCount + list.size() ;
this.groupChatPlanOwnerLogService.batchAdd(staffIds, plan);
List<String> staffIdList = this.filterNoClerk(wxEnterpriseId,list) ;
logger.info("全部,群主数={},{},过滤后={}", wxEnterpriseId,list.size(),staffIdList.size());
if(CollectionUtils.isNotEmpty(staffIdList)) {
String staffIds = staffIdList.stream().collect(Collectors.joining(",")) ;
totalCount = totalCount + staffIdList.size() ;
this.groupChatPlanOwnerLogService.batchAdd(staffIds, plan);
}
}
this.groupChatPlanMapper.updateStaffCount(planId,totalCount);
}
......
......@@ -453,6 +453,20 @@
</foreach>
</select>
<select id="listByStaffIdsForClerk" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
select
staff_id staffId
from tab_haoban_staff_clerk_relation
WHERE
wx_enterprise_id = #{wxEnterpriseId}
AND status_flag = 1 and manage_flag <![CDATA[<>]]> 1
AND staff_id in
<foreach collection="staffIdList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<select id="listAllStaffIdByEnterpriseId" resultType="java.lang.String">
select a.staff_id
from tab_haoban_staff_clerk_relation a left join tab_haoban_staff b on b.staff_id = a.staff_id
......
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