Browse Source

咨询师首页折线图开发

anderx 2 years ago
parent
commit
0b93509bba

+ 1 - 1
src/main/java/com/goafanti/admin/controller/AdminStatisticsController.java

@@ -57,7 +57,7 @@ public class AdminStatisticsController extends CertifyApiController {
     }
 
     /**
-     * 营销首页折线图
+     * 咨询首页折线图
      * @return
      */
     @RequestMapping(value = "/consultant/lists", method = RequestMethod.GET)

+ 39 - 2
src/main/java/com/goafanti/admin/service/impl/AdminStatisticsServiceImpl.java

@@ -139,11 +139,48 @@ public class AdminStatisticsServiceImpl implements AdminStatisticsService {
     @Override
     public Object consultantLists(String aid) {
         //获取当月的列表
-        Map<String,Object> map=new HashMap<>();
+        Map<String,Object> map=new LinkedHashMap<>();
         Days days = new Days();
         List<String> thisMonth = getThisMonth(days);
         List<ConsultantUserCount> list = adminMapper.consultantthisMonthUser(days.firstDay,days.endDay, aid);
-        return null;
+        List<Integer>  projectCountList =new ArrayList<>();
+        List<Integer>  inProgressList =new ArrayList<>();
+        List<Integer>  notStartedList =new ArrayList<>();
+        List<Integer>  completeList =new ArrayList<>();
+        List<Integer>  stopList =new ArrayList<>();
+        List<Integer>  publicReleaseCountList =new ArrayList<>();
+        List<Integer>  assistCountList =new ArrayList<>();
+        int projectCount=0,inProgressCount=0,notStartedCount=0,completeCount=0,stopCount=0,publicReleaseCount=0,
+                assistCount=0;
+        for (String dates : thisMonth) {
+            for (ConsultantUserCount e : list) {
+                if (e.getDates().equals(dates)){
+                    projectCount=projectCount+e.getProjectCount();
+                    inProgressCount=inProgressCount+e.getInProgress();
+                    notStartedCount=notStartedCount+e.getNotStarted();
+                    completeCount=completeCount+e.getComplete();
+                    stopCount=stopCount+e.getStop();
+                    publicReleaseCount=publicReleaseCount+e.getCountPublicRelease();
+                    assistCount=assistCount+e.getCountAssist();
+                }
+            }
+            projectCountList.add(projectCount);
+            inProgressList.add(inProgressCount);
+            notStartedList.add(notStartedCount);
+            completeList.add(completeCount);
+            stopList.add(stopCount);
+            publicReleaseCountList.add(publicReleaseCount);
+            assistCountList.add(assistCount);
+        }
+        map.put("dates",thisMonth);
+        map.put("projectCountList",projectCountList);
+        map.put("inProgressList",inProgressList);
+        map.put("notStartedList",notStartedList);
+        map.put("completeList",completeList);
+        map.put("stopList",stopList);
+        map.put("publicReleaseCountList",publicReleaseCountList);
+        map.put("assistCountList",assistCountList);
+        return map;
     }