Commit 5fcc0fbe by jianan

agms团队寿险数据问题3

parent 0b781d5f
...@@ -40,6 +40,10 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService { ...@@ -40,6 +40,10 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService {
@Autowired @Autowired
private SystemConfigService systemConfigService; private SystemConfigService systemConfigService;
private static List<String> organizationIdList = new ArrayList<>();
private static List<String> frIdList = new ArrayList<>();;
private static List<String> groupIdList = new ArrayList<>();;
@Override @Override
public StatisticsPEPResponseVO statisticsPEP(StatisticsPEPRequestVO requestVO) { public StatisticsPEPResponseVO statisticsPEP(StatisticsPEPRequestVO requestVO) {
//AGMS -- Dashboard查询 PEP活动管理 //AGMS -- Dashboard查询 PEP活动管理
...@@ -174,11 +178,14 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService { ...@@ -174,11 +178,14 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService {
SearchStaffAchievementResponseVO searchStaffAchievementResponseVO = null; SearchStaffAchievementResponseVO searchStaffAchievementResponseVO = null;
List<Achieve> achieveList = new ArrayList<>(); List<Achieve> achieveList = new ArrayList<>();
// 1.根据查询时间范围获取查询开始时间和结束时间 // 1.获取机构id
this.getGroupIdByThisInterface();
// 2.根据查询时间范围获取查询开始时间和结束时间
String startTime; String startTime;
String endTime; String endTime;
if ("d".equals(time)) { if ("d".equals(time)) {
endTime = startTime = CommonUtil.dateParseString(new Date(),"yyyy-MM-dd"); endTime = startTime = CommonUtil.dateParseString(new Date(), "yyyy-MM-dd");
} else if ("w".equals(time)) { } else if ("w".equals(time)) {
startTime = CommonUtil.getWeekStart(); startTime = CommonUtil.getWeekStart();
...@@ -203,12 +210,9 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService { ...@@ -203,12 +210,9 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService {
if ("life".equals(category)) { if ("life".equals(category)) {
if ("b".equals(type)) { if ("b".equals(type)) {
searchStaffAchievementRequestBody.setIsdown("1"); searchStaffAchievementRequestBody.setIsdown("1");
String organizationIds = systemConfigService.getSingleConfigValue("N22_Organization_ID");
// 循环查分公司 // 循环查分公司
for (String organizationId :organizationIds.split(",")){ for (String organizationId : organizationIdList) {
searchStaffAchievementRequestBody.setSearchtype("3"); searchStaffAchievementRequestBody.setSearchtype("3");
searchStaffAchievementRequestBody.setOrganization_id(organizationId); searchStaffAchievementRequestBody.setOrganization_id(organizationId);
...@@ -216,9 +220,8 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService { ...@@ -216,9 +220,8 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService {
List<Achieve> achieves = n22SalaryService.searchStaffAchievementGetAchieveList(searchStaffAchievementResponseVO); List<Achieve> achieves = n22SalaryService.searchStaffAchievementGetAchieveList(searchStaffAchievementResponseVO);
achieveList.addAll(achieves); achieveList.addAll(achieves);
} }
String FRIds = systemConfigService.getSingleConfigValue("N22_FR_ID");
// 循环查渠道机构 // 循环查渠道机构
for (String FRId :FRIds.split(",")){ for (String FRId : frIdList) {
searchStaffAchievementRequestBody.setSearchtype("2"); searchStaffAchievementRequestBody.setSearchtype("2");
searchStaffAchievementRequestBody.setRolegroup_id(FRId); searchStaffAchievementRequestBody.setRolegroup_id(FRId);
...@@ -226,12 +229,19 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService { ...@@ -226,12 +229,19 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService {
List<Achieve> achieves = n22SalaryService.searchStaffAchievementGetAchieveList(searchStaffAchievementResponseVO); List<Achieve> achieves = n22SalaryService.searchStaffAchievementGetAchieveList(searchStaffAchievementResponseVO);
achieveList.addAll(achieves); achieveList.addAll(achieves);
} }
} else { } else {
// 查团队
searchStaffAchievementRequestBody.setSearchtype("2"); searchStaffAchievementRequestBody.setSearchtype("2");
searchStaffAchievementRequestBody.setIsdown("0"); searchStaffAchievementRequestBody.setIsdown("1");
// 循环查
for (String groupId : groupIdList) {
searchStaffAchievementRequestBody.setRolegroup_id(groupId);
searchStaffAchievementResponseVO = n22SalaryService.searchStaffAchievement(searchStaffAchievementRequestBody); searchStaffAchievementResponseVO = n22SalaryService.searchStaffAchievement(searchStaffAchievementRequestBody);
achieveList = n22SalaryService.searchStaffAchievementGetAchieveList(searchStaffAchievementResponseVO); List<Achieve> achieves = n22SalaryService.searchStaffAchievementGetAchieveList(searchStaffAchievementResponseVO);
achieveList.addAll(achieves);
}
} }
} else if ("all".equals(category)) { } else if ("all".equals(category)) {
searchStaffAchievementRequestBody.setOrganization_id("HX6ZCQ"); searchStaffAchievementRequestBody.setOrganization_id("HX6ZCQ");
...@@ -246,6 +256,40 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService { ...@@ -246,6 +256,40 @@ public class AgmsDashboardServiceImpl implements AgmsDashboardService {
} }
/** /**
* 用业绩接口的返回报文筛选出所有团队组id
*
* @return
* @throws Exception
*/
private void getGroupIdByThisInterface() throws Exception {
String curDay = CommonUtil.dateParseString(new Date(),"yyyy-MM-dd");
// 组装参数
SearchStaffAchievementRequestBody searchStaffAchievementRequestBody = new SearchStaffAchievementRequestBody();
searchStaffAchievementRequestBody.setIssuedatestart(curDay);
searchStaffAchievementRequestBody.setIssuedateend(curDay);
searchStaffAchievementRequestBody.setPolicystatus("201");
searchStaffAchievementRequestBody.setSearchtype("2");
searchStaffAchievementRequestBody.setIsdown("0");
// 调接口
SearchStaffAchievementResponseVO searchStaffAchievementResponseVO = n22SalaryService.searchStaffAchievement(searchStaffAchievementRequestBody);
List<Achieve> achieveList = n22SalaryService.searchStaffAchievementGetAchieveList(searchStaffAchievementResponseVO);
for (Achieve item : achieveList) {
if ("二级机构".equals(item.getRolegrouptype())) {
organizationIdList.add(item.getID());
}
if ("渠道机构".equals(item.getRolegrouptype())) {
frIdList.add(item.getID());
}
if ("寿险团队".equals(item.getRolegrouptype())) {
groupIdList.add(item.getID());
}
}
}
/**
* dashBoard -- 寿险+产险销售统计 * dashBoard -- 寿险+产险销售统计
* @param type 类型 * @param type 类型
* @param time 时间 * @param time 时间
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment