Commit 644c83c0 by 徐高华

活码

parent 11a128df
......@@ -147,7 +147,6 @@ public interface TabHaobanHmQrcodeMapper {
*/
TabHaobanHmQrcode queryByClerkIdAndOverFlag(@Param("clerkId") String clerkId,
@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("overFlag") Integer overFlag,
@Param("hmType") Integer hmType);
/**
......
......@@ -123,7 +123,7 @@ public interface HmQrcodeService {
* @author mozhu
* @date 2022-07-27 14:52:40
*/
HmQrcodeBO queryByClerkId(String clerkId, String wxEnterpriseId, Integer overFlag,Integer hmType);
HmQrcodeBO queryByClerkId(String clerkId, String wxEnterpriseId, Integer hmType);
/**
......
......@@ -109,9 +109,9 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
}
@Override
public HmQrcodeBO queryByClerkId(String clerkId, String wxEnterpriseId, Integer overFlag, Integer hmType) {
public HmQrcodeBO queryByClerkId(String clerkId, String wxEnterpriseId, Integer hmType) {
return EntityUtil.changeEntity(HmQrcodeBO.class,
tabHaobanHmQrcodeMapper.queryByClerkIdAndOverFlag(clerkId, wxEnterpriseId, overFlag, hmType));
tabHaobanHmQrcodeMapper.queryByClerkIdAndOverFlag(clerkId, wxEnterpriseId, hmType));
}
@Override
......
......@@ -172,7 +172,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
}
// 判断导购是否有活码,如果没有返回错误
if (StringUtils.isNotBlank(inClerkId)) {
hm = this.getHmFromClerk(inClerkId, wxEnterpriseId);
hm = this.getHmFromClerk(inClerkId, wxEnterpriseId , memberId , enterpriseId);
if (null == hm) {
remarkMap.put("reason","无任何导购活码");
retDTO.setRemarkMap(remarkMap);
......@@ -210,7 +210,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
dy = store.getNdy();
}
}
hm = this.getHmFormStore(wxEnterpriseId, inStoreId, dz, dy, new ArrayList<>());
hm = this.getHmFormStore(wxEnterpriseId, inStoreId, dz, dy, new ArrayList<>(),enterpriseId,memberId);
log.info("获取到的门店配置dz={},dy={},获取的活码={}", dz, dy, JSON.toJSONString(hm));
if (null == hm) {
remarkMap.put("reason","无任何导购活码");
......@@ -257,7 +257,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
if(StringUtils.isNotBlank(mainClerkId)) {
clerkIdList.add(mainClerkId);
if (fwStore.getZs() == 1) {
hm = this.getHmFromClerk(mainClerkId, wxEnterpriseId);
hm = this.getHmFromClerk(mainClerkId, wxEnterpriseId , memberId, enterpriseId);
if(null != hm) {
log.info("获取服务导购活码,mainClerkId={}",mainClerkId);
remarkMap.put("sm", "主门店-服务导购");
......@@ -266,7 +266,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
}
if (null == hm && StringUtils.isNotBlank(mainStoreId)) {
hm = this.getHmFormStore(wxEnterpriseId, mainStoreId, fwStore.getDz(), fwStore.getDy(),
clerkIdList);
clerkIdList,enterpriseId,memberId);
if (null != hm) {
remarkMap.put("sm", "主门店-店长-店员");
}
......@@ -288,7 +288,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
continue;
}
if(xgStore.getZs()==1) {
hm = this.getHmFromClerk(clerkId, wxEnterpriseId);
hm = this.getHmFromClerk(clerkId, wxEnterpriseId , memberId, enterpriseId);
if (null != hm) {
remarkMap.put("sm", "协管活码-主导购");
storeIdList = null;
......@@ -301,7 +301,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
// 店长
if (null == hm && xgStore.getDz() == 1 && CollectionUtils.isNotEmpty(storeIdList)) {
for (String storeId : storeIdList) {
hm = this.getHmFormStore(wxEnterpriseId, storeId, 1, 0, clerkIdList);
hm = this.getHmFormStore(wxEnterpriseId, storeId, 1, 0, clerkIdList,enterpriseId,memberId);
if (null != hm) {
remarkMap.put("sm", "协管活码-店长");
break;
......@@ -311,7 +311,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
// 店员
if (null == hm && xgStore.getDy() == 1 && CollectionUtils.isNotEmpty(storeIdList)) {
for (String storeId : storeIdList) {
hm = this.getHmFormStore(wxEnterpriseId, storeId, 0, 1, clerkIdList);
hm = this.getHmFormStore(wxEnterpriseId, storeId, 0, 1, clerkIdList,enterpriseId,memberId);
if (null != hm) {
remarkMap.put("sm", "协管活码-店员");
break;
......@@ -487,16 +487,26 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
return hm.getWxQrcode();
}
private HmQrcodeBO getHmFromClerk(String clerkId, String wxEnterpriseId) {
private HmQrcodeBO getHmFromClerk(String clerkId, String wxEnterpriseId , String memberId , String enterpriseId) {
if (StringUtils.isBlank(clerkId) || "-1".equals(clerkId)) {
return null;
}
HmQrcodeBO hm = this.hmQrcodeService.queryByClerkId(clerkId, wxEnterpriseId, 0,1);
HmQrcodeBO hm = this.hmQrcodeService.queryByClerkId(clerkId, wxEnterpriseId,1);
// 已经达上线
if(hm.getOverFlag()==1 && StringUtils.isNotBlank(memberId)) {
String staffId = hm.getStaffId();
TabHaobanExternalClerkRelated friend = tabHaobanExternalClerkRelatedMapper.getByMemberIdAndStaffId(staffId, enterpriseId, memberId);
if (null != friend) {
return hm ;
}else {
return null ;
}
}
return hm;
}
private HmQrcodeBO getHmFormStore(String wxEnterpriseId, String inStoreId, int dz, int dy,
List<String> clerkIdList) {
List<String> clerkIdList , String enterpriseId , String memberId) {
if (StringUtils.isBlank(inStoreId) || "-1".equals(inStoreId)) {
return null;
}
......@@ -505,7 +515,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
if (null != dzClerk) {
clerkIdList.add(dzClerk.getClerkId());
if (dz == 1) {
hm = this.getHmFromClerk(dzClerk.getClerkId(), wxEnterpriseId);
hm = this.getHmFromClerk(dzClerk.getClerkId(), wxEnterpriseId , memberId , enterpriseId);
if (null != hm) {
log.info("获取到店长活码,clerkId={},inStoreId={}", hm.getClerkId(), inStoreId);
}
......
......@@ -311,7 +311,6 @@
from tab_haoban_hm_qrcode
where clerk_id = #{clerkId} and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
and over_flag = #{overFlag}
<if test="hmType != null">
and hm_type = #{hmType}
</if>
......
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