Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

yurk 3 tahun lalu
induk
melakukan
3ebebd2ec5
51 mengubah file dengan 3224 tambahan dan 711 penghapusan
  1. 6 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DingDingController.java
  2. 21 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/LeaveQuotaNumController.java
  3. 21 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/LeaveTypeController.java
  4. 97 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectRequirementController.java
  5. 1 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java
  6. 10 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportExtraDegreeController.java
  7. 15 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskGroupController.java
  8. 67 6
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserYearleaveSettingController.java
  9. 30 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WxCorpInfoController.java
  10. 72 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/LeaveQuotaNum.java
  11. 48 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/LeaveType.java
  12. 53 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ProjectRequirement.java
  13. 2 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ReportExtraDegree.java
  14. 0 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/LeaveQuotaNum.java
  15. 16 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/LeaveQuotaNumMapper.java
  16. 16 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/LeaveTypeMapper.java
  17. 19 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectRequirementMapper.java
  18. 3 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/DingDingService.java
  19. 16 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/LeaveQuotaNumService.java
  20. 16 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/LeaveTypeService.java
  21. 16 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectRequirementService.java
  22. 228 107
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java
  23. 20 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/LeaveQuotaNumServiceImpl.java
  24. 20 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/LeaveTypeServiceImpl.java
  25. 20 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectRequirementServiceImpl.java
  26. 8 6
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  27. 3 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java
  28. 27 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/LeaveQuotaNumMapper.xml
  29. 19 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/LeaveTypeMapper.xml
  30. 44 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectRequirementMapper.xml
  31. 9 9
      fhKeeper/formulahousekeeper/timesheet/config/index.js
  32. 4 3
      fhKeeper/formulahousekeeper/timesheet/src/views/centerManage/centerManage.vue
  33. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue
  34. 37 1
      fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue
  35. 4 1
      fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue
  36. 243 133
      fhKeeper/formulahousekeeper/timesheet/src/views/project/project_gantt.vue
  37. 26 31
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue
  38. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue
  39. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_import.vue
  40. 1261 231
      fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/demo_index.html
  41. 221 47
      fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.css
  42. 1 1
      fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.js
  43. 413 105
      fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.json
  44. TEMPAT SAMPAH
      fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.ttf
  45. TEMPAT SAMPAH
      fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.woff
  46. TEMPAT SAMPAH
      fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.woff2
  47. 4 3
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/audit/audit.vue
  48. 27 0
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue
  49. 26 2
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue
  50. 1 1
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue
  51. 10 10
      fhKeeper/formulahousekeeper/timesheet_h5/vue.config.js

+ 6 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DingDingController.java

@@ -19,6 +19,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.List;
@@ -360,10 +361,11 @@ public class DingDingController {
         return new HttpRespMsg();
     }
 //
-    @RequestMapping("/getCorpLeaveQuata")
-    public HttpRespMsg getCorpLeaveQuata(String leaveCode, Integer companyId, Integer departmentId, String userId, @RequestParam(required = false, defaultValue = "1") Integer pageIndex) {
-        CompanyDingding companyDingding = companyDingdingService.getOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
-        return dingDingService.getLeaveTypeList(leaveCode, companyId, departmentId, userId, pageIndex);
+    @RequestMapping("/syncLeaveQuotaData")
+    public HttpRespMsg syncLeaveQuotaData(Integer companyId, HttpServletRequest request) {
+        String token = request.getHeader("TOKEN");
+        User user = userMapper.selectById(token);
+        return dingDingService.syncLeaveQuotaData(companyId);
     }
 
     @RequestMapping("/testSendBusTripLink")

+ 21 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/LeaveQuotaNumController.java

@@ -0,0 +1,21 @@
+package com.management.platform.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+@RestController
+@RequestMapping("/leave-quota-num")
+public class LeaveQuotaNumController {
+
+}
+

+ 21 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/LeaveTypeController.java

@@ -0,0 +1,21 @@
+package com.management.platform.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+@RestController
+@RequestMapping("/leave-type")
+public class LeaveTypeController {
+
+}
+

+ 97 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectRequirementController.java

@@ -0,0 +1,97 @@
+package com.management.platform.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.management.platform.constant.Constant;
+import com.management.platform.entity.*;
+import com.management.platform.mapper.ProjectMapper;
+import com.management.platform.mapper.ProjectRequirementMapper;
+import com.management.platform.mapper.TaskGroupMapper;
+import com.management.platform.mapper.UserMapper;
+import com.management.platform.service.ProjectRequirementService;
+import com.management.platform.util.HttpRespMsg;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+@RestController
+@RequestMapping("/project-requirement")
+public class ProjectRequirementController {
+    @Resource
+    private HttpServletRequest request;
+    @Resource
+    private UserMapper userMapper;
+    @Resource
+    private ProjectMapper projectMapper;
+    @Resource
+    private ProjectRequirementMapper projectRequirementMapper;
+    @Resource
+    private ProjectRequirementService projectRequirementService;
+    @Resource
+    private TaskGroupMapper taskGroupMapper;
+
+    @RequestMapping("/addOrMod")
+    public HttpRespMsg addOrMod(ProjectRequirement record) {
+        HttpRespMsg msg = new HttpRespMsg();
+        if (record.getProjectId() == null) {
+            msg.setError("项目不能为空");
+            return msg;
+        }
+        projectRequirementService.saveOrUpdate(record);
+
+        return msg;
+    }
+
+    @RequestMapping("/listByPage")
+    public HttpRespMsg listByPage(Integer pageIndex, Integer pageSize, Integer projectId, String groupName) {
+        HttpRespMsg msg = new HttpRespMsg();
+        Integer companyId = userMapper.selectById(request.getHeader("TOKEN")).getCompanyId();
+        int startIndex = (pageIndex-1)*pageSize;
+        long total = projectMapper.selectCount(new QueryWrapper<Project>().eq("company_id", companyId));
+        LocalDate now = LocalDate.now();
+        now = now.minusDays(7);
+        String startDate = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(now);
+        List<Integer> projectIds = new ArrayList<>();
+        if (!StringUtils.isEmpty(groupName)) {
+            List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId));
+            List<Integer> collect = projectList.stream().map(Project::getId).collect(Collectors.toList());
+            List<TaskGroup> taskGroups = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().eq("name", groupName).in("project_id", collect));
+            projectIds = taskGroups.stream().map(TaskGroup::getProjectId).collect(Collectors.toList());
+        }
+        List<ProjectRequirement> projectRequirements = projectRequirementMapper.customSelect(companyId, startDate, projectId, projectIds.size()==0?null:projectIds, startIndex, pageSize);
+        HashMap map = new HashMap();
+        map.put("total", total);
+        map.put("records", projectRequirements);
+        msg.data = map;
+
+        return msg;
+    }
+
+    @RequestMapping("/delete")
+    public HttpRespMsg delete(Integer id) {
+        HttpRespMsg msg = new HttpRespMsg();
+        projectRequirementMapper.deleteById(id);
+
+        return msg;
+    }
+
+}
+

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

@@ -109,7 +109,6 @@ public class ReportController {
     private void fillReportProgress(Report report, String professionProgress) {
         if (!StringUtil.isEmpty(professionProgress)) {
             professionProgress = professionProgress.replaceAll("@",",");
-            System.out.println("JSON=="+professionProgress);
             JSONArray array = JSONArray.parseArray(professionProgress);
             List<ReportProfessionProgress> list = new ArrayList<ReportProfessionProgress>();
             for(int i=0;i<array.size();i++) {
@@ -1109,7 +1108,7 @@ public class ReportController {
                                       Integer projectId,
                                       @RequestParam(required = false, defaultValue = "0") Integer dateType,
                                       String date,
-                                      @RequestParam(required = false, defaultValue = "0") Integer pageIndex,
+                                      @RequestParam(required = false, defaultValue = "1") Integer pageIndex,
                                       @RequestParam(required = false, defaultValue = "1000") Integer pageSize,
                                               Integer departmentId,
                                       HttpServletRequest request) {

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

@@ -13,6 +13,7 @@ import com.management.platform.service.ReportExtraDegreeService;
 import com.management.platform.util.HttpRespMsg;
 import org.apache.poi.util.StringUtil;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -141,11 +142,19 @@ public class ReportExtraDegreeController {
      * @return
      */
     @RequestMapping("/getAll")
-    public HttpRespMsg getAll() {
+    public HttpRespMsg getAll(@RequestParam(required = false, defaultValue = "0") Integer withProjects) {
         HttpRespMsg msg = new HttpRespMsg();
         String token = request.getHeader("TOKEN");
         User user = userMapper.selectById(token);
+
         List<ReportExtraDegree> all = reportExtraDegreeMapper.getAll(user.getCompanyId());
+        if (withProjects == 1) {
+            List<Project> allProjects = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()));
+            for (ReportExtraDegree degree : all) {
+                degree.setProjects(allProjects.stream().filter(pro->pro.getAssociateDegreeNames() != null && pro.getAssociateDegreeNames().contains(degree.getName())).map(Project::getProjectName).collect(Collectors.joining(",")));
+            }
+        }
+
         msg.data = all;
         return msg;
     }

+ 15 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskGroupController.java

@@ -199,7 +199,22 @@ public class TaskGroupController {
         return msg;
     }
 
+    @RequestMapping("/getGroupNames")
+    public HttpRespMsg getGroupNames() {
+        String token = request.getHeader("TOKEN");
+        Integer companyId = userMapper.selectById(token).getCompanyId();
+        List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().select("id").eq("company_id", companyId));
+        List<Integer> collect = projectList.stream().map(Project::getId).collect(Collectors.toList());
+        HttpRespMsg msg = new HttpRespMsg();
+        if (collect.size() > 0) {
+            msg.data = taskGroupService.list(new QueryWrapper<TaskGroup>().select("distinct name").in("project_id", collect));
+        } else {
+            msg.data = new ArrayList<>();
+        }
 
 
+        return msg;
+    }
+
 }
 

+ 67 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserYearleaveSettingController.java

@@ -2,15 +2,14 @@ package com.management.platform.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dingtalk.api.DefaultDingTalkClient;
 import com.dingtalk.api.DingTalkClient;
 import com.dingtalk.api.request.OapiAttendanceVacationTypeListRequest;
 import com.dingtalk.api.response.OapiAttendanceVacationTypeListResponse;
-import com.management.platform.entity.CompanyDingding;
-import com.management.platform.entity.User;
-import com.management.platform.entity.UserYearleaveSetting;
-import com.management.platform.mapper.UserMapper;
-import com.management.platform.mapper.UserYearleaveSettingMapper;
+import com.management.platform.entity.*;
+import com.management.platform.mapper.*;
 import com.management.platform.service.CompanyDingdingService;
 import com.management.platform.service.DingDingService;
 import com.management.platform.service.UserYearleaveSettingService;
@@ -25,7 +24,10 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -46,6 +48,12 @@ public class UserYearleaveSettingController {
     private DingDingService dingDingService;
     @Resource
     private CompanyDingdingService companyDingdingService;
+    @Resource
+    private LeaveQuotaNumMapper leaveQuotaNumMapper;
+    @Resource
+    private LeaveTypeMapper leaveTypeMapper;
+    @Resource
+    private DepartmentMapper departmentMapper;
 
     @Resource
     private HttpServletRequest request;
@@ -105,7 +113,60 @@ public class UserYearleaveSettingController {
      */
     @RequestMapping("/getDingDingLeaveQt")
     public HttpRespMsg getDingDingLeaveQt(String leaveCode, Integer companyId, Integer departmentId, String userId,@RequestParam(required = false, defaultValue = "1") Integer pageIndex) {
-        return dingDingService.getLeaveTypeList(leaveCode, companyId, departmentId, userId, pageIndex);
+        QueryWrapper<LeaveQuotaNum> quotaNumQueryWrapper = new QueryWrapper<>();
+        quotaNumQueryWrapper.eq("company_id", companyId);
+        HashMap map = new HashMap();
+        if (leaveCode == null) {
+            List<LeaveType> typeList = leaveTypeMapper.selectList(new QueryWrapper<LeaveType>().eq("company_id", companyId));
+            Optional<LeaveType> first = typeList.stream().filter(type -> type.getIsDefault() == 1).findFirst();
+            LeaveType defaultType = null;
+            if (first.isPresent()) {
+                defaultType = first.get();
+            } else {
+                defaultType = typeList.get(0);
+            }
+
+            leaveCode = defaultType.getLeaveCode();
+            map.put("leaveTypeList", typeList);
+            map.put("defaultLeaveType", defaultType);
+        }
+        quotaNumQueryWrapper.eq("leave_code", leaveCode);
+        if (userId != null) {
+            String dingdingUserid = userMapper.selectById(userId).getDingdingUserid();
+            quotaNumQueryWrapper.eq("user_dingding_id", dingdingUserid);
+        } else if (departmentId != null) {
+            //指定部门
+            Department dept = departmentMapper.selectById(departmentId);
+            List<Department> allDept = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
+            List<Department> allSubDepts = getSubDeptList(allDept, dept);
+            List<User> userList = userMapper.selectList(
+                    new QueryWrapper<User>()
+                            .in("department_id", allSubDepts.stream().map(Department::getDepartmentId).collect(Collectors.toList())));
+            List<String> userDDIds = userList.stream().map(User::getDingdingUserid).collect(Collectors.toList());
+            quotaNumQueryWrapper.in("user_dingding_id", userDDIds);
+        }
+        quotaNumQueryWrapper.orderByAsc("name").orderByAsc("start_time");
+        IPage<LeaveQuotaNum> leaveQuotaNumIPage = leaveQuotaNumMapper.selectPage(new Page<>(pageIndex, 50), quotaNumQueryWrapper);
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.data = map;
+
+        map.put("total", leaveQuotaNumIPage.getTotal());
+        map.put("records", leaveQuotaNumIPage.getRecords());
+
+        return msg;
+    }
+
+
+    //递归获取子部门
+    private List<Department> getSubDeptList(List<Department> allDeptList, Department department) {
+        List<Department> deptList = new ArrayList<>();
+        deptList.add(department);
+        //查找子部门的数据
+        List<Department> collect = allDeptList.stream().filter(sub -> sub.getSuperiorId() != null && sub.getSuperiorId().equals(department.getDepartmentId())).collect(Collectors.toList());
+        for (Department subItem : collect) {
+            deptList.addAll(getSubDeptList(allDeptList, subItem));
+        }
+        return deptList;
     }
 }
 

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

@@ -1,8 +1,15 @@
 package com.management.platform.controller;
 
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.management.platform.entity.User;
+import com.management.platform.entity.WxCorpInfo;
+import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.WxCorpInfoService;
 import com.management.platform.util.HttpRespMsg;
+import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
@@ -23,12 +30,34 @@ public class WxCorpInfoController {
 
     @Resource
     WxCorpInfoService wxCorpInfoService;
-
+    @Resource
+    UserMapper userMapper;
     @RequestMapping("/testDownload")
     public HttpRespMsg testDownload() {
         HttpRespMsg msg = new HttpRespMsg();
         msg.data = wxCorpInfoService.testDownloadFile();
         return msg;
     }
+
+    @RequestMapping("/testSendTemplateMsg")
+    public HttpRespMsg testSendTemplateMsg(String userId) {
+        User user = userMapper.selectById(userId);
+        int companyId=user.getCompanyId();
+        WxCorpInfo corpInfo = wxCorpInfoService.getOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+
+        //推送到企业微信
+        String corpUid = user.getCorpwxUserid();
+        JSONObject json=new JSONObject();
+        JSONArray dataJson=new JSONArray();
+        JSONObject jsonObj=new JSONObject();
+        jsonObj.put("key", "提醒");
+        jsonObj.put("value", "测试提醒消息");
+        dataJson.add(jsonObj);
+        json.put("template_id","tty9TkCAAAYoevY-40ciWD5lDncDfR5w");
+        json.put("url", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://mobworktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
+        json.put("content_item",dataJson);
+        wxCorpInfoService.sendWXCorpTemplateMsg(corpInfo, corpUid, json);
+        return new HttpRespMsg();
+    }
 }
 

+ 72 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/LeaveQuotaNum.java

@@ -0,0 +1,72 @@
+package com.management.platform.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class LeaveQuotaNum extends Model<LeaveQuotaNum> {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @TableField("company_id")
+    private Integer companyId;
+
+    @TableField("user_dingding_id")
+    private String userDingdingId;
+
+    @TableField("name")
+    private String name;
+
+    @TableField("leave_code")
+    private String leaveCode;
+
+    @TableField("start_time")
+    private String startTime;
+
+    @TableField("end_time")
+    private String endTime;
+
+    @TableField("quota_in_hours")
+    private String quotaInHours;
+
+    @TableField("quota_in_days")
+    private String quotaInDays;
+
+    @TableField("used_in_hours")
+    private String usedInHours;
+
+    @TableField("used_in_days")
+    private String usedInDays;
+
+    @TableField("left_in_hours")
+    private String leftInHours;
+
+    @TableField("left_in_days")
+    private String leftInDays;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 48 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/LeaveType.java

@@ -0,0 +1,48 @@
+package com.management.platform.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class LeaveType extends Model<LeaveType> {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @TableField("company_id")
+    private Integer companyId;
+
+    @TableField("leave_code")
+    private String leaveCode;
+
+    @TableField("leave_name")
+    private String leaveName;
+
+    @TableField("is_default")
+    private Integer isDefault;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 53 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ProjectRequirement.java

@@ -0,0 +1,53 @@
+package com.management.platform.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class ProjectRequirement extends Model<ProjectRequirement> {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @TableField("project_id")
+    private Integer projectId;
+
+    @TableField("memb_req")
+    private String membReq;
+
+    @TableField("task_req")
+    private String taskReq;
+
+    @TableField(exist = false)
+    private String projectCode;
+    @TableField(exist = false)
+    private String projectName;
+
+    @TableField(exist = false)
+    private String activeUsers;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/ReportExtraDegree.java

@@ -39,6 +39,8 @@ public class ReportExtraDegree extends Model<ReportExtraDegree> {
     @TableField("name")
     private String name;
 
+    @TableField(exist = false)
+    private String projects;
 
     @Override
     protected Serializable pkVal() {

+ 0 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/LeaveQuotaNum.java

@@ -3,7 +3,6 @@ package com.management.platform.entity.vo;
 public class LeaveQuotaNum {
     public String userDingdingId;
     public String name;//员工姓名
-    public String userId;
     public String leaveCode;//假期编码
     public String startTime; //假期有效开始时间
     public String endTime;//假期有效截止时间

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/LeaveQuotaNumMapper.java

@@ -0,0 +1,16 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.LeaveQuotaNum;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+public interface LeaveQuotaNumMapper extends BaseMapper<LeaveQuotaNum> {
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/LeaveTypeMapper.java

@@ -0,0 +1,16 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.LeaveType;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+public interface LeaveTypeMapper extends BaseMapper<LeaveType> {
+
+}

+ 19 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectRequirementMapper.java

@@ -0,0 +1,19 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.ProjectRequirement;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+public interface ProjectRequirementMapper extends BaseMapper<ProjectRequirement> {
+
+    public List<ProjectRequirement> customSelect(Integer companyId, String startDate, Integer projectId, List<Integer> refProjectIdList, Integer startIndex, Integer pageSize);
+}

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/DingDingService.java

@@ -32,5 +32,7 @@ public interface DingDingService {
 
     void getCorpSelfDefSmartReport(CompanyDingding dingding);
 
-    public HttpRespMsg getLeaveTypeList(String leaveCode, Integer companyId, Integer departmentId, String userId, Integer pageIndex);
+//    public HttpRespMsg getLeaveTypeList(String leaveCode, Integer companyId, Integer departmentId, String userId, Integer pageIndex);
+
+    public HttpRespMsg syncLeaveQuotaData(Integer companyId);
 }

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/LeaveQuotaNumService.java

@@ -0,0 +1,16 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.LeaveQuotaNum;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+public interface LeaveQuotaNumService extends IService<LeaveQuotaNum> {
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/LeaveTypeService.java

@@ -0,0 +1,16 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.LeaveType;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+public interface LeaveTypeService extends IService<LeaveType> {
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectRequirementService.java

@@ -0,0 +1,16 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.ProjectRequirement;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+public interface ProjectRequirementService extends IService<ProjectRequirement> {
+
+}

+ 228 - 107
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java

@@ -15,7 +15,7 @@ import com.dingtalk.api.response.*;
 import com.google.gson.JsonObject;
 import com.management.platform.constant.Constant;
 import com.management.platform.entity.*;
-import com.management.platform.entity.vo.LeaveQuotaNum;
+//import com.management.platform.entity.vo.LeaveQuotaNum;
 import com.management.platform.entity.vo.LeaveTypeVO;
 import com.management.platform.entity.vo.UserVO;
 import com.management.platform.mapper.*;
@@ -72,6 +72,8 @@ public class DingDingServiceImpl implements DingDingService {
     @Resource
     private SysModuleMapper sysModuleMapper;
     @Resource
+    private LeaveQuotaNumService leaveQuotaNumService;
+    @Resource
     private SysFunctionMapper sysFunctionMapper;
     @Resource
     private SysRoleModuleService sysRoleModuleService;
@@ -113,6 +115,8 @@ public class DingDingServiceImpl implements DingDingService {
     private LeaveSheetMapper leaveSheetMapper;
     @Resource
     private LeaveSheetService leaveSheetService;
+    @Resource
+    private LeaveTypeService leaveTypeService;
 
     @Value("${configEnv.isPrivateDeploy}")
     private boolean isPrivateDeploy;//企业内部应用,私有化部署的情况
@@ -1288,7 +1292,6 @@ public class DingDingServiceImpl implements DingDingService {
                         LocalDate workDate =  LocalDateTime.ofEpochSecond(d/1000, 0, ZoneOffset.ofHours(8)).toLocalDate();
                         UserDingdingTime timeItem = new UserDingdingTime();
                         timeItem.setWorkDate(workDate);
-                        System.out.println("workDate====="+workDate);
                         List<DdingCardTimeItem> oneDayTimes = dailyMap.get(d);
 
                         DdingCardTimeItem onDutyEarleast = null;
@@ -1303,7 +1306,6 @@ public class DingDingServiceImpl implements DingDingService {
                             offDutyLatest = findOff.get();
                         }
                         if (onDutyEarleast != null) {
-                            System.out.println("最早打卡时间"+onDutyEarleast.getUserCheckTime());
                             timeItem.setDingdingCorpid(onDutyEarleast.getCorpId());
                             timeItem.setDingdingUserid(onDutyEarleast.getUserId());
                             timeItem.setUserId(uid);
@@ -1314,7 +1316,6 @@ public class DingDingServiceImpl implements DingDingService {
                             timeItem.setWeekDayTxt(DateTimeUtil.getWeekDayTxt(timeItem.getWeekDay()));
                         }
                         if (offDutyLatest != null) {
-                            System.out.println("最晚打卡时间"+offDutyLatest.getUserCheckTime());
                             LocalDateTime oLt = LocalDateTime.ofEpochSecond(offDutyLatest.getUserCheckTime()/1000, 0, ZoneOffset.ofHours(8));
                             timeItem.setEndTime(hmFormat.format(oLt));
                         }
@@ -1346,120 +1347,121 @@ public class DingDingServiceImpl implements DingDingService {
         }
     }
 
-    public HttpRespMsg getLeaveTypeList(String leaveCode, Integer companyId, Integer departmentId, String userId, Integer pageIndex) {
+//    public HttpRespMsg getLeaveTypeList(String leaveCode, Integer companyId, Integer departmentId, String userId, Integer pageIndex) {
+//        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
+//        HttpRespMsg msg = new HttpRespMsg();
+//        HashMap resultMap = new HashMap();
+//        DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/attendance/vacation/type/list");
+//        OapiAttendanceVacationTypeListRequest req = new OapiAttendanceVacationTypeListRequest();
+//        List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId).eq("role_name", "超级管理员"));
+////        String oaManagerDid = "2221645448842951";
+//        String oaManagerDid = userList.get(0).getDingdingUserid();
+//        if (leaveCode == null) {
+//            req.setOpUserid(oaManagerDid);
+//            req.setVacationSource("all");
+//            OapiAttendanceVacationTypeListResponse rsp = null;
+//            try {
+//                rsp = client.execute(req, getInnerCorpToken(dingding));
+//                System.out.println(rsp.getBody());
+//                JSONObject json = JSONObject.parseObject(rsp.getBody());
+//                JSONArray result = json.getJSONArray("result");
+//                List<LeaveTypeVO> typeList = new ArrayList<>();
+//                LeaveTypeVO defaultType = null;
+//                for (int i=0;i<result.size(); i++) {
+//                    JSONObject obj = result.getJSONObject(i);
+//                    LeaveTypeVO vo = new LeaveTypeVO();
+//                    vo.leaveCode = obj.getString("leave_code");
+//                    vo.leaveName = obj.getString("leave_name");
+//                    if (vo.leaveName.equals("调休")) {
+//                        defaultType = vo;
+//                    }
+//                    typeList.add(vo);
+//                }
+//                resultMap.put("leaveTypeList", typeList);
+//                if (defaultType == null) defaultType = typeList.get(0);
+//                leaveCode = defaultType.leaveCode;
+//                resultMap.put("defaultLeaveType", defaultType);
+//                System.out.println("本次请求的LeaveCode: "+leaveCode);
+//                reqQuotaList(companyId, dingding, leaveCode, oaManagerDid, departmentId, userId, pageIndex, resultMap);
+//            } catch (ApiException e) {
+//                e.printStackTrace();
+//            }
+//        } else {
+//            reqQuotaList(companyId, dingding, leaveCode, oaManagerDid, departmentId, userId, pageIndex, resultMap);
+//        }
+//        msg.data = resultMap;
+//        return msg;
+//    }
+
+    @Override
+    public HttpRespMsg syncLeaveQuotaData(Integer companyId) {
         CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         HttpRespMsg msg = new HttpRespMsg();
         HashMap resultMap = new HashMap();
         DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/attendance/vacation/type/list");
         OapiAttendanceVacationTypeListRequest req = new OapiAttendanceVacationTypeListRequest();
         List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId).eq("role_name", "超级管理员"));
-//        String oaManagerDid = "2221645448842951";
         String oaManagerDid = userList.get(0).getDingdingUserid();
-        if (leaveCode == null) {
-            req.setOpUserid(oaManagerDid);
-            req.setVacationSource("all");
-            OapiAttendanceVacationTypeListResponse rsp = null;
-            try {
-                rsp = client.execute(req, getInnerCorpToken(dingding));
-                System.out.println(rsp.getBody());
-                JSONObject json = JSONObject.parseObject(rsp.getBody());
-                JSONArray result = json.getJSONArray("result");
-                List<LeaveTypeVO> typeList = new ArrayList<>();
-                LeaveTypeVO defaultType = null;
-                for (int i=0;i<result.size(); i++) {
-                    JSONObject obj = result.getJSONObject(i);
-                    LeaveTypeVO vo = new LeaveTypeVO();
-                    vo.leaveCode = obj.getString("leave_code");
-                    vo.leaveName = obj.getString("leave_name");
-                    if (vo.leaveName.equals("调休")) {
-                        defaultType = vo;
-                    }
-                    typeList.add(vo);
+        req.setOpUserid(oaManagerDid);
+        req.setVacationSource("all");
+        OapiAttendanceVacationTypeListResponse rsp = null;
+        try {
+            rsp = client.execute(req, getInnerCorpToken(dingding));
+            JSONObject json = JSONObject.parseObject(rsp.getBody());
+            JSONArray result = json.getJSONArray("result");
+            List<LeaveType> typeList = new ArrayList<>();
+            leaveTypeService.remove(new QueryWrapper<LeaveType>().eq("company_id", dingding.getCompanyId()));
+            for (int i=0;i<result.size(); i++) {
+                JSONObject obj = result.getJSONObject(i);
+                LeaveType vo = new LeaveType();
+                vo.setLeaveCode(obj.getString("leave_code"));
+                vo.setLeaveName(obj.getString("leave_name"));
+                if (vo.getLeaveName().equals("调休")) {
+                    vo.setIsDefault(1);
                 }
-                resultMap.put("leaveTypeList", typeList);
-                if (defaultType == null) defaultType = typeList.get(0);
-                leaveCode = defaultType.leaveCode;
-                resultMap.put("defaultLeaveType", defaultType);
-                System.out.println("本次请求的LeaveCode: "+leaveCode);
-                reqQuotaList(companyId, dingding, leaveCode, oaManagerDid, departmentId, userId, pageIndex, resultMap);
-            } catch (ApiException e) {
-                e.printStackTrace();
+                vo.setCompanyId(dingding.getCompanyId());
+                typeList.add(vo);
             }
-        } else {
-            reqQuotaList(companyId, dingding, leaveCode, oaManagerDid, departmentId, userId, pageIndex, resultMap);
+            leaveTypeService.saveBatch(typeList);
+            List<User> allUsers = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
+            int batchSize = 50;
+            int batchCount = allUsers.size()%50+allUsers.size()/50==0?0:1;
+            //删除老数据
+            leaveQuotaNumService.remove(new QueryWrapper<LeaveQuotaNum>().eq("company_id", companyId));
+            for (LeaveType type : typeList) {
+                //分批请求,50个一批
+                for (int i=0;i<batchCount; i++) {
+                    int startIndex = i*batchSize;
+                    int endIndex = (i+1)*batchSize;
+                    if (endIndex > allUsers.size()) endIndex = allUsers.size();
+                    List<User> curUserList = allUsers.subList(startIndex, endIndex);
+                    syncQuotaList(type.getLeaveCode(), oaManagerDid, dingding, curUserList, 0);
+                }
+            }
+        } catch (ApiException e) {
+            e.printStackTrace();
+            msg.setError(e.getMessage());
+            return msg;
         }
-        msg.data = resultMap;
-        return msg;
-    }
 
-    //递归获取子部门
-    private List<Department> getSubDeptList(List<Department> allDeptList, Department department) {
-        List<Department> deptList = new ArrayList<>();
-        deptList.add(department);
-        //查找子部门的数据
-        List<Department> collect = allDeptList.stream().filter(sub -> sub.getSuperiorId() != null && sub.getSuperiorId().equals(department.getDepartmentId())).collect(Collectors.toList());
-        for (Department subItem : collect) {
-            deptList.addAll(getSubDeptList(allDeptList, subItem));
-        }
-        return deptList;
+        return new HttpRespMsg();
     }
 
-    private void reqQuotaList(Integer companyId, CompanyDingding dingding,
-                                             String leaveCode, String oaManagerDid, Integer departmentId, String userId, Integer pageIndex, HashMap resultMap) {
-        //再调用查看假期余额的接口
+
+    //同步公司全部人员的假期余额
+    private void syncQuotaList(String leaveCode,String oaManagerDid, CompanyDingding dingding, List<User> userList, long offset) {
         long pageSize = 50L;
         DefaultDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/attendance/vacation/quota/list");
         OapiAttendanceVacationQuotaListRequest quoataReq = new OapiAttendanceVacationQuotaListRequest();
         quoataReq.setLeaveCode(leaveCode);
         quoataReq.setOpUserid(oaManagerDid);
-        List<User> userList = null;
-        String userIds = null;
-        if (StringUtils.isEmpty(userId)) {
-            int total = 0;
-            if (departmentId == null) {
-                //全部员工,包括离职的
-                userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId).orderByAsc("id").last("limit " + (pageIndex-1)*pageSize+", "+pageSize));
-                total = userMapper.selectCount(new QueryWrapper<User>().eq("company_id", companyId));
-            } else {
-                //指定部门
-                Department dept = departmentMapper.selectById(departmentId);
-                List<Department> allDept = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
-                List<Department> allSubDepts = getSubDeptList(allDept, dept);
-                userList = userMapper.selectList(
-                        new QueryWrapper<User>()
-                                .in("department_id", allSubDepts.stream().map(Department::getDepartmentId).collect(Collectors.toList()))
-                                .orderByAsc("id").last("limit " + (pageIndex-1)*pageSize+", "+pageSize));
-                total = userMapper.selectCount(new QueryWrapper<User>()
-                        .in("department_id", allSubDepts.stream().map(Department::getDepartmentId).collect(Collectors.toList())));
-            }
-            String collect = userList.stream().map(User::getDingdingUserid).collect(Collectors.joining(","));
-            userIds = collect;
-            resultMap.put("total", total);
-        } else {
-            userList = new ArrayList<>();
-            userList.add(userMapper.selectById(userId));
-            userIds = userList.get(0).getDingdingUserid();
-            resultMap.put("total", 1);
-        }
-
+        String collect = userList.stream().map(User::getDingdingUserid).collect(Collectors.joining(","));
+        String userIds = collect;
         System.out.println("请求的size="+userList.size());
         System.out.println("长度=="+userIds.length());
         List<LeaveQuotaNum> quotaNumList = new ArrayList<>();
-        for (User user : userList) {
-            LeaveQuotaNum quotaNum = new LeaveQuotaNum();
-            quotaNum.userId = user.getId();
-            quotaNum.userDingdingId = user.getDingdingUserid();
-            quotaNum.name = user.getName();
-            quotaNum.leaveCode = leaveCode;
-            quotaNumList.add(quotaNum);
-        }
-        resultMap.put("records", quotaNumList);
-        if (quotaNumList.size() == 0) {
-            //无员工数据了
-            return;
-        }
         quoataReq.setUserids(userIds);
-        quoataReq.setOffset(0L);
+        quoataReq.setOffset(offset);
         quoataReq.setSize(pageSize);
         OapiAttendanceVacationQuotaListResponse quotaListResponse = null;
         try {
@@ -1467,7 +1469,7 @@ public class DingDingServiceImpl implements DingDingService {
         } catch (ApiException e) {
             e.printStackTrace();
         }
-        System.out.println(quotaListResponse.getBody());
+        System.out.println(quotaListResponse.getBody()+":"+quotaListResponse.getErrmsg());
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         JSONObject json = JSONObject.parseObject(quotaListResponse.getBody());
         DecimalFormat df = new DecimalFormat("#0.0");
@@ -1478,33 +1480,152 @@ public class DingDingServiceImpl implements DingDingService {
                 for (int i=0;i<leaveQuotas.size(); i++) {
                     JSONObject jsonObject = leaveQuotas.getJSONObject(i);
                     String userDDid = jsonObject.getString("userid");
-                    LeaveQuotaNum quotaNum = quotaNumList.stream().filter(qu->qu.userDingdingId.equals(userDDid)).findFirst().get();
+                    LeaveQuotaNum quotaNum = new LeaveQuotaNum();
+                    quotaNum.setLeaveCode(leaveCode);
+                    quotaNum.setUserDingdingId(userDDid);
+                    String name = userList.stream().filter(u->u.getDingdingUserid().equals(userDDid)).findFirst().get().getName();
+                    quotaNum.setName(name);
+                    quotaNum.setCompanyId(dingding.getCompanyId());
                     Date startDate = new Date(jsonObject.getLongValue("start_time"));
-                    quotaNum.startTime = sdf.format(startDate);
+                    quotaNum.setStartTime(sdf.format(startDate));
                     Date endDate = new Date(jsonObject.getLongValue("end_time"));
-                    quotaNum.endTime = sdf.format(endDate);
+                    quotaNum.setEndTime(sdf.format(endDate));
                     Integer quota_num_per_hour = jsonObject.getInteger("quota_num_per_hour");
                     if (quota_num_per_hour != null) {
                         //按小时为单位的情况
-                        quotaNum.quotaInHours = df.format(quota_num_per_hour*1.0/100);
+                        quotaNum.setQuotaInHours(df.format(quota_num_per_hour*1.0/100));
                         Integer used_num_per_hour = jsonObject.getInteger("used_num_per_hour");
-                        quotaNum.usedInHours = df.format(used_num_per_hour*1.0/100);
+                        quotaNum.setUsedInHours(df.format(used_num_per_hour*1.0/100));
                         //计算剩余
-                        quotaNum.leftInHours = df.format((quota_num_per_hour - used_num_per_hour)*1.0/100);
+                        quotaNum.setLeftInHours(df.format((quota_num_per_hour - used_num_per_hour)*1.0/100));
                     } else {
                         //按天单位的情况
                         Integer quota_num_per_day = jsonObject.getInteger("quota_num_per_day");
-                        quotaNum.quotaInDays = df.format(quota_num_per_day*1.0/100);
+                        quotaNum.setQuotaInDays(df.format(quota_num_per_day*1.0/100));
                         Integer used_num_per_day = jsonObject.getInteger("used_num_per_day");
-                        quotaNum.usedInDays = df.format(used_num_per_day*1.0/100);
+                        quotaNum.setUsedInDays(df.format(used_num_per_day*1.0/100));
                         //计算剩余
-                        quotaNum.leftInDays = df.format((quota_num_per_day - used_num_per_day)*1.0/100);
+                        quotaNum.setLeftInDays(df.format((quota_num_per_day - used_num_per_day)*1.0/100));
                     }
+                    System.out.println(quotaNum.getName()+" 假期额度="+quotaNum.getQuotaInDays());
+                    quotaNumList.add(quotaNum);
                 }
+                leaveQuotaNumService.saveBatch(quotaNumList);
+            }
+            if (result.getBooleanValue("has_more")) {
+                //请求下一批
+                offset += pageSize;
+                System.out.println("请求下一批:offset="+offset);
+                syncQuotaList(leaveCode,oaManagerDid, dingding, userList, offset);
             }
-
         }
     }
+//
+//    private void reqQuotaList(Integer companyId, CompanyDingding dingding,
+//                                             String leaveCode, String oaManagerDid, Integer departmentId, String userId, Integer pageIndex, HashMap resultMap) {
+//        //再调用查看假期余额的接口
+//        long pageSize = 50L;
+//        DefaultDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/attendance/vacation/quota/list");
+//        OapiAttendanceVacationQuotaListRequest quoataReq = new OapiAttendanceVacationQuotaListRequest();
+//        quoataReq.setLeaveCode(leaveCode);
+//        quoataReq.setOpUserid(oaManagerDid);
+//        List<User> userList = null;
+//        String userIds = null;
+//        if (StringUtils.isEmpty(userId)) {
+//            int total = 0;
+//            if (departmentId == null) {
+//                //全部员工,包括离职的
+//                QueryWrapper<User> queryWrapper = new QueryWrapper<User>();
+//                queryWrapper.select("distinct dingding_userid, name").eq("company_id", companyId);
+//                userList = userMapper.selectList(queryWrapper);
+//                total = userList.size();
+//            } else {
+//                //指定部门
+//                Department dept = departmentMapper.selectById(departmentId);
+//                List<Department> allDept = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
+//                List<Department> allSubDepts = getSubDeptList(allDept, dept);
+//                userList = userMapper.selectList(
+//                        new QueryWrapper<User>().select("distinct dingding_userid, name")
+//                                .in("department_id", allSubDepts.stream().map(Department::getDepartmentId).collect(Collectors.toList())));
+//                total = userList.size();
+//            }
+//            String collect = userList.stream().map(User::getDingdingUserid).collect(Collectors.joining(","));
+//            userIds = collect;
+//            resultMap.put("total", total);
+//        } else {
+//            userList = new ArrayList<>();
+//            userList = userMapper.selectList(new QueryWrapper<User>().in("id", ListUtil.convertLongIdsArrayToList(userId)));
+//            userIds = userList.stream().map(User::getDingdingUserid).collect(Collectors.joining(","));
+//            resultMap.put("total", userList.size());
+//        }
+//
+//        System.out.println("请求的size="+userList.size());
+//        System.out.println("长度=="+userIds.length());
+//        List<LeaveQuotaNum> quotaNumList = new ArrayList<>();
+//        for (User user : userList) {
+//            LeaveQuotaNum quotaNum = new LeaveQuotaNum();
+//            quotaNum.userDingdingId = user.getDingdingUserid();
+//            quotaNum.name = user.getName();
+//            quotaNum.leaveCode = leaveCode;
+//            quotaNumList.add(quotaNum);
+//        }
+//
+//        if (quotaNumList.size() == 0) {
+//            //无员工数据了
+//            return;
+//        }
+//        quoataReq.setUserids(userIds);
+//        quoataReq.setOffset(0L);
+//        quoataReq.setSize(pageSize);
+//        OapiAttendanceVacationQuotaListResponse quotaListResponse = null;
+//        try {
+//            quotaListResponse = client.execute(quoataReq, getInnerCorpToken(dingding));
+//        } catch (ApiException e) {
+//            e.printStackTrace();
+//        }
+//        System.out.println(quotaListResponse.getBody()+":"+quotaListResponse.getErrmsg());
+//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//        JSONObject json = JSONObject.parseObject(quotaListResponse.getBody());
+//        DecimalFormat df = new DecimalFormat("#0.0");
+//        if (json.getInteger("errcode") == 0) {
+//            JSONObject result = json.getJSONObject("result");
+//            JSONArray leaveQuotas = result.getJSONArray("leave_quotas");
+//            if (leaveQuotas != null) {
+//                for (int i=0;i<leaveQuotas.size(); i++) {
+//                    JSONObject jsonObject = leaveQuotas.getJSONObject(i);
+//                    String userDDid = jsonObject.getString("userid");
+//                    for (LeaveQuotaNum quotaNum : quotaNumList) {
+//                        if (quotaNum.userDingdingId.equals(userDDid)) {
+//                            Date startDate = new Date(jsonObject.getLongValue("start_time"));
+//                            quotaNum.startTime = sdf.format(startDate);
+//                            Date endDate = new Date(jsonObject.getLongValue("end_time"));
+//                            quotaNum.endTime = sdf.format(endDate);
+//                            Integer quota_num_per_hour = jsonObject.getInteger("quota_num_per_hour");
+//                            if (quota_num_per_hour != null) {
+//                                //按小时为单位的情况
+//                                quotaNum.quotaInHours = df.format(quota_num_per_hour*1.0/100);
+//                                Integer used_num_per_hour = jsonObject.getInteger("used_num_per_hour");
+//                                quotaNum.usedInHours = df.format(used_num_per_hour*1.0/100);
+//                                //计算剩余
+//                                quotaNum.leftInHours = df.format((quota_num_per_hour - used_num_per_hour)*1.0/100);
+//                            } else {
+//                                //按天单位的情况
+//                                Integer quota_num_per_day = jsonObject.getInteger("quota_num_per_day");
+//                                quotaNum.quotaInDays = df.format(quota_num_per_day*1.0/100);
+//                                Integer used_num_per_day = jsonObject.getInteger("used_num_per_day");
+//                                quotaNum.usedInDays = df.format(used_num_per_day*1.0/100);
+//                                //计算剩余
+//                                quotaNum.leftInDays = df.format((quota_num_per_day - used_num_per_day)*1.0/100);
+//                            }
+//                            System.out.println(quotaNum.name+" 假期额度="+quotaNum.quotaInDays);
+//                            break;
+//                        }
+//                    }
+//                }
+//                resultMap.put("records", quotaNumList);
+//            }
+//        }
+//    }
 
     public void activateSuite(String authCorpid, String tmpAuthCode) throws ApiException {
         DingTalkClient client= new DefaultDingTalkClient("https://oapi.dingtalk.com/service/activate_suite?suite_access_token=" + getDDSuiteAccessToken());

+ 20 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/LeaveQuotaNumServiceImpl.java

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.LeaveQuotaNum;
+import com.management.platform.mapper.LeaveQuotaNumMapper;
+import com.management.platform.service.LeaveQuotaNumService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+@Service
+public class LeaveQuotaNumServiceImpl extends ServiceImpl<LeaveQuotaNumMapper, LeaveQuotaNum> implements LeaveQuotaNumService {
+
+}

+ 20 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/LeaveTypeServiceImpl.java

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.LeaveType;
+import com.management.platform.mapper.LeaveTypeMapper;
+import com.management.platform.service.LeaveTypeService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+@Service
+public class LeaveTypeServiceImpl extends ServiceImpl<LeaveTypeMapper, LeaveType> implements LeaveTypeService {
+
+}

+ 20 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectRequirementServiceImpl.java

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.ProjectRequirement;
+import com.management.platform.mapper.ProjectRequirementMapper;
+import com.management.platform.service.ProjectRequirementService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-05-24
+ */
+@Service
+public class ProjectRequirementServiceImpl extends ServiceImpl<ProjectRequirementMapper, ProjectRequirement> implements ProjectRequirementService {
+
+}

+ 8 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -577,7 +577,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     if (r.getGroupId() != null && r.getGroupId() != 0) {
                         //直接获取分组的负责人作为审核人
                         TaskGroup curGroup = taskGroups.stream().filter(tg->tg.getId().equals(r.getGroupId())).findFirst().get();
-                        System.out.println("选中的分组是=="+curGroup.getName());
                         if (curGroup.getInchargerId() != null) {
                             User user = userMapper.selectById(curGroup.getInchargerId());
                             HashMap map = new HashMap();
@@ -618,7 +617,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             //顺便返回公司的工作时间设置
             resultMap.put("timeType",timeType);
             //返回公司的项目工时预警的成本项列表
-            List<ProjectBasecostSetting> timeBasecostList = projectBasecostSettingMapper.selectList(new QueryWrapper<ProjectBasecostSetting>().eq("company_id", companyId).eq("alarm_type", 1));
+            List<ProjectBasecostSetting> timeBasecostList = new ArrayList<>();
+            if (company.getPackageProject() == 1) {
+                timeBasecostList = projectBasecostSettingMapper.selectList(new QueryWrapper<ProjectBasecostSetting>().eq("company_id", companyId).eq("alarm_type", 1));
+            }
+
             resultMap.put("timeBasecostList",timeBasecostList);
 
             httpRespMsg.data = resultMap;
@@ -1559,10 +1562,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 //公司没有自定义流程,直接进行项目经理审核
                 reportMapper.update(new Report().setState(1).setProjectAuditTime(now),
                         new QueryWrapper<Report>().in("id", ids));
-                if (oldState == -1) {
-                    allUsers = userMapper.selectList(new QueryWrapper<User>().eq("company_id", company.getId()));
-                    allReports = reportMapper.selectList(new QueryWrapper<Report>().in("id", ids));
-                }
+                allUsers = userMapper.selectList(new QueryWrapper<User>().eq("company_id", company.getId()));
+                allReports = reportMapper.selectList(new QueryWrapper<Report>().in("id", ids));
             } else {
                 allUsers = userMapper.selectList(new QueryWrapper<User>().eq("company_id", company.getId()));
                 allReports = reportMapper.selectList(new QueryWrapper<Report>().in("id", ids));
@@ -2871,6 +2872,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             }
             //pageIndex从1开始
             Integer startIndex = (pageIndex -1) * pageSize;
+            System.out.println("startIndex="+startIndex+", pageSize="+pageSize);
             List<Map<String, Object>> auditReportList = reportMapper.getDeptImportAuditList(companyId, leaderId, startDate, endDate, filterDeptIds, projectId, startIndex, pageSize);
             long total = reportMapper.getDeptImportAuditListCount(companyId, leaderId, startDate, endDate, filterDeptIds, projectId);
             HashMap result = new HashMap();

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -327,7 +327,9 @@ public class TimingTask {
                         json.put("template_id","tty9TkCAAAYoevY-40ciWD5lDncDfR5w");
                         json.put("url", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://mobworktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
                         json.put("content_item",dataJson);
-                        wxCorpInfoService.sendWXCorpTemplateMsg(cpList.get(0), corpUid, json);
+                        if (cpList.size() > 0) {
+                            wxCorpInfoService.sendWXCorpTemplateMsg(cpList.get(0), corpUid, json);
+                        }
                     } else if (u.get("wxOpenid") != null) {
                         push(u, t.getAlertMsg());
                     }

+ 27 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/LeaveQuotaNumMapper.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.management.platform.mapper.LeaveQuotaNumMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.LeaveQuotaNum">
+        <id column="id" property="id" />
+        <result column="company_id" property="companyId" />
+        <result column="user_dingding_id" property="userDingdingId" />
+        <result column="name" property="name" />
+        <result column="leave_code" property="leaveCode" />
+        <result column="start_time" property="startTime" />
+        <result column="end_time" property="endTime" />
+        <result column="quota_in_hours" property="quotaInHours" />
+        <result column="quota_in_days" property="quotaInDays" />
+        <result column="used_in_hours" property="usedInHours" />
+        <result column="used_in_days" property="usedInDays" />
+        <result column="left_in_hours" property="leftInHours" />
+        <result column="left_in_days" property="leftInDays" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, company_id, user_dingding_id, name, leave_code, start_time, end_time, quota_in_hours, quota_in_days, used_in_hours, used_in_days, left_in_hours, left_in_days
+    </sql>
+
+</mapper>

+ 19 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/LeaveTypeMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.management.platform.mapper.LeaveTypeMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.LeaveType">
+        <id column="id" property="id" />
+        <result column="company_id" property="companyId" />
+        <result column="leave_code" property="leaveCode" />
+        <result column="leave_name" property="leaveName" />
+        <result column="is_default" property="isDefault" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, company_id, leave_code, leave_name, is_default
+    </sql>
+
+</mapper>

+ 44 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectRequirementMapper.xml

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.management.platform.mapper.ProjectRequirementMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.ProjectRequirement">
+        <id column="id" property="id" />
+        <result column="project_id" property="projectId" />
+        <result column="memb_req" property="membReq" />
+        <result column="task_req" property="taskReq" />
+    </resultMap>
+
+    <resultMap id="RichMap" type="com.management.platform.entity.ProjectRequirement">
+        <id column="id" property="id" />
+        <result column="project_id" property="projectId" />
+        <result column="memb_req" property="membReq" />
+        <result column="task_req" property="taskReq" />
+        <result column="project_code" property="projectCode" />
+        <result column="project_name" property="projectName" />
+        <result column="active_users" property="activeUsers" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, project_id, memb_req, task_req
+    </sql>
+
+    <select id="customSelect" resultMap="RichMap">
+        SELECT project_requirement.id, project.id AS project_id, project.`project_name`, project.`project_code`, project_requirement.`memb_req`, project_requirement.`task_req`,
+        (SELECT GROUP_CONCAT(DISTINCT user.`name`) FROM report LEFT JOIN `user` ON user.`id` = report.`creator_id` WHERE report.company_id=#{companyId} AND report.create_time >= #{startDate} AND report.`project_id` = project.id) AS active_users
+        FROM project LEFT JOIN project_requirement ON project.id = project_requirement.`project_id`
+        WHERE project.`company_id` = #{companyId}
+         <if test="projectId != null">
+             and project.id = #{projectId}
+         </if>
+         <if test="refProjectIdList != null">
+         and project.id in
+             <foreach collection="refProjectIdList" index="index" close=")" open="(" separator="," item="item">
+                 #{item}
+             </foreach>
+         </if>
+        order by project.id asc limit #{startIndex}, #{pageSize}
+    </select>
+</mapper>

+ 9 - 9
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -4,15 +4,15 @@ var path = require('path')
 // var ip = '192.168.2.4'
 // var ip = '192.168.2.12'// var ip = '47.100.37.243' 
 
-// var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
-// for (var i in ifaces) {
-//     for (var j in ifaces[i]) {
-//         var val = ifaces[i][j]
-//         if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
-//             ip = val.address
-//         }
-//     }
-// }
+var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
+for (var i in ifaces) {
+    for (var j in ifaces[i]) {
+        var val = ifaces[i][j]
+        if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
+            ip = val.address
+        }
+    }
+}
 
 module.exports = {
   build: {

+ 4 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/centerManage/centerManage.vue

@@ -14,8 +14,9 @@
                     {{scope.$index + 1}}
                 </template>
             </el-table-column>
-            <el-table-column prop="name" label="名称" ></el-table-column>
-            <el-table-column label="操作" width="150">
+            <el-table-column prop="name" label="名称" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="projects" label="相关项目" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column label="操作" width="170">
                 <template slot-scope="scope" >
                     <el-button size="small" type="primary" @click="addNewSubProject(scope.row)">编辑</el-button>
                     <el-button size="small" type="danger" @click="deleteSubPro(scope.row)">删除</el-button>
@@ -118,7 +119,7 @@
             },
             getSub() {
                 this.listLoading = true;
-                this.http.post('/report-extra-degree/getAll ',{},
+                this.http.post('/report-extra-degree/getAll ',{withProjects:1},
                 res => {
                     this.listLoading = false;
                     if (res.code == "ok") {

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -48,7 +48,7 @@
                     {{scope.row.projectName}}
                   </template>
                 </el-table-column>
-                <el-table-column prop="inchargerName" label="负责人"  width="80">
+                <el-table-column prop="inchargerName" label="负责人"  width="130">
                   <template slot-scope="scope" >
                     {{scope.row.inchargerName}}
                   </template>

+ 37 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -526,6 +526,9 @@
                   </span> 
               </el-select>
             </div>
+            <div style="margin:0 10px 0 40px">
+              <el-button size="small" type="primary" @click="listSynchronize" :loading="synchronizeLoading">从钉钉同步</el-button>
+            </div>
             
           </div>
             <el-table key="apk2is8" v-loading="loading" :data="vacationList" style="width: 100%" height="90%">
@@ -817,7 +820,8 @@ export default {
       leaveTypeItem: '',
       departmentOptions: [],
       departmentSel: [],
-      userSelId: ''
+      userSelId: '',
+      synchronizeLoading: false
     };
   },
   computed: {},
@@ -847,7 +851,39 @@ export default {
   },
   filters: {},
   methods: {
+    // 从钉钉同步假期剩余表
+    listSynchronize(){
+      this.synchronizeLoading = true
+      this.http.post('/dingding/syncLeaveQuotaData',{
+        companyId: this.user.companyId
+      },res => {
+        if(res.code == 'ok'){
+          this.synchronizeLoading = false
+          this.$message({
+            message: '同步成功',
+            type: 'success'
+          })
+          this.getVacationList()
+          this.page = 1
+          this.departmentSel = []
+          this.userSelId = ''
+        }else {
+          this.synchronizeLoading = false
+          this.$message({
+            message: res.msg,
+            type: 'error'
+          })
+        }
+      },err => {
+        this.synchronizeLoading = false
+        this.$message({
+          message: err,
+          type: 'error'
+        })
+      })
+    },
 
+    // 获取部门列表
     getDepartmentOptions(){
       this.http.post(this.port.manage.depList,{
       },res =>{

+ 4 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -9,6 +9,7 @@
             </el-radio-group></div>
         </el-col>
         <el-col :span="14" style="display: flex;flex-wrap: wrap;">
+            <div style="width:100%;display:flex">
             <el-date-picker v-show="user.timeType.fixMonthcost==0"
             v-model="dateRange" :editable="false" 
             format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
@@ -34,10 +35,12 @@
                 <el-radio-button label="人员"></el-radio-button>
                 <el-radio-button :label="namess" v-if="jichu.customDegreeActive == 1"></el-radio-button>
             </el-radio-group>
-
+            </div>
+            <div style="width:100%;display:flex">
             <el-select v-model="personnelValue" filterable clearable placeholder="请选择人员" style="margin-top: 10px;width: 350px" v-if="radio == '人员'" @change="personnel()">
                 <el-option v-for="item in hasReportUserList" :key="item.id" :label="item.name" :value="item.name"></el-option>
             </el-select>
+            </div>
         </el-col>
         <el-col :span="4">
             <el-button @click="showExportDialog">报表导出</el-button>

File diff ditekan karena terlalu besar
+ 243 - 133
fhKeeper/formulahousekeeper/timesheet/src/views/project/project_gantt.vue


+ 26 - 31
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -20,7 +20,7 @@
                          <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini"  @click="showWorkTime"></el-button>
                     </div> -->
                         <span v-for="(item,index) in allDate" :id="'day'+index" :class="index==choseDay?'chooseDate date_item':'date_item'"
-                        @click="choseDate(index, item)" :key="index" style="padding:0 6px;display: inline-block;width: 46px;text-align: center;">
+                        @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 46px;text-align: center;' + (canClick(index,item) == false ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
                         <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
                             <div style="text-align:center;position:relative;"><span>{{item.showDate}}</span>
                             <br>
@@ -1818,15 +1818,18 @@
                     quanbu = +quanbu + zhi
                 }
                 this.jsTime = quanbu
-
+                let worktime = this.jsTime
+                if(this.isBatch != 0){
+                    worktime = this.jsTime / this.jsDay
+                }
                 if(this.user.timeType.fillOvertime && domain){
                     for(let di in spl){
                             this.$set(spl[di],'isOvertime',false)
                             this.$set(spl[di],'overtimeHours',null)
                         }
-                    if(quanbu*1 > this.user.timeType.allday){
+                    if(worktime*1 > this.user.timeType.allday){
                         this.$set(domain,'isOvertime',true)
-                        this.$set(domain,'overtimeHours',quanbu - this.user.timeType.allday)
+                        this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
                         // domain.overtimeHours = domain.workingTime - this.user.timeType.allday
                         
                     }else {
@@ -3200,7 +3203,18 @@
 
             // 选择日期
             choseDate(i, item) {
-                
+                if(this.canClick(i,item) == false){
+                    return
+                }
+                // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
+                this.choseDay = i;
+                let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
+                sessionStorage.msg = this.date + day,
+                this.getReportList();
+                this.getDepartment();
+                this.curDate = item.date;
+            },
+            canClick(i, item){
                 let nowDate = new Date()
                 let nowDateYear = nowDate.getFullYear()
                 let itemYear = parseInt(this.date.split('-')[0])
@@ -3209,36 +3223,16 @@
                 let nowDateDay = nowDate.getDate()
                 let itemDay = parseInt(item.showDate.split('.')[1])
                 if(nowDateYear < itemYear){
-                    this.$message({
-                        message: '无法填报',
-                        type: 'warning'
-                    })
-                    return
+                    return false
                 }else if(nowDateYear == itemYear){
                     if(nowDateMonth < itemMonth){
-                        this.$message({
-                            message: '无法填报',
-                            type: 'warning'
-                        })
-                        return
+                        return false
                     }else if(nowDateMonth == itemMonth){
                         if(nowDateDay < itemDay){
-                            this.$message({
-                                message: '无法填报',
-                                type: 'warning'
-                            })
-                            return
+                            return false
                         }
                     }
                 }
-
-                console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
-                this.choseDay = i;
-                let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
-                sessionStorage.msg = this.date + day,
-                this.getReportList();
-                this.getDepartment();
-                this.curDate = item.date;
             },
 
             // 获取日期列表
@@ -3547,7 +3541,7 @@
                                 userNames:null,
                                 time: this.report.time
                             }
-                            if (this.timeBasecostList.length > 0) {
+                            if (this.timeBasecostList && this.timeBasecostList.length > 0) {
                                 //默认给第一个,必填字段
                                 this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
                             }
@@ -3876,7 +3870,6 @@
                     res => {
                         if (res.code == "ok") {
                             this.timeBasecostList = res.data;
-                            console.log(this.timeBasecostList);
                         }
                     });
                 }
@@ -4878,7 +4871,9 @@
             this.getDepartment();
             this.scrollFunction()
             this.userssHu();
-            this.getBasecostItemList();
+            if (this.user.company.packageProject == 1) {
+                this.getBasecostItemList();
+            }
             if(this.user.timeType.lockWorktime){
                 this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
             }

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue

@@ -190,7 +190,7 @@
                     <el-table-column prop="date" label="员工/日期" width="200">
                         <template slot-scope="scope">
                             <div>
-                                <div v-if="scope.row.membdateList.length > 3">
+                                <div v-if="scope.row.membdateList.length > 1">
                                     <el-popover placement="top" width="400" trigger="hover">
                                     <div>
                                         <span v-for="(item, index) in scope.row.membdateList" :key="index">

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_import.vue

@@ -161,7 +161,7 @@
                     <el-table-column prop="date" label="员工/日期" width="200">
                         <template slot-scope="scope">
                             <div>
-                                <div v-if="scope.row.membdateList.length > 3">
+                                <div v-if="scope.row.membdateList.length > 1">
                                     <el-popover placement="top" width="400" trigger="hover">
                                     <div>
                                         <span v-for="(item, index) in scope.row.membdateList" :key="index">

File diff ditekan karena terlalu besar
+ 1261 - 231
fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/demo_index.html


File diff ditekan karena terlalu besar
+ 221 - 47
fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.css


File diff ditekan karena terlalu besar
+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.js


+ 413 - 105
fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.json

@@ -1,163 +1,471 @@
 {
-  "id": "1456778",
-  "name": "苏打优选",
+  "id": "2390497",
+  "name": "seyaproject",
   "font_family": "iconfont",
-  "css_prefix_text": "icon-",
+  "css_prefix_text": "firerock-icon",
   "description": "",
   "glyphs": [
     {
-      "icon_id": "91804",
-      "name": "待收货",
-      "font_class": "daishouhuo",
-      "unicode": "e601",
-      "unicode_decimal": 58881
+      "icon_id": "15673407",
+      "name": "打卡记录",
+      "font_class": "dakajilu",
+      "unicode": "e6e1",
+      "unicode_decimal": 59105
     },
     {
-      "icon_id": "908503",
-      "name": "搜索",
-      "font_class": "sousuo",
-      "unicode": "e678",
-      "unicode_decimal": 59000
+      "icon_id": "5651484",
+      "name": "关联",
+      "font_class": "guanlian",
+      "unicode": "e674",
+      "unicode_decimal": 58996
     },
     {
-      "icon_id": "915611",
-      "name": "首页",
-      "font_class": "shouye",
-      "unicode": "e677",
-      "unicode_decimal": 58999
+      "icon_id": "14949575",
+      "name": "users",
+      "font_class": "users",
+      "unicode": "e70a",
+      "unicode_decimal": 59146
     },
     {
-      "icon_id": "1085722",
-      "name": "设置",
-      "font_class": "shezhi",
-      "unicode": "e65c",
-      "unicode_decimal": 58972
+      "icon_id": "736503",
+      "name": "权限",
+      "font_class": "quanxian1",
+      "unicode": "e615",
+      "unicode_decimal": 58901
     },
     {
-      "icon_id": "1110582",
-      "name": "购物车—线",
-      "font_class": "gouwuchexian",
-      "unicode": "e60d",
-      "unicode_decimal": 58893
+      "icon_id": "7987507",
+      "name": "系统",
+      "font_class": "xitong-",
+      "unicode": "e616",
+      "unicode_decimal": 58902
     },
     {
-      "icon_id": "1162363",
-      "name": "待发货",
-      "font_class": "1111113",
-      "unicode": "e60c",
-      "unicode_decimal": 58892
+      "icon_id": "11111002",
+      "name": "客户",
+      "font_class": "kehu",
+      "unicode": "e67e",
+      "unicode_decimal": 59006
     },
     {
-      "icon_id": "1215021",
-      "name": "反馈",
-      "font_class": "iconfontfankui",
-      "unicode": "e6b4",
-      "unicode_decimal": 59060
+      "icon_id": "6517457",
+      "name": "文件-请假单",
+      "font_class": "wj-qjd",
+      "unicode": "e70e",
+      "unicode_decimal": 59150
     },
     {
-      "icon_id": "1382060",
-      "name": "礼物",
-      "font_class": "liwu",
-      "unicode": "e694",
-      "unicode_decimal": 59028
+      "icon_id": "5961300",
+      "name": "待办事项",
+      "font_class": "daibanshixiang",
+      "unicode": "ec4e",
+      "unicode_decimal": 60494
     },
     {
-      "icon_id": "1577002",
-      "name": "客服",
-      "font_class": "kefu",
-      "unicode": "e618",
-      "unicode_decimal": 58904
+      "icon_id": "11465003",
+      "name": "待办",
+      "font_class": "daiban",
+      "unicode": "e64b",
+      "unicode_decimal": 58955
     },
     {
-      "icon_id": "1610138",
-      "name": "钱包",
-      "font_class": "qianbao",
+      "icon_id": "6023953",
+      "name": "工时统计",
+      "font_class": "gongshitongji",
       "unicode": "e614",
       "unicode_decimal": 58900
     },
     {
-      "icon_id": "1833855",
-      "name": "下箭头",
-      "font_class": "xiajiantou",
-      "unicode": "e733",
-      "unicode_decimal": 59187
+      "icon_id": "2318254",
+      "name": "审核通过",
+      "font_class": "shenhetongguo",
+      "unicode": "e6a0",
+      "unicode_decimal": 59040
     },
     {
-      "icon_id": "2076312",
-      "name": " 我的",
-      "font_class": "wode",
-      "unicode": "e8a0",
-      "unicode_decimal": 59552
+      "icon_id": "9144552",
+      "name": "审核驳回",
+      "font_class": "shenhebohui",
+      "unicode": "e6c6",
+      "unicode_decimal": 59078
     },
     {
-      "icon_id": "2392549",
-      "name": "打勾",
-      "font_class": "dagou",
-      "unicode": "e670",
-      "unicode_decimal": 58992
+      "icon_id": "17483402",
+      "name": "待办  等待 审核",
+      "font_class": "daibandengdaishenhe",
+      "unicode": "e612",
+      "unicode_decimal": 58898
+    },
+    {
+      "icon_id": "5149104",
+      "name": "建筑工程类",
+      "font_class": "jianzhugongchenglei",
+      "unicode": "e61e",
+      "unicode_decimal": 58910
+    },
+    {
+      "icon_id": "16187171",
+      "name": "甘特图",
+      "font_class": "gantetu",
+      "unicode": "e6a1",
+      "unicode_decimal": 59041
+    },
+    {
+      "icon_id": "3686260",
+      "name": "客户管理",
+      "font_class": "kehuguanli",
+      "unicode": "e60f",
+      "unicode_decimal": 58895
+    },
+    {
+      "icon_id": "1868952",
+      "name": "流程",
+      "font_class": "liucheng",
+      "unicode": "e634",
+      "unicode_decimal": 58932
+    },
+    {
+      "icon_id": "9651039",
+      "name": "长箭头",
+      "font_class": "right",
+      "unicode": "e60e",
+      "unicode_decimal": 58894
+    },
+    {
+      "icon_id": "17223736",
+      "name": "App_New_Line",
+      "font_class": "App_New_Line",
+      "unicode": "e6e3",
+      "unicode_decimal": 59107
+    },
+    {
+      "icon_id": "261001",
+      "name": "line",
+      "font_class": "0",
+      "unicode": "e609",
+      "unicode_decimal": 58889
+    },
+    {
+      "icon_id": "17197893",
+      "name": "Insert Line",
+      "font_class": "InsertLine",
+      "unicode": "e61d",
+      "unicode_decimal": 58909
+    },
+    {
+      "icon_id": "19410111",
+      "name": "密 码",
+      "font_class": "mima",
+      "unicode": "e611",
+      "unicode_decimal": 58897
     },
     {
-      "icon_id": "2488741",
-      "name": "home",
-      "font_class": "home",
-      "unicode": "e641",
-      "unicode_decimal": 58945
+      "icon_id": "16842350",
+      "name": "密 码",
+      "font_class": "mima1",
+      "unicode": "e608",
+      "unicode_decimal": 58888
     },
     {
-      "icon_id": "3670096",
-      "name": "购物车",
-      "font_class": "tubiaolunkuo-",
+      "icon_id": "20915138",
+      "name": "验证码",
+      "font_class": "yanzhengma",
+      "unicode": "e60d",
+      "unicode_decimal": 58893
+    },
+    {
+      "icon_id": "11640993",
+      "name": "dot",
+      "font_class": "dot",
+      "unicode": "e60b",
+      "unicode_decimal": 58891
+    },
+    {
+      "icon_id": "9382963",
+      "name": "dot",
+      "font_class": "dot2",
+      "unicode": "e607",
+      "unicode_decimal": 58887
+    },
+    {
+      "icon_id": "7171606",
+      "name": "报表管理",
+      "font_class": "baobiao",
+      "unicode": "e636",
+      "unicode_decimal": 58934
+    },
+    {
+      "icon_id": "4426098",
+      "name": "组织架构",
+      "font_class": "zuzhijiagou1",
+      "unicode": "e698",
+      "unicode_decimal": 59032
+    },
+    {
+      "icon_id": "13100227",
+      "name": "填报",
+      "font_class": "tianbao1",
+      "unicode": "e60a",
+      "unicode_decimal": 58890
+    },
+    {
+      "icon_id": "4469651",
+      "name": "组织架构",
+      "font_class": "zuzhijiagou",
       "unicode": "e606",
       "unicode_decimal": 58886
     },
     {
-      "icon_id": "5294023",
-      "name": "红包",
-      "font_class": "hongbao",
-      "unicode": "e72f",
-      "unicode_decimal": 59183
+      "icon_id": "4231111",
+      "name": "组织结构",
+      "font_class": "zuzhijiegou",
+      "unicode": "e670",
+      "unicode_decimal": 58992
+    },
+    {
+      "icon_id": "12860884",
+      "name": "权限",
+      "font_class": "quanxian",
+      "unicode": "e663",
+      "unicode_decimal": 58979
+    },
+    {
+      "icon_id": "2101853",
+      "name": "报销",
+      "font_class": "baoxiao",
+      "unicode": "e788",
+      "unicode_decimal": 59272
+    },
+    {
+      "icon_id": "5207594",
+      "name": "报销单",
+      "font_class": "baoxiaodan",
+      "unicode": "e644",
+      "unicode_decimal": 58948
+    },
+    {
+      "icon_id": "19236386",
+      "name": "填报",
+      "font_class": "tianbao",
+      "unicode": "e726",
+      "unicode_decimal": 59174
+    },
+    {
+      "icon_id": "12000587",
+      "name": "记录",
+      "font_class": "record",
+      "unicode": "e605",
+      "unicode_decimal": 58885
+    },
+    {
+      "icon_id": "20147073",
+      "name": "导入",
+      "font_class": "daoru",
+      "unicode": "e613",
+      "unicode_decimal": 58899
     },
     {
-      "icon_id": "5452460",
-      "name": "缓存",
-      "font_class": "huancun",
+      "icon_id": "20154661",
+      "name": "导出",
+      "font_class": "daochu",
+      "unicode": "e6ab",
+      "unicode_decimal": 59051
+    },
+    {
+      "icon_id": "19441448",
+      "name": "export",
+      "font_class": "export",
+      "unicode": "e72d",
+      "unicode_decimal": 59181
+    },
+    {
+      "icon_id": "8796451",
+      "name": "启动",
+      "font_class": "qidong",
+      "unicode": "e63c",
+      "unicode_decimal": 58940
+    },
+    {
+      "icon_id": "19037188",
+      "name": "完 成 ",
+      "font_class": "wancheng",
+      "unicode": "e610",
+      "unicode_decimal": 58896
+    },
+    {
+      "icon_id": "20134686",
+      "name": "菜单",
+      "font_class": "caidan",
+      "unicode": "e6b7",
+      "unicode_decimal": 59063
+    },
+    {
+      "icon_id": "8524192",
+      "name": "审核",
+      "font_class": "shenhe",
       "unicode": "e604",
       "unicode_decimal": 58884
     },
     {
-      "icon_id": "5460006",
-      "name": "定位",
-      "font_class": "yuejuan_Location",
-      "unicode": "e619",
-      "unicode_decimal": 58905
+      "icon_id": "3590688",
+      "name": "里程碑",
+      "font_class": "icon-",
+      "unicode": "e6ad",
+      "unicode_decimal": 59053
     },
     {
-      "icon_id": "5849780",
-      "name": "右箭头",
-      "font_class": "iconfontyoujiantou-copy-copy-copy-copy",
-      "unicode": "e600",
-      "unicode_decimal": 58880
+      "icon_id": "5112963",
+      "name": "任务",
+      "font_class": "renwu",
+      "unicode": "e64c",
+      "unicode_decimal": 58956
+    },
+    {
+      "icon_id": "10368440",
+      "name": "风险",
+      "font_class": "fengxian",
+      "unicode": "e6a2",
+      "unicode_decimal": 59042
+    },
+    {
+      "icon_id": "17156568",
+      "name": "ok",
+      "font_class": "normal-ico-ok",
+      "unicode": "e70f",
+      "unicode_decimal": 59151
+    },
+    {
+      "icon_id": "1161198",
+      "name": "棱形",
+      "font_class": "icon2",
+      "unicode": "e603",
+      "unicode_decimal": 58883
+    },
+    {
+      "icon_id": "10202911",
+      "name": "file",
+      "font_class": "file",
+      "unicode": "e60c",
+      "unicode_decimal": 58892
+    },
+    {
+      "icon_id": "2078615",
+      "name": "excel",
+      "font_class": "ex",
+      "unicode": "e65c",
+      "unicode_decimal": 58972
+    },
+    {
+      "icon_id": "4073514",
+      "name": "Zip",
+      "font_class": "Zip",
+      "unicode": "e9ec",
+      "unicode_decimal": 59884
     },
     {
-      "icon_id": "7400719",
-      "name": "退货",
-      "font_class": "tuihuo",
-      "unicode": "e624",
-      "unicode_decimal": 58916
+      "icon_id": "4863362",
+      "name": "JPG",
+      "font_class": "JPG",
+      "unicode": "e6ed",
+      "unicode_decimal": 59117
     },
     {
-      "icon_id": "9031364",
-      "name": "标准待分享2",
-      "font_class": "biaozhundaifenxiang",
+      "icon_id": "5173010",
+      "name": "audio",
+      "font_class": "audio",
       "unicode": "e602",
       "unicode_decimal": 58882
     },
     {
-      "icon_id": "9173301",
-      "name": "下箭头",
-      "font_class": "xiajiantou-copy",
-      "unicode": "e8a1",
-      "unicode_decimal": 59553
+      "icon_id": "8469709",
+      "name": "txt",
+      "font_class": "txt",
+      "unicode": "e741",
+      "unicode_decimal": 59201
+    },
+    {
+      "icon_id": "19705514",
+      "name": "video",
+      "font_class": "video",
+      "unicode": "e771",
+      "unicode_decimal": 59249
+    },
+    {
+      "icon_id": "20213818",
+      "name": "PDF",
+      "font_class": "PDF",
+      "unicode": "e61a",
+      "unicode_decimal": 58906
+    },
+    {
+      "icon_id": "20651005",
+      "name": "word",
+      "font_class": "word",
+      "unicode": "eecf",
+      "unicode_decimal": 61135
+    },
+    {
+      "icon_id": "17781647",
+      "name": "上 传",
+      "font_class": "shangchuan",
+      "unicode": "e6fd",
+      "unicode_decimal": 59133
+    },
+    {
+      "icon_id": "7337849",
+      "name": "秒表",
+      "font_class": "miaobiao",
+      "unicode": "ecfa",
+      "unicode_decimal": 60666
+    },
+    {
+      "icon_id": "8659928",
+      "name": "task",
+      "font_class": "task",
+      "unicode": "e600",
+      "unicode_decimal": 58880
+    },
+    {
+      "icon_id": "13530978",
+      "name": "time",
+      "font_class": "meditor-time",
+      "unicode": "e601",
+      "unicode_decimal": 58881
+    },
+    {
+      "icon_id": "9339879",
+      "name": "tree",
+      "font_class": "tree",
+      "unicode": "e691",
+      "unicode_decimal": 59025
+    },
+    {
+      "icon_id": "807967",
+      "name": "统计",
+      "font_class": "tongji",
+      "unicode": "e631",
+      "unicode_decimal": 58929
+    },
+    {
+      "icon_id": "1778691",
+      "name": "项目",
+      "font_class": "xiangmu",
+      "unicode": "e617",
+      "unicode_decimal": 58903
+    },
+    {
+      "icon_id": "14417643",
+      "name": "财务",
+      "font_class": "caiwu",
+      "unicode": "e89c",
+      "unicode_decimal": 59548
+    },
+    {
+      "icon_id": "11673579",
+      "name": "setting",
+      "font_class": "setting",
+      "unicode": "e672",
+      "unicode_decimal": 58994
     }
   ]
 }

TEMPAT SAMPAH
fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.ttf


TEMPAT SAMPAH
fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.woff


TEMPAT SAMPAH
fhKeeper/formulahousekeeper/timesheet_h5/src/assets/style/font/iconfont.woff2


+ 4 - 3
fhKeeper/formulahousekeeper/timesheet_h5/src/views/audit/audit.vue

@@ -33,7 +33,8 @@ export default {
         return {
             search: {
                 date: null,
-                projectId: null
+                projectId: null,
+                pageIndex:1,
             },
             list: [],
             denyReasonDialog: false,
@@ -61,10 +62,10 @@ export default {
                 forbidClick: true,
                 duration: 0
             });
-            this.$axios.get('/report/listImportByState', this.search)
+            this.$axios.post('/report/listImportByState', this.search)
             .then(res => {
                 this.$toast.clear();
-                this.list = res.data
+                this.list = res.data.record;
             }).catch(err=> {
                 this.$toast.clear();
                 alert('err=' + err);

+ 27 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -3,8 +3,15 @@
         <van-nav-bar title="填写日报" left-text="返回" @click-left="back" fixed left-arrow/>
 
         <van-form class="login_form" @submit="submitReport">
+            <div>
             <van-field readonly clickable name="datetimePicker" :value="form.createDate" label="时间选择" placeholder="点击选择时间" 
             @click="showPicker = true" :rules="rules.createDate" />
+                <div v-if="report.time" class="attendanceRecord">
+                    <i class="iconfont firerock-icondakajilu" style="font-size:0.35rem;margin-right:0.12rem"></i>
+                    <span v-if="user.timeType.syncDingding==1&&!report.time">暂无考勤记录</span>
+                    <span v-else>{{report.time.startTime}}-{{report.time.endTime}}, {{report.time.workHours}}小时</span>
+                </div>
+            </div>
             <van-popup v-model="showPicker" position="bottom">
                 <van-datetime-picker v-model="currentDate" type="date" :min-date="minDate" :max-date="maxDate" @confirm="changeTime" @cancel="showPicker = false"/>
             </van-popup>
@@ -1221,6 +1228,7 @@
                         }
                     }
                 }
+                
                 // return
                 const toast = this.$toast.loading({
                     forbidClick: true,
@@ -1271,6 +1279,16 @@
                         return;
                     }
                 }
+                if (this.reportTimeType.type == 1 && this.report.time) {
+                            var totalTime = 0;
+                            for (var t=0;t<this.form.domains.length; t++) {
+                                totalTime += parseFloat(this.form.domains[t].workingTime);
+                            }
+                            if (this.report.time.workHours && totalTime > parseFloat(this.report.time.workHours)) {
+                                this.$toast.fail("填报工时之和"+(totalTime)+"h不能超过考勤总工时("+this.report.time.workHours.toFixed(1)+"h)");
+                                return;
+                            }
+                        }
                 
                 //填字段
                 for(var i in this.form.domains) {
@@ -1550,6 +1568,15 @@
     }
     .login_form {
         margin-top: 46px;
+        position: relative;
+    }
+    .attendanceRecord{
+        position: absolute;
+        top: 0.26667rem;
+        right: 0.42667rem;
+        color: #969799;
+        font-size: 0.35rem;
+        line-height: 0.64rem;
     }
 
     .form_domains {

+ 26 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -1,6 +1,6 @@
 <template>
     <div>
-        <van-nav-bar title="按周填报" left-text="返回" @click-left="back" fixed left-arrow/>
+        <van-nav-bar title="按周填报" left-text="返回" @click-left="back" fixed left-arrow style="z-index:2"/>
 
         <van-form class="login_form">
             <van-grid :column-num="2" :border="false">
@@ -12,7 +12,7 @@
                     </div>
                 </van-grid-item>
             </van-grid>
-            <van-grid :column-num="weekIndex" :border="false">
+            <van-grid :column-num="weekIndex" :border="false" style="position:relative">
                 <van-grid-item v-for="item,index in dateRange" :key="index" :class="index == inbtn ? 'inbtn' : ''">
                     <van-button
                     class="selectgxbtn"
@@ -20,6 +20,9 @@
                     size="mini"
                     @click="switchWeek(item,index)">{{weekArr[index]}}</van-button>
                 </van-grid-item>
+                <div class="submitClear">
+                        <van-button type="default" size="small" @click="submitClear">清空</van-button>
+                    </div>
             </van-grid>
 
 
@@ -1285,6 +1288,21 @@
                 }
                 return true
             },
+            // 清空当前填写信息
+            submitClear(){
+                this.currentForm.domains = [{
+                                id: null,
+                                projectId: "",
+                                projectName: "",
+                                workingTime: 8,
+                                content: "",
+                                state: 2,
+                                multiWorktime:0,
+                                worktimeList:{},
+                                degreeId: ''
+                            }],
+                console.log(this.currentForm);
+            },
 
             // 提交日报
             submitReport() {
@@ -1768,5 +1786,11 @@
     .van-checkbox__label--disabled {
         color: #c8c9cc !important;
     }
+    .submitClear{
+        position: absolute;
+        right: 0.1rem;
+        bottom: -0.95rem;
+        z-index: 1;
+    }
 </style>
 

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

@@ -66,7 +66,7 @@
                     this.routers.push({name: '查看日报',url: '/calendar',icon: 'description'})
                     this.routers.push({name: '填写日报',url: '/edit',icon: 'edit'})
                     if (this.user.companyId == 817 || this.user.companyId == 7 || this.user.companyId == 10) {
-                        this.routers.push({name: '按周填报',url: '/weekEdit',icon: 'edit'})
+                        this.routers.push({name: '按周填报',url: '/weekEdit',icon: 'records'})
                     }
                 }
                 if(list[i].name == '项目报告审核') {

+ 10 - 10
fhKeeper/formulahousekeeper/timesheet_h5/vue.config.js

@@ -3,17 +3,17 @@ const pxtorem = require("postcss-pxtorem");
 const path = require('path');
 const themePath = path.resolve(__dirname,'src/assets/style/theme.less');
 
+// var ip = '192.168.2.4'
 // var ip = '127.0.0.1'
-var ip = '192.168.2.4'
-// var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
-// for (var i in ifaces) {
-//     for (var j in ifaces[i]) {
-//         var val = ifaces[i][j]
-//         if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
-//             ip = val.address
-//         }
-//     }
-// }
+var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
+for (var i in ifaces) {
+    for (var j in ifaces[i]) {
+        var val = ifaces[i][j]
+        if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
+            ip = val.address
+        }
+    }
+}
 
 module.exports = {
     // 关闭eslint检查