Pārlūkot izejas kodu

销售钉盘—— 列表查询bug修改

zxa 3 gadi atpakaļ
vecāks
revīzija
e0f5fc6b17

+ 17 - 1
jeecg-boot-material-view/src/main/java/org/jeecg/ctop/material/service/impl/ManagerSaleValueServiceImpl.java

@@ -70,6 +70,9 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
             if ("b161b7d9793942f980dbfe8c931cd1b0".equals(userId) || "228c45f913924639bf20c79ce5dadb16".equals(userId)) {
                 //账户集合
                 List<Long> accountIds = baseMapper.getCompanyAccountIds(companyId, mediaId);
+                if (Check.isNull(accountIds)) {
+                    return Result.error("未查询到账户!");
+                }
                 JSONObject data = getManagerData(accountIds, userId, mediaId, companyId);
                 data.put("weeklyGoalValue", weekly);
                 data.put("monthlyGoalValue", monthly);
@@ -93,6 +96,9 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
         } else if ("CompanyManager".equals(roleCode) || "admin".equals(roleCode)) {
             //账户集合
             List<Long> accountIds = baseMapper.getCompanyAccountIds(companyId, mediaId);
+            if (Check.isNull(accountIds)) {
+                return Result.error("未查询到账户!");
+            }
             JSONObject data = getManagerData(accountIds, userId, mediaId, companyId);
             data.put("weeklyGoalValue", weekly);
             data.put("monthlyGoalValue", monthly);
@@ -183,6 +189,10 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
         String roleCode = baseMapper.getRoleCodeByUserId(userId);
 
         List<Long> compayAllAccountIds = baseMapper.getCompanyAccountIds(companyId, mediaId);
+        if (Check.isNull(compayAllAccountIds)) {
+            return Result.error("未查询到账户!");
+        }
+
         JSONObject data = null;
         //销售总监
         if ("saleDirector".equals(roleCode)) {
@@ -316,6 +326,9 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
             //丁兆明特殊处理
             if ("b161b7d9793942f980dbfe8c931cd1b0".equals(userId) || "228c45f913924639bf20c79ce5dadb16".equals(userId)) {
                 List<Long> projectIds = baseMapper.querySalesDirectorProjectIds(companyId, mediaId, null);
+                if(Check.isNull(projectIds)){
+                    throw new Exception("未查询到项目!");
+                }
                 if (startTime.equals(endTime)) {
                     return getProjectDailyCharges(projectIds, mediaId, startTime, null, pageNo, pageSize);
                 } else {
@@ -330,7 +343,7 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
             //账户集合
             List<Long> projectIds = baseMapper.querySalesDirectorProjectIds(companyId, mediaId, saleTeaMber);
             if (Check.isNull(projectIds)) {
-                throw new Exception("未查询到账户!");
+                throw new Exception("未查询到项目!");
             }
             if (startTime.equals(endTime)) {
                 return getProjectDailyCharges(projectIds, mediaId, startTime, null, pageNo, pageSize);
@@ -340,6 +353,9 @@ public class ManagerSaleValueServiceImpl extends ServiceImpl<ManagerSaleValueMap
             //分公司总经理
         } else if ("CompanyManager".equals(roleCode) || "admin".equals(roleCode)) {
             List<Long> projectIds = baseMapper.querySalesDirectorProjectIds(companyId, mediaId, null);
+            if(Check.isNull(projectIds)){
+                throw new Exception("未查询到项目!");
+            }
             if (startTime.equals(endTime)) {
                 return getProjectDailyCharges(projectIds, mediaId, startTime, null, pageNo, pageSize);
             } else {