|
@ -11,16 +11,20 @@ import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
import com.epmet.commons.tools.validator.group.AddGroup; |
|
|
import com.epmet.commons.tools.validator.group.AddGroup; |
|
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|
|
|
|
|
import com.epmet.dto.IcHouseDTO; |
|
|
|
|
|
import com.epmet.dto.result.HouseInfoDTO; |
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
import com.epmet.plugin.power.dto.axis.PowerKernelHouseholdDTO; |
|
|
import com.epmet.plugin.power.dto.axis.PowerKernelHouseholdDTO; |
|
|
|
|
|
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.excel.PowerKernelHouseholdExcel; |
|
|
import com.epmet.plugin.power.modules.axis.service.PowerKernelHouseholdService; |
|
|
import com.epmet.plugin.power.modules.axis.service.PowerKernelHouseholdService; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import java.util.List; |
|
|
import java.math.BigDecimal; |
|
|
import java.util.Map; |
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -86,5 +90,29 @@ public class PowerKernelHouseholdController { |
|
|
ExcelUtils.exportExcelToTarget(response, null, list, PowerKernelHouseholdExcel.class); |
|
|
ExcelUtils.exportExcelToTarget(response, null, list, PowerKernelHouseholdExcel.class); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 为节点绑定党员中心户 |
|
|
|
|
|
*/ |
|
|
|
|
|
@PostMapping("/bind") |
|
|
|
|
|
public Result Bind(@RequestBody PowerKernelHouseFormDTO form){ |
|
|
|
|
|
String customerId = loginUserUtil.getLoginUserCustomerId(); |
|
|
|
|
|
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()); |
|
|
|
|
|
powerKernelHouseholdService.insert(entity); |
|
|
|
|
|
} |
|
|
|
|
|
return new Result(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|