|
@@ -66,13 +66,9 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Result<Object> getDayAndMonthlyCharges(String userId, String mediaId, String companyId, String startTime, String endTime, String operate) throws ParseException {
|
|
|
|
|
|
+ public Result<Object> getDayAndMonthlyCharges(String userId, String mediaId, String startTime, String endTime, String operate) throws ParseException {
|
|
Result<Object> result = new Result<>();
|
|
Result<Object> result = new Result<>();
|
|
String roleCode = baseMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = baseMapper.getRoleCodeByUserId(userId);
|
|
- Boolean bjCompany = false;
|
|
|
|
- if ("d57fecdcf7a94d009736d9c850731582".equals(companyId)) {
|
|
|
|
- bjCompany = true;
|
|
|
|
- }
|
|
|
|
List<String> oneUserIds = new ArrayList<>();
|
|
List<String> oneUserIds = new ArrayList<>();
|
|
List<String> twoUserIds = new ArrayList<>();
|
|
List<String> twoUserIds = new ArrayList<>();
|
|
//销售总监
|
|
//销售总监
|
|
@@ -80,31 +76,31 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
|
|
//丁兆明特殊处理
|
|
//丁兆明特殊处理
|
|
if ("b161b7d9793942f980dbfe8c931cd1b0".equals(userId) || "228c45f913924639bf20c79ce5dadb16".equals(userId)) {
|
|
if ("b161b7d9793942f980dbfe8c931cd1b0".equals(userId) || "228c45f913924639bf20c79ce5dadb16".equals(userId)) {
|
|
//账户集合
|
|
//账户集合
|
|
- List<Long> accountIds = baseMapper.querySalesDirectorAccountIds(companyId, mediaId, null, null);
|
|
|
|
|
|
+ List<Long> accountIds = baseMapper.querySalesDirectorAccountIds(null, mediaId, null, null);
|
|
if (Check.isNull(accountIds)) {
|
|
if (Check.isNull(accountIds)) {
|
|
return Result.error("未查询到账户!");
|
|
return Result.error("未查询到账户!");
|
|
}
|
|
}
|
|
- JSONObject data = getManagerData(accountIds, userId, mediaId, companyId, bjCompany, null, startTime, endTime);
|
|
|
|
|
|
+ JSONObject data = getManagerData(accountIds, userId, mediaId, null, startTime, endTime);
|
|
return Result.ok(data);
|
|
return Result.ok(data);
|
|
}
|
|
}
|
|
//查询销售总监及旗下的人员 集
|
|
//查询销售总监及旗下的人员 集
|
|
List<String> saleTeaMber = baseMapper.querySaleDirctorItsTeamMember(userId);
|
|
List<String> saleTeaMber = baseMapper.querySaleDirctorItsTeamMember(userId);
|
|
saleTeaMber.add(userId);
|
|
saleTeaMber.add(userId);
|
|
//账户集合
|
|
//账户集合
|
|
- List<Long> accountIds = baseMapper.querySalesDirectorAccountIds(companyId, mediaId, saleTeaMber, null);
|
|
|
|
|
|
+ List<Long> accountIds = baseMapper.querySalesDirectorAccountIds(null, mediaId, saleTeaMber, null);
|
|
if (Check.isNull(accountIds)) {
|
|
if (Check.isNull(accountIds)) {
|
|
return Result.error("未查询到账户!");
|
|
return Result.error("未查询到账户!");
|
|
}
|
|
}
|
|
- JSONObject data = getManagerData(accountIds, userId, mediaId, companyId, bjCompany, saleTeaMber, startTime, endTime);
|
|
|
|
|
|
+ JSONObject data = getManagerData(accountIds, userId, mediaId, saleTeaMber, startTime, endTime);
|
|
result = Result.ok(data);
|
|
result = Result.ok(data);
|
|
//分公司总经理
|
|
//分公司总经理
|
|
} else if ("CompanyManager".equals(roleCode) || "admin".equals(roleCode)) {
|
|
} else if ("CompanyManager".equals(roleCode) || "admin".equals(roleCode)) {
|
|
//账户集合
|
|
//账户集合
|
|
- List<Long> accountIds = baseMapper.querySalesDirectorAccountIds(companyId, mediaId, null, null);
|
|
|
|
|
|
+ List<Long> accountIds = baseMapper.querySalesDirectorAccountIds(null, mediaId, null, null);
|
|
if (Check.isNull(accountIds)) {
|
|
if (Check.isNull(accountIds)) {
|
|
return Result.error("未查询到账户!");
|
|
return Result.error("未查询到账户!");
|
|
}
|
|
}
|
|
- JSONObject data = getManagerData(accountIds, userId, mediaId, companyId, bjCompany, null, startTime, endTime);
|
|
|
|
|
|
+ JSONObject data = getManagerData(accountIds, userId, mediaId, null, startTime, endTime);
|
|
result = Result.ok(data);
|
|
result = Result.ok(data);
|
|
} else {
|
|
} else {
|
|
result = Result.error("该用户角色权限不足!");
|
|
result = Result.error("该用户角色权限不足!");
|
|
@@ -113,7 +109,7 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private JSONObject getManagerData(List<Long> accountIds, String userId, String mediaId, String companyId, boolean bjCompany, List<String> saleTeaMber, String startTime, String endTime) throws ParseException {
|
|
|
|
|
|
+ private JSONObject getManagerData(List<Long> accountIds, String userId, String mediaId, List<String> saleTeaMber, String startTime, String endTime) throws ParseException {
|
|
//当天日期
|
|
//当天日期
|
|
String statDay = DateUtils.date2Str();
|
|
String statDay = DateUtils.date2Str();
|
|
//当前小时数
|
|
//当前小时数
|
|
@@ -135,25 +131,25 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
|
|
//1 头条
|
|
//1 头条
|
|
if ("1".equals(mediaId)) {
|
|
if ("1".equals(mediaId)) {
|
|
//查询当日消耗 + 环比
|
|
//查询当日消耗 + 环比
|
|
- result = baseMapper.queryTtTodayCharge(statDay, hour, accountIds, companyId);
|
|
|
|
|
|
+ result = baseMapper.queryTtTodayCharge(statDay, hour, accountIds, null);
|
|
//周消耗
|
|
//周消耗
|
|
- weekCharge = baseMapper.queryTtManydaysTotalCharge(weekFirstDay, statDay, accountIds, companyId);
|
|
|
|
|
|
+ weekCharge = baseMapper.queryTtManydaysTotalCharge(weekFirstDay, statDay, accountIds, null);
|
|
//月消耗
|
|
//月消耗
|
|
- String monthCharge = baseMapper.queryTtManydaysTotalCharge(monthFirstday, statDay, accountIds, companyId);
|
|
|
|
|
|
+ String monthCharge = baseMapper.queryTtManydaysTotalCharge(monthFirstday, statDay, accountIds, null);
|
|
result.put("weekCharge", new BigDecimal(weekCharge));
|
|
result.put("weekCharge", new BigDecimal(weekCharge));
|
|
result.put("monthCharge", new BigDecimal(monthCharge));
|
|
result.put("monthCharge", new BigDecimal(monthCharge));
|
|
//现金消耗 + 环比ROI
|
|
//现金消耗 + 环比ROI
|
|
- JSONObject realCharged = baseMapper.queryTtRealCharged(lastMonthFirstday, monthFirstday, statDay, accountIds, companyId);
|
|
|
|
|
|
+ JSONObject realCharged = baseMapper.queryTtRealCharged(lastMonthFirstday, monthFirstday, statDay, accountIds, null);
|
|
result.put("realCharged", realCharged.getBigDecimal("realCharged"));
|
|
result.put("realCharged", realCharged.getBigDecimal("realCharged"));
|
|
result.put("realChargedRoi", realCharged.getString("realChargedRoi"));
|
|
result.put("realChargedRoi", realCharged.getString("realChargedRoi"));
|
|
- if (bjCompany) {
|
|
|
|
- long days = DateUtils.getDiscrepantDays(startTime, endTime) + 1;
|
|
|
|
- if (!startTime.equals(statDay)) {
|
|
|
|
- hour = 23;
|
|
|
|
- }
|
|
|
|
- JSONObject oneResult = baseMapper.queryTtTodayCharge2(startTime, endTime, hour, accountIds, companyId, days);
|
|
|
|
- result.put("oneCharge", oneResult.getBigDecimal("totalCharge"));
|
|
|
|
- result.put("oneChargeRoi", oneResult.getString("chargeRoi"));
|
|
|
|
|
|
+
|
|
|
|
+ long days = DateUtils.getDiscrepantDays(startTime, endTime) + 1;
|
|
|
|
+ if (!startTime.equals(statDay)) {
|
|
|
|
+ hour = 23;
|
|
|
|
+ }
|
|
|
|
+ JSONObject oneResult = baseMapper.queryTtTodayCharge2(startTime, endTime, hour, accountIds, null, days);
|
|
|
|
+ result.put("oneCharge", oneResult.getBigDecimal("totalCharge"));
|
|
|
|
+ result.put("oneChargeRoi", oneResult.getString("chargeRoi"));
|
|
|
|
|
|
/*//运营一部:李超及其下级 李超 id:f6a6843879c949618e4a859140c8a127
|
|
/*//运营一部:李超及其下级 李超 id:f6a6843879c949618e4a859140c8a127
|
|
oneAccountIds = baseMapper.querySalesDirectorAccountIds(companyId, mediaId, saleTeaMber, Arrays.asList(lichaoId));
|
|
oneAccountIds = baseMapper.querySalesDirectorAccountIds(companyId, mediaId, saleTeaMber, Arrays.asList(lichaoId));
|
|
@@ -170,27 +166,26 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
|
|
JSONObject twoResult2 = baseMapper.queryTtTodayCharge3(startTime, endTime, mediaId, hour, companyId, days);
|
|
JSONObject twoResult2 = baseMapper.queryTtTodayCharge3(startTime, endTime, mediaId, hour, companyId, days);
|
|
result.put("twoCharge2", twoResult2.getBigDecimal("totalCharge"));
|
|
result.put("twoCharge2", twoResult2.getBigDecimal("totalCharge"));
|
|
result.put("twoChargeRoi2", twoResult2.getString("chargeRoi"));*/
|
|
result.put("twoChargeRoi2", twoResult2.getString("chargeRoi"));*/
|
|
- }
|
|
|
|
|
|
+
|
|
} else if ("2".equals(mediaId)) {
|
|
} else if ("2".equals(mediaId)) {
|
|
- result = baseMapper.queryKsTodayCharge(statDay, hour, accountIds, companyId);
|
|
|
|
|
|
+ result = baseMapper.queryKsTodayCharge(statDay, hour, accountIds, null);
|
|
//周消耗
|
|
//周消耗
|
|
- weekCharge = baseMapper.queryKsManydaysTotalCharge(weekFirstDay, statDay, accountIds, companyId);
|
|
|
|
|
|
+ weekCharge = baseMapper.queryKsManydaysTotalCharge(weekFirstDay, statDay, accountIds, null);
|
|
//月消耗
|
|
//月消耗
|
|
- String monthCharge = baseMapper.queryKsManydaysTotalCharge(monthFirstday, statDay, accountIds, companyId);
|
|
|
|
|
|
+ String monthCharge = baseMapper.queryKsManydaysTotalCharge(monthFirstday, statDay, accountIds, null);
|
|
result.put("weekCharge", new BigDecimal(weekCharge));
|
|
result.put("weekCharge", new BigDecimal(weekCharge));
|
|
result.put("monthCharge", new BigDecimal(monthCharge));
|
|
result.put("monthCharge", new BigDecimal(monthCharge));
|
|
//现金消耗 + 环比ROI
|
|
//现金消耗 + 环比ROI
|
|
- JSONObject realCharged = baseMapper.queryKsRealCharged(lastMonthFirstday, monthFirstday, statDay, accountIds, companyId);
|
|
|
|
|
|
+ JSONObject realCharged = baseMapper.queryKsRealCharged(lastMonthFirstday, monthFirstday, statDay, accountIds, null);
|
|
result.put("realCharged", realCharged.getBigDecimal("realCharged"));
|
|
result.put("realCharged", realCharged.getBigDecimal("realCharged"));
|
|
result.put("realChargedRoi", realCharged.getString("realChargedRoi"));
|
|
result.put("realChargedRoi", realCharged.getString("realChargedRoi"));
|
|
- if (bjCompany) {
|
|
|
|
- long days = DateUtils.getDiscrepantDays(startTime, endTime) + 1;
|
|
|
|
- if (!startTime.equals(statDay)) {
|
|
|
|
- hour = 23;
|
|
|
|
- }
|
|
|
|
- JSONObject oneResult = baseMapper.queryKsTodayCharge2(startTime, endTime, hour, accountIds, companyId, days);
|
|
|
|
- result.put("oneCharge", oneResult.getBigDecimal("totalCharge"));
|
|
|
|
- result.put("oneChargeRoi", oneResult.getString("chargeRoi"));
|
|
|
|
|
|
+ long days = DateUtils.getDiscrepantDays(startTime, endTime) + 1;
|
|
|
|
+ if (!startTime.equals(statDay)) {
|
|
|
|
+ hour = 23;
|
|
|
|
+ }
|
|
|
|
+ JSONObject oneResult = baseMapper.queryKsTodayCharge2(startTime, endTime, hour, accountIds, null, days);
|
|
|
|
+ result.put("oneCharge", oneResult.getBigDecimal("totalCharge"));
|
|
|
|
+ result.put("oneChargeRoi", oneResult.getString("chargeRoi"));
|
|
/*result.put("oneCharge", oneResult.getBigDecimal("totalCharge"));
|
|
/*result.put("oneCharge", oneResult.getBigDecimal("totalCharge"));
|
|
result.put("oneChargeRoi", oneResult.getString("chargeRoi"));
|
|
result.put("oneChargeRoi", oneResult.getString("chargeRoi"));
|
|
//运营一部:李超及其下级 李超 id:f6a6843879c949618e4a859140c8a127
|
|
//运营一部:李超及其下级 李超 id:f6a6843879c949618e4a859140c8a127
|
|
@@ -209,10 +204,9 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
|
|
JSONObject twoResult2 = baseMapper.queryKsTodayCharge3(startTime, endTime, mediaId, hour, companyId, days);
|
|
JSONObject twoResult2 = baseMapper.queryKsTodayCharge3(startTime, endTime, mediaId, hour, companyId, days);
|
|
result.put("twoCharge2", twoResult2.getBigDecimal("totalCharge"));
|
|
result.put("twoCharge2", twoResult2.getBigDecimal("totalCharge"));
|
|
result.put("twoChargeRoi2", twoResult2.getString("chargeRoi"));*/
|
|
result.put("twoChargeRoi2", twoResult2.getString("chargeRoi"));*/
|
|
- }
|
|
|
|
}
|
|
}
|
|
- result.put("weeklyGoalValue", baseMapper.getWeekly(userId, companyId, mediaId));
|
|
|
|
- result.put("monthlyGoalValue", baseMapper.getMonthly(userId, companyId, mediaId));
|
|
|
|
|
|
+ result.put("weeklyGoalValue", baseMapper.getWeekly(userId, null, mediaId));
|
|
|
|
+ result.put("monthlyGoalValue", baseMapper.getMonthly(userId, null, mediaId));
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -226,7 +220,6 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
|
|
@Override
|
|
@Override
|
|
public void setUpManagerSaleValue(ManagerSaleValue sale) throws Exception {
|
|
public void setUpManagerSaleValue(ManagerSaleValue sale) throws Exception {
|
|
QueryWrapper<ManagerSaleValue> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<ManagerSaleValue> queryWrapper = new QueryWrapper<>();
|
|
- queryWrapper.eq("company_id", sale.getCompanyId());
|
|
|
|
queryWrapper.eq("media_id", sale.getMediaId());
|
|
queryWrapper.eq("media_id", sale.getMediaId());
|
|
queryWrapper.eq("user_id", sale.getUserId());
|
|
queryWrapper.eq("user_id", sale.getUserId());
|
|
ManagerSaleValue one = this.getOne(queryWrapper);
|
|
ManagerSaleValue one = this.getOne(queryWrapper);
|
|
@@ -245,10 +238,10 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Result<Object> getHomeCharges(String userId, String mediaId, String companyId, String startTime, String endTime) throws ParseException {
|
|
|
|
|
|
+ public Result<Object> getHomeCharges(String userId, String mediaId, String startTime, String endTime) throws ParseException {
|
|
String roleCode = baseMapper.getRoleCodeByUserId(userId);
|
|
String roleCode = baseMapper.getRoleCodeByUserId(userId);
|
|
|
|
|
|
- List<Long> compayAllAccountIds = baseMapper.querySalesDirectorAccountIds(companyId, mediaId, null, null);
|
|
|
|
|
|
+ List<Long> compayAllAccountIds = baseMapper.querySalesDirectorAccountIds(null, mediaId, null, null);
|
|
if (Check.isNull(compayAllAccountIds)) {
|
|
if (Check.isNull(compayAllAccountIds)) {
|
|
return Result.error("未查询到账户!");
|
|
return Result.error("未查询到账户!");
|
|
}
|
|
}
|
|
@@ -259,9 +252,9 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
|
|
//丁兆明特殊处理
|
|
//丁兆明特殊处理
|
|
if ("b161b7d9793942f980dbfe8c931cd1b0".equals(userId) || "228c45f913924639bf20c79ce5dadb16".equals(userId)) {
|
|
if ("b161b7d9793942f980dbfe8c931cd1b0".equals(userId) || "228c45f913924639bf20c79ce5dadb16".equals(userId)) {
|
|
if (startTime.equals(endTime)) {
|
|
if (startTime.equals(endTime)) {
|
|
- data = getDailyCharges(null, compayAllAccountIds, userId, mediaId, companyId, startTime);
|
|
|
|
|
|
+ data = getDailyCharges(null, compayAllAccountIds, userId, mediaId, null, startTime);
|
|
} else {
|
|
} else {
|
|
- data = getManyDaysCharges(null, compayAllAccountIds, userId, mediaId, companyId, startTime, endTime);
|
|
|
|
|
|
+ data = getManyDaysCharges(null, compayAllAccountIds, userId, mediaId, null, startTime, endTime);
|
|
}
|
|
}
|
|
return Result.ok(data);
|
|
return Result.ok(data);
|
|
}
|
|
}
|
|
@@ -269,24 +262,24 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
|
|
List<String> saleTeaMber = baseMapper.querySaleDirctorItsTeamMember(userId);
|
|
List<String> saleTeaMber = baseMapper.querySaleDirctorItsTeamMember(userId);
|
|
saleTeaMber.add(userId);
|
|
saleTeaMber.add(userId);
|
|
//账户集合
|
|
//账户集合
|
|
- List<Long> accountIds = baseMapper.querySalesDirectorAccountIds(companyId, mediaId, saleTeaMber, null);
|
|
|
|
|
|
+ List<Long> accountIds = baseMapper.querySalesDirectorAccountIds(null, mediaId, saleTeaMber, null);
|
|
if (Check.isNull(accountIds)) {
|
|
if (Check.isNull(accountIds)) {
|
|
return Result.error("未查询到账户!");
|
|
return Result.error("未查询到账户!");
|
|
}
|
|
}
|
|
if (startTime.equals(endTime)) {
|
|
if (startTime.equals(endTime)) {
|
|
//消耗数据
|
|
//消耗数据
|
|
- data = getDailyCharges(compayAllAccountIds, accountIds, userId, mediaId, companyId, startTime);
|
|
|
|
|
|
+ data = getDailyCharges(compayAllAccountIds, accountIds, userId, mediaId, null, startTime);
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- data = getManyDaysCharges(compayAllAccountIds, accountIds, userId, mediaId, companyId, startTime, endTime);
|
|
|
|
|
|
+ data = getManyDaysCharges(compayAllAccountIds, accountIds, userId, mediaId, null, startTime, endTime);
|
|
|
|
|
|
}
|
|
}
|
|
//分公司总经理
|
|
//分公司总经理
|
|
} else if ("CompanyManager".equals(roleCode) || "admin".equals(roleCode)) {
|
|
} else if ("CompanyManager".equals(roleCode) || "admin".equals(roleCode)) {
|
|
if (startTime.equals(endTime)) {
|
|
if (startTime.equals(endTime)) {
|
|
- data = getDailyCharges(null, compayAllAccountIds, userId, mediaId, companyId, startTime);
|
|
|
|
|
|
+ data = getDailyCharges(null, compayAllAccountIds, userId, mediaId, null, startTime);
|
|
} else {
|
|
} else {
|
|
- data = getManyDaysCharges(null, compayAllAccountIds, userId, mediaId, companyId, startTime, endTime);
|
|
|
|
|
|
+ data = getManyDaysCharges(null, compayAllAccountIds, userId, mediaId, null, startTime, endTime);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
return Result.error("该用户角色权限不足!");
|
|
return Result.error("该用户角色权限不足!");
|
|
@@ -376,20 +369,9 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public PageInfo getProjectChargeTop(String userId, String mediaId, String companyId, String startTime, String endTime, String operate, Integer pageNo, Integer pageSize) throws Exception {
|
|
|
|
- Boolean bjCompany = false;
|
|
|
|
|
|
+ public PageInfo getProjectChargeTop(String userId, String mediaId, String startTime, String endTime, String operate, Integer pageNo, Integer pageSize) throws Exception {
|
|
List<String> operateUser = new ArrayList<>();
|
|
List<String> operateUser = new ArrayList<>();
|
|
- if ("d57fecdcf7a94d009736d9c850731582".equals(companyId) && !Check.isNull(operate)) {
|
|
|
|
- bjCompany = true;
|
|
|
|
- if ("1".equals(operate)) {
|
|
|
|
- //运营一部:李超及其下级 李超 id:f6a6843879c949618e4a859140c8a127
|
|
|
|
- operateUser.add("f6a6843879c949618e4a859140c8a127");
|
|
|
|
- } else {
|
|
|
|
- //运营二部:兰兰及其下级 兰兰id:461857c245f54ba5813bcb5900a23092
|
|
|
|
- operateUser.add("461857c245f54ba5813bcb5900a23092");
|
|
|
|
- operateUser.add("00d630a129e4487cba5427788a1f08ce");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
//账户集合
|
|
//账户集合
|
|
List<Long> accountIds = null;
|
|
List<Long> accountIds = null;
|
|
//当天日期
|
|
//当天日期
|
|
@@ -400,58 +382,41 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
|
|
if ("saleDirector".equals(roleCode) || "saleAm".equals(roleCode)) {
|
|
if ("saleDirector".equals(roleCode) || "saleAm".equals(roleCode)) {
|
|
//丁兆明特殊处理
|
|
//丁兆明特殊处理
|
|
if ("b161b7d9793942f980dbfe8c931cd1b0".equals(userId) || "228c45f913924639bf20c79ce5dadb16".equals(userId)) {
|
|
if ("b161b7d9793942f980dbfe8c931cd1b0".equals(userId) || "228c45f913924639bf20c79ce5dadb16".equals(userId)) {
|
|
- if (bjCompany) {
|
|
|
|
- accountIds = baseMapper.querySalesDirectorAccountIds(companyId, mediaId, null, operateUser);
|
|
|
|
- } else {
|
|
|
|
- accountIds = baseMapper.querySalesDirectorAccountIds(companyId, mediaId, null, null);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ accountIds = baseMapper.querySalesDirectorAccountIds(null, mediaId, null, operateUser);
|
|
if (Check.isNull(accountIds)) {
|
|
if (Check.isNull(accountIds)) {
|
|
throw new Exception("未查询到账户!");
|
|
throw new Exception("未查询到账户!");
|
|
}
|
|
}
|
|
if (startTime.equals(endTime) && today.equals(startTime)) {
|
|
if (startTime.equals(endTime) && today.equals(startTime)) {
|
|
- return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, null, pageNo, pageSize);
|
|
|
|
|
|
+ return getProjectDailyCharges(accountIds, null, mediaId, startTime, null, pageNo, pageSize);
|
|
} else if (startTime.equals(endTime)) {
|
|
} else if (startTime.equals(endTime)) {
|
|
- return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, startTime, pageNo, pageSize);
|
|
|
|
|
|
+ return getProjectDailyCharges(accountIds, null, mediaId, startTime, startTime, pageNo, pageSize);
|
|
} else {
|
|
} else {
|
|
- return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, endTime, pageNo, pageSize);
|
|
|
|
|
|
+ return getProjectDailyCharges(accountIds, null, mediaId, startTime, endTime, pageNo, pageSize);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//查询销售总监及旗下的人员 集
|
|
//查询销售总监及旗下的人员 集
|
|
List<String> saleTeaMber = baseMapper.querySaleDirctorItsTeamMember(userId);
|
|
List<String> saleTeaMber = baseMapper.querySaleDirctorItsTeamMember(userId);
|
|
saleTeaMber.add(userId);
|
|
saleTeaMber.add(userId);
|
|
- if (bjCompany) {
|
|
|
|
- accountIds = baseMapper.querySalesDirectorAccountIds(companyId, mediaId, saleTeaMber, operateUser);
|
|
|
|
- } else {
|
|
|
|
- //账户集合
|
|
|
|
- accountIds = baseMapper.querySalesDirectorAccountIds(companyId, mediaId, saleTeaMber, null);
|
|
|
|
- if (Check.isNull(accountIds)) {
|
|
|
|
- throw new Exception("未查询到账户!");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ accountIds = baseMapper.querySalesDirectorAccountIds(null, mediaId, saleTeaMber, operateUser);
|
|
if (startTime.equals(endTime) && today.equals(startTime)) {
|
|
if (startTime.equals(endTime) && today.equals(startTime)) {
|
|
- return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, null, pageNo, pageSize);
|
|
|
|
|
|
+ return getProjectDailyCharges(accountIds, null, mediaId, startTime, null, pageNo, pageSize);
|
|
} else if (startTime.equals(endTime)) {
|
|
} else if (startTime.equals(endTime)) {
|
|
- return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, startTime, pageNo, pageSize);
|
|
|
|
|
|
+ return getProjectDailyCharges(accountIds, null, mediaId, startTime, startTime, pageNo, pageSize);
|
|
} else {
|
|
} else {
|
|
- return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, endTime, pageNo, pageSize);
|
|
|
|
|
|
+ return getProjectDailyCharges(accountIds, null, mediaId, startTime, endTime, pageNo, pageSize);
|
|
}
|
|
}
|
|
//分公司总经理
|
|
//分公司总经理
|
|
} else if ("CompanyManager".equals(roleCode) || "admin".equals(roleCode)) {
|
|
} else if ("CompanyManager".equals(roleCode) || "admin".equals(roleCode)) {
|
|
- if (bjCompany) {
|
|
|
|
- accountIds = baseMapper.querySalesDirectorAccountIds(companyId, mediaId, null, operateUser);
|
|
|
|
- } else {
|
|
|
|
- accountIds = baseMapper.querySalesDirectorAccountIds(companyId, mediaId, null, null);
|
|
|
|
- }
|
|
|
|
|
|
+ accountIds = baseMapper.querySalesDirectorAccountIds(null, mediaId, null, operateUser);
|
|
if (Check.isNull(accountIds)) {
|
|
if (Check.isNull(accountIds)) {
|
|
throw new Exception("未查询到账户!");
|
|
throw new Exception("未查询到账户!");
|
|
}
|
|
}
|
|
if (startTime.equals(endTime) && today.equals(startTime)) {
|
|
if (startTime.equals(endTime) && today.equals(startTime)) {
|
|
- return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, null, pageNo, pageSize);
|
|
|
|
|
|
+ return getProjectDailyCharges(accountIds, null, mediaId, startTime, null, pageNo, pageSize);
|
|
} else if (startTime.equals(endTime)) {
|
|
} else if (startTime.equals(endTime)) {
|
|
- return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, startTime, pageNo, pageSize);
|
|
|
|
|
|
+ return getProjectDailyCharges(accountIds, null, mediaId, startTime, startTime, pageNo, pageSize);
|
|
} else {
|
|
} else {
|
|
- return getProjectDailyCharges(accountIds, companyId, mediaId, startTime, endTime, pageNo, pageSize);
|
|
|
|
|
|
+ return getProjectDailyCharges(accountIds, null, mediaId, startTime, endTime, pageNo, pageSize);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
throw new Exception("该用户角色权限不足!");
|
|
throw new Exception("该用户角色权限不足!");
|