1、检查主数据缓存更新问题
This commit is contained in:
@ -16,6 +16,7 @@ import com.pictc.enums.ExceptionCommonCode;
|
|||||||
import com.pictc.enums.ValidEnum;
|
import com.pictc.enums.ValidEnum;
|
||||||
import com.pictc.utils.DataLogTools;
|
import com.pictc.utils.DataLogTools;
|
||||||
import com.xjrsoft.common.advice.tran.CurrencyDataProvider;
|
import com.xjrsoft.common.advice.tran.CurrencyDataProvider;
|
||||||
|
import com.xjrsoft.common.advice.tran.TranDataManager;
|
||||||
import com.xjrsoft.common.enums.YesOrNoEnum;
|
import com.xjrsoft.common.enums.YesOrNoEnum;
|
||||||
import com.xjrsoft.common.exception.BusinessException;
|
import com.xjrsoft.common.exception.BusinessException;
|
||||||
import com.xjrsoft.module.common.db.service.CommonCallService;
|
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 CommonCallService commonCallService;
|
||||||
|
|
||||||
|
|
||||||
private final CurrencyDataProvider tranProvider;
|
private final CurrencyDataProvider tranProvider;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Long add(UpdateLngBCurrencyDto dto) {
|
public Long add(UpdateLngBCurrencyDto dto) {
|
||||||
|
|||||||
@ -172,6 +172,8 @@ public class CustomerController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngCustomerDto after(DataOperationContent<UpdateLngCustomerDto> content) {
|
public UpdateLngCustomerDto after(DataOperationContent<UpdateLngCustomerDto> content) {
|
||||||
|
UpdateLngCustomerDto obj =content.getObj();
|
||||||
|
tranProvider.removeCacheData(obj.getCuCode());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@ -191,6 +193,8 @@ public class CustomerController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngCustomerDto after(DataOperationContent<UpdateLngCustomerDto> content) {
|
public UpdateLngCustomerDto after(DataOperationContent<UpdateLngCustomerDto> content) {
|
||||||
|
UpdateLngCustomerDto obj =content.getObj();
|
||||||
|
tranProvider.saveData(obj.getCuCode(), obj);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@ -210,6 +214,8 @@ public class CustomerController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngCustomerDto after(DataOperationContent<UpdateLngCustomerDto> content) {
|
public UpdateLngCustomerDto after(DataOperationContent<UpdateLngCustomerDto> content) {
|
||||||
|
UpdateLngCustomerDto obj =content.getObj();
|
||||||
|
tranProvider.saveData(obj.getCuCode(), obj);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|||||||
@ -178,6 +178,8 @@ public class GradeSystemController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngGradeSystemDto after(DataOperationContent<UpdateLngGradeSystemDto> content) {
|
public UpdateLngGradeSystemDto after(DataOperationContent<UpdateLngGradeSystemDto> content) {
|
||||||
|
UpdateLngGradeSystemDto obj =content.getObj();
|
||||||
|
tranProvider.saveData(obj.getId().toString(), obj);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@ -196,6 +198,8 @@ public class GradeSystemController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngGradeSystemDto after(DataOperationContent<UpdateLngGradeSystemDto> content) {
|
public UpdateLngGradeSystemDto after(DataOperationContent<UpdateLngGradeSystemDto> content) {
|
||||||
|
UpdateLngGradeSystemDto obj =content.getObj();
|
||||||
|
tranProvider.saveData(obj.getId().toString(), obj);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||||
import com.pictc.enums.BusinessCode;
|
import com.pictc.enums.BusinessCode;
|
||||||
|
import com.xjrsoft.common.advice.tran.CustomerDataProvider;
|
||||||
import com.xjrsoft.common.exception.BusinessException;
|
import com.xjrsoft.common.exception.BusinessException;
|
||||||
import com.xjrsoft.module.mdm.client.ILngBankClient;
|
import com.xjrsoft.module.mdm.client.ILngBankClient;
|
||||||
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
|
import com.xjrsoft.module.mdm.dto.UpdateLngBBankDto;
|
||||||
@ -46,6 +47,7 @@ import lombok.AllArgsConstructor;
|
|||||||
@Service
|
@Service
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, LngCustomer> implements ICustomerService {
|
public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, LngCustomer> implements ICustomerService {
|
||||||
|
|
||||||
private final LngCustomerMapper lngCustomerMapper;
|
private final LngCustomerMapper lngCustomerMapper;
|
||||||
|
|
||||||
private final LngCustomerAttrPowerMapper lngCustomerAttrPowerMapper;
|
private final LngCustomerAttrPowerMapper lngCustomerAttrPowerMapper;
|
||||||
@ -57,12 +59,17 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
|
|||||||
|
|
||||||
private final ILngBankClient bankClient;
|
private final ILngBankClient bankClient;
|
||||||
|
|
||||||
|
private final CustomerDataProvider tranProvider;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean delete(List<Long> ids) {
|
public Boolean delete(List<Long> ids) {
|
||||||
List<LngCustomer> customerList = lngCustomerMapper.selectList(Wrappers.lambdaQuery(LngCustomer.class).in(LngCustomer::getId, 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());
|
List<String> cuCodeList = customerList.stream().map(LngCustomer::getCuCode).filter(Objects::nonNull).collect(Collectors.toList());
|
||||||
lngCustomerMapper.deleteBatchIds(ids);
|
lngCustomerMapper.deleteBatchIds(ids);
|
||||||
if(CollectionUtil.isNotEmpty(cuCodeList)) {
|
if(CollectionUtil.isNotEmpty(cuCodeList)) {
|
||||||
|
|||||||
@ -168,6 +168,8 @@ public class SupplierController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngSupplierDto after(DataOperationContent<UpdateLngSupplierDto> content) {
|
public UpdateLngSupplierDto after(DataOperationContent<UpdateLngSupplierDto> content) {
|
||||||
|
UpdateLngSupplierDto obj =content.getObj();
|
||||||
|
tranProvider.removeCacheData(obj.getSuCode());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@ -187,6 +189,8 @@ public class SupplierController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngSupplierDto after(DataOperationContent<UpdateLngSupplierDto> content) {
|
public UpdateLngSupplierDto after(DataOperationContent<UpdateLngSupplierDto> content) {
|
||||||
|
UpdateLngSupplierDto obj =content.getObj();
|
||||||
|
tranProvider.saveData(obj.getSuCode(), obj);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@ -206,6 +210,8 @@ public class SupplierController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateLngSupplierDto after(DataOperationContent<UpdateLngSupplierDto> content) {
|
public UpdateLngSupplierDto after(DataOperationContent<UpdateLngSupplierDto> content) {
|
||||||
|
UpdateLngSupplierDto obj =content.getObj();
|
||||||
|
tranProvider.saveData(obj.getSuCode(), obj);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user