Commit 2515bbcf by danmo

fix

1 parent f80b8f8b
...@@ -108,13 +108,10 @@ public class WeAccessTokenInterceptor implements Interceptor{ ...@@ -108,13 +108,10 @@ public class WeAccessTokenInterceptor implements Interceptor{
*/ */
@Override @Override
public void onSuccess(Object o, ForestRequest forestRequest, ForestResponse forestResponse) { public void onSuccess(Object o, ForestRequest forestRequest, ForestResponse forestResponse) {
log.info("url:【{}】,result:【{}】",forestRequest.getUrl(),forestResponse.getContent());
WeResultDto weResultDto = JSONUtil.toBean(forestResponse.getContent(), WeResultDto.class); WeResultDto weResultDto = JSONUtil.toBean(forestResponse.getContent(), WeResultDto.class);
if(null != weResultDto.getErrcode() && !weResultDto.getErrcode().equals(WeConstans.WE_SUCCESS_CODE)&& !weResultDto.getErrcode().equals(WeConstans.NOT_EXIST_CONTACT) ){ if(null != weResultDto.getErrcode() && !weResultDto.getErrcode().equals(WeConstans.WE_SUCCESS_CODE)&& !weResultDto.getErrcode().equals(WeConstans.NOT_EXIST_CONTACT) ){
throw new ForestRuntimeException(forestResponse.getContent()); throw new ForestRuntimeException(forestResponse.getContent());
} }
} }
......
...@@ -31,6 +31,7 @@ import org.springframework.security.core.context.SecurityContext; ...@@ -31,6 +31,7 @@ import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder; 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;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -567,26 +568,31 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -567,26 +568,31 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
List<WeFlowerCustomerRel> weFlowerCustomerRels = iWeFlowerCustomerRelService.list(new LambdaQueryWrapper<WeFlowerCustomerRel>() List<WeFlowerCustomerRel> weFlowerCustomerRels = iWeFlowerCustomerRelService.list(new LambdaQueryWrapper<WeFlowerCustomerRel>()
.eq(WeFlowerCustomerRel::getExternalUserid, weCustomer.getExternalUserid())); .eq(WeFlowerCustomerRel::getExternalUserid, weCustomer.getExternalUserid()));
if (CollectionUtil.isNotEmpty(weFlowerCustomerRels)) { try {
List<Long> weFlowerCustomerRelIds = weFlowerCustomerRels.stream().map(WeFlowerCustomerRel::getId).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(weFlowerCustomerRels)) {
iWeFlowerCustomerTagRelService.remove( List<Long> weFlowerCustomerRelIds = weFlowerCustomerRels.stream().map(WeFlowerCustomerRel::getId).collect(Collectors.toList());
new LambdaQueryWrapper<WeFlowerCustomerTagRel>().in(WeFlowerCustomerTagRel::getFlowerCustomerRelId, iWeFlowerCustomerTagRelService.remove(
weFlowerCustomerRelIds) new LambdaQueryWrapper<WeFlowerCustomerTagRel>().in(WeFlowerCustomerTagRel::getFlowerCustomerRelId,
); weFlowerCustomerRelIds)
);
iWeFlowerCustomerRelService.removeByIds(
weFlowerCustomerRelIds iWeFlowerCustomerRelService.removeByIds(
); weFlowerCustomerRelIds
} );
}
iWeFlowerCustomerRelService.saveBatch(weFlowerCustomerRel); iWeFlowerCustomerRelService.saveBatch(weFlowerCustomerRel);
//设置标签跟客户关系,标签和标签组,saveOrUpdate,建立标签与添加人关系 //设置标签跟客户关系,标签和标签组,saveOrUpdate,建立标签与添加人关系
if (CollectionUtil.isNotEmpty(weTags) && CollectionUtil.isNotEmpty(weGroups)) { if (CollectionUtil.isNotEmpty(weTags) && CollectionUtil.isNotEmpty(weGroups)) {
iWeTagService.saveOrUpdateBatch(weTags); iWeTagService.saveOrUpdateBatch(weTags);
iWeTagGroupService.saveOrUpdateBatch(weGroups); iWeTagGroupService.saveOrUpdateBatch(weGroups);
iWeFlowerCustomerTagRelService.saveOrUpdateBatch(weFlowerCustomerTagRels); iWeFlowerCustomerTagRelService.saveOrUpdateBatch(weFlowerCustomerTagRels);
}
} catch (Exception e) {
e.printStackTrace();
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!