Commit ab8567a5 authored by lixuan's avatar lixuan

Merge branch 'dev-lx' into dev

parents b40fbf64 7036438f
Pipeline #144863 failed with stages
in 28 minutes and 38 seconds
......@@ -81,8 +81,8 @@ public class HouseResourceController {
}
@PostMapping("/saveYearTax")
public AjaxResult postSaveYearTax(@RequestBody List<YearTaxSaveUpdateDto> dtos) {
houseResourceService.saveYearTax(dtos);
public AjaxResult postSaveYearTax(@RequestBody YearTaxSaveUpdateDto dto) {
houseResourceService.saveYearTax(dto);
return AjaxResult.success();
}
}
......@@ -7,6 +7,8 @@ import java.math.BigDecimal;
@Data
public class YearTaxSaveUpdateDto {
private String id;
private String businessEntityInfoId;
private Integer year;
......
......@@ -30,5 +30,5 @@ public interface HouseResourceService {
PageBusinessEntityStatisticsDetail pageBusinessEntityStatistics(PageBusinessEntityStatisticsQuery query);
void saveYearTax(List<YearTaxSaveUpdateDto> dtos);
void saveYearTax(YearTaxSaveUpdateDto dto);
}
......@@ -436,8 +436,16 @@ public class HouseResourceServiceImpl implements HouseResourceService {
}
@Override
public void saveYearTax(List<YearTaxSaveUpdateDto> dtos) {
for (YearTaxSaveUpdateDto dto : dtos) {
@Transactional(rollbackFor = Exception.class)
public void saveYearTax(YearTaxSaveUpdateDto dto) {
if (Objects.nonNull(dto.getId())) {
BusinessEntitySell existingSell = businessEntitySellMapper.selectBusinessEntitySellById(dto.getId());
if (existingSell == null) {
throw new RuntimeException("未找到对应的记录");
}
BeanUtils.copyProperties(dto, existingSell);
businessEntitySellMapper.updateBusinessEntitySell(existingSell);
} else {
BusinessEntitySell businessEntitySell = new BusinessEntitySell();
BeanUtils.copyProperties(dto, businessEntitySell);
businessEntitySell.setId(UUID.randomUUID().toString().replaceAll("-", ""));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment