|
|
@ -19,6 +19,7 @@ import com.epmet.plugin.power.dto.axis.form.PowerKernelHouseFormDTO; |
|
|
|
import com.epmet.plugin.power.modules.axis.entity.PowerKernelHouseholdEntity; |
|
|
|
import com.epmet.plugin.power.modules.axis.excel.PowerKernelHouseholdExcel; |
|
|
|
import com.epmet.plugin.power.modules.axis.service.PowerKernelHouseholdService; |
|
|
|
import org.apache.commons.compress.utils.Lists; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
@ -99,17 +100,29 @@ public class PowerKernelHouseholdController { |
|
|
|
Set<String> houseIds = new HashSet<>(); |
|
|
|
Collections.addAll(houseIds,form.getHouseIdList()); |
|
|
|
Result<List<HouseInfoDTO>> listResult = govOrgOpenFeignClient.queryListHouseInfo(houseIds, customerId); |
|
|
|
|
|
|
|
// Result<IcHouseDTO> icHouseDTOResult = govOrgOpenFeignClient.get(form.getAxisStructId());
|
|
|
|
|
|
|
|
for (HouseInfoDTO dto: listResult.getData()) { |
|
|
|
PowerKernelHouseholdEntity entity = new PowerKernelHouseholdEntity(); |
|
|
|
entity.setCustomerId(dto.getCustomerId()); |
|
|
|
BigDecimal Latitude = new BigDecimal(dto.getBuildingLatitude()); |
|
|
|
BigDecimal Longitude = new BigDecimal(dto.getBuildingLongitude()); |
|
|
|
entity.setLatitude(Latitude); |
|
|
|
entity.setLongitude(Longitude); |
|
|
|
entity.setAddress(dto.getAllName()); |
|
|
|
if(!listResult.success()){ |
|
|
|
return listResult; |
|
|
|
} |
|
|
|
List<HouseInfoDTO> houseList = listResult.getData(); |
|
|
|
List<PowerKernelHouseholdEntity> list = Lists.newArrayList(); |
|
|
|
PowerKernelHouseholdEntity entity; |
|
|
|
|
|
|
|
for(HouseInfoDTO houseInfo : houseList){ |
|
|
|
Result<IcHouseDTO> icHouseDTOResult = govOrgOpenFeignClient.get(houseInfo.getHomeId()); |
|
|
|
if(!icHouseDTOResult.success()){ |
|
|
|
continue ; |
|
|
|
} |
|
|
|
IcHouseDTO houseDto = icHouseDTOResult.getData(); |
|
|
|
entity = new PowerKernelHouseholdEntity(); |
|
|
|
entity.setHouseId(houseInfo.getHomeId()); |
|
|
|
entity.setLongitude(new BigDecimal(houseInfo.getBuildingLongitude())); |
|
|
|
entity.setLatitude(new BigDecimal(houseInfo.getBuildingLatitude())); |
|
|
|
entity.setAddress(houseInfo.getAllName()); |
|
|
|
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
|
|
|
|
|
entity.setOwnerPhone(houseDto.getOwnerPhone()); |
|
|
|
entity.setOwnerIdCard(houseDto.getOwnerIdCard()); |
|
|
|
entity.setOwnerName(houseDto.getOwnerName()); |
|
|
|
powerKernelHouseholdService.insert(entity); |
|
|
|
} |
|
|
|
return new Result(); |
|
|
|