Commit 0a6f9bba by 孙喜旺

fix

1 parent f00e335c
...@@ -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,6 +568,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -567,6 +568,7 @@ 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()));
try {
if (CollectionUtil.isNotEmpty(weFlowerCustomerRels)) { if (CollectionUtil.isNotEmpty(weFlowerCustomerRels)) {
List<Long> weFlowerCustomerRelIds = weFlowerCustomerRels.stream().map(WeFlowerCustomerRel::getId).collect(Collectors.toList()); List<Long> weFlowerCustomerRelIds = weFlowerCustomerRels.stream().map(WeFlowerCustomerRel::getId).collect(Collectors.toList());
iWeFlowerCustomerTagRelService.remove( iWeFlowerCustomerTagRelService.remove(
...@@ -588,6 +590,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -588,6 +590,10 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
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!