Commit 092f787b by 墨竹

查询活码增加查询条件

parent 01737bd3
package com.gic.haoban.manage.service.dao.mapper.hm;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.service.entity.hm.TabHaobanHmQrcode;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeClerkBO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 活码(TabHaobanHmQrcode)表数据库访问层
......@@ -103,7 +102,8 @@ public interface TabHaobanHmQrcodeMapper {
List<TabHaobanHmQrcode> listByStoreId(
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("storeId") String storeId,
@Param("overFlag") Integer overFlag);
@Param("overFlag") Integer overFlag,
@Param("hmType") Integer hmType);
/**
* 通过id添加num
......@@ -147,7 +147,8 @@ public interface TabHaobanHmQrcodeMapper {
*/
TabHaobanHmQrcode queryByClerkIdAndOverFlag(@Param("clerkId") String clerkId,
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("overFlag") Integer overFlag);
@Param("overFlag") Integer overFlag,
@Param("hmType") Integer hmType);
/**
* 活码门店ids
......
......@@ -9,8 +9,6 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO;
import java.util.List;
import org.apache.ibatis.annotations.Param;
/**
* 活码(TabHaobanHmQrcode)表服务接口
......@@ -82,7 +80,7 @@ public interface HmQrcodeService {
* @author mozhu
* @date 2022-07-07 17:19:08
*/
List<HmQrcodeBO> listByStoreId(String wxEnterpriseId,String storeId, Integer overFlag);
List<HmQrcodeBO> listByStoreId(String wxEnterpriseId, String storeId, Integer overFlag,Integer hmType);
/**
* 通过id添加num
......@@ -112,7 +110,7 @@ public interface HmQrcodeService {
* @author mozhu
* @date 2022-07-07 17:19:02
*/
HmQrcodeBO queryByClerkId(String clerkId,String wxEnterpriseId);
HmQrcodeBO queryByClerkId(String clerkId, String wxEnterpriseId);
/**
* 查询职员id 有效
......@@ -120,11 +118,12 @@ public interface HmQrcodeService {
* @param clerkId 职员id
* @param wxEnterpriseId wx企业标识
* @param overFlag 在国旗
* @param hmType hm型
* @return {@link HmQrcodeBO }
* @author mozhu
* @date 2022-07-07 17:24:57
* @date 2022-07-27 14:52:40
*/
HmQrcodeBO queryByClerkId(String clerkId,String wxEnterpriseId,Integer overFlag);
HmQrcodeBO queryByClerkId(String clerkId, String wxEnterpriseId, Integer overFlag,Integer hmType);
/**
......@@ -136,27 +135,30 @@ public interface HmQrcodeService {
* @author mozhu
* @date 2022-07-07 16:18:13
*/
int updateStatusById(Long hmId,Integer statusFlag);
int updateStatusById(Long hmId, Integer statusFlag);
/**
* 活码门店ids
*
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return {@link List }<{@link HmQrcodeBO }>
* @author mozhu
* @date 2022-07-08 15:09:50
* @date 2022-07-27 14:52:03
*/
List<HmQrcodeBO> getHmStoreByEnterpriseId(String wxEnterpriseId , String enterpriseId);
List<HmQrcodeBO> getHmStoreByEnterpriseId(String wxEnterpriseId, String enterpriseId);
/**
* 根据分组id获取活码数量
*
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @param groupIds 组id
* @param hmIds hm id
* @return {@link List }<{@link HmQrcodeGroupNumBO }>
* @author mozhu
* @date 2022-07-12 17:38:43
* @date 2022-07-27 14:52:10
*/
List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String wxEnterpriseId, String enterpriseId, List<Long> groupIds, List<String> hmIds);
......@@ -172,20 +174,21 @@ public interface HmQrcodeService {
/**
* 批量修改活码分组
*
* @param hmIds
* @param groupId
* @return
*/
int batchUpdateQrcodeGroup(List<Long> hmIds, Long groupId);
int getCanAddCount(String wxEnterpriseId , String enterpriseId , String clerkId) ;
int getCanAddCount(String wxEnterpriseId, String enterpriseId, String clerkId);
List<HmQrcodeClerkBO> listCanAddClerk(String wxEnterpriseId , String enterpriseId , String clerkId) ;
List<HmQrcodeClerkBO> listCanAddClerk(String wxEnterpriseId, String enterpriseId, String clerkId);
List<String> getHmStoreForWxa(String wxEnterpriseId ,String enterpriseId);
List<String> getHmStoreForWxa(String wxEnterpriseId, String enterpriseId);
List<String> listHmIdForIndex(HmQrcodeListQDTO qdto);
List<String> listHasQrcodeClerk(String enterpriseId , List<String> clerkIdList) ;
List<String> listHasQrcodeClerk(String enterpriseId, List<String> clerkIdList);
}
......@@ -84,9 +84,9 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
}
@Override
public List<HmQrcodeBO> listByStoreId(String wxEnterpriseId, String storeId, Integer overFlag) {
public List<HmQrcodeBO> listByStoreId(String wxEnterpriseId, String storeId, Integer overFlag,Integer hmType) {
return EntityUtil.changeEntityListNew(HmQrcodeBO.class,
tabHaobanHmQrcodeMapper.listByStoreId(wxEnterpriseId, storeId, overFlag));
tabHaobanHmQrcodeMapper.listByStoreId(wxEnterpriseId, storeId, overFlag,hmType));
}
@Override
......@@ -106,9 +106,9 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
}
@Override
public HmQrcodeBO queryByClerkId(String clerkId, String wxEnterpriseId, Integer overFlag) {
public HmQrcodeBO queryByClerkId(String clerkId, String wxEnterpriseId, Integer overFlag,Integer hmType) {
return EntityUtil.changeEntity(HmQrcodeBO.class,
tabHaobanHmQrcodeMapper.queryByClerkIdAndOverFlag(clerkId, wxEnterpriseId, overFlag));
tabHaobanHmQrcodeMapper.queryByClerkIdAndOverFlag(clerkId, wxEnterpriseId, overFlag,hmType));
}
@Override
......
......@@ -519,6 +519,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
logger.error("任务重新分配问题发送消息队列出错",e);
}
}
}
}
......
package com.gic.haoban.manage.service.service.out.impl.hm;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.redisson.api.RRateLimiter;
import org.redisson.api.RateIntervalUnit;
import org.redisson.api.RateType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.BasePageInfo;
......@@ -30,11 +13,7 @@ import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.common.utils.DingUtils;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.hm.HmLinkDTO;
import com.gic.haoban.manage.api.dto.hm.HmLinkStoreDTO;
import com.gic.haoban.manage.api.dto.hm.HmLinkStoreSettingDTO;
import com.gic.haoban.manage.api.dto.hm.HmLinkWxaDTO;
import com.gic.haoban.manage.api.dto.hm.HmPageDTO;
import com.gic.haoban.manage.api.dto.hm.*;
import com.gic.haoban.manage.api.dto.qdto.hm.HmLinkSearchQDTO;
import com.gic.haoban.manage.api.service.hm.HmLinkApiService;
import com.gic.haoban.manage.service.config.Config;
......@@ -49,11 +28,7 @@ import com.gic.haoban.manage.service.pojo.qo.HmQrcodeTempQO;
import com.gic.haoban.manage.service.service.KeyDataService;
import com.gic.haoban.manage.service.service.MemberQueryService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.service.hm.HmLinkService;
import com.gic.haoban.manage.service.service.hm.HmLinkStoreService;
import com.gic.haoban.manage.service.service.hm.HmPageService;
import com.gic.haoban.manage.service.service.hm.HmQrcodeService;
import com.gic.haoban.manage.service.service.hm.HmQrcodeTempService;
import com.gic.haoban.manage.service.service.hm.*;
import com.gic.member.api.dto.MemberClerkDTO;
import com.gic.member.api.dto.es.MemberDataDTO;
import com.gic.member.api.dto.es.MemberStoreClerkDataDTO;
......@@ -63,6 +38,17 @@ import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactDTO;
import com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactResultDTO;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.redisson.api.RRateLimiter;
import org.redisson.api.RateIntervalUnit;
import org.redisson.api.RateType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
@Service("hmLinkApiService")
public class HmLinkApiServiceImpl implements HmLinkApiService {
......@@ -494,7 +480,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
if (StringUtils.isBlank(clerkId) || "-1".equals(clerkId)) {
return null;
}
HmQrcodeBO hm = this.hmQrcodeService.queryByClerkId(clerkId, wxEnterpriseId, 0);
HmQrcodeBO hm = this.hmQrcodeService.queryByClerkId(clerkId, wxEnterpriseId, 0,1);
return hm;
}
......@@ -519,7 +505,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
// 店员需要过滤主导购、店长
log.info("过滤的导购={}",clerkIdList);
if (null == hm && dy == 1) {
List<HmQrcodeBO> list = this.hmQrcodeService.listByStoreId(wxEnterpriseId, inStoreId, 0);
List<HmQrcodeBO> list = this.hmQrcodeService.listByStoreId(wxEnterpriseId, inStoreId, 0,1);
if (CollectionUtils.isNotEmpty(list)) {
log.info("查询门店下有活码的导购数={}",list.size());
list = list.stream().filter(dto -> !clerkIdList.contains(dto.getClerkId())).collect(Collectors.toList());
......
......@@ -272,6 +272,9 @@
<if test="overFlag != null">
and over_flag = #{overFlag}
</if>
<if test="hmType != null">
and hm_type = #{hmType}
</if>
</select>
<update id="updateAddNumById">
......@@ -307,7 +310,12 @@
<include refid="Base_Column_List"></include>
from tab_haoban_hm_qrcode
where clerk_id = #{clerkId} and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId} and over_flag = #{overFlag} limit 1
and wx_enterprise_id = #{wxEnterpriseId}
and over_flag = #{overFlag}
<if test="hmType != null">
and hm_type = #{hmType}
</if>
limit 1
</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