Commit 5ce36519 authored by lixuan's avatar lixuan

feat: 房源

parent e752ea69
...@@ -117,7 +117,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -117,7 +117,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/api/party/**","/api/grid/screen/party/**").permitAll() .antMatchers("/api/party/**","/api/grid/screen/party/**").permitAll()
// 静态资源,可匿名访问downloadTemplate // 静态资源,可匿名访问downloadTemplate
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**", "/doc.html").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**", "/doc.html", "/api/house/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证 // 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated() .anyRequest().authenticated()
.and() .and()
......
...@@ -34,5 +34,5 @@ public interface HouseResourceMapper { ...@@ -34,5 +34,5 @@ public interface HouseResourceMapper {
List<HouseResourcePage> selectForContrast(@Param("two") String two, @Param("name") String name); List<HouseResourcePage> selectForContrast(@Param("two") String two, @Param("name") String name);
List<HouseResourcePage> selectByIdList(List<String> idList); List<HouseResourcePage> selectByIdList(@Param("idList") List<String> idList);
} }
...@@ -88,19 +88,12 @@ public class HouseResourceServiceImpl implements HouseResourceService { ...@@ -88,19 +88,12 @@ public class HouseResourceServiceImpl implements HouseResourceService {
throw new RuntimeException("年份 " + entry.getKey() + " 只能有一条销售数据"); throw new RuntimeException("年份 " + entry.getKey() + " 只能有一条销售数据");
} }
} }
businessEntitySellMapper.deleteBusinessEntitySellByEntityId(businessEntityInfoId);
for (BusinessEntitySell businessEntitySell : businessEntityDto.getBusinessEntitySells()) { for (BusinessEntitySell businessEntitySell : businessEntityDto.getBusinessEntitySells()) {
if (StringUtils.hasText(businessEntitySell.getId())) { businessEntitySell.setId(UUID.randomUUID().toString().replaceAll("-", ""));
BusinessEntitySell existSell = businessEntitySellMapper.selectBusinessEntitySellById(businessEntitySell.getId()); businessEntitySell.setBusinessEntityInfoId(businessEntityInfoId);
if (Objects.isNull(existSell)) { businessEntitySellMapper.insertBusinessEntitySell(businessEntitySell);
throw new RuntimeException("未找到对应的销售记录: " + businessEntitySell.getId());
}
BeanUtils.copyProperties(businessEntitySell, existSell);
businessEntitySellMapper.updateBusinessEntitySell(existSell);
} else {
businessEntitySell.setId(UUID.randomUUID().toString().replaceAll("-", ""));
businessEntitySell.setBusinessEntityInfoId(businessEntityInfoId);
businessEntitySellMapper.insertBusinessEntitySell(businessEntitySell);
}
} }
} }
} }
...@@ -195,19 +188,11 @@ public class HouseResourceServiceImpl implements HouseResourceService { ...@@ -195,19 +188,11 @@ public class HouseResourceServiceImpl implements HouseResourceService {
} }
} }
businessEntitySellMapper.deleteBusinessEntitySellByEntityId(businessEntityInfoId);
for (BusinessEntitySell businessEntitySell : businessEntityDto.getBusinessEntitySells()) { for (BusinessEntitySell businessEntitySell : businessEntityDto.getBusinessEntitySells()) {
if (StringUtils.hasText(businessEntitySell.getId())) { businessEntitySell.setId(UUID.randomUUID().toString().replaceAll("-", ""));
BusinessEntitySell existSell = businessEntitySellMapper.selectBusinessEntitySellById(businessEntitySell.getId()); businessEntitySell.setBusinessEntityInfoId(businessEntityInfoId);
if (existSell == null) { businessEntitySellMapper.insertBusinessEntitySell(businessEntitySell);
throw new RuntimeException("未找到对应的销售记录: " + businessEntitySell.getId());
}
BeanUtils.copyProperties(businessEntitySell, existSell);
businessEntitySellMapper.updateBusinessEntitySell(existSell);
} else {
businessEntitySell.setId(UUID.randomUUID().toString().replaceAll("-", ""));
businessEntitySell.setBusinessEntityInfoId(businessEntityInfoId);
businessEntitySellMapper.insertBusinessEntitySell(businessEntitySell);
}
} }
} }
} }
......
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