Commit 0d621fc3 by songyinghui

feat: 活码分组到企业微信

parent 9437255c
......@@ -168,7 +168,7 @@ public interface TabHaobanHmQrcodeMapper {
* @author mozhu
* @date 2022-07-12 17:39:12
*/
List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(@Param("enterpriseId") String enterpriseId,@Param("groupIds") List<Long> groupIds, @Param("hmIds") List<String> hmIds);
List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("enterpriseId") String enterpriseId,@Param("groupIds") List<Long> groupIds, @Param("hmIds") List<String> hmIds);
/**
* 获取总数
......@@ -178,7 +178,7 @@ public interface TabHaobanHmQrcodeMapper {
* @author mozhu
* @date 2022-07-12 15:10:09
*/
int getTotalByEnterpriseId(@Param("enterpriseId") String enterpriseId, @Param("hmIds") List<String> hmIds);
int getTotalByEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("enterpriseId") String enterpriseId, @Param("hmIds") List<String> hmIds);
/**
* 批量修改 活码所属分组
......
package com.gic.haoban.manage.service.service.hm;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
......@@ -157,7 +156,7 @@ public interface HmQrcodeService {
* @author mozhu
* @date 2022-07-12 17:38:43
*/
List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String enterpriseId,List<Long> groupIds, List<String> hmIds);
List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String wxEnterpriseId, String enterpriseId, List<Long> groupIds, List<String> hmIds);
/**
* 获取总数
......@@ -167,7 +166,7 @@ public interface HmQrcodeService {
* @author mozhu
* @date 2022-07-12 15:08:35
*/
int getTotalByEnterpriseId(String enterpriseId, List<String> hmIds);
int getTotalByEnterpriseId(String wxEnterpriseId, String enterpriseId, List<String> hmIds);
/**
* 批量修改活码分组
......
......@@ -123,13 +123,13 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
}
@Override
public List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String enterpriseId, List<Long> groupIds, List<String> hmIds) {
return tabHaobanHmQrcodeMapper.getGroupIdNumByEnterpriseId(enterpriseId, groupIds, hmIds);
public List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String wxEnterpriseId, String enterpriseId, List<Long> groupIds, List<String> hmIds) {
return tabHaobanHmQrcodeMapper.getGroupIdNumByEnterpriseId(wxEnterpriseId, enterpriseId, groupIds, hmIds);
}
@Override
public int getTotalByEnterpriseId(String enterpriseId, List<String> hmIds) {
return tabHaobanHmQrcodeMapper.getTotalByEnterpriseId(enterpriseId, hmIds);
public int getTotalByEnterpriseId(String wxEnterpriseId, String enterpriseId, List<String> hmIds) {
return tabHaobanHmQrcodeMapper.getTotalByEnterpriseId(wxEnterpriseId, enterpriseId, hmIds);
}
@Override
......
......@@ -105,7 +105,6 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
HmGroupInfoQO groupInfoQo = new HmGroupInfoQO();
BeanUtils.copyProperties(groupQueryDTO, groupInfoQo);
groupInfoQo.setWxEnterpriseId(null);
groupInfoQo.setStatus(HmGroupStatus.ENABLE.getCode());
Page<HmGroupSettingBO> groupSettingPage = groupService.queryGroupSettingList(groupInfoQo);
......@@ -127,9 +126,10 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
HmQrcodeListQDTO hmQrcodeListQDTO = new HmQrcodeListQDTO();
hmQrcodeListQDTO.setEnterpriseId(groupQueryDTO.getEnterpriseId());
hmQrcodeListQDTO.setStoreId(storeList);
hmQrcodeListQDTO.setWxEnterpriseId(groupQueryDTO.getWxEnterpriseId());
hmIds = qrcodeService.listHmIdForIndex(hmQrcodeListQDTO);
}
List<HmQrcodeGroupNumBO> qrcodeGroupNumBoList = qrcodeService.getGroupIdNumByEnterpriseId(groupQueryDTO.getEnterpriseId(), groupIds, hmIds);
List<HmQrcodeGroupNumBO> qrcodeGroupNumBoList = qrcodeService.getGroupIdNumByEnterpriseId(groupQueryDTO.getWxEnterpriseId(), groupQueryDTO.getEnterpriseId(), groupIds, hmIds);
if (CollectionUtils.isNotEmpty(qrcodeGroupNumBoList)) {
qrcodeGroupNumMap = qrcodeGroupNumBoList.stream()
.collect(Collectors.toMap(HmQrcodeGroupNumBO::getHmGroupId, HmQrcodeGroupNumBO::getNum, (v1, v2) -> v1));
......@@ -193,11 +193,12 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
HmQrcodeListQDTO hmQrcodeListQDTO = new HmQrcodeListQDTO();
hmQrcodeListQDTO.setEnterpriseId(enterpriseId);
hmQrcodeListQDTO.setStoreId(storeList);
hmQrcodeListQDTO.setWxEnterpriseId(wxEnterpriseId);
hmIds = qrcodeService.listHmIdForIndex(hmQrcodeListQDTO);
log.info("导购拥有的活码权限列表:{}", JSON.toJSONString(hmIds));
}
}
int totalReferCount = qrcodeService.getTotalByEnterpriseId(enterpriseId, hmIds);
int totalReferCount = qrcodeService.getTotalByEnterpriseId(wxEnterpriseId, enterpriseId, hmIds);
return ServiceResponse.success(totalReferCount);
}
......
......@@ -329,7 +329,10 @@
<select id="listHmIdForIndex" resultType="String" parameterType="com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO">
select distinct(a.hm_id)
from tab_haoban_hm_qrcode a left join tab_haoban_hm_clerk_relation b on a.hm_id = b.hm_id and b.status = 1
where a.enterprise_id = #{enterpriseId} and a.status_flag != 0
where a.enterprise_id = #{enterpriseId} and a.status_flag != 0
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and a.wx_enterprise_id = #{wxEnterpriseId}
</if>
<if test="null != hmSelect and '' != hmSelect ">
and (a.hm_code=#{hmSelect} or a.name like '%${hmSelect}%' or a.creator_name like '%${hmSelect}%' )
</if>
......@@ -371,6 +374,9 @@
from tab_haoban_hm_qrcode
where status_flag != 0
and enterprise_id = #{enterpriseId}
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
<if test="groupIds != null and groupIds.size > 0">
and hm_group_id IN
<foreach collection="groupIds" item="id" index="index" open="(" close=")" separator=",">
......@@ -391,6 +397,9 @@
from tab_haoban_hm_qrcode
where status_flag != 0
and enterprise_id = #{enterpriseId}
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
<if test="hmIds != null and hmIds.size > 0">
and hm_id in
<foreach collection="hmIds" open="(" close=")" separator="," item="hmId">
......
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