|
|
@ -44,10 +44,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.CustomerGridConstant; |
|
|
|
import com.epmet.constants.ImportTaskConstants; |
|
|
|
import com.epmet.dao.CustomerGridDao; |
|
|
|
import com.epmet.dao.IcBuildingDao; |
|
|
|
import com.epmet.dao.IcNeighborHoodDao; |
|
|
|
import com.epmet.dao.IcPropertyManagementDao; |
|
|
|
import com.epmet.dao.*; |
|
|
|
import com.epmet.dto.*; |
|
|
|
import com.epmet.dto.form.IcNeighborHoodAddFormDTO; |
|
|
|
import com.epmet.dto.form.ImportInfoFormDTO; |
|
|
@ -121,6 +118,10 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao |
|
|
|
private OssFeignClient ossFeignClient; |
|
|
|
@Autowired |
|
|
|
private ExecutorService executorService; |
|
|
|
@Autowired |
|
|
|
private IcBuildingUnitDao icBuildingUnitDao; |
|
|
|
@Autowired |
|
|
|
private IcHouseDao icHouseDao; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<IcNeighborHoodDTO> page(Map<String, Object> params) { |
|
|
@ -598,7 +599,22 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao |
|
|
|
info.setBuildingExistStatus(true); |
|
|
|
if (info.getBuildingUpdateStatus()){ |
|
|
|
if (info.getTotalUnitNum() < building.getTotalUnitNum()){ |
|
|
|
info.setBuildingUnitNumStatus(true); |
|
|
|
/** |
|
|
|
* 需求变动 |
|
|
|
* 单元数可以修改变小,先去校验,单元下存在房屋就报错,不存在,删除对应单元,更新楼栋单元数 |
|
|
|
* 校验规则,单元号倒序,校验(原来的单元数 - 现在单元数)个单元下是不是存在房屋,存在房屋不能更新 |
|
|
|
*/ |
|
|
|
Integer size = building.getTotalUnitNum() - info.getTotalUnitNum(); |
|
|
|
List<String> ids = icBuildingUnitDao.getUnitIdByBuildingId(building.getId(), size); |
|
|
|
if (!org.springframework.util.CollectionUtils.isEmpty(ids)){ |
|
|
|
Integer houseCount = icHouseDao.getHouseCountByUnitIds(ids); |
|
|
|
if (houseCount.compareTo(NumConstant.ZERO) != NumConstant.ZERO){ |
|
|
|
info.setBuildingUnitNumStatus(true); |
|
|
|
}else { |
|
|
|
icBuildingUnitDao.delUnit(ids); |
|
|
|
icBuildingService.updateBuilding(info); |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
info.setBuildingId(building.getId()); |
|
|
|
icBuildingService.updateBuilding(info); |
|
|
|