|
@ -15,6 +15,7 @@ import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.dto.IcHouseDTO; |
|
|
import com.epmet.dto.IcHouseDTO; |
|
|
import com.epmet.dto.result.HouseInfoDTO; |
|
|
import com.epmet.dto.result.HouseInfoDTO; |
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
|
|
|
import com.epmet.plugin.commons.utils.NumUtils; |
|
|
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.dto.axis.form.PowerKernelHouseFormDTO; |
|
|
import com.epmet.plugin.power.dto.axis.form.PowerKernelHouseHoldViewListFormDTO; |
|
|
import com.epmet.plugin.power.dto.axis.form.PowerKernelHouseHoldViewListFormDTO; |
|
@ -24,14 +25,15 @@ import com.epmet.plugin.power.dto.axis.result.PowerKernelListPostitionResultDTO; |
|
|
import com.epmet.plugin.power.dto.axis.result.PowerkernelMemberListResultDTO; |
|
|
import com.epmet.plugin.power.dto.axis.result.PowerkernelMemberListResultDTO; |
|
|
import com.epmet.plugin.power.modules.axis.dao.PowerKernelHouseholdDao; |
|
|
import com.epmet.plugin.power.modules.axis.dao.PowerKernelHouseholdDao; |
|
|
import com.epmet.plugin.power.modules.axis.entity.PowerKernelHouseholdEntity; |
|
|
import com.epmet.plugin.power.modules.axis.entity.PowerKernelHouseholdEntity; |
|
|
|
|
|
import com.epmet.plugin.power.modules.axis.service.PowerAxisStructService; |
|
|
import com.epmet.plugin.power.modules.axis.service.PowerKernelHouseholdService; |
|
|
import com.epmet.plugin.power.modules.axis.service.PowerKernelHouseholdService; |
|
|
import com.google.common.collect.Sets; |
|
|
import com.google.common.collect.Sets; |
|
|
|
|
|
import org.apache.commons.compress.utils.Lists; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import javax.validation.constraints.NotBlank; |
|
|
|
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigDecimal; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
@ -54,6 +56,9 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl<PowerKernel |
|
|
@Autowired |
|
|
@Autowired |
|
|
private PowerKernelHouseholdService powerKernelHouseholdService; |
|
|
private PowerKernelHouseholdService powerKernelHouseholdService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private PowerAxisStructService powerAxisStructService; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageData<PowerKernelHouseholdDTO> page(Map<String, Object> params) { |
|
|
public PageData<PowerKernelHouseholdDTO> page(Map<String, Object> params) { |
|
|
|
|
|
|
|
@ -123,8 +128,12 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl<PowerKernel |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public List<PowerKernelHouseHoldViewListResultDTO> getList(PowerKernelHouseHoldViewListFormDTO form) { |
|
|
public List<PowerKernelHouseHoldViewListResultDTO> getList(PowerKernelHouseHoldViewListFormDTO form) { |
|
|
form.setPageNo((form.getPageNo() - 1) * form.getPageSize()); |
|
|
String axisStructId = powerAxisStructService.getRootAxisStructId(form.getAxisStructId(), form.getCustomerId(), form.getAgencyId()); |
|
|
form.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
if (StringUtils.isBlank(axisStructId)) { |
|
|
|
|
|
return Lists.newArrayList(); |
|
|
|
|
|
} |
|
|
|
|
|
form.setAxisStructId(axisStructId); |
|
|
|
|
|
form.setPageNo((form.getPageNo() - NumConstant.ONE) * form.getPageSize()); |
|
|
List<PowerKernelHouseHoldViewListResultDTO> list = baseDao.getList(form); |
|
|
List<PowerKernelHouseHoldViewListResultDTO> list = baseDao.getList(form); |
|
|
for (PowerKernelHouseHoldViewListResultDTO dto : list) { |
|
|
for (PowerKernelHouseHoldViewListResultDTO dto : list) { |
|
|
List<String> nameList = dto.getKernelMemberList().stream().map(PowerkernelMemberListResultDTO::getKernelMemberName).distinct().collect(Collectors.toList()); |
|
|
List<String> nameList = dto.getKernelMemberList().stream().map(PowerkernelMemberListResultDTO::getKernelMemberName).distinct().collect(Collectors.toList()); |
|
@ -135,22 +144,17 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl<PowerKernel |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public long getTotal(PowerKernelHouseHoldViewListFormDTO form) { |
|
|
public long getTotal(PowerKernelHouseHoldViewListFormDTO form) { |
|
|
form.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
|
|
|
|
|
return baseDao.getTotal(form); |
|
|
return baseDao.getTotal(form); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<PowerKernelListPostitionResultDTO> getListPosition(PowerKernelListPostitionFormDTO form) { |
|
|
public List<PowerKernelListPostitionResultDTO> getListPosition(PowerKernelListPostitionFormDTO form) { |
|
|
Integer limit = form.getLimit(); |
|
|
String customerId = form.getCustomerId(); |
|
|
if (null == limit || NumConstant.ZERO_L == limit) { |
|
|
String axisStructId = powerAxisStructService.getRootAxisStructId(form.getAxisStructId(), customerId, form.getAgencyId()); |
|
|
limit = 999; |
|
|
|
|
|
} |
|
|
|
|
|
String axisStructId = form.getAxisStructId(); |
|
|
|
|
|
if (StringUtils.isBlank(axisStructId)) { |
|
|
if (StringUtils.isBlank(axisStructId)) { |
|
|
String agencyId = form.getAgencyId(); |
|
|
return Lists.newArrayList(); |
|
|
axisStructId = baseDao.queryAxisStructId(agencyId,form.getCustomerId()); |
|
|
|
|
|
} |
|
|
} |
|
|
return baseDao.queryListPosition(axisStructId, form.getCustomerId(), limit); |
|
|
return baseDao.queryListPosition(axisStructId, customerId, NumUtils.getNumberInt(form.getLimit(), true, NumUtils.ONE_THOUSAND)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|