瀏覽代碼

临时提交

王苗苗 2 月之前
父節點
當前提交
b3bec13e1b

+ 3 - 0
slibra-system/src/main/java/com/slibra/business/mapper/TCallRecordMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import com.slibra.business.domain.TCallRecord;
 import com.slibra.business.res.CallUserCountInfo;
+import com.slibra.business.res.Top7Res;
 import com.slibra.business.res.UserTypeResp;
 import org.apache.ibatis.annotations.Param;
 
@@ -106,4 +107,6 @@ public interface TCallRecordMapper
     int getCallInEqualsDay(String date);
 
     int getCallInEqualsMonth(String month);
+
+    List<Top7Res> getTop7ResListByMonthAndSize(@Param("nowMonth") String nowMonth, @Param("size") Integer size);
 }

+ 3 - 3
slibra-system/src/main/java/com/slibra/business/res/Top7Res.java

@@ -23,15 +23,15 @@ public class Top7Res implements Serializable {
     private static final long serialVersionUID = 1L;
 
     /** 序号 */
-    @Excel(name = "序号")
     private int index;
 
+    /** 总数 */
+    private int total;
+
     /** 业务类型名称 */
-    @Excel(name = "业务类型名称")
     private String name;
 
     /** 占比 */
-    @Excel(name = "占比")
     private BigDecimal percent;
 
 

+ 17 - 0
slibra-system/src/main/java/com/slibra/business/service/impl/TCallRecordServiceImpl.java

@@ -599,6 +599,23 @@ public class TCallRecordServiceImpl implements ITCallRecordService
             recent7MonthAndCountsLastYear.add(dayAndCountRes);
         }
         build.setRecent7MonthAndCountsLastYear(recent7MonthAndCountsLastYear);
+        //本月业务类型 top7 处理
+        List<Top7Res> top7ResList = this.tCallRecordMapper.getTop7ResListByMonthAndSize(nowMonth, DEFAULT_DAYS_QUERY_COUNT+1);
+        //处理展示数据
+        if(!CollectionUtils.isEmpty(top7ResList)) {
+            //获取本月的所有的数据
+            int nowMonthSize = this.tCallRecordMapper.getCallInEqualsMonth(nowMonth);
+            for (int i = 1; i <= top7ResList.size(); i++) {
+                Top7Res top7Res = top7ResList.get(i);
+                top7Res.setIndex(i);
+                if(nowMonthSize > 0)
+                    top7Res.setPercent(DecimalUtils.getNLengthHalfUp(BigDecimal.valueOf(top7Res.getTotal() / (double) nowMonthSize).multiply(BigDecimal_100), INT_2));
+            }
+        }
+        build.setBusinessTop7(top7ResList);
+        //今日机器人坐席情况
+
+        //今日人工坐席情况
         return build;
     }
 

+ 15 - 0
slibra-system/src/main/resources/mapper/business/TCallRecordMapper.xml

@@ -507,4 +507,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           AND category = 0
           AND DATE_FORMAT(time_begin, '%Y-%m' ) = #{date}
     </select>
+
+    <select id="getTop7ResListByMonthAndSize" resultType="com.slibra.business.res.Top7Res">
+        SELECT
+            COUNT(*) total,
+            bussiness_type name
+        FROM
+            t_call_record
+        WHERE
+            del_flag = 0
+          AND DATE_FORMAT(time_begin, '%Y-%m' ) = #{nowMonth}
+        GROUP BY
+            bussiness_type
+        ORDER BY total DESC
+            LIMIT #{size}
+    </select>
 </mapper>