后台运行区域初始化工作,处理实体类中null的问题

This commit is contained in:
TS-QD1 2023-11-24 18:34:11 +08:00
parent c4882be424
commit 024e5ab280
5 changed files with 54 additions and 45 deletions

View File

@ -139,13 +139,13 @@ public class PopulationController extends AbstractController {
@GetMapping("findHouse")
public SuccessResultList<List<PopulationDTO>> findHouse(ListPage page) {
Map<String, Object> params = requestParams();
if(null == params.get("keywords")) {
try {
throw new SearchException("身份证号/手机号/姓名不能为空");
} catch (SearchException e) {
e.printStackTrace();
}
}
// if(null == params.get("keywords")) {
// try {
// throw new SearchException("身份证号/手机号/姓名不能为空");
// } catch (SearchException e) {
// e.printStackTrace();
// }
// }
page.setParams(params);
return populationService.findHouse(page);
}

View File

@ -95,7 +95,7 @@ public class PopulationInfoBaseDTO {
}
public String getHealthStatus() {
return healthStatus;
return healthStatus == null ? "" : healthStatus;
}
public void setHealthStatus(String healthStatus) {
@ -125,6 +125,9 @@ public class PopulationInfoBaseDTO {
}
public Integer getAge() {
if (StringUtils.isBlank(this.getBirthday())) {
return 0;
}
LocalDate birthDate = LocalDate.parse(this.birthday);
Period period = Period.between(birthDate, LocalDate.now());
return period.getYears();

View File

@ -31,6 +31,7 @@ public class AreaUtils {
@PostConstruct
public void init() {
new Thread(() -> {
PopulationInfoStaticService = PopulationInfoService;
initArea0();
initArea1();
@ -42,6 +43,7 @@ public class AreaUtils {
aree.put(2, area2);
aree.put(3, area3);
aree.put(4, area4);
}).start();
}
public List<AreaZtreeDTO> getList(String id) {

View File

@ -407,12 +407,16 @@
var renderMain = function() {
var main = '';
$.each(data.floors, function(index, item) {
var units = '';
$.each(item.units, function(jndex, jtem) {
var houses = '';
if(jtem.houses.length > data.units[jndex].maxHouseCount) {
data.units[jndex].maxHouseCount = jtem.houses.length;
}
});
});
$.each(data.floors, function(index, item) {
var units = '';
$.each(item.units, function(jndex, jtem) {
var houses = '';
$.each(jtem.houses, function(kndex, ktem) {
var option = ktem.isCreator === 1 ? `
<div class="option">