Commit 90bbadb5 by 墨竹

Merge branch 'feature/01-10' into developer

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