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 { ...@@ -81,8 +81,8 @@ public class HouseResourceController {
} }
@PostMapping("/saveYearTax") @PostMapping("/saveYearTax")
public AjaxResult postSaveYearTax(@RequestBody List<YearTaxSaveUpdateDto> dtos) { public AjaxResult postSaveYearTax(@RequestBody YearTaxSaveUpdateDto dto) {
houseResourceService.saveYearTax(dtos); houseResourceService.saveYearTax(dto);
return AjaxResult.success(); return AjaxResult.success();
} }
} }
...@@ -7,6 +7,8 @@ import java.math.BigDecimal; ...@@ -7,6 +7,8 @@ import java.math.BigDecimal;
@Data @Data
public class YearTaxSaveUpdateDto { public class YearTaxSaveUpdateDto {
private String id;
private String businessEntityInfoId; private String businessEntityInfoId;
private Integer year; private Integer year;
......
...@@ -30,5 +30,5 @@ public interface HouseResourceService { ...@@ -30,5 +30,5 @@ public interface HouseResourceService {
PageBusinessEntityStatisticsDetail pageBusinessEntityStatistics(PageBusinessEntityStatisticsQuery query); PageBusinessEntityStatisticsDetail pageBusinessEntityStatistics(PageBusinessEntityStatisticsQuery query);
void saveYearTax(List<YearTaxSaveUpdateDto> dtos); void saveYearTax(YearTaxSaveUpdateDto dto);
} }
...@@ -436,8 +436,16 @@ public class HouseResourceServiceImpl implements HouseResourceService { ...@@ -436,8 +436,16 @@ public class HouseResourceServiceImpl implements HouseResourceService {
} }
@Override @Override
public void saveYearTax(List<YearTaxSaveUpdateDto> dtos) { @Transactional(rollbackFor = Exception.class)
for (YearTaxSaveUpdateDto dto : dtos) { 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(); BusinessEntitySell businessEntitySell = new BusinessEntitySell();
BeanUtils.copyProperties(dto, businessEntitySell); BeanUtils.copyProperties(dto, businessEntitySell);
businessEntitySell.setId(UUID.randomUUID().toString().replaceAll("-", "")); 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