Browse Source

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

seyason 2 years ago
parent
commit
694a509337

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/StagesController.java

@@ -197,7 +197,7 @@ public class StagesController {
         } else {
             queryWrapper.orderByAsc(order);
         }
-        List<Task> tasks = taskService.simpleList(queryWrapper);
+        List<Task> tasks = taskService.simpleList(queryWrapper,null,null);
         //没有权限只能看到自己创建的,负责的和待分配的任务
         List<SysRichFunction> functionList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全部任务");
         if (functionList.size() == 0 && !userId.equals(project.getInchargerId())) {
@@ -206,7 +206,7 @@ public class StagesController {
         List<Task> subTasks = new ArrayList<>();
         if (tasks.size() > 0) {
             List<Integer> collect = tasks.stream().map(Task::getId).collect(Collectors.toList());
-            List<Task> subLists = taskService.simpleList(new QueryWrapper<Task>().in("parent_tid", collect));
+            List<Task> subLists = taskService.simpleList(new QueryWrapper<Task>().in("parent_tid", collect),null,null);
             if (functionList.size() == 0 && !userId.equals(project.getInchargerId())) {
                 subLists = subLists.stream().filter(t->t.getExecutorId() == null || t.getExecutorId().contains(userId) || userId.equals(t.getCreaterId())).collect(Collectors.toList());
             }

+ 13 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java

@@ -3,7 +3,10 @@ package com.management.platform.controller;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.pagehelper.IPage;
 import com.management.platform.entity.*;
 import com.management.platform.entity.vo.SysRichFunction;
 import com.management.platform.mapper.*;
@@ -289,7 +292,7 @@ public class TaskController {
 
     private void updateProjectProgress(Integer projectId) {
         //只有里程碑才更新项目进度, 非已撤销状态的
-        List<Task> all = taskMapper.simpleList(new QueryWrapper<Task>().eq("project_id", projectId).ne("task_status", 2).eq("task_type",1));
+        List<Task> all = taskMapper.simpleList(new QueryWrapper<Task>().eq("project_id", projectId).ne("task_status", 2).eq("task_type",1),null,null);
         Project project = new Project();
         project.setId(projectId);
         if (all.size() > 0) {
@@ -441,8 +444,10 @@ public class TaskController {
 
 
     @RequestMapping("/list")
-    public HttpRespMsg list(Task task, Integer viewId, String order, boolean isDesc) {
+    public HttpRespMsg list(Task task, Integer viewId, String order, boolean isDesc,Integer pageIndex,Integer pageSize) {
         HttpRespMsg msg = new HttpRespMsg();
+        Integer size=pageSize;
+        Integer start=(pageIndex-1)*pageSize;
         String userId = request.getHeader("Token");
         User user = userMapper.selectById(userId);
         Project project = projectService.getById(task.getProjectId());
@@ -480,8 +485,8 @@ public class TaskController {
             //已超期的任务,未完成的任务
             queryWrapper.lt("end_date", LocalDate.now()).eq("task_status", 0);
         }
-        List<Task> list = taskService.simpleList(queryWrapper);
-
+        List<Task> list = taskService.simpleList(queryWrapper,start,size);
+        int total = taskMapper.selectCount(queryWrapper);
         //没有权限只能看到自己创建的,负责的和待分配的任务
         List<SysRichFunction> functionList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "查看全部任务");
         if (functionList.size() == 0 && !userId.equals(project.getInchargerId())) {
@@ -495,7 +500,10 @@ public class TaskController {
             }
 
         });
-        msg.data = list;
+        Map map=new HashMap();
+        map.put("records",list);
+        map.put("total",total);
+        msg.data = map;
         return msg;
     }
 

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/TaskMapper.java

@@ -1,6 +1,7 @@
 package com.management.platform.mapper;
 
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.management.platform.entity.Task;
@@ -24,7 +25,7 @@ public interface TaskMapper extends BaseMapper<Task> {
     List getStagesPanel(Integer projectId);
     List getTopCostTask(Integer projectId);
 
-    List<Task> simpleList(@Param(Constants.WRAPPER) Wrapper wrapper);
+    List<Task> simpleList(@Param(Constants.WRAPPER) Wrapper wrapper,Integer start,Integer size);
 
     List<Task> nameList(@Param(Constants.WRAPPER) Wrapper wrapper);
 

+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/TaskService.java

@@ -1,6 +1,7 @@
 package com.management.platform.service;
 
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.management.platform.entity.Task;
 import com.management.platform.entity.TaskGroup;
@@ -27,7 +28,7 @@ public interface TaskService extends IService<Task> {
     HttpRespMsg getTopCostTask(Integer projectId);
 
     //获取不带任务描述的列表数据
-    List<Task> simpleList(Wrapper<Task> queryWrapper);
+    List<Task> simpleList(Wrapper<Task> queryWrapper,Integer start,Integer size);
     List<Task> nameList(Wrapper<Task> queryWrapper);
 
 

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -1509,7 +1509,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
 
     @Override
     public HttpRespMsg taskSum(Integer id, HttpServletRequest request) {
-        List<Task> allTask = taskMapper.simpleList(new QueryWrapper<Task>().eq("project_id", id));
+        List<Task> allTask = taskMapper.simpleList(new QueryWrapper<Task>().eq("project_id", id),null,null);
         long finishCount = allTask.stream().filter(t -> t.getTaskStatus() == 1).count();
         long unfinishCount = allTask.stream().filter(t -> t.getTaskStatus() == 0).count();
         long timeupCount = allTask.stream().filter(t -> t.getTaskStatus() == 0 && t.getEndDate() != null && t.getEndDate().isBefore(LocalDate.now())).count();

+ 44 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -97,6 +97,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     @Resource
     private SysFunctionMapper sysFunctionMapper;
     @Resource
+    private UserFvTimeMapper userFvTimeMapper;
+    @Resource
     private ProjectBasecostSettingMapper projectBasecostSettingMapper;
     @Resource
     private UserDingdingTimeMapper userDingdingTimeMapper;
@@ -658,6 +660,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     UserDingdingTime time = dingdingTimes.get(0);
                     resultMap.put("time", time);
                 }
+            }else if(timeType.getSyncFanwei()==1){
+                List<UserFvTime> userFvTimeList = userFvTimeMapper.selectList(new QueryWrapper<UserFvTime>()
+                        .eq("user_id", userId).eq("work_date", date));
+                if (userFvTimeList.size() > 0) {
+                    UserFvTime time = userFvTimeList.get(0);
+                    resultMap.put("time", time);
+                }
             } else if (timeType.getShowCorpwxCardtime() == 1) {
                 User user = userMapper.selectById(userId);
                 List<UserCorpwxTime> corpwxTimes = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>()
@@ -713,7 +722,14 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 UserDingdingTime time = dingdingTimes.get(0);
                 msg.data = time;
             }
-        } else if (timeType.getShowCorpwxCardtime() == 1) {
+        }else if(timeType.getSyncFanwei()==1){
+            List<UserFvTime> userFvTimeList = userFvTimeMapper.selectList(new QueryWrapper<UserFvTime>()
+                    .eq("user_id", userId).eq("work_date", date));
+            if (userFvTimeList.size() > 0) {
+                UserFvTime time = userFvTimeList.get(0);
+                msg.data=time;
+            }
+        }  else if (timeType.getShowCorpwxCardtime() == 1) {
             List<UserCorpwxTime> corpwxTimes = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>()
                     .eq("corpwx_userid", user.getCorpwxUserid()).eq("create_date", date));
             if (corpwxTimes.size() > 0) {
@@ -1246,6 +1262,28 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         }
                     }
                 }
+            } else if(timeType.getSyncFanwei()==1){
+                //泛微的情况
+                QueryWrapper<UserFvTime> userFvTimeQueryWrapper = new QueryWrapper<>();
+                if (nameList.size() > 0) {
+                    for (Map map : nameList) {
+                        String itemUid = (String)map.get("userId");
+                        String dateStr = (String)map.get("dateStr");
+                        userFvTimeQueryWrapper.or(wrapper->wrapper.eq("user_id", itemUid).eq("work_date", dateStr));
+                    }
+                    List<UserFvTime> timeList = userFvTimeMapper.selectList(userFvTimeQueryWrapper);
+                    //过滤匹配当前的数据
+                    for (Map map : nameList) {
+                        String itemUid = (String)map.get("userId");
+                        String dateStr = (String)map.get("dateStr");
+                        Optional<UserFvTime> first = timeList.stream().filter(time -> time.getUserId().equals(itemUid) && dtf.format(time.getWorkDate()).equals(dateStr)).findFirst();
+                        if (first.isPresent()) {
+                            double wh = first.get().getWorkHours();
+                            //赋值打卡时长
+                            map.put("cardHours", wh);
+                        }
+                    }
+                }
             }
             httpRespMsg.data = nameList;
         } catch (NullPointerException e) {
@@ -4949,7 +4987,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             List<UserDingdingTime> dingdingTimes = userDingdingTimeMapper.selectList(new QueryWrapper<UserDingdingTime>()
                     .eq("user_id", userId).in("work_date", dateList));
             msg.data = dingdingTimes;
-        } else if (timeType.getShowCorpwxCardtime() == 1) {
+        } else if(timeType.getSyncFanwei()==1){
+            List<UserFvTime> userFvTimes = userFvTimeMapper.selectList(new QueryWrapper<UserFvTime>()
+                    .eq("user_id", userId).in("work_date", dateList));
+            msg.data = userFvTimes;
+        }else if (timeType.getShowCorpwxCardtime() == 1) {
             List<UserCorpwxTime> corpwxTimes = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>()
                     .eq("corpwx_userid", user.getCorpwxUserid()).in("create_date", dateList));
             msg.data = corpwxTimes;

+ 3 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java

@@ -103,10 +103,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
     }
 
     @Override
-    public List<Task> simpleList(Wrapper<Task> queryWrapper) {
-        return taskMapper.simpleList(queryWrapper);
+    public List<Task> simpleList(Wrapper<Task> queryWrapper,Integer start,Integer size) {
+        return taskMapper.simpleList(queryWrapper,start,size);
     }
 
+
     @Override
     public List<Task> nameList(Wrapper<Task> queryWrapper) {
         return taskMapper.nameList(queryWrapper);
@@ -692,5 +693,4 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         httpRespMsg.data=list;
         return httpRespMsg;
     }
-
 }

+ 3 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TaskMapper.xml

@@ -98,6 +98,9 @@
         select id, name, creater_id, creater_name, creator_color, executor_id, executor_name, executor_color, task_level, task_status, create_date, end_date, project_id, stages_id, company_id, indate, parent_tid, group_id, seq, plan_hours, task_type, parent_tname, finish_date, start_date
         from task
         ${ew.customSqlSegment}
+        <if test="start!=null and size!=null">
+            limit #{start},#{size}
+        </if>
     </select>
     <select id="nameList" resultMap="BaseResultMap">
         select id, name, task_level, stages_id, company_id, indate,  group_id, seq,task_type,task_desc

+ 7 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -1495,11 +1495,18 @@ export default {
                 if(node.type == 'dep') {
                   this.dataArray[this.sindex].auditDeptId = node.value;
                   this.dataArray[this.sindex].auditDeptName = node.label;
+                  this.dataArray[this.sindex].auditorType = 1
+                  this.dataArray[this.sindex].userId = ''
+                  this.dataArray[this.sindex].userName = ''
                 } else {
                   this.dataArray[this.sindex].userId = node.value;
                   this.dataArray[this.sindex].userName = node.label;
+                  this.dataArray[this.sindex].auditDeptId = ''
+                  this.dataArray[this.sindex].auditDeptName = ''
+                  this.dataArray[this.sindex].auditorType = 2
                 }
               }
+              console.log(this.dataArray, '数据')
             },
     deleteNode() {
                 this.dialogVisible = false;

+ 34 - 7
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -242,7 +242,7 @@
                         <!--列表-->
                         <el-table v-if="displayTable" :data="taskDataList" 
                         :header-cell-style="{'font-weight':'normal'}" border
-                        highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
+                        highlight-current-row v-loading="listLoading" :height="tableHeight - 20" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
                             <el-table-column fixed :label="$t('wan-cheng')"  width="50">
                                 <template slot-scope="scope">
                                     <el-checkbox :disabled="scope.row.taskStatus==2" v-model="scope.row.isFinish" size="large" class="cb"  
@@ -322,6 +322,17 @@
                                 </template>
                             </el-table-column>
                         </el-table>
+                        <el-col :span="24" class="toolbar" v-if="displayTable">
+                        <el-pagination
+                            @size-change="taskListSizeChange"
+                            @current-change="taskListPageChange"
+                            :page-sizes="[20 , 50 , 80 , 100]"
+                            :page-size="taskListSize"
+                            layout="total, sizes, prev, pager, next"
+                            :total="taskListTotal"
+                            style="float:right;"
+                        ></el-pagination>
+                        </el-col>
                     </el-main>
                 </el-container>
             </el-tab-pane>
@@ -1292,7 +1303,11 @@
                 groupDetailData: {},
                 groupDetailTil: '',
                 setTemplateData: {},
-                setTemplateDialog: false
+                setTemplateDialog: false,
+                
+                taskListPage: 1,
+                taskListSize: 20,
+                taskListTotal: 0
             };
             
         },
@@ -2313,19 +2328,30 @@
                     this.getViewTaskList();
                 }
             },
+
+            taskListPageChange(val){
+                this.taskListPage = val
+                this.getViewTaskList()
+            },
+            taskListSizeChange(val){
+                this.taskListSize = val
+                this.taskListPage = 1
+                this.getViewTaskList()
+            },
             //加载视图任务列表
             getViewTaskList() {
-                this.http.post('/task/list',{projectId: this.curProjectId, viewId: this.selectedGroup.id, order: this.order, isDesc: this.isDesc},
+                this.http.post('/task/list',{projectId: this.curProjectId, viewId: this.selectedGroup.id, order: this.order, isDesc: this.isDesc,pageIndex: this.taskListPage,pageSize:this.taskListSize},
                 res => {
                     if (res.code == "ok") {
                         // this.taskDataList = res.data;
                         // console.log(this.taskDataList, '任务视图的列表')
-                        for(var i in res.data) {
-                            if(res.data[i].executorName != null) {
-                                res.data[i].executorName = res.data[i].executorName.split(',')
+                        for(var i in res.data.records) {
+                            if(res.data.records[i].executorName != null) {
+                                res.data.records[i].executorName = res.data.records[i].executorName.split(',')
                             }
                         }
-                        this.taskDataList = res.data;
+                        this.taskDataList = res.data.records;
+                        this.taskListTotal = res.data.total
                         console.log(this.taskDataList, '任务视图的列表')
                         this.taskDataList.forEach(t=>{
                             t.isFinish = t.taskStatus==1?true:false;
@@ -2746,6 +2772,7 @@
                 this.selectedGroup = this.viewList.filter(g=>g.id == index)[0];
                 this.getViewTaskList();
                 this.displayTable = true;
+                this.taskListPage = 1
             } ,
             groupChange(index, indexPath) {
                 console.log('店家了')

+ 25 - 11
fhKeeper/formulahousekeeper/timesheet/src/views/project/vueGantt.vue

@@ -14,7 +14,9 @@
           <template slot-scope="scope">
             <span v-if="user.userNameNeedTranslate == 1 && scope.row.translationType == 'user'">
               <span v-for="(item, index) in scope.row.userNameList" :key="index">
-                <ww-open-data type='userName' :openid='scope.row.text'></ww-open-data>
+                <!-- <ww-open-data type='userName' :openid='scope.row.text'></ww-open-data> -->
+                <ww-open-data type='userName' :openid='item'></ww-open-data>
+                <span v-if="index < scope.row.userNameList.length - 1">,</span>
               </span>
             </span>
             <span v-if="user.userNameNeedTranslate == 1 && scope.row.translationType == 'user'">{{scope.row.proNameText}}</span>
@@ -99,6 +101,7 @@ export default {
 
     // this.treeDataList = this.integrationTree(this.tasks.data)
     console.log(this.mergeList, '合并数据')
+    console.log(this.treeDataList, '合并完全的数据')
   },
   methods: {
     // 递归加颜色以及存储需要合并的数据
@@ -106,20 +109,31 @@ export default {
       for (let i in data) {
             if(this.stafforpro == '按项目查看') {
               data[i].color = '#409EFF'
-              if(data[i].type == 'user' && data[i].text) {
+              // if(data[i].type == 'user' && data[i].text) {
+              //   let arr = []
+              //   if(data[i].text.indexOf('/') != '-1') {
+              //     let str = data[i].text.split('/')[0]
+              //     if(str.indexOf(',') != '-1') {
+              //       let arrList = str.split(',')
+              //       data[i].userNameList = arrList
+              //     } else {
+              //       arr.push(str)
+              //       data[i].userNameList = arr
+              //     }
+              //     data[i].proNameText = data[i].text.split('/')[1]
+              //   }
+              // }
+              if(data[i].translationType == 'user' && data[i].text) {
                 let arr = []
-                if(data[i].text.indexOf('/') != '-1') {
-                  let str = data[i].text.split('/')[0]
-                  if(str.indexOf(',') != '-1') {
-                    let arrList = str.split(',')
-                    data[i].userNameList = arrList
-                  } else {
-                    arr.push(str)
-                    data[i].userNameList = arr
+                arr = data[i].text.split(',')
+                for(var j in arr) {
+                  if(arr[j].indexOf('/') != '-1') {
+                    arr[j] = arr[j].split('/')[0]
                   }
-                  data[i].proNameText = data[i].text.split('/')[1]
                 }
+                data[i].userNameList = arr
               }
+
             }
             this.num++
             let obj = {