Commit ebb361fc by 墨竹

feat:修改返回活码数量接口

parent 634af29a
......@@ -161,11 +161,12 @@ public interface TabHaobanHmQrcodeMapper {
* 根据分组id获取活码数量
*
* @param enterpriseId 企业标识
* @return int
* @param groupIds 组id
* @return {@link List }<{@link HmQrcodeGroupNumBO }>
* @author mozhu
* @date 2022-07-12 15:18:34
* @date 2022-07-12 17:39:12
*/
List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(@Param("enterpriseId") String enterpriseId);
List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(@Param("enterpriseId") String enterpriseId,@Param("groupIds") List<Long> groupIds);
/**
* 获取总数
......
......@@ -150,11 +150,12 @@ public interface HmQrcodeService {
* 根据分组id获取活码数量
*
* @param enterpriseId 企业标识
* @param groupIds 组id
* @return {@link List }<{@link HmQrcodeGroupNumBO }>
* @author mozhu
* @date 2022-07-12 15:20:48
* @date 2022-07-12 17:38:43
*/
List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String enterpriseId);
List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String enterpriseId,List<Long> groupIds);
/**
* 获取总数
......
......@@ -107,8 +107,8 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
}
@Override
public List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String enterpriseId) {
return tabHaobanHmQrcodeMapper.getGroupIdNumByEnterpriseId(enterpriseId);
public List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String enterpriseId,List<Long> groupIds) {
return tabHaobanHmQrcodeMapper.getGroupIdNumByEnterpriseId(enterpriseId,groupIds);
}
@Override
......
......@@ -574,7 +574,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
if (StringUtils.isNotBlank(state)) {
//"HM+id" "DT+key"
log.info("特殊欢迎语 state:{}", state);
welcomeDetailBO = welcomeService.getMatchWelcomeWithReferId(staffId, wxEnterpriseId, state);
String refId = getRefId(state);
welcomeDetailBO = welcomeService.getMatchWelcomeWithReferId(staffId, wxEnterpriseId, refId);
} else {
welcomeDetailBO = welcomeService.getMatchWelcome(staffId, wxEnterpriseId);
}
......@@ -635,6 +636,23 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
}
/**
* 获取链接或者活码id
* @param state
* @return
*/
private String getRefId(String state) {
String substring = state.substring(2);
String refId = "";
if (state.contains("HM")) {
refId = substring;
} else if (state.contains("DT")) {
KeyDataLinkBO dataForHmLink = keyDataService.getDataForHmLink(refId);
refId = Convert.toStr(dataForHmLink.getLinkId());
}
return refId;
}
private void attachmentAddImage(List<QywxExternalMessageBaseDTO> attachments, WelcomeMediaBO media, WxEnterpriseDTO wxEnterpriseDTO) {
String mediaUrl = media.getMediaUrl();
String[] arr = mediaUrl.split("/");
......
......@@ -29,7 +29,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
......@@ -114,7 +113,7 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
}
result.addAll(groupDtoPage.getResult());
List<Long> groupIds = result.stream().map(HmGroupDTO::getGroupId).collect(Collectors.toList());
List<HmQrcodeGroupNumBO> qrcodeGroupNumBoList = qrcodeService.getGroupIdNumByEnterpriseId(groupQueryDTO.getEnterpriseId());
List<HmQrcodeGroupNumBO> qrcodeGroupNumBoList = qrcodeService.getGroupIdNumByEnterpriseId(groupQueryDTO.getEnterpriseId(),groupIds);
Map<Integer, Integer> qrcodeGroupNumMap = qrcodeGroupNumBoList.stream()
.collect(Collectors.toMap(HmQrcodeGroupNumBO::getHmGroupId, HmQrcodeGroupNumBO::getNum, (v1, v2) -> v1));
for (HmGroupDTO groupDTO : result) {
......
......@@ -329,6 +329,12 @@
from tab_haoban_hm_qrcode
where status_flag != 0
and enterprise_id = #{enterpriseId}
<if test="groupIds != null">
and hm_group_id IN
<foreach collection="groupIds" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
</foreach>
</if>
GROUP BY hm_group_id
</select>
......
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