From e557ae3f3046f77805f490219ea447eebcd7355d Mon Sep 17 00:00:00 2001
From: yanghui <2536613402@qq.com>
Date: 星期四, 10 十一月 2022 17:02:48 +0800
Subject: [PATCH] #feat 商品接口提交
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationHouseServiceImpl.java | 48 ++++++++++++++++++++++++++++++------------------
1 files changed, 30 insertions(+), 18 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationHouseServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationHouseServiceImpl.java
index dfd229c..30b810c 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationHouseServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationHouseServiceImpl.java
@@ -9,6 +9,7 @@
import javax.annotation.Resource;
import com.panzhihua.common.model.dtos.community.ComMngPopulationHouseInsertAdminDTO;
+import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.service.ComMngPopulationHouseUserService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -98,9 +99,8 @@
cascadeHouseVOList = this.baseMapper.getHouseLevelByAlley(cascadeHouseDTO.getCommunityId(),
cascadeHouseDTO.getVillageId());
cascadeHouseVOList = cascadeHouseVOList.stream()
- .collect(Collectors.collectingAndThen(
- Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getAlley()))),
- ArrayList::new));
+ .collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
+ Comparator.comparing(ComMngCascadeHouseVO::getAlley))),ArrayList::new));
cascadeHouseVOList.forEach(cascade -> {
cascade.setName(cascade.getAlley());
});
@@ -116,7 +116,7 @@
() -> new TreeSet<>(Comparator.comparing(o -> o.getAlley() + ";" + o.getHouseNum()))),
ArrayList::new));
cascadeHouseVOList.forEach(cascade -> {
- cascade.setName(cascade.getHouseNum());
+ cascade.setName(cascade.getHouseNum()+"("+cascade.getName()+")");
});
}
break;
@@ -434,8 +434,8 @@
// subordinateList =
// subordinateList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new
// TreeSet<>(Comparator.comparing(o -> o.getFloor()))), ArrayList::new));
- subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getFloor))
- .collect(Collectors.toList());
+// subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getFloor))
+// .collect(Collectors.toList());
subordinateList.forEach(cascade -> {
if (cascade.getFloor().contains("栋")) {
cascade.setName(cascade.getFloor());
@@ -448,8 +448,8 @@
if (houseDO != null) {
subordinateList =
this.baseMapper.getHouseLevelByUnitNos(houseDO.getVillageId(), houseDO.getFloor());
- subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getUnitNo))
- .collect(Collectors.toList());
+// subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getUnitNo))
+// .collect(Collectors.toList());
// subordinateList =
// subordinateList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new
// TreeSet<>(Comparator.comparing(o -> o.getUnitNo()))), ArrayList::new));
@@ -466,8 +466,8 @@
if (houseDO != null) {
subordinateList = this.baseMapper.getHouseLevelByHouseNos(houseDO.getVillageId(),
houseDO.getFloor(), houseDO.getUnitNo());
- subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getHouseNo))
- .collect(Collectors.toList());
+// subordinateList = subordinateList.stream().filter(distinctByKey(ComMngSubordinateVO::getHouseNo))
+// .collect(Collectors.toList());
// subordinateList =
// subordinateList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new
// TreeSet<>(Comparator.comparing(o -> o.getHouseNo()))), ArrayList::new));
@@ -544,6 +544,10 @@
}
}
+ /**
+ * 实有房屋数据修复定时任务
+ * @return 实有房屋数据修复定时任务
+ */
@Override
@Transactional
public R timedTaskHouseJobHandler(){
@@ -576,23 +580,31 @@
//查询该房屋下人员的关联信息的关系
for (ComMngPopulationHouseUserDO houseUser : houseUserList) {
population = comMngPopulationDAO.selectById(houseUser.getPopulId());
- if(population.getIsRent().equals(ComMngPopulationDO.isOk.yes)){
- houseUser.setRelationId(ComMngPopulationHouseUserDO.relationId.zuhu);
- }else {
- houseUser.setRelationId(ComMngPopulationHouseUserDO.relationId.zuzhu);
+ if(population != null){
+ if(population.getIsRent() != null && population.getIsRent().equals(ComMngPopulationDO.isOk.yes)){
+ houseUser.setRelationId(ComMngPopulationHouseUserDO.relationId.zuhu);
+ }else {
+ houseUser.setRelationId(ComMngPopulationHouseUserDO.relationId.zuzhu);
+ }
+ updateHouseUserList.add(houseUser);
}
- updateHouseUserList.add(houseUser);
}
}
//查看房子的楼层排序
- if(house.getFloorNum() == null){
+ if(house.getFloorNum() == null && StringUtils.isNotEmpty(house.getHouseNo())){
boolean result = house.getHouseNo().matches("[0-9]+");
if (result) {// 该字段为纯数字
if (house.getHouseNo().length() == 4) {
- house.setFloorNum(Integer.parseInt(house.getHouseNo().substring(0, 2).replaceAll("^(0+)", "")));
+ String floorNum = house.getHouseNo().substring(0, 2).replaceAll("^(0+)", "");
+ if(StringUtils.isNotEmpty(floorNum)){
+ house.setFloorNum(Integer.parseInt(floorNum));
+ }
} else if (house.getHouseNo().length() == 3) {
- house.setFloorNum(Integer.parseInt(house.getHouseNo().substring(0, 1).replaceAll("^(0+)", "")));
+ String floorNum = house.getHouseNo().substring(0, 1).replaceAll("^(0+)", "");
+ if(StringUtils.isNotEmpty(floorNum)){
+ house.setFloorNum(Integer.parseInt(floorNum));
+ }
}
}
}
--
Gitblit v1.7.1