Commit f3cc80f7 by fudahua

同步通讯录 门店同步fix

parent 0c1dc7a5
......@@ -32,6 +32,7 @@ import com.task.allocation.api.AbstractTaskAllocationNewOperation;
import com.task.allocation.exception.TaskAllocationException;
import com.task.allocation.qo.TaskAllocationComputed;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -76,6 +77,8 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
private static final String LOCK_KEY = "sync_wx_lock_";
private static final String LOCK_SUCCESS_KEY = "sync_wx_success_lock_";
@Override
public void departmentDealMq(String params) {
logger.info("mq处理中:{}", params);
......@@ -333,6 +336,14 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
@Override
public void unlockTask(String wxEnterpriseId) {
String key = LOCK_KEY + wxEnterpriseId;
String taskId = (String) RedisUtil.getCache(key);
if (StringUtils.isNotBlank(taskId)) {
TabHaobanSyncTask syncTask = syncTaskService.getSyncTask(taskId);
if (syncTask.getStatusFlag().equals(SyncTaskStatusEnum.compute.getVal())) {
String sKey = LOCK_SUCCESS_KEY + wxEnterpriseId;
RedisUtil.setCache(sKey, taskId);
}
}
RedisUtil.delCache(key);
}
......@@ -346,6 +357,11 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
public SyncCheckDTO getTaskCheck(String wxEnterpriseId) {
String taskId = getTaskLock(wxEnterpriseId);
SyncCheckDTO syncCheckDTO = new SyncCheckDTO();
String sKey = LOCK_SUCCESS_KEY + wxEnterpriseId;
if (null == taskId) {
taskId = (String) RedisUtil.getCache(sKey);
RedisUtil.delCache(sKey);
}
if (null == taskId) {
return syncCheckDTO;
}
......
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