This commit is contained in:
张秉卓
2026-02-26 18:28:13 +08:00
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.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,8 +40,8 @@ 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)

View File

@ -149,10 +149,10 @@ public class CustomerController {
@Override @Override
public UpdateLngCustomerDto after(DataOperationContent<UpdateLngCustomerDto> content) { public UpdateLngCustomerDto after(DataOperationContent<UpdateLngCustomerDto> content) {
String msg = CommonCallUtils.saveAfter(content.getTableName(),content.getIdValue()); String msg = CommonCallUtils.saveAfter(content.getTableName(),content.getIdValue());
if (StringUtils.isNotBlank(msg)) { if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg)); throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
} }
UpdateLngCustomerDto obj =content.getObj(); UpdateLngCustomerDto obj =content.getObj();
tranProvider.saveData(obj.getCuCode(), obj); tranProvider.saveData(obj.getCuCode(), obj);
return obj; return obj;
} }
@ -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;
} }
})); }));

View File

@ -123,7 +123,7 @@ public class GradeSystemController {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg)); throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
} }
codeRuleClient.useEncode(GS_CODE); codeRuleClient.useEncode(GS_CODE);
UpdateLngGradeSystemDto obj =content.getObj(); UpdateLngGradeSystemDto obj =content.getObj();
tranProvider.saveData(obj.getId().toString(), obj); tranProvider.saveData(obj.getId().toString(), obj);
return obj; return obj;
} }
@ -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;
} }
})); }));

View File

@ -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;
@ -56,6 +58,8 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
private final IFileClient fileClient; private final IFileClient fileClient;
private final ILngBankClient bankClient; private final ILngBankClient bankClient;
private final CustomerDataProvider tranProvider;
@ -63,6 +67,9 @@ public class CustomerServiceImpl extends MPJBaseServiceImpl<LngCustomerMapper, L
@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)) {

View File

@ -148,7 +148,7 @@ public class SupplierController {
if (StringUtils.isNotBlank(msg)) { if (StringUtils.isNotBlank(msg)) {
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg)); throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DB_FUNCTION_EXEC_ERROR, msg));
} }
UpdateLngSupplierDto obj =content.getObj(); UpdateLngSupplierDto obj =content.getObj();
tranProvider.saveData(obj.getSuCode(), obj); tranProvider.saveData(obj.getSuCode(), obj);
return obj; return obj;
} }
@ -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;
} }
})); }));