|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.epmet.datareport.service.evaluationindex.screen.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
@ -7,6 +8,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
|
import com.epmet.datareport.dao.evaluationindex.screen.*; |
|
|
|
import com.epmet.datareport.service.evaluationindex.screen.AgencyService; |
|
|
|
import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; |
|
|
|
import com.epmet.datareport.utils.DateUtils; |
|
|
|
import com.epmet.datareport.utils.ModuleConstant; |
|
|
@ -56,6 +58,9 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { |
|
|
|
private ScreenCustomerAgencyDao customerAgencyDao; |
|
|
|
@Autowired |
|
|
|
private OperCrmOpenFeignClient operCrmOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private AgencyService screenCustomerAgencyService; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 1、先锋模范 |
|
|
|
* @param fineExampleFormDTO |
|
|
@ -117,8 +122,14 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { |
|
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) |
|
|
|
@Override |
|
|
|
public ContactMassLineChartResultDTO contactMassLineChart(ContactMassLineChartFormDTO contactMassLineChartFormDTO) { |
|
|
|
|
|
|
|
List<String> subAgencyIdorGridIdList=screenCustomerAgencyService.getNextAgencyIds(contactMassLineChartFormDTO.getAreaCode(),contactMassLineChartFormDTO.getAgencyId()); |
|
|
|
log.info("当前组织的下级id:"+JSON.toJSONString(subAgencyIdorGridIdList)); |
|
|
|
|
|
|
|
ContactMassLineChartResultDTO result = new ContactMassLineChartResultDTO(); |
|
|
|
List<ContactMassLineChartResult> contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId()); |
|
|
|
// List<ContactMassLineChartResult> contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId());
|
|
|
|
//多客户版修改如下:
|
|
|
|
List<ContactMassLineChartResult> contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChartByAgencyIds(subAgencyIdorGridIdList); |
|
|
|
if (contactMassLineChartResults.size() == NumConstant.ZERO){ |
|
|
|
result.setXAxis(new ArrayList<>()); |
|
|
|
result.setGroupMemberData(new ArrayList<>()); |
|
|
@ -247,6 +258,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { |
|
|
|
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) |
|
|
|
@Override |
|
|
|
public List<AdvanceBranchRankResultDTO> advancedBranchRank(AgencyAndNumFormDTO param) { |
|
|
|
List<AdvanceBranchRankResultDTO> result = new LinkedList<>(); |
|
|
|
if(null == param.getTopNum()){ |
|
|
|
param.setTopNum(NumConstant.FIVE); |
|
|
|
}else if(NumConstant.ZERO == param.getTopNum()){ |
|
|
@ -254,6 +266,26 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { |
|
|
|
} |
|
|
|
PageHelper.startPage(NumConstant.ONE,param.getTopNum()); |
|
|
|
String monthId = dateUtils.getCurrentMonthId(); |
|
|
|
if(StringUtils.isNotBlank(param.getAreaCode())){ |
|
|
|
log.info("先进排行榜单-先进支部排行入参"+JSON.toJSONString(param)); |
|
|
|
//areaCode不为空,按照areaCode查询
|
|
|
|
List<OrgRankDataResultDTO> gridData = |
|
|
|
screenOrgRankDataDao.selectGridDataMonthlyAreaCode(monthId,param.getAreaCode()); |
|
|
|
int time = NumConstant.TWELVE; |
|
|
|
while(CollectionUtils.isEmpty(gridData) && time > NumConstant.ONE){ |
|
|
|
time--; |
|
|
|
monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); |
|
|
|
PageHelper.startPage(NumConstant.ONE,param.getTopNum()); |
|
|
|
gridData = screenOrgRankDataDao.selectGridDataMonthlyAreaCode(monthId,param.getAreaCode()); |
|
|
|
} |
|
|
|
if(null == gridData || gridData.isEmpty()) return result; |
|
|
|
gridData.forEach( data -> { |
|
|
|
AdvanceBranchRankResultDTO o = ConvertUtils.sourceToTarget(data,AdvanceBranchRankResultDTO.class); |
|
|
|
o.setClosedProjectRatio(convertPercentStr(data.getClosedProjectRatio())); |
|
|
|
o.setSatisfactionRatio(convertPercentStr(data.getSatisfactionRatio())); |
|
|
|
result.add(o); |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
List<OrgRankDataResultDTO> gridData = |
|
|
|
screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId); |
|
|
|
int time = NumConstant.TWELVE; |
|
|
@ -263,7 +295,6 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { |
|
|
|
PageHelper.startPage(NumConstant.ONE,param.getTopNum()); |
|
|
|
gridData = screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId); |
|
|
|
} |
|
|
|
List<AdvanceBranchRankResultDTO> result = new LinkedList<>(); |
|
|
|
if(null == gridData || gridData.isEmpty()) return result; |
|
|
|
gridData.forEach( data -> { |
|
|
|
AdvanceBranchRankResultDTO o = ConvertUtils.sourceToTarget(data,AdvanceBranchRankResultDTO.class); |
|
|
@ -271,7 +302,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { |
|
|
|
o.setSatisfactionRatio(convertPercentStr(data.getSatisfactionRatio())); |
|
|
|
result.add(o); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
@ -288,7 +319,13 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { |
|
|
|
public List<PartyUserPointResultDTO> advancedPartymemberRank(AgencyAndNumFormDTO param) { |
|
|
|
if(null == param.getTopNum()) param.setTopNum(NumConstant.TEN); |
|
|
|
PageHelper.startPage(NumConstant.ONE,param.getTopNum()); |
|
|
|
List<PartyUserPointResultDTO> result = screenPartyUserRankDataDao.selectPartymemberPointOrder(param.getAgencyId()); |
|
|
|
List<PartyUserPointResultDTO> result=new ArrayList<>(); |
|
|
|
if(StringUtils.isNotBlank(param.getAreaCode())){ |
|
|
|
log.info("先进排行榜单-先进党员排行按照areaCode查询入参:"+param.getAreaCode()); |
|
|
|
result=screenPartyUserRankDataDao.selectPartymemberPointOrderByAreaCode(param.getAreaCode()); |
|
|
|
}else{ |
|
|
|
result=screenPartyUserRankDataDao.selectPartymemberPointOrder(param.getAgencyId()); |
|
|
|
} |
|
|
|
if(null == result) return new ArrayList<>(); |
|
|
|
return result; |
|
|
|
} |
|
|
|