增加事务注解

This commit is contained in:
2025-10-28 18:25:00 +08:00
parent f8aad0fd81
commit 80110a4d46
7 changed files with 24 additions and 5 deletions

View File

@ -62,7 +62,7 @@ public class ExpenseNameController {
.like(StrUtil.isNotBlank(dto.getValid()),LngBFee::getValid,dto.getValid())
.like(StrUtil.isNotBlank(dto.getCode()),LngBFee::getCode,dto.getCode())
.like(StrUtil.isNotBlank(dto.getNote()),LngBFee::getNote,dto.getNote())
.orderByAsc(LngBFee::getCode,LngBFee::getCode)
.orderByAsc(LngBFee::getSort,LngBFee::getCode)
.select(LngBFee.class,x -> VoToColumnUtil.fieldsToColumns(LngBFeePageVo.class).contains(x.getProperty()));
IPage<LngBFee> page = expenseNameService.page(ConventPage.getPage(dto), queryWrapper);
PageOutput<LngBFeePageVo> pageOutput = ConventPage.getPageOutput(page, LngBFeePageVo.class);

View File

@ -60,7 +60,8 @@ public class BankServiceImpl extends ServiceImpl<LngBBankMapper, LngBBank> imple
return res.getId();
}
@Override
@Override
@Transactional(rollbackFor = Exception.class)
public boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBBankDto.class,ids);
for (Long id : ids) {
@ -74,6 +75,7 @@ public class BankServiceImpl extends ServiceImpl<LngBBankMapper, LngBBank> imple
@Override
@Transactional(rollbackFor = Exception.class)
public boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBBankDto.class,ids);

View File

@ -57,7 +57,8 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
return res.getId();
}
@Override
@Override
@Transactional(rollbackFor = Exception.class)
public boolean enable(List<Long> ids) {
dataService.enable(UpdateLngBRegionDto.class,ids);
for (Long id : ids) {
@ -71,6 +72,7 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
@Override
@Transactional(rollbackFor = Exception.class)
public boolean disable(List<Long> ids) {
dataService.disable(UpdateLngBRegionDto.class,ids);
for (Long id : ids) {
@ -85,6 +87,7 @@ public class CountryRegionServiceImpl extends ServiceImpl<LngBRegionMapper, LngB
@Override
@Transactional(rollbackFor = Exception.class)
public Long update(UpdateLngBRegionDto dto) {
if(!CountryRegionEnum.CONTINENT.getCode().equals(dto.getRegionTypeCode()) ) {
if(dto.getPid() != null && dto.getPid() != 0) {

View File

@ -4,6 +4,7 @@ import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -35,6 +36,7 @@ public class ExpenseNameServiceImpl extends ServiceImpl<LngBFeeMapper, LngBFee>
private final CommonCallService commonCallService;
@Override
@Transactional(rollbackFor = Exception.class)
public Long add(UpdateLngBFeeDto dto) {
this.checkParams(dto);
UpdateLngBFeeDto res = DataLogTools.insert(dto);
@ -43,6 +45,7 @@ public class ExpenseNameServiceImpl extends ServiceImpl<LngBFeeMapper, LngBFee>
}
@Override
@Transactional(rollbackFor = Exception.class)
public Long update(UpdateLngBFeeDto dto) {
this.checkParams(dto);
UpdateLngBFeeDto res = DataLogTools.update(dto);
@ -52,6 +55,7 @@ public class ExpenseNameServiceImpl extends ServiceImpl<LngBFeeMapper, LngBFee>
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBBankDto.class,ids);
for (Long id : ids) {
@ -64,6 +68,7 @@ public class ExpenseNameServiceImpl extends ServiceImpl<LngBFeeMapper, LngBFee>
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBBankDto.class,ids);
for (Long id : ids) {

View File

@ -60,7 +60,8 @@ public class PipeGasDownloadPointServiceImpl extends ServiceImpl<LngBStationPngM
return res.getId();
}
@Override
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBStationPngDto.class,ids);
for (Long id : ids) {
@ -74,6 +75,7 @@ public class PipeGasDownloadPointServiceImpl extends ServiceImpl<LngBStationPngM
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBStationPngDto.class,ids);

View File

@ -61,7 +61,8 @@ public class PipelineGgasLineServiceImpl extends ServiceImpl<LngBPngLineMapper,
return res.getId();
}
@Override
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBPngLineDto.class,ids);
for (Long id : ids) {
@ -82,6 +83,7 @@ public class PipelineGgasLineServiceImpl extends ServiceImpl<LngBPngLineMapper,
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBPngLineDto.class,ids);

View File

@ -4,6 +4,7 @@ import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -35,6 +36,7 @@ public class TaxRateServiceImpl extends ServiceImpl<LngBTaxMapper, LngBTax> impl
private final CommonCallService commonCallService;
@Override
@Transactional(rollbackFor = Exception.class)
public Long add(UpdateLngBTaxDto dto) {
this.checkParams(dto);
UpdateLngBTaxDto res = DataLogTools.insert(dto);
@ -43,6 +45,7 @@ public class TaxRateServiceImpl extends ServiceImpl<LngBTaxMapper, LngBTax> impl
}
@Override
@Transactional(rollbackFor = Exception.class)
public Long update(UpdateLngBTaxDto dto) {
this.checkParams(dto);
UpdateLngBTaxDto res = DataLogTools.update(dto);
@ -52,6 +55,7 @@ public class TaxRateServiceImpl extends ServiceImpl<LngBTaxMapper, LngBTax> impl
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean enable(List<Long> ids) {
DataLogTools.enable(UpdateLngBTaxDto.class,ids);
for (Long id : ids) {
@ -64,6 +68,7 @@ public class TaxRateServiceImpl extends ServiceImpl<LngBTaxMapper, LngBTax> impl
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean disable(List<Long> ids) {
DataLogTools.disable(UpdateLngBBankDto.class,ids);
for (Long id : ids) {