Commit 1a744cac by 徐高华

Merge branch 'master-调整队列' into 'master'

Master 调整队列

See merge request !1456
parents 544fa2bc bf44e19e
......@@ -28,7 +28,6 @@ public interface DealSyncOperationApiService {
/**
* mq拆分
* 部门同步处理
* "routerName": "departmentSyncDealMq2"
*
* @param params
*/
......
......@@ -113,4 +113,6 @@ public interface StoreRangeService {
List<String> listStoreIdByName( String wxEnterpriseId, String enterpriseId, String storeName) ;
public boolean hasStore(String wxEnterpriseId , String enterpriseId, String storeId) ;
}
......@@ -3,6 +3,8 @@ package com.gic.haoban.manage.service.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.ToolUtil;
import com.gic.enterprise.api.dto.StoreGroupDTO;
import com.gic.enterprise.api.service.StoreGroupService;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
......@@ -45,6 +47,8 @@ public class StoreRangeServiceImpl implements StoreRangeService {
@Autowired
private StaffClerkRelationService staffClerkRelationService;
@Autowired
private StoreGroupService storeGroupService;
@Override
......@@ -267,4 +271,24 @@ public class StoreRangeServiceImpl implements StoreRangeService {
public List<String> listStoreIdByName(String wxEnterpriseId, String enterpriseId, String storeName) {
return tabHaobanStoreRelationMapper.listStoreIdByName(wxEnterpriseId,enterpriseId,storeName);
}
@Override
public boolean hasStore(String wxEnterpriseId , String enterpriseId, String storeId) {
List<String> storeGroupIds = this.listStoreGroupIdByWxEnterpriseId(wxEnterpriseId, enterpriseId);
if (CollectionUtils.isEmpty(storeGroupIds)) {
logger.info("好办门店分组id为空");
return false ;
}
String[] array = storeGroupIds.toArray(new String[0]);
List<StoreGroupDTO> storeGroupDTOS = storeGroupService.listStoreGroup(array, enterpriseId);
List<String> parentGroupIds = storeGroupDTOS.stream().map(StoreGroupDTO::getParentGroupId).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(parentGroupIds) && parentGroupIds.contains("0")) {
logger.info("企微包含所有门店",wxEnterpriseId);
return true ;
}
if(isFlagByStoreId(storeId,wxEnterpriseId,enterpriseId)) {
return true ;
}
return false ;
}
}
......@@ -934,6 +934,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
TabHaobanSyncTask syncTask = syncTaskService.getSyncTask(taskId);
String wxEnterpriseId = syncTask.getWxEnterpriseId();
this.unlockTask(wxEnterpriseId) ;
this.cleanDiffrence(wxEnterpriseId, taskId);
logger.info("同步通讯录完成");
RedisUtil.unlock(key);
}
......@@ -970,6 +971,8 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
List<String> dataIds = preDealService.listReDataIdByPDataId(taskId, stffId, PreDealTypeEnum.friend.getVal());
if (CollectionUtils.isEmpty(dataIds)) {
logger.info("无第三方的数据/自建");
String staffLockKey = DealSyncOperationApiServiceImpl.FRIEND_LOCK + stffId;
RedisUtil.delCache(staffLockKey);
preDealService.updateStatusByDataId(taskId, stffId, PreDealTypeEnum.friend_clerk.getVal(), PreDealStatusEnum.computed.getVal(), "成功");
} else {
sendToMq(taskId, new HashSet<>(dataIds), SyncTaskStatusEnum.friend_sync,null);
......
......@@ -75,7 +75,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Autowired
private HmQrcodeService hmQrcodeService;
@Autowired
private Config config;
private StoreRangeService storeRangeService;
@Override
public void bindLogMq(String params) {
......@@ -513,11 +513,13 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
logger.info("导购未关联成员,oldClerkId={}", oldClerkId);
return;
}
/* StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getByClerkId(oldClerkId);
if (null == oldRelationDTO) {
logger.info("导购未关联成员,clerkCode={}", clerkCode);
return;
}*/
// 如果新门店未关联好办,进行解绑
boolean hasFlag = this.storeRangeService.hasStore(oldRelationDTO.getWxEnterpriseId(),enterpriseId,clerkDTO.getStoreId()) ;
if(!hasFlag) {
logger.info("新门店未关联好办,storeId={}",clerkDTO.getStoreId());
staffClerkRelationService.delBind(oldClerkId, "-1", ChannelCodeEnum.GIC_CLERK_DEL_UNBIND.getCode(), null,null);
return ;
}
logger.info("导购门店转移,老的绑定导购id={}", oldRelationDTO.getClerkId());
this.moveOrAddClerk(clerkSyncQDTO, oldRelationDTO);
} else if (type == 3) {
......
......@@ -169,7 +169,7 @@ public class SelfFriendSyncNewOperation implements BaseSyncOperation {
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
Log.info("发送队列SelfFriendSyncNewOperation={}",JSON.toJSONString(ret));
clientInstance.sendBatchMessages("departmentSyncDealMq2", ret);
clientInstance.sendBatchMessages("departmentSyncDealMq", ret);
} catch (Exception e) {
logger.info("发送失败:{},{}", taskId);
e.printStackTrace();
......
......@@ -336,7 +336,7 @@ public class DepartmentContoller extends WebBaseController {
Object cache = RedisUtil.getLocalCache("department-list-cache-" + wxEnterpriseId);
if (null == cache) {
List<DepartmentShortDTO> list = departmentApiService.listAllDepartment(wxEnterpriseId);
RedisUtil.setLocalCache("department-list-cache-" + wxEnterpriseId, list, -1L);
RedisUtil.setLocalCache("department-list-cache-" + wxEnterpriseId, list, 60*60*24L);
return resultResponse(HaoBanErrCode.ERR_1, list);
} else {
return resultResponse(HaoBanErrCode.ERR_1, cache);
......
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