Commit 04e3839d by 孙喜旺

任务宝发送任务失败修正

1 parent e01afcf8
...@@ -128,7 +128,11 @@ public interface IWeCustomerService extends IService<WeCustomer> ...@@ -128,7 +128,11 @@ public interface IWeCustomerService extends IService<WeCustomer>
void updateWeCustomerPortrait(WeCustomerPortrait weCustomerPortrait); void updateWeCustomerPortrait(WeCustomerPortrait weCustomerPortrait);
/**
* 查询全部客户列表
* @param weCustomer
* @return
*/
public List<WeCustomer> selectWeCustomerAllList(WeCustomer weCustomer);
} }
...@@ -170,8 +170,9 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS ...@@ -170,8 +170,9 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS
WeCustomer weCustomer = new WeCustomer(); WeCustomer weCustomer = new WeCustomer();
weCustomer.setUserIds(staffId); weCustomer.setUserIds(staffId);
weCustomer.setDepartmentIds(department); weCustomer.setDepartmentIds(department);
customers = weCustomerService.selectWeCustomerList(weCustomer); customers = weCustomerService.selectWeCustomerAllList(weCustomer);
redisCache.setCacheList(WeConstans.WECUSTOMERS_KEY, customers); redisCache.setCacheList(WeConstans.WECUSTOMERS_KEY, customers);
redisCache.expire(WeConstans.WECUSTOMERS_KEY,2 * 60L);
} }
return customers; return customers;
} else { } else {
...@@ -182,7 +183,7 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS ...@@ -182,7 +183,7 @@ public class WeCustomerMessagePushServiceImpl implements IWeCustomerMessagePushS
weCustomer.setUserIds(staffId); weCustomer.setUserIds(staffId);
weCustomer.setTagIds(tag); weCustomer.setTagIds(tag);
weCustomer.setDepartmentIds(department); weCustomer.setDepartmentIds(department);
return weCustomerService.selectWeCustomerList(weCustomer); return weCustomerService.selectWeCustomerAllList(weCustomer);
} }
} }
......
...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.common.constant.Constants; import com.linkwechat.common.constant.Constants;
import com.linkwechat.common.constant.WeConstans; import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.enums.TrajectorySceneType; import com.linkwechat.common.enums.TrajectorySceneType;
import com.linkwechat.common.exception.CustomException;
import com.linkwechat.common.utils.DateUtils; import com.linkwechat.common.utils.DateUtils;
import com.linkwechat.common.utils.SecurityUtils; import com.linkwechat.common.utils.SecurityUtils;
import com.linkwechat.common.utils.SnowFlakeUtil; import com.linkwechat.common.utils.SnowFlakeUtil;
...@@ -119,13 +120,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -119,13 +120,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
@Override @Override
public List<WeCustomer> selectWeCustomerList(WeCustomer weCustomer) { public List<WeCustomer> selectWeCustomerList(WeCustomer weCustomer) {
//当前登录用户为企业用户 //当前登录用户为企业用户
try {
if(Constants.USER_TYPE_WECOME if(Constants.USER_TYPE_WECOME
.equals(SecurityUtils.getLoginUser().getUser().getUserType())){ .equals(SecurityUtils.getLoginUser().getUser().getUserType())){
weCustomer.setUserIds((SecurityUtils.getLoginUser().getUser().getWeUserId())); weCustomer.setUserIds((SecurityUtils.getLoginUser().getUser().getWeUserId()));
} }
} catch (Exception e) {
}
return weCustomerMapper.selectWeCustomerList(weCustomer); return weCustomerMapper.selectWeCustomerList(weCustomer);
} }
...@@ -709,8 +707,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -709,8 +707,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
iWeCustomerTrajectoryService.inforMationNews(weCustomerPortrait.getUserId(),weCustomerPortrait.getExternalUserid(), TrajectorySceneType.TRAJECTORY_TYPE_XXDT_BCZL.getKey()); iWeCustomerTrajectoryService.inforMationNews(weCustomerPortrait.getUserId(),weCustomerPortrait.getExternalUserid(), TrajectorySceneType.TRAJECTORY_TYPE_XXDT_BCZL.getKey());
} }
@Override
public List<WeCustomer> selectWeCustomerAllList(WeCustomer weCustomer) {
return weCustomerMapper.selectWeCustomerList(weCustomer);
}
} }
...@@ -34,6 +34,8 @@ import org.apache.commons.collections4.CollectionUtils; ...@@ -34,6 +34,8 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -240,6 +242,9 @@ public class WeTaskFissionServiceImpl extends ServiceImpl<WeTaskFissionMapper, W ...@@ -240,6 +242,9 @@ public class WeTaskFissionServiceImpl extends ServiceImpl<WeTaskFissionMapper, W
customerMessagePushDto.setDepartment(departmentIds); customerMessagePushDto.setDepartment(departmentIds);
} }
try { try {
SecurityContext context = SecurityContextHolder.getContext();
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);
SecurityContextHolder.setContext(context);
weCustomerMessagePushService.addWeCustomerMessagePush(customerMessagePushDto); weCustomerMessagePushService.addWeCustomerMessagePush(customerMessagePushDto);
} catch (JsonProcessingException | ParseException e) { } catch (JsonProcessingException | ParseException e) {
e.printStackTrace(); e.printStackTrace();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!