Commit 90bbadb5 by 墨竹

Merge branch 'feature/01-10' into developer

parents feb83697 4c27b8e9
......@@ -32,6 +32,8 @@ public class StaffClerkRelationDTO implements Serializable {
private String storeName;
private String staffName;
private String wxOpenUserId;
public String getStaffClerkRelationId() {
return staffClerkRelationId;
}
......@@ -135,4 +137,12 @@ public class StaffClerkRelationDTO implements Serializable {
public void setStaffName(String staffName) {
this.staffName = staffName;
}
public String getWxOpenUserId() {
return wxOpenUserId;
}
public void setWxOpenUserId(String wxOpenUserId) {
this.wxOpenUserId = wxOpenUserId;
}
}
......@@ -77,6 +77,17 @@ public interface MemberUnionidRelatedApiService {
Page<MemberUnionidRelatedDTO> pageMemberUnionByParams(List<String> userIdList, List<String> sendMemberIds,
String enterpriseId, BasePageInfo pageInfo);
/**
* 群发助手发送企业微信消息
*
* @param wxEnterpriseId
* @param userId
* @param extendUserList
* @param materialId
* @return {@link String }
* @author mozhu
* @date 2022-01-13 10:50:44
*/
String sendMessage(String wxEnterpriseId, String userId, List<String> extendUserList, String materialId);
/**
......
......@@ -56,7 +56,7 @@ public interface TabHaobanStaffClerkRelationMapper {
void delByStoreIdAndCode( @Param("storeId")String storeId,@Param("clerkCode")String clerkCode);
List<TabHaobanStaffClerkRelation> listByClerkIds(@Param("clerkIds") List<String> clerkIds);
List<StaffClerkRelationDTO> listByClerkIds(@Param("clerkIds") List<String> clerkIds);
List<TabHaobanStaffClerkRelation> listByStoreId(@Param("storeId")String storeId);
......
......@@ -234,10 +234,10 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Override
public List<StaffClerkRelationDTO> listByClerkIds(List<String> clerkList) {
if (clerkList == null || clerkList.isEmpty()) {
if (CollectionUtils.isEmpty(clerkList)) {
return Collections.EMPTY_LIST;
}
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, mapper.listByClerkIds(clerkList));
return mapper.listByClerkIds(clerkList);
}
@Override
......
......@@ -1357,18 +1357,24 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override
public List<String> listBindClerkUserId(String storeId) {
List<String> userIdList = new ArrayList<String>();
List<String> storeIds = new ArrayList<String>();
storeIds.add(storeId);
List<String> clerkList = clerkService.getclerkListByStoreIds(storeIds);
List<StaffClerkRelationDTO> staffRelationList = staffClerkRelationService.listByClerkIds(clerkList);
Map<String, StaffClerkRelationDTO> clerkIdMap = staffRelationList.stream().filter(s -> s.getClerkId() != null).collect(Collectors.toMap(StaffClerkRelationDTO::getClerkId, s -> s));
Set<String> keySet = clerkIdMap.keySet();
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(staffRelationList.get(0).getWxEnterpriseId());
String corpid = wxEnterpriseDTO.getCorpid();
for (String clerkId : clerkList) {
if (keySet.contains(clerkId)) {
if (corpid.length() > 20) {
userIdList.add(clerkIdMap.get(clerkId).getWxOpenUserId());
} else {
userIdList.add(clerkIdMap.get(clerkId).getWxUserId());
}
}
}
return userIdList;
}
......
......@@ -234,15 +234,10 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override
public List<StaffClerkRelationDTO> listByClerkIds(List<String> clerkIds) {
if (clerkIds == null || clerkIds.isEmpty()) {
if (CollectionUtil.isEmpty(clerkIds)) {
return Collections.EMPTY_LIST;
}
List<TabHaobanStaffClerkRelation> list = tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds);
if (CollectionUtil.isEmpty(list)) {
return new ArrayList<StaffClerkRelationDTO>();
}
List<StaffClerkRelationDTO> result = EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, list);
return result;
return tabHaobanStaffClerkRelationMapper.listByClerkIds(clerkIds);
}
@Override
......
......@@ -156,15 +156,18 @@
and status_flag = 1
</update>
<select id="listByClerkIds" resultMap="BaseResultMap" parameterType="java.lang.String">
<select id="listByClerkIds" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_staff_clerk_relation
where status_flag=1
and clerk_id in
a.*,
b.wx_open_user_id
from tab_haoban_staff_clerk_relation a
left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.status_flag=1
and a.clerk_id in
<foreach collection="clerkIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
group by b.staff_id
</select>
<select id="listByStoreId" resultMap="BaseResultMap" parameterType="java.lang.String">
......
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