Commit 0a6f9bba by 孙喜旺

fix

1 parent f00e335c
......@@ -108,13 +108,10 @@ public class WeAccessTokenInterceptor implements Interceptor{
*/
@Override
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);
if(null != weResultDto.getErrcode() && !weResultDto.getErrcode().equals(WeConstans.WE_SUCCESS_CODE)&& !weResultDto.getErrcode().equals(WeConstans.NOT_EXIST_CONTACT) ){
throw new ForestRuntimeException(forestResponse.getContent());
}
}
......
......@@ -31,6 +31,7 @@ import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.*;
import java.util.stream.Collectors;
......@@ -567,26 +568,31 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
List<WeFlowerCustomerRel> weFlowerCustomerRels = iWeFlowerCustomerRelService.list(new LambdaQueryWrapper<WeFlowerCustomerRel>()
.eq(WeFlowerCustomerRel::getExternalUserid, weCustomer.getExternalUserid()));
if (CollectionUtil.isNotEmpty(weFlowerCustomerRels)) {
List<Long> weFlowerCustomerRelIds = weFlowerCustomerRels.stream().map(WeFlowerCustomerRel::getId).collect(Collectors.toList());
iWeFlowerCustomerTagRelService.remove(
new LambdaQueryWrapper<WeFlowerCustomerTagRel>().in(WeFlowerCustomerTagRel::getFlowerCustomerRelId,
weFlowerCustomerRelIds)
);
iWeFlowerCustomerRelService.removeByIds(
weFlowerCustomerRelIds
);
}
try {
if (CollectionUtil.isNotEmpty(weFlowerCustomerRels)) {
List<Long> weFlowerCustomerRelIds = weFlowerCustomerRels.stream().map(WeFlowerCustomerRel::getId).collect(Collectors.toList());
iWeFlowerCustomerTagRelService.remove(
new LambdaQueryWrapper<WeFlowerCustomerTagRel>().in(WeFlowerCustomerTagRel::getFlowerCustomerRelId,
weFlowerCustomerRelIds)
);
iWeFlowerCustomerRelService.removeByIds(
weFlowerCustomerRelIds
);
}
iWeFlowerCustomerRelService.saveBatch(weFlowerCustomerRel);
iWeFlowerCustomerRelService.saveBatch(weFlowerCustomerRel);
//设置标签跟客户关系,标签和标签组,saveOrUpdate,建立标签与添加人关系
if (CollectionUtil.isNotEmpty(weTags) && CollectionUtil.isNotEmpty(weGroups)) {
iWeTagService.saveOrUpdateBatch(weTags);
iWeTagGroupService.saveOrUpdateBatch(weGroups);
iWeFlowerCustomerTagRelService.saveOrUpdateBatch(weFlowerCustomerTagRels);
//设置标签跟客户关系,标签和标签组,saveOrUpdate,建立标签与添加人关系
if (CollectionUtil.isNotEmpty(weTags) && CollectionUtil.isNotEmpty(weGroups)) {
iWeTagService.saveOrUpdateBatch(weTags);
iWeTagGroupService.saveOrUpdateBatch(weGroups);
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!