Commit ff28c9bb by 徐高华

朋友圈

parent f02f63c8
...@@ -82,6 +82,8 @@ public interface StaffClerkRelationApiService { ...@@ -82,6 +82,8 @@ public interface StaffClerkRelationApiService {
*/ */
List<StaffClerkRelationDTO> listByStoreId(String storeId); List<StaffClerkRelationDTO> listByStoreId(String storeId);
List<StaffClerkRelationDTO> listByStoreIds(String wxEnterpriseId, List<String> storeIds) ;
/** /**
* 查询导购信息 * 查询导购信息
* @param storeId * @param storeId
......
...@@ -250,6 +250,11 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -250,6 +250,11 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} }
@Override @Override
public List<StaffClerkRelationDTO> listByStoreIds(String wxEnterpriseId, List<String> storeIds) {
return tabHaobanStaffClerkRelationMapper.listByStoreIds(wxEnterpriseId,storeIds);
}
@Override
public boolean unbindByStaffAndClerkId(String staffId, String clerkId, int channelCode) { public boolean unbindByStaffAndClerkId(String staffId, String clerkId, int channelCode) {
return staffClerkRelationService.delBind(clerkId, staffId, channelCode, null); return staffClerkRelationService.delBind(clerkId, staffId, channelCode, null);
} }
......
...@@ -1724,9 +1724,9 @@ public class WxStaffController extends WebBaseController { ...@@ -1724,9 +1724,9 @@ public class WxStaffController extends WebBaseController {
ClerkDTO clerk = this.clerkService.getclerkById(clerkId) ; ClerkDTO clerk = this.clerkService.getclerkById(clerkId) ;
int clerkType = clerk.getClerkType() ; int clerkType = clerk.getClerkType() ;
List<ClerkListVO> resultList = null ; List<ClerkListVO> resultList = null ;
if(clerkType==0) { if(clerkType != 0) {
return RestResponse.failure("-1", "无权访问"); return RestResponse.failure("-1", "非店长身份");
}else if(clerkType==1) { }
List<ClerkListDTO> clerkList = clerkService.getClerkByStoreId(enterpriseId, clerk.getStoreId()); List<ClerkListDTO> clerkList = clerkService.getClerkByStoreId(enterpriseId, clerk.getStoreId());
if (CollectionUtils.isNotEmpty(clerkList) && StringUtils.isNotEmpty(clerkSearchParams)) { if (CollectionUtils.isNotEmpty(clerkList) && StringUtils.isNotEmpty(clerkSearchParams)) {
clerkList = clerkList.stream().filter(dto->dto.getClerkCode().contains(clerkSearchParams) || dto.getClerkName().contains(clerkSearchParams)).collect(Collectors.toList()) ; clerkList = clerkList.stream().filter(dto->dto.getClerkCode().contains(clerkSearchParams) || dto.getClerkName().contains(clerkSearchParams)).collect(Collectors.toList()) ;
...@@ -1735,18 +1735,6 @@ public class WxStaffController extends WebBaseController { ...@@ -1735,18 +1735,6 @@ public class WxStaffController extends WebBaseController {
return RestResponse.failure("-1", "无导购"); return RestResponse.failure("-1", "无导购");
} }
resultList = EntityUtil.changeEntityListByJSON(ClerkListVO.class, clerkList); resultList = EntityUtil.changeEntityListByJSON(ClerkListVO.class, clerkList);
}else if(clerkType==2) {
// 如果有权限控制,进行管辖门店过0滤
List<String> authStoreIdList = this.staffApiService.getHaoBanStoreIdsRolesByClerkId(clerkId,wxEnterpriseId);
if (CollectionUtils.isEmpty(authStoreIdList)) {
return RestResponse.failure("-1", "无授权门店");
}
if (authStoreIdList.size() == 1 && authStoreIdList.contains("-1")) {
authStoreIdList = null ;
}
// 查询区经门店下的店长,eid,storelist,clerkSearchParams
logger.info("查询所有店长,返回={}", enterpriseId);
}
List<String> clerkIdList = resultList.stream().map(dto->dto.getClerkId()).collect(Collectors.toList()) ; List<String> clerkIdList = resultList.stream().map(dto->dto.getClerkId()).collect(Collectors.toList()) ;
List<StaffClerkRelationDTO> relationList = this.staffClerkRelationApiService.listByClerkIdsWxEnterpriseId(clerkIdList, wxEnterpriseId) ; List<StaffClerkRelationDTO> relationList = this.staffClerkRelationApiService.listByClerkIdsWxEnterpriseId(clerkIdList, wxEnterpriseId) ;
List<String> retlationIdList = relationList.stream().map(dto->dto.getClerkId()).collect(Collectors.toList()) ; List<String> retlationIdList = relationList.stream().map(dto->dto.getClerkId()).collect(Collectors.toList()) ;
......
...@@ -110,38 +110,39 @@ public class QwMessageController extends WebBaseController { ...@@ -110,38 +110,39 @@ public class QwMessageController extends WebBaseController {
String enterpriseId = qo.getEnterpriseId(); String enterpriseId = qo.getEnterpriseId();
String staffId = qo.getStaffId(); String staffId = qo.getStaffId();
List<String> clerkIdList = qo.getClerkIdList() ; List<String> clerkIdList = qo.getClerkIdList() ;
List<String> storeIdList = qo.getStoreIdList() ;
ClerkDTO clerk = this.clerkService.getclerkById(clerkId); ClerkDTO clerk = this.clerkService.getclerkById(clerkId);
logger.info("clerkType={},ChooseAll={}",clerk.getClerkType(),qo.getChooseAll()); logger.info("clerkType={},ChooseAll={}",clerk.getClerkType(),qo.getChooseAll());
// 查询所有门店-导购 int clerkType = clerk.getClerkType() ;
if(StringUtils.isNotBlank(qo.getChooseAll()) && "1".equals(qo.getChooseAll())) { if(clerkType==0) {
if (clerk.getClerkType() == 1) { return RestResponse.failure("-1","非店长、区间");
String storeId = clerk.getStoreId() ; }
clerkIdList = staffApiService.listBindStaffId(storeId); String chooseAll = qo.getChooseAll() ;
logger.info("店长,导购数={}",clerkIdList.size()); if(StringUtils.isBlank(chooseAll) || !"1".equals(chooseAll)) {
} else if(clerk.getClerkType()==2) { if(clerkType==1 && CollectionUtils.isEmpty(clerkIdList)) {
// 区经 return RestResponse.failure("-1","请选择导购");
} else {
clerkIdList = new ArrayList<>();
} }
if(clerkType==2 && CollectionUtils.isEmpty(storeIdList)) {
return RestResponse.failure("-1","请选择门店");
} }
logger.info("clerkIdList={}",JSON.toJSONString(clerkIdList));
if(CollectionUtils.isEmpty(clerkIdList)) {
return RestResponse.failure("-1","无发送导购数据");
} }
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("clerkIdList", clerkIdList); json.put("clerkIdList", clerkIdList);
json.put("storeIdList", storeIdList) ;
json.put("enterpriseId", enterpriseId); json.put("enterpriseId", enterpriseId);
json.put("imgJson", imgJson); json.put("imgJson", imgJson);
json.put("staffId", staffId); json.put("staffId", staffId);
json.put("sendClerkId", clerkId); json.put("sendClerkId", clerkId);
json.put("sendClerkType", clerkType) ;
json.put("sendClerkStoreId", clerk.getStoreId());
// 朋友圈-分享 // 朋友圈-分享
json.put("sendType", 2); json.put("sendType", 2);
json.put("wxEnterpriseId", wxEnterpriseId); json.put("wxEnterpriseId", wxEnterpriseId);
json.put("content", qo.getContent()) ; json.put("content", qo.getContent()) ;
json.put("contentMaterialId", contentMaterialId) ; json.put("contentMaterialId", contentMaterialId) ;
String ret = json.toJSONString(); String params = json.toJSONString();
try { try {
GICMQClientUtil.getClientInstance().sendCommonMessage("haobanCommonRouter", ret, GICMQClientUtil.getClientInstance().sendCommonMessage("haobanCommonRouter", params,
"com.gic.haoban.app.customer.service.api.service.MessageLogApiService", "callBackSendMessage"); "com.gic.haoban.app.customer.service.api.service.MessageLogApiService", "callBackSendMessage");
} catch (Exception e) { } catch (Exception e) {
logger.info(e.getMessage(), e); logger.info(e.getMessage(), e);
......
...@@ -14,9 +14,16 @@ public class CustomerQO implements Serializable{ ...@@ -14,9 +14,16 @@ public class CustomerQO implements Serializable{
private String staffId; private String staffId;
private List<String> memberIdList ; private List<String> memberIdList ;
private List<String> clerkIdList ; private List<String> clerkIdList ;
private List<String> storeIdList ;
private String content ; private String content ;
private boolean qwFriendFlag = false ; private boolean qwFriendFlag = false ;
public List<String> getStoreIdList() {
return storeIdList;
}
public void setStoreIdList(List<String> storeIdList) {
this.storeIdList = storeIdList;
}
public String getContent() { public String getContent() {
return content; return content;
} }
......
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