|
@ -9,13 +9,11 @@ import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.dao.IcIndividualCategoryManageDao; |
|
|
import com.epmet.dao.IcIndividualCategoryManageDao; |
|
|
import com.epmet.dto.IcResiCategoryStatsConfigDTO; |
|
|
import com.epmet.dto.IcResiCategoryStatsConfigDTO; |
|
|
|
|
|
import com.epmet.dto.form.CategoryCountListFormDTO; |
|
|
import com.epmet.dto.form.EditIndividualCategoryFormDTO; |
|
|
import com.epmet.dto.form.EditIndividualCategoryFormDTO; |
|
|
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; |
|
|
import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; |
|
|
import com.epmet.dto.form.StatsResiListFormDTO; |
|
|
import com.epmet.dto.form.StatsResiListFormDTO; |
|
|
import com.epmet.dto.result.IcStatsResiResultDTO; |
|
|
import com.epmet.dto.result.*; |
|
|
import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; |
|
|
|
|
|
import com.epmet.dto.result.IndividualCategoryAllListResultDTO; |
|
|
|
|
|
import com.epmet.dto.result.IndividualCategoryListResultDTO; |
|
|
|
|
|
import com.epmet.entity.IcIndividualCategoryManageEntity; |
|
|
import com.epmet.entity.IcIndividualCategoryManageEntity; |
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.feign.OperCustomizeOpenFeignClient; |
|
|
import com.epmet.feign.OperCustomizeOpenFeignClient; |
|
@ -27,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 个人分类管理 |
|
|
* 个人分类管理 |
|
@ -54,27 +53,22 @@ public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl<IcInd |
|
|
if (null == staffInfo){ |
|
|
if (null == staffInfo){ |
|
|
throw new EpmetException(String.format("查询工作人员%s信息失败...",tokenDto.getUserId())); |
|
|
throw new EpmetException(String.format("查询工作人员%s信息失败...",tokenDto.getUserId())); |
|
|
} |
|
|
} |
|
|
StatsResiListFormDTO formDTO = new StatsResiListFormDTO(); |
|
|
|
|
|
formDTO.setId(staffInfo.getAgencyId()); |
|
|
|
|
|
formDTO.setLevel("agency"); |
|
|
|
|
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
|
|
Result<List<IcStatsResiResultDTO>> list = userOpenFeignClient.getPersonCategoryList(formDTO); |
|
|
|
|
|
if (!list.success()){ |
|
|
|
|
|
throw new EpmetException("查询人员分类下人数失败..."); |
|
|
|
|
|
} |
|
|
|
|
|
List<IcStatsResiResultDTO> datas = list.getData(); |
|
|
|
|
|
List<IndividualCategoryListResultDTO> result = baseDao.individualCategoryList(tokenDto.getUserId()); |
|
|
List<IndividualCategoryListResultDTO> result = baseDao.individualCategoryList(tokenDto.getUserId()); |
|
|
if (CollectionUtils.isNotEmpty(datas) && CollectionUtils.isNotEmpty(result)){ |
|
|
|
|
|
result.forEach( r -> datas.stream().filter( d -> d.getId().equals(r.getId())).forEach(d -> r.setCount(d.getCount()))); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
if (CollectionUtils.isEmpty(datas) && CollectionUtils.isNotEmpty(result)){ |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
if (CollectionUtils.isEmpty(result)){ |
|
|
if (CollectionUtils.isEmpty(result)){ |
|
|
return new ArrayList<>(); |
|
|
return new ArrayList<>(); |
|
|
} |
|
|
} |
|
|
return new ArrayList<>(); |
|
|
CategoryCountListFormDTO formDTO = new CategoryCountListFormDTO(); |
|
|
|
|
|
formDTO.setConfigList(result.stream().map(m -> m.getWarnConfigId()).collect(Collectors.toList())); |
|
|
|
|
|
formDTO.setOrgId(staffInfo.getAgencyId()); |
|
|
|
|
|
Result<List<CategoryCountListResultDTO>> list = userOpenFeignClient.getPersonCategoryList(formDTO); |
|
|
|
|
|
if (!list.success()){ |
|
|
|
|
|
throw new EpmetException("查询人员分类下人数失败..."); |
|
|
|
|
|
} |
|
|
|
|
|
List<CategoryCountListResultDTO> datas = list.getData(); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(datas)){ |
|
|
|
|
|
result.forEach( r -> datas.stream().filter( d -> d.getConfigId().equals(r.getId())).forEach(d -> r.setCount(d.getCount()))); |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|