|
@@ -94,16 +94,12 @@ public class ZAreaServiceImpl implements IZAreaService {
|
|
|
if (StringUtils.isNotEmpty(vo.getAreaName())) {
|
|
|
ZArea area = baseMapper.getByName(vo.getAreaName());
|
|
|
ZBuilding building = new ZBuilding();
|
|
|
- building.setSource("1");
|
|
|
ZUnit unit = new ZUnit();
|
|
|
- unit.setSource("1");
|
|
|
ZHouse house = new ZHouse();
|
|
|
- house.setSource("1");
|
|
|
if (ObjectUtils.isEmpty(area)) {
|
|
|
area = new ZArea();
|
|
|
//小区zDsZ1a2b3c4d%1234!
|
|
|
area.setName(vo.getAreaName());
|
|
|
- area.setSource("1");
|
|
|
area.setCreateBy(operName);
|
|
|
area.setCreateTime(new Date());
|
|
|
area.setDistrict(districtValue);
|
|
@@ -152,6 +148,14 @@ public class ZAreaServiceImpl implements IZAreaService {
|
|
|
throw new ServiceException("" + "第" + (n + 1) + "行格式错误,导入失败!");
|
|
|
}
|
|
|
} else if (isUpdateSupport) {
|
|
|
+ //小区zDsZ1a2b3c4d%1234!
|
|
|
+ area.setCreateBy(operName);
|
|
|
+ area.setCreateTime(new Date());
|
|
|
+ area.setDistrict(districtValue);
|
|
|
+ area.setSource(sourceValue);
|
|
|
+ area.setAdministrative(vo.getAdministrative());
|
|
|
+ area.setRenovationColumn("Y");
|
|
|
+ baseMapper.updateById(area);
|
|
|
if (StringUtils.isNotEmpty(vo.getBuildName())) {
|
|
|
building = zBuildingMapper.getByName(vo.getBuildName(), area.getId());
|
|
|
if (ObjectUtils.isEmpty(building)) {
|
|
@@ -193,6 +197,11 @@ public class ZAreaServiceImpl implements IZAreaService {
|
|
|
throw new ServiceException("" + "第" + (n + 1) + "行格式错误,导入失败!");
|
|
|
}
|
|
|
} else {
|
|
|
+ building.setAreaId(area.getId());
|
|
|
+ building.setUpdateBy(operName);
|
|
|
+ building.setUpdateTime(new Date());
|
|
|
+ building.setSource(sourceValue);
|
|
|
+ zBuildingMapper.updateById(building);
|
|
|
if (StringUtils.isNotEmpty(vo.getUnitName())) {
|
|
|
unit = zUnitMapper.getByName(vo.getUnitName(), building.getId());
|
|
|
if (ObjectUtils.isEmpty(unit)) {
|
|
@@ -223,6 +232,13 @@ public class ZAreaServiceImpl implements IZAreaService {
|
|
|
throw new ServiceException("" + "第" + (n + 1) + "行格式错误,导入失败!");
|
|
|
}
|
|
|
} else {
|
|
|
+ //单元
|
|
|
+ unit.setAreaId(area.getId());
|
|
|
+ unit.setBuildingId(building.getId());
|
|
|
+ unit.setUpdateBy(operName);
|
|
|
+ unit.setUpdateTime(new Date());
|
|
|
+ unit.setSource(sourceValue);
|
|
|
+ zUnitMapper.updateById(unit);
|
|
|
if (StringUtils.isNotEmpty(vo.getHouseName())) {
|
|
|
house = zHouseMapper.getByName(vo.getHouseName(), unit.getId());
|
|
|
if (ObjectUtils.isEmpty(house)) {
|
|
@@ -240,6 +256,18 @@ public class ZAreaServiceImpl implements IZAreaService {
|
|
|
house.setPhone(vo.getPhone());
|
|
|
zHouseMapper.insert(house);
|
|
|
successNum++;
|
|
|
+ }else{
|
|
|
+ //房屋
|
|
|
+ house.setAreaId(area.getId());
|
|
|
+ house.setBuildingId(building.getId());
|
|
|
+ house.setUnitId(unit.getId());
|
|
|
+ house.setUpdateBy(operName);
|
|
|
+ house.setUpdateTime(new Date());
|
|
|
+ house.setSource(sourceValue);
|
|
|
+ house.setHouseUserName(vo.getHouseUserName());
|
|
|
+ house.setIdCard(vo.getIdCard());
|
|
|
+ house.setPhone(vo.getPhone());
|
|
|
+ zHouseMapper.updateById(house);
|
|
|
}
|
|
|
} else {
|
|
|
throw new ServiceException("" + "第" + (n + 1) + "行格式错误,导入失败!");
|
|
@@ -297,6 +325,9 @@ public class ZAreaServiceImpl implements IZAreaService {
|
|
|
public TableDataInfo<ZAreaVo> queryPageList(ZAreaBo bo, PageQuery pageQuery) {
|
|
|
LambdaQueryWrapper<ZArea> lqw = buildQueryWrapper(bo);
|
|
|
Page<ZAreaVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
+ for (ZAreaVo vo:result.getRecords()) {
|
|
|
+ vo.setSource(zHouseMapper.getAreaSourceString("area_id",vo.getId()));
|
|
|
+ }
|
|
|
return TableDataInfo.build(result);
|
|
|
}
|
|
|
|