Commit 479eb3be authored by lixuan's avatar lixuan

Merge branch 'dev'

# Conflicts:
#	ruoyi-admin/src/main/java/com/ruoyi/web/controller/house/HouseResourceController.java
#	ruoyi-system/src/main/java/com/ruoyi/system/domain/house/vo/YearTaxSaveUpdateDto.java
#	ruoyi-system/src/main/java/com/ruoyi/system/service/house/HouseResourceService.java
#	ruoyi-system/src/main/java/com/ruoyi/system/service/house/impl/HouseResourceServiceImpl.java
parents 5f597353 ab8567a5
Pipeline #144864 failed with stages
in 7 minutes and 7 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