1、检查主数据缓存更新问题

This commit is contained in:
2026-02-26 11:10:23 +08:00
parent aa6d36e4f1
commit 69497395e2
5 changed files with 31 additions and 7 deletions

View File

@ -16,6 +16,7 @@ import com.pictc.enums.ExceptionCommonCode;
import com.pictc.enums.ValidEnum;
import com.pictc.utils.DataLogTools;
import com.xjrsoft.common.advice.tran.CurrencyDataProvider;
import com.xjrsoft.common.advice.tran.TranDataManager;
import com.xjrsoft.common.enums.YesOrNoEnum;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.module.common.db.service.CommonCallService;
@ -39,9 +40,9 @@ public class CurrencyServiceImpl extends ServiceImpl<LngBCurrencyMapper, LngBCur
private final CommonCallService commonCallService;
private final CurrencyDataProvider tranProvider;
@Override
@Transactional(rollbackFor = Exception.class)
public Long add(UpdateLngBCurrencyDto dto) {

View File

@ -172,6 +172,8 @@ public class CustomerController {
@Override
public UpdateLngCustomerDto after(DataOperationContent<UpdateLngCustomerDto> content) {
UpdateLngCustomerDto obj =content.getObj();
tranProvider.removeCacheData(obj.getCuCode());
return null;
}
}));
@ -191,6 +193,8 @@ public class CustomerController {
@Override
public UpdateLngCustomerDto after(DataOperationContent<UpdateLngCustomerDto> content) {
UpdateLngCustomerDto obj =content.getObj();
tranProvider.saveData(obj.getCuCode(), obj);
return null;
}
}));
@ -210,6 +214,8 @@ public class CustomerController {
@Override
public UpdateLngCustomerDto after(DataOperationContent<UpdateLngCustomerDto> content) {
UpdateLngCustomerDto obj =content.getObj();
tranProvider.saveData(obj.getCuCode(), obj);
return null;
}
}));

View File

@ -178,6 +178,8 @@ public class GradeSystemController {
@Override
public UpdateLngGradeSystemDto after(DataOperationContent<UpdateLngGradeSystemDto> content) {
UpdateLngGradeSystemDto obj =content.getObj();
tranProvider.saveData(obj.getId().toString(), obj);
return null;
}
}));
@ -196,6 +198,8 @@ public class GradeSystemController {
@Override
public UpdateLngGradeSystemDto after(DataOperationContent<UpdateLngGradeSystemDto> content) {
UpdateLngGradeSystemDto obj =content.getObj();
tranProvider.saveData(obj.getId().toString(), obj);
return null;
}
}));

View File

@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.pictc.enums.BusinessCode;
import com.xjrsoft.common.advice.tran.CustomerDataProvider;
import com.xjrsoft.common.exception.BusinessException;
import com.xjrsoft.module.mdm.client.ILngBankClient;
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
@ -46,6 +47,7 @@ import lombok.AllArgsConstructor;
@Service
@AllArgsConstructor
public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, LngCustomer> implements ICustomerService {
private final LngCustomerMapper lngCustomerMapper;
private final LngCustomerAttrPowerMapper lngCustomerAttrPowerMapper;
@ -57,12 +59,17 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
private final ILngBankClient bankClient;
private final CustomerDataProvider tranProvider;
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean delete(List<Long> ids) {
List<LngCustomer> customerList = lngCustomerMapper.selectList(Wrappers.lambdaQuery(LngCustomer.class).in(LngCustomer::getId, ids));
for(LngCustomer customer: customerList) {
tranProvider.removeCacheData(customer.getCuCode());
}
List<String> cuCodeList = customerList.stream().map(LngCustomer::getCuCode).filter(Objects::nonNull).collect(Collectors.toList());
lngCustomerMapper.deleteBatchIds(ids);
if(CollectionUtil.isNotEmpty(cuCodeList)) {

View File

@ -168,6 +168,8 @@ public class SupplierController {
@Override
public UpdateLngSupplierDto after(DataOperationContent<UpdateLngSupplierDto> content) {
UpdateLngSupplierDto obj =content.getObj();
tranProvider.removeCacheData(obj.getSuCode());
return null;
}
}));
@ -187,6 +189,8 @@ public class SupplierController {
@Override
public UpdateLngSupplierDto after(DataOperationContent<UpdateLngSupplierDto> content) {
UpdateLngSupplierDto obj =content.getObj();
tranProvider.saveData(obj.getSuCode(), obj);
return null;
}
}));
@ -206,6 +210,8 @@ public class SupplierController {
@Override
public UpdateLngSupplierDto after(DataOperationContent<UpdateLngSupplierDto> content) {
UpdateLngSupplierDto obj =content.getObj();
tranProvider.saveData(obj.getSuCode(), obj);
return null;
}
}));