|
@ -603,7 +603,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa |
|
|
PageHelper.startPage(form.getPageNo(), form.getPageSize()); |
|
|
PageHelper.startPage(form.getPageNo(), form.getPageSize()); |
|
|
List<PartyUnitListbrieResultDTO> dto = baseDao.getListbrief(form, tokenDto.getCustomerId()); |
|
|
List<PartyUnitListbrieResultDTO> dto = baseDao.getListbrief(form, tokenDto.getCustomerId()); |
|
|
// 获取gridName
|
|
|
// 获取gridName
|
|
|
for (PartyUnitListbrieResultDTO item:dto) { |
|
|
for (PartyUnitListbrieResultDTO item : dto) { |
|
|
if (StringUtils.isNotEmpty(item.getGridId())) { |
|
|
if (StringUtils.isNotEmpty(item.getGridId())) { |
|
|
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); |
|
|
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); |
|
|
if (null != gridInfo) { |
|
|
if (null != gridInfo) { |
|
@ -617,15 +617,28 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<PartyTypepercentResultDTO> getTypepercent(PartyTypepercentFormDTO form) { |
|
|
public List<PartyTypepercentResultDTO> getTypepercent(PartyTypepercentFormDTO form) { |
|
|
List<PartyTypepercentResultDTO> dto = baseDao.getTypepercent(form.getAgencyId()); |
|
|
|
|
|
int total = 0; |
|
|
DictListFormDTO dictFromDTO = new DictListFormDTO(); |
|
|
for (PartyTypepercentResultDTO item : dto) { |
|
|
dictFromDTO.setDictType(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); |
|
|
total = Integer.parseInt(item.getValue()) + total; |
|
|
Result<List<DictListResultDTO>> dictResult = epmetAdminOpenFeignClient.dictList(dictFromDTO); |
|
|
} |
|
|
if (!dictResult.success()) { |
|
|
for (PartyTypepercentResultDTO item : dto) { |
|
|
throw new EpmetException(dictResult.getCode()); |
|
|
item.setPercent((Integer.parseInt(item.getValue()) * 100) / total + "%"); |
|
|
|
|
|
} |
|
|
} |
|
|
return dto; |
|
|
|
|
|
|
|
|
List<PartyTypepercentResultDTO> result = baseDao.getTypepercent(form.getAgencyId()); |
|
|
|
|
|
Map<String, Integer> map = result.stream().collect(Collectors.toMap(PartyTypepercentResultDTO::getCode, PartyTypepercentResultDTO::getValue)); |
|
|
|
|
|
|
|
|
|
|
|
int sum = result.stream().mapToInt(PartyTypepercentResultDTO::getValue).sum(); |
|
|
|
|
|
|
|
|
|
|
|
return dictResult.getData().stream().map(item -> { |
|
|
|
|
|
PartyTypepercentResultDTO dto = new PartyTypepercentResultDTO(); |
|
|
|
|
|
dto.setLabel(item.getLabel()); |
|
|
|
|
|
dto.setCode(item.getValue()); |
|
|
|
|
|
dto.setValue(null == map.get(item.getValue()) ? NumConstant.ZERO : map.get(item.getValue())); |
|
|
|
|
|
dto.setPercent((Integer.parseInt(item.getValue()) * 100) / sum + "%"); |
|
|
|
|
|
return dto; |
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private String getServiceMatter(Map<String, String> map, String matter) { |
|
|
private String getServiceMatter(Map<String, String> map, String matter) { |
|
|