Quellcode durchsuchen

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

seyason vor 5 Jahren
Ursprung
Commit
b0ff975df9

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TimeCalculationController.java

@@ -42,7 +42,7 @@ public class TimeCalculationController {
      * pageIndex 分页页码
      * pageSize 分页大小
      * userId 筛选用户id 可传
-     * actionCode 筛选行为种类 可传 不传时排除0
+     * actionCode 筛选行为种类 可传 不传时默认6、7、8
      * date 筛选日期 可传
      */
     @RequestMapping("/getDevianceList")

+ 12 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TimeCalculationServiceImpl.java

@@ -65,7 +65,7 @@ public class TimeCalculationServiceImpl extends ServiceImpl<TimeCalculationMappe
         try {
             Map<String, Object> resultMap = new HashMap<>();
             Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
-            //注意这里目前把代码为0以外的行为全部计作异常 后续可能需要修改
+            //actionCode为null时筛选6、7、8
             resultMap.put("records", timeCalculationMapper
                     .getDevianceList(new Page<>(pageIndex, pageSize), userId, actionCode, date, companyId));
             //返回总数
@@ -93,13 +93,21 @@ public class TimeCalculationServiceImpl extends ServiceImpl<TimeCalculationMappe
                 map.put("phone", userMap.get("phone"));
                 //然后根据日期和用户id获取到所有的记录 然后手动累加在一起
                 Long[] timeArray = {0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L};
-                String[] stringArray = new String[9];
+                //编程 资料 文档 设计 美工 运营 小说 游戏 音乐
                 for (Map<String, Object> dataMap : timeCalculationMapper
                         .getTodayStatistics((String) userMap.get("id"), date, companyId)) {
                     timeArray[(int) dataMap.get("type")] += (Long) dataMap.get("duration");
                 }
-                for (int i = 0; i < 9; i++) {
-                    stringArray[i] = convertSecond(timeArray[i]);
+                Long[] resultArray = new Long[5];
+                //编程 浏览 设计 办公 娱乐
+                resultArray[0] = timeArray[0];
+                resultArray[1] = timeArray[1] + timeArray[2];
+                resultArray[2] = timeArray[3] + timeArray[4];
+                resultArray[3] = timeArray[5];
+                resultArray[4] = timeArray[6] + timeArray[7] + timeArray[8];
+                String[] stringArray = new String[5];
+                for (int i = 0; i < 5; i++) {
+                    stringArray[i] = convertSecond(resultArray[i]);
                 }
                 map.put("statistics", stringArray);
                 //最后是数组的和

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeCalculationMapper.xml

@@ -34,7 +34,7 @@
             AND a.action_type = #{actionCode}
         </if>
         <if test="actionCode == null">
-            AND a.action_type != 0
+            AND a.action_type IN (6,7,8)
         </if>
         <if test="date != null and date != ''">
             AND a.date = #{date}
@@ -57,7 +57,7 @@
             AND a.action_type = #{actionCode}
         </if>
         <if test="actionCode == null">
-            AND a.action_type != 0
+            AND a.action_type IN (6,7,8)
         </if>
         <if test="date != null and date != ''">
             AND a.date = #{date}

+ 5 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/statistics.vue

@@ -32,12 +32,11 @@
       <el-table-column type="index" width="60"></el-table-column>
       <el-table-column prop="name" label="姓名" width="140" sortable></el-table-column>
       <el-table-column prop="phone" label="手机" width="180"></el-table-column>
-      <!-- 这里数胡乱写进去的 后续需要重新约定数字代表的意义 -->
-      <el-table-column prop="statistics[0]" label="编程"></el-table-column>
-      <el-table-column prop="statistics[1]" label="设计" sortable></el-table-column>
-      <el-table-column prop="statistics[2]" label="办公" sortable></el-table-column>
-      <el-table-column prop="statistics[3]" label="娱乐" sortable></el-table-column>
-      <el-table-column prop="statistics[4]" label="浏览" sortable></el-table-column>
+      <el-table-column prop="statistics[0]" label="编程" sortable></el-table-column>
+      <el-table-column prop="statistics[1]" label="浏览" sortable></el-table-column>
+      <el-table-column prop="statistics[2]" label="设计" sortable></el-table-column>
+      <el-table-column prop="statistics[3]" label="办公" sortable></el-table-column>
+      <el-table-column prop="statistics[4]" label="娱乐" sortable></el-table-column>
       <el-table-column prop="sum" label="总时长" width="180" sortable></el-table-column>
     </el-table>