seyason 3 سال پیش
والد
کامیت
3f8250e634
13فایلهای تغییر یافته به همراه131 افزوده شده و 101 حذف شده
  1. 1 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/aop/AopLogConfiguration.java
  2. 3 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java
  3. 114 87
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DepartmentServiceImpl.java
  4. 8 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java
  5. 0 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java
  6. 2 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java
  7. 0 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/LeaveSheetServiceImpl.java
  8. 0 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  9. BIN
      fhKeeper/formulahousekeeper/management-platform/人员导入模板 (4).xlsx
  10. BIN
      fhKeeper/formulahousekeeper/management-platform/人员导入模板.xlsx
  11. 1 0
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/department_list.vue
  12. 1 0
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue
  13. 1 0
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/profession_list.vue

+ 1 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/aop/AopLogConfiguration.java

@@ -41,10 +41,7 @@ public class AopLogConfiguration {
 
         String methodName = joinPoint.getSignature().getName();
         if (!"loginAdmin".equals(methodName)) {
-            log.info("---------------请求内容---------------");
-            log.info("请求类方法:"+methodName);
-            log.info("请求类方法参数:"+ Arrays.toString(joinPoint.getArgs()));
-            log.info("---------------请求内容---------------");
+            log.info("请求方法:"+methodName+", 参数: "+Arrays.toString(joinPoint.getArgs()));
         }
     }
 

+ 3 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -735,9 +735,9 @@ public class WeiXinCorpController {
             //该用户已存在
             User curUser = userList.get(0);
             //写死进行测试
-            if (curUser.getName().equals("屈跃庭")) {
-                curUser = userMapper.selectById("7913998191517310976");
-            }
+//            if (curUser.getName().equals("屈跃庭")) {
+//                curUser = userMapper.selectById("7913998191517310976");
+//            }
             Company company = companyMapper.selectOne(new QueryWrapper<Company>().eq("id", curUser.getCompanyId()));
 
             //检测密码正确时

+ 114 - 87
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DepartmentServiceImpl.java

@@ -135,6 +135,8 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
         return httpRespMsg;
     }
 
+
+
     //删除部门
     @Override
     public HttpRespMsg deleteDepartment(Integer departmentId, HttpServletRequest request) {
@@ -185,6 +187,23 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
         return departmentMapper.selectCount(new QueryWrapper<Department>().eq("superior_id", id)) > 0;
     }
 
+    private void fillSubDepartmentList(List<Department> allDepts, DepartmentVO parentDept) {
+        Integer id = parentDept.getId();
+        List<Department> collect = allDepts.stream().filter(all -> all.getSuperiorId() != null && all.getSuperiorId().intValue() == id).collect(Collectors.toList());
+        List<DepartmentVO> subResult = new ArrayList<>();
+        if (collect.size() > 0) {
+            collect.forEach(c->{
+                DepartmentVO vo = formatDepartmentToVO(c);
+                subResult.add(vo);
+                //继续添加当前部门的子部门
+                fillSubDepartmentList(allDepts, vo);
+            });
+        }
+        if (subResult.size() > 0) {
+            parentDept.setChildren(subResult);
+        }
+    }
+
     //获取部门列表
     @Override
     public HttpRespMsg getDepartmentList(HttpServletRequest request) {
@@ -196,94 +215,102 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
                     .eq("company_id", companyId));
             //结果列表
             List<DepartmentVO> list = new ArrayList<>();
-            Stack<DepartmentVO>
-                    //主栈 存放顺序依赖下半段
-                    stack1 = new Stack<>(),
-                    //副栈 存放主栈中依赖被切开后的上半段
-                    stack2 = new Stack<>();
-            //遍历一次 把其中无父级的部门PO取出来转换成部门VO放入主栈中 并将其从原始部门数据中移除
-            for (int i = 0; i < departmentList.size(); i++) {
-                Department department = departmentList.get(i);
-                if (department.getSuperiorId() == null) {
-                    stack1.push(formatDepartmentToVO(department));
-                    departmentList.remove(i--);
-                }
-            }
+            List<Department> rootDepartments = departmentList.stream().filter(dept -> dept.getSuperiorId() == null).collect(Collectors.toList());
+            rootDepartments.forEach(root->{
+                DepartmentVO rootDeptVO = formatDepartmentToVO(root);
+                list.add(rootDeptVO);
+                fillSubDepartmentList(departmentList, rootDeptVO);
+            });
+
+
+//            Stack<DepartmentVO>
+//                    //主栈 存放顺序依赖下半段
+//                    stack1 = new Stack<>(),
+//                    //副栈 存放主栈中依赖被切开后的上半段
+//                    stack2 = new Stack<>();
+//            //遍历一次 把其中无父级的部门PO取出来转换成部门VO放入主栈中 并将其从原始部门数据中移除
+//            for (int i = 0; i < departmentList.size(); i++) {
+//                Department department = departmentList.get(i);
+//                if (department.getSuperiorId() == null) {
+//                    stack1.push(formatDepartmentToVO(department));
+//                    departmentList.remove(i--);
+//                }
+//            }
             //在原始部门数据移除之前无限循环 将列表里的元素全部按照顺序放进主栈和副栈当中
-            while (departmentList.size() > 0) {
-                //用来判断主栈最上方那个部门是 false-本来就在的 还是 true-刚被加入进去的
-                Boolean isPushed = false;
-                //偷看顶部元素
-                DepartmentVO temp = stack1.peek();
-                //遍历一次原始数据列表
-                for (int i = 0; i < departmentList.size(); i++) {
-                    //如果列表中有任何主栈顶部门的子部门
-                    Department department = departmentList.get(i);
-                    if (department.getSuperiorId().equals(temp.getId())) {
-                        //设定主栈最上方的部门是刚放进去的 本次循环中不要向外排
-                        isPushed = true;
-                        //那就转换成部门VO放入主栈
-                        stack1.push(formatDepartmentToVO(department));
-                        //从列表中移除部门
-                        departmentList.remove(i--);
-                    }
-                }
-                //如果主栈最上方部门不是刚被加进去的而是一开始循环遍历时的那个
-                if (!isPushed) {
-                    //也就是说这个最上方部门并没有子部门 所以排出来扔进副栈
-                    stack2.push(stack1.pop());
-                }
-            }
-            //开始从主栈中向外排
-            while (!stack1.isEmpty()) {
-                //取得栈顶部门及其父部门id
-                DepartmentVO first = stack1.pop();
-                Integer superiorId = first.getParentId();
-                //如果没有父部门id 那就直接放进最终列表当中
-                if (superiorId != null) {
-                    List<DepartmentVO> targetList = new ArrayList<>();
-                    //有父部门的话 那么下方很可能也是相同的父部门 所以要把类似的它们存入最终栈中
-                    targetList.add(first);
-                    //把副栈中所有相同父部门的部门存入最终栈
-                    while (!stack2.isEmpty() &&
-                            stack2.peek().getParentId() != null &&
-                            stack2.peek().getParentId().equals(superiorId)) {
-                        targetList.add(stack2.pop());
-                    }
-                    //把主栈中所有相同父部门的部门存入最终栈
-                    while (stack1.peek().getParentId() != null && stack1.peek().getParentId().equals(superiorId)) {
-                        targetList.add(stack1.pop());
-                    }
-                    //把这些部门装入父部门 也就是当前主栈栈顶的那个部门的children中
-                    stack1.peek().setChildren(targetList);
-                } else {
-                    list.add(first);
-                }
-            }
-            //这个时候主栈已经清空了 副栈中元素加入主栈中再来一次
-            while (!stack2.isEmpty()) {
-                stack1.push(stack2.pop());
-            }
-            //主栈再来一次 这次不用考虑副栈了
-            while (!stack1.isEmpty()) {
-                //取得栈顶部门及其父部门id
-                DepartmentVO first = stack1.pop();
-                Integer superiorId = first.getParentId();
-                //如果没有父部门id 那就直接放进最终列表当中
-                if (superiorId != null) {
-                    List<DepartmentVO> targetList = new ArrayList<>();
-                    //有父部门的话 那么下方很可能也是相同的父部门 所以要把类似的它们存入最终栈中
-                    targetList.add(first);
-                    //首先把主栈中所有相同父部门的部门存入最终栈
-                    while (stack1.peek().getParentId() != null && stack1.peek().getParentId().equals(superiorId)) {
-                        targetList.add(stack1.pop());
-                    }
-                    //把这些部门装入父部门 也就是当前主栈栈顶的那个部门的children中
-                    stack1.peek().setChildren(targetList);
-                } else {
-                    list.add(first);
-                }
-            }
+//            while (departmentList.size() > 0) {
+//                //用来判断主栈最上方那个部门是 false-本来就在的 还是 true-刚被加入进去的
+//                Boolean isPushed = false;
+//                //偷看顶部元素
+//                DepartmentVO temp = stack1.peek();
+//                //遍历一次原始数据列表
+//                for (int i = 0; i < departmentList.size(); i++) {
+//                    //如果列表中有任何主栈顶部门的子部门
+//                    Department department = departmentList.get(i);
+//                    if (department.getSuperiorId().equals(temp.getId())) {
+//                        //设定主栈最上方的部门是刚放进去的 本次循环中不要向外排
+//                        isPushed = true;
+//                        //那就转换成部门VO放入主栈
+//                        stack1.push(formatDepartmentToVO(department));
+//                        //从列表中移除部门
+//                        departmentList.remove(i--);
+//                    }
+//                }
+//                //如果主栈最上方部门不是刚被加进去的而是一开始循环遍历时的那个
+//                if (!isPushed) {
+//                    //也就是说这个最上方部门并没有子部门 所以排出来扔进副栈
+//                    stack2.push(stack1.pop());
+//                }
+//            }
+//            //开始从主栈中向外排
+//            while (!stack1.isEmpty()) {
+//                //取得栈顶部门及其父部门id
+//                DepartmentVO first = stack1.pop();
+//                Integer superiorId = first.getParentId();
+//                //如果没有父部门id 那就直接放进最终列表当中
+//                if (superiorId != null) {
+//                    List<DepartmentVO> targetList = new ArrayList<>();
+//                    //有父部门的话 那么下方很可能也是相同的父部门 所以要把类似的它们存入最终栈中
+//                    targetList.add(first);
+//                    //把副栈中所有相同父部门的部门存入最终栈
+//                    while (!stack2.isEmpty() &&
+//                            stack2.peek().getParentId() != null &&
+//                            stack2.peek().getParentId().equals(superiorId)) {
+//                        targetList.add(stack2.pop());
+//                    }
+//                    //把主栈中所有相同父部门的部门存入最终栈
+//                    while (stack1.peek().getParentId() != null && stack1.peek().getParentId().equals(superiorId)) {
+//                        targetList.add(stack1.pop());
+//                    }
+//                    //把这些部门装入父部门 也就是当前主栈栈顶的那个部门的children中
+//                    stack1.peek().setChildren(targetList);
+//                } else {
+//                    list.add(first);
+//                }
+//            }
+//            //这个时候主栈已经清空了 副栈中元素加入主栈中再来一次
+//            while (!stack2.isEmpty()) {
+//                stack1.push(stack2.pop());
+//            }
+//            //主栈再来一次 这次不用考虑副栈了
+//            while (!stack1.isEmpty()) {
+//                //取得栈顶部门及其父部门id
+//                DepartmentVO first = stack1.pop();
+//                Integer superiorId = first.getParentId();
+//                //如果没有父部门id 那就直接放进最终列表当中
+//                if (superiorId != null) {
+//                    List<DepartmentVO> targetList = new ArrayList<>();
+//                    //有父部门的话 那么下方很可能也是相同的父部门 所以要把类似的它们存入最终栈中
+//                    targetList.add(first);
+//                    //首先把主栈中所有相同父部门的部门存入最终栈
+//                    while (stack1.peek().getParentId() != null && stack1.peek().getParentId().equals(superiorId)) {
+//                        targetList.add(stack1.pop());
+//                    }
+//                    //把这些部门装入父部门 也就是当前主栈栈顶的那个部门的children中
+//                    stack1.peek().setChildren(targetList);
+//                } else {
+//                    list.add(first);
+//                }
+//            }
             //返回数据
             httpRespMsg.data = list;
         } catch (NullPointerException e) {

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

@@ -646,10 +646,17 @@ public class DingDingServiceImpl implements DingDingService {
                 user.setDepartmentCascade(convertDepartmentIdToCascade(departmentId));
             }
             //检查用户是否已经存在
-            if (userMapper.selectCount(new QueryWrapper<User>().eq("dingding_userid", dingdingUserid).eq("company_id", companyId)) == 0) {
+            User oldUser = userMapper.selectOne(new QueryWrapper<User>().eq("dingding_userid", dingdingUserid).eq("company_id", companyId));
+            if (oldUser == null) {
                 userMapper.insert(user);
             } else {
                 System.out.println("该人员已存在:dingdingUserid==" + dingdingUserid);
+                //可能需要更新姓名
+                if (oldUser.getName() == null) {
+                    oldUser.setName(userJson.getString("name"));
+                    userMapper.updateById(oldUser);
+                    System.out.println("更新用户姓名==" + oldUser.getName());
+                }
                 //已有人员不做改动
 //                User oldUser = userMapper.selectList(new QueryWrapper<User>().eq("dingding_userid", dingdingUserid).eq("company_id", companyId).orderByDesc("create_time")).get(0);
 //                oldUser.setName(userJson.getString("name"));

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

@@ -127,7 +127,6 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
         IPage<ExpenseSheet> listIPager = expenseSheetMapper.selectPage(new Page<>(pageIndex, pageSize),
                 queryWrapper);
         List<ExpenseSheet> records = listIPager.getRecords();
-        System.out.println("record size===="+records.size());
         Long total = listIPager.getTotal();
         Map<String, Object> map = new HashMap<>();
         map.put("records", records);

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

@@ -184,9 +184,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                 }
                 finance.setCompanyId(companyId);
                 finance.setName(name);
-                Integer deptId = null;
 
-                Optional<User> first = first = userList.stream().filter(u -> u.getName().equals(name)).findFirst();
+                Optional<User> first = userList.stream().filter(u -> u.getName().equals(name)).findFirst();
                 if (first.isPresent()) {
                     finance.setUserId(first.get().getId());
                     BigDecimal total = new BigDecimal(0);
@@ -294,7 +293,7 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                             if (map.get("creatorId").equals(finance.getUserId())) {
                                 double time = (Double)map.get("workingTime");
                                 localUser.setCost(total.divide(new BigDecimal(time), 6, BigDecimal.ROUND_HALF_UP));
-                                System.out.println("cost=="+localUser.getCost());
+//                                System.out.println("cost=="+localUser.getCost());
                                 break;
                             }
                         }

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

@@ -104,7 +104,6 @@ public class LeaveSheetServiceImpl extends ServiceImpl<LeaveSheetMapper, LeaveSh
         IPage<LeaveSheet> listIPager = leaveSheetMapper.selectPage(new Page<>(pageIndex, pageSize),
                 queryWrapper);
         List<LeaveSheet> records = listIPager.getRecords();
-        System.out.println("record size===="+records.size());
         Long total = listIPager.getTotal();
         Map<String, Object> map = new HashMap<>();
         map.put("records", records);

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

@@ -1716,7 +1716,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 if (outputStream != null && inputStream != null) {
                     outputStream.close();
                     inputStream.close();
-                    System.out.println("流已关闭");
                 }
             } catch (IOException e) {
                 e.printStackTrace();

BIN
fhKeeper/formulahousekeeper/management-platform/人员导入模板 (4).xlsx


BIN
fhKeeper/formulahousekeeper/management-platform/人员导入模板.xlsx


+ 1 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/department_list.vue

@@ -68,6 +68,7 @@
     export default {
         data() {
             return {
+                fullDayTxt:['全天','上午','下午'],
                 tmpPics:[],
                 imgShow: false,
                 user: JSON.parse(localStorage.userInfo),

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue

@@ -82,6 +82,7 @@
     export default {
         data() {
             return {
+                fullDayTxt:['全天','上午','下午'],
                 denyForm:{reason:null},
                 denyReasonDialog:false,
                 tmpPics:[],

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/profession_list.vue

@@ -69,6 +69,7 @@
     export default {
         data() {
             return {
+                fullDayTxt:['全天','上午','下午'],
                 tmpPics:[],
                 imgShow: false,
                 user: JSON.parse(localStorage.userInfo),