Explorar o código

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

ggooalice %!s(int64=2) %!d(string=hai) anos
pai
achega
d199f41443
Modificáronse 30 ficheiros con 1292 adicións e 339 borrados
  1. 12 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/CustomerInfoController.java
  2. 260 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java
  3. 48 24
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProviderInfoController.java
  4. 16 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java
  5. 64 33
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java
  6. 7 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/BusinessTrip.java
  7. 8 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Department.java
  8. 8 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/LeaveSheet.java
  9. 24 23
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java
  10. 449 168
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  11. 12 6
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  12. 2 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/BusinessTripMapper.xml
  13. 2 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/DepartmentMapper.xml
  14. 2 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/LeaveSheetMapper.xml
  15. 5 0
      fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/controller/CompanyController.java
  16. 37 0
      fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/controller/TimeTypeController.java
  17. 8 1
      fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/entity/Company.java
  18. 122 2
      fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/entity/TimeType.java
  19. 3 0
      fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/service/CompanyService.java
  20. 16 0
      fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/service/TimeTypeService.java
  21. 110 23
      fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/service/impl/CompanyServiceImpl.java
  22. 20 0
      fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/service/impl/TimeTypeServiceImpl.java
  23. 1 0
      fhKeeper/formulahousekeeper/ops-platform/src/main/resources/application.yml
  24. 2 1
      fhKeeper/formulahousekeeper/ops-platform/src/main/resources/mapper/CompanyMapper.xml
  25. 21 1
      fhKeeper/formulahousekeeper/ops-platform/src/main/resources/mapper/TimeTypeMapper.xml
  26. 1 0
      fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue
  27. 26 39
      fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue
  28. 2 2
      fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue
  29. 2 2
      fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue
  30. 2 1
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

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

@@ -131,14 +131,24 @@ public class CustomerInfoController {
 
 
     @RequestMapping("/list")
-    public HttpRespMsg list(@RequestParam Integer pageIndex, @RequestParam Integer pageSize, String keyword) {
+    public HttpRespMsg list(@RequestParam Integer pageIndex, @RequestParam Integer pageSize, String keyword, String sortProp, Integer sortOrder) {
         HttpRespMsg msg = new HttpRespMsg();
         String token = request.getHeader("TOKEN");
         User user = userMapper.selectById(token);
-        QueryWrapper<CustomerInfo> queryWrapper = new QueryWrapper<CustomerInfo>().eq("company_id", user.getCompanyId()).orderByDesc("id");
+        QueryWrapper<CustomerInfo> queryWrapper = new QueryWrapper<CustomerInfo>().eq("company_id", user.getCompanyId());
         if (!StringUtils.isEmpty(keyword)) {
             queryWrapper.like("customer_name", keyword);
         }
+        if (!StringUtils.isEmpty(sortProp)) {
+            if (sortOrder == 0) {
+                //降序
+                queryWrapper.orderByDesc(sortProp);
+            } else {
+                queryWrapper.orderByAsc(sortProp);
+            }
+        } else {
+            queryWrapper.orderByDesc("id");
+        }
         IPage<CustomerInfo> projectIPage = customerInfoMapper.selectPage(new Page<>(pageIndex, pageSize),
                 queryWrapper);
         List<CustomerInfo> list = projectIPage.getRecords();

+ 260 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java

@@ -1,9 +1,17 @@
 package com.management.platform.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.management.platform.entity.Company;
 import com.management.platform.entity.Project;
+import com.management.platform.entity.ProviderCategory;
+import com.management.platform.mapper.CompanyMapper;
+import com.management.platform.mapper.ProviderCategoryMapper;
 import com.management.platform.service.ProjectService;
 import com.management.platform.util.HttpRespMsg;
+import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddressList;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.util.StringUtils;
@@ -14,10 +22,13 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import java.io.File;
+import java.io.FileOutputStream;
 import java.time.LocalDate;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -36,6 +47,10 @@ public class ProjectController {
     private String path;
     @Resource
     private HttpServletRequest request;
+    @Resource
+    private CompanyMapper companyMapper;
+    @Resource
+    private ProviderCategoryMapper providerCategoryMapper;
 
     /**
      * 获取我参与的全部项目的负责人列表
@@ -528,5 +543,250 @@ public class ProjectController {
         httpRespMsg.setError("更新失败");
         return httpRespMsg;
     }
+    @RequestMapping("/getTemplate")
+    public HttpRespMsg getTemplate(Integer companyId){
+        HttpRespMsg msg = new HttpRespMsg();
+        List<String> heads = new ArrayList<>();
+        Company company = companyMapper.selectById(companyId);
+        List<ProviderCategory> providerCategoryList = providerCategoryMapper.selectList(new QueryWrapper<ProviderCategory>().eq("company_id", companyId));
+        List<String> collect = providerCategoryList.stream().distinct().map(pc -> pc.getProviderCategoryName()).collect(Collectors.toList());
+        heads.add("项目编号");
+        heads.add("项目分类");
+        heads.add("是否为公共项目");
+        heads.add("项目名称");
+        heads.add("子项目(多个用,隔开)");
+        heads.add("参与人");
+        heads.add("主要负责人");
+        heads.add("级别");
+        if(company.getPackageCustomer()==1){
+            heads.add("客户");
+        }
+        if(company.getPackageProvider()==1){
+            for (String s : collect) {
+                heads.add(s);
+            }
+        }
+        heads.add("开始日期");
+        heads.add("截止日期");
+        heads.add("合同金额");
+        List<List<String>> allList = new ArrayList<>();
+        allList.add(heads);
+        String title = company.getCompanyName()+"_项目导入模板";
+        /*msg.data = ExcelUtil.exportGeneralExcelByTitleAndList(fileName, allList, path);*/
+        String result="系统提示:Excel文件导出成功!";
+        String fileName= title+".xls";
+        try {
+//            response.reset();
+//            response.setHeader("Content-disposition",
+//                "attachment;filename="+ URLEncoder.encode(fileName, "UTF-8"));
+//            //设置文件头编码格式
+//            response.setContentType("APPLICATION/OCTET-STREAM;charset=UTF-8");//设置类型
+//            response.setHeader("Cache-Control","no-cache");//设置头
+//            response.setDateHeader("Expires", 0);//设置日期头
+            // 创建工作簿
+            HSSFWorkbook workBook = new HSSFWorkbook();
+            // 创建工作类
+            HSSFSheet sheet = workBook.createSheet();
+            //设置首行冻结
+            sheet.createFreezePane(0, 1);
+            sheet.setDefaultColumnWidth(16);
+            //设置字体样式
+            HSSFFont headFont = workBook.createFont();
+            headFont.setBold(true);
+            headFont.setFontHeightInPoints((short) 10);
+            headFont.setFontName("黑体");
+
+            HSSFFont titleFont = workBook.createFont();
+            titleFont.setBold(true);
+            titleFont.setFontHeightInPoints((short) 10);
+            titleFont.setFontName("黑体");
+
+            HSSFFont font = workBook.createFont();
+            font.setFontHeightInPoints((short) 10);
+            font.setFontName("宋体");
+
+            //设置单元格样式
+            CellStyle headStyle = workBook.createCellStyle();
+            headStyle.setFont(headFont);
+            headStyle.setAlignment(HorizontalAlignment.CENTER);
+            headStyle.setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment.CENTER);
+            headStyle.setWrapText(true);
+            headStyle.setBorderBottom(BorderStyle.THIN); //下边框
+            headStyle.setBorderLeft(BorderStyle.THIN);//左边框
+            headStyle.setBorderTop(BorderStyle.THIN);//上边框
+            headStyle.setBorderRight(BorderStyle.THIN);//右边框
+
+            String color = "c0c0c0";    //此处得到的color为16进制的字符串
+            //转为RGB码
+            int r = Integer.parseInt((color.substring(0,2)),16);   //转为16进制
+            int g = Integer.parseInt((color.substring(2,4)),16);
+            int b = Integer.parseInt((color.substring(4,6)),16);
+
+            //自定义cell颜色
+            HSSFPalette palette = workBook.getCustomPalette();
+            //这里的9是索引
+            palette.setColorAtIndex((short)9, (byte) r, (byte) g, (byte) b);
+
+            CellStyle titleStyle = workBook.createCellStyle();
+            titleStyle.setFont(titleFont);
+            titleStyle.setAlignment(HorizontalAlignment.CENTER);
+            titleStyle.setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment.CENTER);
+            titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);  //填充单元格
+            titleStyle.setFillForegroundColor((short)9);    //填色
+            titleStyle.setWrapText(true);
+            titleStyle.setBorderBottom(BorderStyle.THIN); //下边框
+            titleStyle.setBorderLeft(BorderStyle.THIN);//左边框
+            titleStyle.setBorderTop(BorderStyle.THIN);//上边框
+            titleStyle.setBorderRight(BorderStyle.THIN);//右边框
+
+            CellStyle cellStyle = workBook.createCellStyle();
+            cellStyle.setFont(font);
+            cellStyle.setAlignment(HorizontalAlignment.CENTER);
+            cellStyle.setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment.CENTER);
+            cellStyle.setWrapText(true);
+            cellStyle.setBorderBottom(BorderStyle.THIN); //下边框
+            cellStyle.setBorderLeft(BorderStyle.THIN);//左边框
+            cellStyle.setBorderTop(BorderStyle.THIN);//上边框
+            cellStyle.setBorderRight(BorderStyle.THIN);//右边框
+
+            if(allList.size() > 0) {
+                //标题(如果需要在EXCEL内容最上面加标题,请打开下面的注释,修改start)
+                /*
+                HSSFRow titleRow = sheet.createRow(0);
+                titleRow.setHeightInPoints(30);
+                HSSFCell titleCell = titleRow.createCell(0);
+                titleCell.setCellStyle(headStyle);
+                titleCell.setCellValue(title);
+                //合并单元格
+                CellRangeAddress cellRangeAddress = new CellRangeAddress(0,0,0, list.get(0).size() - 1);
+                //加入合并单元格对象
+                sheet.addMergedRegion(cellRangeAddress);
+                //使用RegionUtil类为合并后的单元格添加边框
+			    RegionUtil.setBorderBottom(BorderStyle.THIN, cellRangeAddress, sheet); // 下边框
+                RegionUtil.setBorderLeft(BorderStyle.THIN, cellRangeAddress, sheet); // 左边框
+                RegionUtil.setBorderRight(BorderStyle.THIN, cellRangeAddress, sheet); // 有边框
+                RegionUtil.setBorderTop(BorderStyle.THIN, cellRangeAddress, sheet); // 上边框
+                */
+                int start = 0;
+                for(List<String> rowList : allList) {
+                    HSSFRow row = sheet.createRow(start);
+                    row.setHeightInPoints(24);
+                    for(int i = 0; i < rowList.size(); i++) {
+                        HSSFCell cell = row.createCell(i);
+                        ClientAnchor anchor = new HSSFClientAnchor();
+                        if(start == 0) {
+                            cell.setCellStyle(titleStyle);
+                            // 关键修改
+                            anchor.setDx1(0);
+                            anchor.setDx2(0);
+                            anchor.setDy1(0);
+                            anchor.setDy2(0);
+                            anchor.setCol1(cell.getColumnIndex());
+                            anchor.setRow1(cell.getRowIndex());
+                            anchor.setCol2(cell.getColumnIndex() + 5);
+                            anchor.setRow2(cell.getRowIndex() + 6);
+                            // 结束
+                            Drawing drawing = sheet.createDrawingPatriarch();
+                            Comment comment = null;
+                            String[] textList=null;
+                            DVConstraint constraint =null;
+                            CellRangeAddressList regions =null;
+                            HSSFDataValidation data_validation_list =null;
+                            switch (rowList.get(i)){
+                                case "是否为公共项目":
+                                    // 加载下拉列表内容
+                                    textList= new String[]{"是", "否"};
+                                    constraint = DVConstraint
+                                            .createExplicitListConstraint(textList);
+                                    // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列
+                                    regions = new CellRangeAddressList(1,
+                                            1000, i, i);
+                                    // 数据有效性对象
+                                    data_validation_list = new HSSFDataValidation(
+                                            regions, constraint);
+                                    sheet.addValidationData(data_validation_list);
+                                    comment = drawing.createCellComment(anchor);
+                                    // 输入批注信息
+                                    comment.setString(new HSSFRichTextString("是否为公共项目\n" +
+                                            "是:公共项目\n" +
+                                            "否:普通项目"));
+                                    cell.setCellComment(comment);
+                                    break;
+                                case "级别":
+                                    // 加载下拉列表内容
+                                    textList= new String[]{"正常", "紧急","重要","重要且紧急"};
+                                    constraint = DVConstraint
+                                            .createExplicitListConstraint(textList);
+                                    // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列
+                                    regions = new CellRangeAddressList(1,
+                                            1000, i, i);
+                                    // 数据有效性对象
+                                    data_validation_list = new HSSFDataValidation(
+                                            regions, constraint);
+                                    sheet.addValidationData(data_validation_list);
+                                    break;
+                                case "项目名称":
+                                    comment = drawing.createCellComment(anchor);
+                                    // 输入批注信息
+                                    comment.setString(new HSSFRichTextString("项目名称必填"));
+                                    cell.setCellComment(comment);
+                                    break;
+                                case "参与人":
+                                    comment = drawing.createCellComment(anchor);
+                                    // 输入批注信息
+                                    comment.setString(new HSSFRichTextString("多个参与人使用中文逗号(,)隔开"));
+                                    cell.setCellComment(comment);
+                                    break;
+                                case "主要负责人":
+                                    comment = drawing.createCellComment(anchor);
+                                    // 输入批注信息
+                                    comment.setString(new HSSFRichTextString("负责人需存在于参与人中"));
+                                    cell.setCellComment(comment);
+                                    break;
+                                case "开始日期":
+                                case "截止日期":
+                                    // 输入批注信息
+                                    comment = drawing.createCellComment(anchor);
+                                    // 输入批注信息
+                                    comment.setString(new HSSFRichTextString("日期格式:yyyy-MM-dd\n" +
+                                            "例如: 2021-01-01"));
+                                    cell.setCellComment(comment);
+                                    break;
+
+                            }
+                        }else {
+                            cell.setCellStyle(cellStyle);
+                        }
+                        cell.setCellValue(rowList.get(i));
+                    }
+                    start++;
+                }
+            }
+            //用于非传统ajax;
+//            String headStr = "attachment; filename=\"" + fileName + "\"";
+//            response.setContentType("APPLICATION/OCTET-STREAM");//返回格式为流
+//            response.setHeader("Content-Disposition", headStr);
+//            //普通下载不需要以上三行,注掉即可
+//            OutputStream os = response.getOutputStream();//在线下载
+            File dir = null;
+            dir = new File(path);
+            // D://cloud/upload 文件上传后所存储的位置,部署到服务器上时配置服务器地址即可
+            if (!dir.exists()) {
+                dir.mkdirs();
+            }
+            FileOutputStream os = new FileOutputStream(path+fileName);//保存到本地
+            workBook.write(os);
+            os.flush();
+            os.close();
+        }catch(Exception e) {
+            System.out.println(result);
+            e.printStackTrace();
+            msg.setError("已存在模板名称为["+fileName+"]的文件,请删除后重新下载");
+            return msg;
+        }
+        msg.data= "/upload/"+fileName;
+        return msg;
+//        return "";
+    }
 }
 

+ 48 - 24
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProviderInfoController.java

@@ -50,38 +50,62 @@ public class ProviderInfoController {
         HttpRespMsg msg = new HttpRespMsg();
         String token = request.getHeader("TOKEN");
         User user = userMapper.selectById(token);
-        List<ProviderInfo> providerInfoMapperAll = providerInfoMapper.selectList(new QueryWrapper<ProviderInfo>().select("id, provider_name,provider_code").eq("company_id", user.getCompanyId()).orderByDesc("id"));
-        List<String> nameList=new ArrayList<>();
-        List<String> codeList=new ArrayList<>();
-        providerInfoMapperAll.forEach(cu->{
-            nameList.add(cu.getProviderName());
-            if(cu.getProviderCode()!=null){
-                codeList.add(cu.getProviderCode());
-            }
-        });
+
         if (info.getId() == null) {
-            if(nameList.contains(info.getProviderName())){
-                msg.setError("供货商名称已存在");
-                return msg;
+            if (!StringUtils.isEmpty(info.getProviderCode())) {
+                int cnt = providerInfoMapper.selectCount(new QueryWrapper<ProviderInfo>().eq("company_id", user.getCompanyId()).eq("provider_code", info.getProviderCode()));
+                if (cnt > 0) {
+                    msg.setError("供货商编号已存在");
+                    return msg;
+                }
             }
-            if(codeList.contains(info.getProviderCode())){
-                msg.setError("供货商编号已存在");
-                return msg;
+            if (!StringUtils.isEmpty(info.getProviderName())) {
+                if (info.getProviderCategoryId() != null) {
+                    int cnt = providerInfoMapper.selectCount(new QueryWrapper<ProviderInfo>().eq("company_id", user.getCompanyId()).eq("provider_name", info.getProviderName()).eq("provider_category_id", info.getProviderCategoryId()));
+                    if (cnt > 0) {
+                        msg.setError("该分类下供货商名称已存在");
+                        return msg;
+                    }
+                } else {
+                    int cnt = providerInfoMapper.selectCount(new QueryWrapper<ProviderInfo>().eq("company_id", user.getCompanyId()).eq("provider_name", info.getProviderName()));
+                    if (cnt > 0) {
+                        msg.setError("该供货商名称已存在");
+                        return msg;
+                    }
+                }
+
             }
             info.setCompanyId(user.getCompanyId());
             providerInfoMapper.insert(info);
         } else {
-            ProviderInfo customerInfo = providerInfoMapper.selectById(info.getId());
-            nameList.remove(customerInfo.getProviderName());
-            codeList.remove(customerInfo.getProviderCode());
-            if(nameList.contains(info.getProviderName())){
-                msg.setError("供货商名称已存在");
-                return msg;
+            if (!StringUtils.isEmpty(info.getProviderCode())) {
+                int cnt = providerInfoMapper.selectCount(new QueryWrapper<ProviderInfo>()
+                        .eq("company_id", user.getCompanyId()).eq("provider_code", info.getProviderCode()).ne("id", info.getId()));
+                if (cnt > 0) {
+                    msg.setError("供货商编号已存在");
+                    return msg;
+                }
             }
-            if(codeList.contains(info.getProviderCode())){
-                msg.setError("供货商编号已存在");
-                return msg;
+            if (!StringUtils.isEmpty(info.getProviderName())) {
+                if (info.getProviderCategoryId() != null) {
+                    int cnt = providerInfoMapper.selectCount(new QueryWrapper<ProviderInfo>()
+                            .eq("company_id", user.getCompanyId()).eq("provider_name", info.getProviderName()).eq("provider_category_id", info.getProviderCategoryId()).ne("id", info.getId()));
+                    if (cnt > 0) {
+                        msg.setError("该分类下供货商名称已存在");
+                        return msg;
+                    }
+                } else {
+                    int cnt = providerInfoMapper.selectCount(new QueryWrapper<ProviderInfo>()
+                            .eq("company_id", user.getCompanyId()).eq("provider_name", info.getProviderName()).ne("id", info.getId()));
+                    if (cnt > 0) {
+                        msg.setError("该分类下供货商名称已存在");
+                        return msg;
+                    }
+                }
+
+
             }
+
             if(StringUtils.isEmpty(info.getProviderCategoryName())){
                 info.setProviderCategoryId(0);
             }

+ 16 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java

@@ -99,6 +99,8 @@ public class TaskController {
                 User exeUser = allUsers.stream().filter(al->al.getId().equals(ex.getExecutorId())).findFirst().get();
                 ex.setExecutorName(exeUser.getName());
                 ex.setExecutorColor(exeUser.getColor());
+            });
+            executorList.stream().forEach(ex->{
                 ex.setProjectId(task.getProjectId());
             });
             String ids = executorList.stream().filter(f->!StringUtils.isEmpty(f.getExecutorId())).map(TaskExecutor::getExecutorId).collect(Collectors.joining(","));
@@ -235,7 +237,7 @@ public class TaskController {
     private void updateProjectProgress(Integer projectId) {
         //更新项目完成度
         //只有第一级任务才更新项目进度, 非已撤销状态的
-        List<Task> all = taskMapper.simpleList(new QueryWrapper<Task>().eq("project_id", projectId).isNull("parent_tid").ne("task_status", 2));
+        List<Task> all = taskMapper.simpleList(new QueryWrapper<Task>().eq("project_id", projectId).isNull("parent_tid").ne("task_status", 2).eq("task_type",1));
 
         if (all.size() > 0) {
             long running = all.stream().filter(a -> a.getTaskStatus() == 1).count();
@@ -300,8 +302,8 @@ public class TaskController {
         Task item = taskService.getById(task.getId());
         if (item.getParentTid() == null) {
             //只有第一级任务才更新项目进度, 非已撤销状态的
-            long allProjectTaskCount =  taskService.count(new QueryWrapper<Task>().eq("project_id", item.getProjectId()).isNull("parent_tid").ne("task_status", 2));
-            long finishTaskCount = taskService.count(new QueryWrapper<Task>().eq("project_id", item.getProjectId()).isNull("parent_tid").eq("task_status", 1));
+            long allProjectTaskCount =  taskService.count(new QueryWrapper<Task>().eq("project_id", item.getProjectId()).isNull("parent_tid").ne("task_status", 2).eq("task_type",1));
+            long finishTaskCount = taskService.count(new QueryWrapper<Task>().eq("project_id", item.getProjectId()).isNull("parent_tid").eq("task_status", 1).eq("task_type",1));
             if (allProjectTaskCount > 0) {
                 int progress = ((int) finishTaskCount) * 100 / (int)allProjectTaskCount;
                 Project project = new Project();
@@ -700,7 +702,7 @@ public class TaskController {
      * @return
      */
     @RequestMapping("/listByPage")
-    public HttpRespMsg listByPage(Integer status, Integer viewId, Integer pageIndex, Integer pageSize,Integer type) {
+    public HttpRespMsg listByPage(Integer status, Integer viewId, Integer pageIndex, Integer pageSize,Integer type,Integer dateType,String startDate,String endDate) {
         HttpRespMsg msg = new HttpRespMsg();
         String userId = request.getHeader("Token");
         User user = userMapper.selectById(userId);
@@ -719,6 +721,16 @@ public class TaskController {
         if(type!=null){
             queryWrapper.eq("task_type",type);
         }
+        if(dateType!=null){
+            switch (dateType){
+                case 0:
+                    queryWrapper.ge("start_date",startDate).le("start_date",endDate);
+                    break;
+                case 1:
+                    queryWrapper.ge("task.end_date",startDate).le("task.end_date",endDate);
+                    break;
+            }
+        }
 //        else if (viewId == 3) {
 //            //今天的任务
 //            queryWrapper.eq("end_date", LocalDate.now());

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

@@ -1386,11 +1386,6 @@ public class WeiXinCorpController {
                     oldUser.setName(user.getName());
                     userMapper.updateById(oldUser);
                 }
-//                //判断部门是否要更新
-//                if (oldUser.getDepartmentId() != 0) {
-//                    oldUser.setDepartmentId(0);
-//                    userMapper.updateById(oldUser);
-//                }
             }
         }
 
@@ -1398,14 +1393,15 @@ public class WeiXinCorpController {
         JSONObject deptObj = getAllDepartments(curCorpAccessToken);
         JSONArray deptObjJSONArray = deptObj.getJSONArray("department");
 
-        List<Department> sysDeptList = new ArrayList<>();
+//        List<Department> sysDeptList = new ArrayList<>();
         for (int i=0;i<deptObjJSONArray.size(); i++) {
             int deptId = deptObjJSONArray.getJSONObject(i).getIntValue("id");
             Department department = new Department();
-//            department.setDepartmentName(deptObjJSONArray.getJSONObject(i).getString("name"));
             department.setCompanyId(companyId);
             //设置企业微信的部门id
-            department.setCorpwxDeptid(deptObjJSONArray.getJSONObject(i).getInteger("id"));
+            JSONObject cutDeptJson = deptObjJSONArray.getJSONObject(i);
+            department.setCorpwxDeptid(cutDeptJson.getInteger("id"));
+            department.setCorpwxDeptpid(cutDeptJson.getInteger("parentid"));
             System.out.println("开始远程获取部门详情=====");
             String url = TRANSMIT_SERVER_GET_DEPTDETAIL.replace("ACCESS_TOKEN", corpContactAccessToken).replace("DEPTID", ""+deptId);
             String result = restTemplate.getForObject(url, String.class);
@@ -1424,21 +1420,22 @@ public class WeiXinCorpController {
             if (oldDept == null) {
                 if (deptId != 1) {
                     //忽略根,根是公司名称
+                    departmentMapper.insert(department);
                     //按名称比对
-                    oldDept = departmentMapper.selectOne(new QueryWrapper<Department>().eq("company_id", companyId).eq("department_name", department.getDepartmentName()).last("limit 1"));
-                    if (oldDept == null) {
-                        departmentMapper.insert(department);
-                    } else {
-                        //按照企业微信部门id进行更新
-                        oldDept.setCorpwxDeptid(department.getCorpwxDeptid());
-                        departmentMapper.updateById(oldDept);
-                    }
+//                    oldDept = departmentMapper.selectOne(new QueryWrapper<Department>().eq("company_id", companyId).eq("department_name", department.getDepartmentName()).last("limit 1"));
+//                    if (oldDept == null) {
+//                        departmentMapper.insert(department);
+//                    } else {
+//                        //按照企业微信部门id进行更新
+//                        oldDept.setCorpwxDeptid(department.getCorpwxDeptid());
+//                        departmentMapper.updateById(oldDept);
+//                    }
                 }
             } else {
                 department = oldDept;
             }
 
-            sysDeptList.add(department);
+//            sysDeptList.add(department);
             deptObjJSONArray.getJSONObject(i).put("sys_dept_id", department.getDepartmentId());
             Integer departmentId = department.getDepartmentId();
             JSONArray userList = getDeptUserInfo(curCorpAccessToken, deptId);
@@ -1541,26 +1538,28 @@ public class WeiXinCorpController {
 
         //再来更新部门的层级关系
         List<Department> needUpdateDepts = new ArrayList<>();
-        for (int i=0;i<deptObjJSONArray.size(); i++) {
-            JSONObject deptJson = deptObjJSONArray.getJSONObject(i);
-            int pid = deptJson.getInteger("parentid");
-            if (pid != 1) {
-                //根部门Id = 1
-                Integer sysDeptId = deptJson.getInteger("sys_dept_id");
-                if (sysDeptId != null) {
-                    Department department = sysDeptList.stream().filter(d -> d.getDepartmentId() != null && d.getDepartmentId().equals(sysDeptId)).findFirst().get();
-                    //从deptjson数组中寻找parent item
-                    for (int m=0;m<deptObjJSONArray.size(); m++) {
-                        JSONObject item = deptObjJSONArray.getJSONObject(m);
-                        if (item.getInteger("id").equals(pid)) {
-                            department.setSuperiorId(item.getInteger("sys_dept_id"));
-                            break;
-                        }
+        List<Department> allDbDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
+        for (Department department : allDbDeptList) {
+            int corpwxpid = department.getCorpwxDeptpid();
+            if (corpwxpid == 1) {
+                //父部门是根部门
+//                if (department.getSuperiorId() != null) {
+//                    department.setSuperiorId(0);
+//                    needUpdateDepts.add(department);
+//                }
+            } else {
+                Optional<Department> first = allDbDeptList.stream().filter(all -> all.getCorpwxDeptid().intValue() == corpwxpid).findFirst();
+                if (first.isPresent()) {
+                    //按照企业微信的部门父部门找到了
+                    Integer sysPid = first.get().getDepartmentId();
+                    if (!sysPid.equals(department.getSuperiorId())) {
+                        department.setSuperiorId(sysPid);
+                        needUpdateDepts.add(department);
                     }
-                    needUpdateDepts.add(department);
                 }
             }
         }
+
         if (needUpdateDepts.size() > 0) {
             departmentService.updateBatchById(needUpdateDepts);
         }
@@ -1601,6 +1600,38 @@ public class WeiXinCorpController {
     }
 
 
+    @RequestMapping("/updateDeptHierachyByCorpWx")
+    public HttpRespMsg updateDeptHierachyByCorpWx(Integer companyId) {
+        //再来更新部门的层级关系
+        List<Department> needUpdateDepts = new ArrayList<>();
+        List<Department> allDbDeptList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
+        for (Department department : allDbDeptList) {
+            int corpwxpid = department.getCorpwxDeptpid();
+            if (corpwxpid == 1) {
+                //父部门是根部门
+//                if (department.getSuperiorId() != null) {
+//                    department.setSuperiorId(0);
+//                    needUpdateDepts.add(department);
+//                }
+            } else {
+                Optional<Department> first = allDbDeptList.stream().filter(all -> all.getCorpwxDeptid().intValue() == corpwxpid).findFirst();
+                if (first.isPresent()) {
+                    //按照企业微信的部门父部门找到了
+                    Integer sysPid = first.get().getDepartmentId();
+                    if (!sysPid.equals(department.getSuperiorId())) {
+                        department.setSuperiorId(sysPid);
+                        needUpdateDepts.add(department);
+                    }
+                }
+            }
+        }
+
+        if (needUpdateDepts.size() > 0) {
+            departmentService.updateBatchById(needUpdateDepts);
+        }
+        return new HttpRespMsg();
+    }
+
 
     //直接通过企业的通讯录secret获取到组织架构,但是如果调用的服务器是第三方服务商会被腾讯识别并拦截
     @RequestMapping("/getCorpMembsWithContactSEC")

+ 7 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/BusinessTrip.java

@@ -21,7 +21,7 @@ import org.springframework.format.annotation.DateTimeFormat;
  * </p>
  *
  * @author Seyason
- * @since 2022-07-03
+ * @since 2022-07-15
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -145,6 +145,12 @@ public class BusinessTrip extends Model<BusinessTrip> {
     @TableField("procinst_id")
     private String procinstId;
 
+    /**
+     * 钉钉审批实例的审批通过时间
+     */
+    @TableField("gmt_finished")
+    private String gmtFinished;
+
 
     @Override
     protected Serializable pkVal() {

+ 8 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Department.java

@@ -16,7 +16,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2022-07-05
+ * @since 2022-07-14
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -69,6 +69,13 @@ public class Department extends Model<Department> {
     private Integer corpwxDeptid;
 
 
+    /**
+     * 企业微信部门的父部门id
+     */
+    @TableField("corpwx_deptpid")
+    private Integer corpwxDeptpid;
+
+
     @Override
     protected Serializable pkVal() {
         return this.departmentId;

+ 8 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/LeaveSheet.java

@@ -20,13 +20,12 @@ import org.springframework.format.annotation.DateTimeFormat;
  * </p>
  *
  * @author Seyason
- * @since 2022-07-03
+ * @since 2022-07-15
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 public class LeaveSheet extends Model<LeaveSheet> {
-
     private static final long serialVersionUID=1L;
 
     @TableId(value = "id", type = IdType.AUTO)
@@ -159,6 +158,13 @@ public class LeaveSheet extends Model<LeaveSheet> {
     private String procinstId;
 
 
+    /**
+     * 钉钉审批实例的审批通过时间
+     */
+    @TableField("gmt_finished")
+    private String gmtFinished;
+
+
     @Override
     protected Serializable pkVal() {
         return this.id;

+ 24 - 23
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java

@@ -1118,6 +1118,7 @@ public class DingDingServiceImpl implements DingDingService {
                     rsp = client.execute(req, accessToken);
                     if (showLog)System.out.println(user.getName()+":"+rsp.getBody());
                     JSONObject json = JSONObject.parseObject(rsp.getBody());
+                    if (json.getInteger("errcode") != 0) continue;
                     JSONObject result = json.getJSONObject("result");
                     //考勤数据
                     JSONArray attendanceList = result.getJSONArray("attendance_result_list");
@@ -1178,18 +1179,18 @@ public class DingDingServiceImpl implements DingDingService {
                             trip.setDayCount(Integer.parseInt(cha.toString()));
                             trip.setStatus(0);
                             trip.setProcinstId(item.getString("procInst_id"));
-                            //检查是否已经存在同一个审批单,有的话就是更新出差记录
-                            BusinessTrip oldTrip = businessTripMapper.selectOne(new QueryWrapper<BusinessTrip>().eq("company_id", trip.getCompanyId()).eq("procinst_id", trip.getProcinstId()));
-                            if (oldTrip != null) {
-                                trip.setId(oldTrip.getId());
-                                businessTripMapper.updateById(trip);
-                            } else {
-                                int cnt = businessTripMapper.selectCount(new QueryWrapper<BusinessTrip>().eq("owner_id", user.getId())
-                                        .eq("start_date", trip.getStartDate())
-                                        .eq("end_date", trip.getEndDate()));
-                                if (cnt == 0) {
-                                    businessTripMapper.insert(trip);
-                                }
+                            trip.setGmtFinished(item.getString("gmt_finished"));
+                            //检查是否已经存在老的同一个审批单,如果有的话,需要删除
+                            QueryWrapper<BusinessTrip> queryWrapper = new QueryWrapper<BusinessTrip>().eq("company_id", trip.getCompanyId()).eq("procinst_id", trip.getProcinstId()).ne("gmt_finished", trip.getGmtFinished());
+                            int oldProIns = businessTripMapper.selectCount(queryWrapper);
+                            if (oldProIns > 0) {
+                                businessTripMapper.delete(queryWrapper);
+                            }
+                            int cnt = businessTripMapper.selectCount(new QueryWrapper<BusinessTrip>().eq("owner_id", user.getId())
+                                    .eq("start_date", trip.getStartDate())
+                                    .eq("end_date", trip.getEndDate()));
+                            if (cnt == 0) {
+                                businessTripMapper.insert(trip);
                             }
                         } else if ("请假".equals(tagName)) {
                             LeaveSheet sheet = new LeaveSheet();
@@ -1197,6 +1198,7 @@ public class DingDingServiceImpl implements DingDingService {
                             sheet.setOwnerName(user.getName());
                             sheet.setStartDate(LocalDateTime.parse(item.getString("begin_time"), timeDtf).toLocalDate());
                             sheet.setEndDate(LocalDateTime.parse(item.getString("end_time"), timeDtf).toLocalDate());
+                            sheet.setGmtFinished(item.getString("gmt_finished"));
                             Long cha = sheet.getEndDate().toEpochDay() - sheet.getStartDate().toEpochDay() + 1;
                             sheet.setTimeDays((float)cha);
                             sheet.setCompanyId(dingding.getCompanyId());
@@ -1216,17 +1218,16 @@ public class DingDingServiceImpl implements DingDingService {
                             }
                             sheet.setLeaveType(leaveTypeIndex);
                             //检查是否已经有同一个请假申请,有的话就是更新
-                            LeaveSheet oldSheet = leaveSheetMapper.selectOne(new QueryWrapper<LeaveSheet>().eq("company_id", sheet.getCompanyId()).eq("procinst_id", sheet.getProcinstId()));
-                            if (oldSheet != null) {
-                                sheet.setId(oldSheet.getId());
-                                leaveSheetMapper.updateById(sheet);
-                            } else {
-                                int cnt = leaveSheetMapper.selectCount(new QueryWrapper<LeaveSheet>().eq("owner_id", user.getId())
-                                        .eq("start_date", sheet.getStartDate())
-                                        .eq("end_date", sheet.getEndDate()));
-                                if (cnt == 0) {
-                                    leaveSheetMapper.insert(sheet);
-                                }
+                            QueryWrapper<LeaveSheet> queryWrapper = new QueryWrapper<LeaveSheet>().eq("company_id", sheet.getCompanyId()).eq("procinst_id", sheet.getProcinstId()).ne("gmt_finished", sheet.getGmtFinished());
+                            int oldProIns = leaveSheetMapper.selectCount(queryWrapper);
+                            if (oldProIns > 0) {
+                                leaveSheetMapper.delete(queryWrapper);
+                            }
+                            int cnt = leaveSheetMapper.selectCount(new QueryWrapper<LeaveSheet>().eq("owner_id", user.getId())
+                                    .eq("start_date", sheet.getStartDate())
+                                    .eq("end_date", sheet.getEndDate()));
+                            if (cnt == 0) {
+                                leaveSheetMapper.insert(sheet);
                             }
                         }
                     }

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

@@ -15,6 +15,10 @@ import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.ListUtil;
 import com.management.platform.util.WorkDayCalculateUtils;
 import org.apache.poi.EncryptedDocumentException;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.xssf.usermodel.XSSFCell;
@@ -2219,195 +2223,470 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             }
             inputStream.close();
             outputStream.close();
-            //然后解析表格
-            XSSFWorkbook workbook = new XSSFWorkbook(file);
-            //我们只需要第一个sheet
-            XSSFSheet sheet = workbook.getSheetAt(0);
-            //获取全部人员
-            List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
-            List<Project> projectList = new ArrayList<Project>();
-            //由于第一行需要指明列对应的标题
-            int rowNum = sheet.getLastRowNum();
-
-            HashMap<String, Integer> projectLevelMap = new HashMap<>();
-            projectLevelMap.put("正常", 1);
-            projectLevelMap.put("紧急", 2);
-            projectLevelMap.put("重要", 3);
-            projectLevelMap.put("重要且紧急", 4);
-            projectLevelMap.put("低风险", 5);
-            projectLevelMap.put("中风险", 6);
-            projectLevelMap.put("高风险", 7);
-            List<String> existCodeList = new ArrayList<>();
-            int importCount = 0;
-            for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
-                XSSFRow row = sheet.getRow(rowIndex);
-                if (row == null) {
-                    continue;
-                }
-                //跳过空行
-                if (ExcelUtil.isRowEmpty(row)) {
-                    continue;
-                }
-                //项目编号	项目名称 参与人 负责人 级别 开始日期 截止日期 合同金额
-                XSSFCell codeCell = row.getCell(0);
-                XSSFCell categoryCell = row.getCell(1);
-                XSSFCell isPublicCell = row.getCell(2);
-                XSSFCell nameCell = row.getCell(3);
-                XSSFCell subNameCell = row.getCell(4);
-                XSSFCell participatorCell = row.getCell(5);
-                XSSFCell inchargerCell = row.getCell(6);
-                XSSFCell levelCell = row.getCell(7);
-                XSSFCell startDateCell = row.getCell(8);
-                XSSFCell endDateCell = row.getCell(9);
-                XSSFCell amountCell = row.getCell(10);
-
-
-                if (codeCell != null)codeCell.setCellType(CellType.STRING);
-                if (nameCell != null)nameCell.setCellType(CellType.STRING);
-                if (categoryCell != null)categoryCell.setCellType(CellType.STRING);
-                if (isPublicCell != null)isPublicCell.setCellType(CellType.STRING);
-                if (subNameCell != null)subNameCell.setCellType(CellType.STRING);
-                if (participatorCell != null)participatorCell.setCellType(CellType.STRING);
-                if (inchargerCell != null)inchargerCell.setCellType(CellType.STRING);
-                if (levelCell != null)levelCell.setCellType(CellType.STRING);
-                if (startDateCell != null)startDateCell.setCellType(CellType.NUMERIC);
-                if (endDateCell != null)endDateCell.setCellType(CellType.NUMERIC);
-                if (amountCell != null)amountCell.setCellType(CellType.STRING);
-                if (nameCell == null) {//项目名称为空的直接跳过
-                    throw new Exception("项目名称不能为空");
-                }
-                Project project = new Project();
-                if (codeCell != null) {
-                    String code = codeCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
-                    if (code.equals("项目编号") && rowIndex == 0) {
-                        //检查是否有子项目列
-                        if (!subNameCell.getStringCellValue().trim().startsWith("子项目")) {
-                            throw new Exception("缺少子项目列,请下载最新模板");
-                        }
-                        //跳过第一行标题
+            if(fileName.endsWith(".xlsx")){
+                //然后解析表格
+                XSSFWorkbook workbook = new XSSFWorkbook(file);
+                //我们只需要第一个sheet
+                XSSFSheet sheet = workbook.getSheetAt(0);
+                //获取全部人员
+                List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
+                //获取全部供货商分类列表
+                List<ProviderCategory> providerCategoryList = providerCategoryMapper.selectList(new QueryWrapper<ProviderCategory>().eq("company_id", user.getCompanyId()));
+                Company company = companyMapper.selectById(user.getCompanyId());
+                //获取全部客户
+                List<CustomerInfo> customerInfoList = customerInfoMapper.selectList(new QueryWrapper<CustomerInfo>().eq("company_id", user.getCompanyId()));
+                //获取全部供货商
+                List<ProviderInfo> providerInfoList = providerInfoMapper.selectList(new QueryWrapper<ProviderInfo>().eq("company_id", user.getCompanyId()));
+                List<Project> projectList = new ArrayList<Project>();
+                //由于第一行需要指明列对应的标题
+                int rowNum = sheet.getLastRowNum();
+                HashMap<String, Integer> projectLevelMap = new HashMap<>();
+                projectLevelMap.put("正常", 1);
+                projectLevelMap.put("紧急", 2);
+                projectLevelMap.put("重要", 3);
+                projectLevelMap.put("重要且紧急", 4);
+                projectLevelMap.put("低风险", 5);
+                projectLevelMap.put("中风险", 6);
+                projectLevelMap.put("高风险", 7);
+                List<String> existCodeList = new ArrayList<>();
+                int importCount = 0;
+                for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
+                    XSSFRow row = sheet.getRow(rowIndex);
+                    if (row == null) {
                         continue;
                     }
-                    //检查项目是否存在
-                    List<ProjectCategory> projectCategoryList = projectCategoryMapper.selectList(new QueryWrapper<ProjectCategory>().eq("company_id", user.getCompanyId()));
-                    if (categoryCell != null && !StringUtils.isEmpty(categoryCell.getStringCellValue())) {
-                        Optional<ProjectCategory> category = projectCategoryList.stream().filter(pc -> pc.getName().equals(categoryCell.getStringCellValue())).findFirst();
-                        if(!category.isPresent()){
-                            throw  new Exception("项目分类["+categoryCell.getStringCellValue()+"]不存在");
+                    //跳过空行
+                    if (ExcelUtil.isRowEmpty(row)) {
+                        continue;
+                    }
+                    //项目编号	项目名称 参与人 负责人 级别 开始日期 截止日期 合同金额
+                    XSSFCell codeCell = row.getCell(0);
+                    XSSFCell categoryCell = row.getCell(1);
+                    XSSFCell isPublicCell = row.getCell(2);
+                    XSSFCell nameCell = row.getCell(3);
+                    XSSFCell subNameCell = row.getCell(4);
+                    XSSFCell participatorCell = row.getCell(5);
+                    XSSFCell inchargerCell = row.getCell(6);
+                    XSSFCell levelCell = row.getCell(7);
+                    XSSFCell startDateCell = row.getCell(8);
+                    XSSFCell endDateCell = row.getCell(9);
+                    XSSFCell amountCell = row.getCell(10);
+
+
+                    if (codeCell != null)codeCell.setCellType(CellType.STRING);
+                    if (nameCell != null)nameCell.setCellType(CellType.STRING);
+                    if (categoryCell != null)categoryCell.setCellType(CellType.STRING);
+                    if (isPublicCell != null)isPublicCell.setCellType(CellType.STRING);
+                    if (subNameCell != null)subNameCell.setCellType(CellType.STRING);
+                    if (participatorCell != null)participatorCell.setCellType(CellType.STRING);
+                    if (inchargerCell != null)inchargerCell.setCellType(CellType.STRING);
+                    if (levelCell != null)levelCell.setCellType(CellType.STRING);
+                    if (startDateCell != null)startDateCell.setCellType(CellType.NUMERIC);
+                    if (endDateCell != null)endDateCell.setCellType(CellType.NUMERIC);
+                    if (amountCell != null)amountCell.setCellType(CellType.STRING);
+                    if (nameCell == null) {//项目名称为空的直接跳过
+                        throw new Exception("项目名称不能为空");
+                    }
+                    Project project = new Project();
+                    if (codeCell != null) {
+                        String code = codeCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
+                        if (code.equals("项目编号") && rowIndex == 0) {
+                            //检查是否有子项目列
+                            if (!subNameCell.getStringCellValue().trim().startsWith("子项目")) {
+                                throw new Exception("缺少子项目列,请下载最新模板");
+                            }
+                            //跳过第一行标题
+                            continue;
+                        }
+                        //检查项目是否存在
+                        List<ProjectCategory> projectCategoryList = projectCategoryMapper.selectList(new QueryWrapper<ProjectCategory>().eq("company_id", user.getCompanyId()));
+                        if (categoryCell != null && !StringUtils.isEmpty(categoryCell.getStringCellValue())) {
+                            Optional<ProjectCategory> category = projectCategoryList.stream().filter(pc -> pc.getName().equals(categoryCell.getStringCellValue())).findFirst();
+                            if(!category.isPresent()){
+                                throw  new Exception("项目分类["+categoryCell.getStringCellValue()+"]不存在");
+                            }
+                            project.setCategory(category.get().getId());
+                            project.setCategoryName(categoryCell.getStringCellValue());
+                        }
+                        //检查编号是否已经存在
+                        if (!StringUtils.isEmpty(code)) {
+                            int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
+                            if (cnt > 0) {
+//                            throw new Exception("项目编号存在重复: " + code);
+                                existCodeList.add(code);
+                                //跳过编号重复的数据
+                                continue;
+                            }
+                        }
+                        project.setProjectCode(code);
+                    }
+                    String name = nameCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
+                    project.setCompanyId(user.getCompanyId());
+                    project.setCreatorId(userId);
+                    project.setCreatorName(user.getName());
+                    project.setProjectName(name);
+
+                    //处理人员
+                    if (inchargerCell != null) {
+                        String inchargerName = inchargerCell.getStringCellValue().trim();
+                        if (!StringUtils.isEmpty(inchargerName)) {
+                            Optional<User> first = userList.stream().filter(u -> u.getName().equals(inchargerName)).findFirst();
+                            if (first.isPresent()) {
+                                project.setInchargerId(first.get().getId());
+                                project.setInchargerName(inchargerName);
+                            } else {
+                                throw new Exception("项目负责人["+inchargerName+"]不存在");
+                            }
                         }
-                        project.setCategory(category.get().getId());
-                        project.setCategoryName(categoryCell.getStringCellValue());
                     }
 
 
-                    //检查编号是否已经存在
-                    if (!StringUtils.isEmpty(code)) {
-                        int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
-                        if (cnt > 0) {
-//                            throw new Exception("项目编号存在重复: " + code);
-                            existCodeList.add(code);
-                            //跳过编号重复的数据
-                            continue;
+                    if (levelCell != null) {
+                        String levelStr = levelCell.getStringCellValue();
+                        if (!StringUtils.isEmpty(levelStr)) {
+                            project.setLevel(projectLevelMap.get(levelStr));
                         }
                     }
-                    project.setProjectCode(code);
-                }
-                String name = nameCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
-                project.setCompanyId(user.getCompanyId());
-                project.setCreatorId(userId);
-                project.setCreatorName(user.getName());
-                project.setProjectName(name);
-
-                //处理人员
-                if (inchargerCell != null) {
-                    String inchargerName = inchargerCell.getStringCellValue().trim();
-                    if (!StringUtils.isEmpty(inchargerName)) {
-                        Optional<User> first = userList.stream().filter(u -> u.getName().equals(inchargerName)).findFirst();
-                        if (first.isPresent()) {
-                            project.setInchargerId(first.get().getId());
-                            project.setInchargerName(inchargerName);
-                        } else {
-                            throw new Exception("项目负责人["+inchargerName+"]不存在");
+                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                    if (startDateCell !=null && !StringUtils.isEmpty(startDateCell.getDateCellValue())) {
+                        project.setPlanStartDate(LocalDate.parse(sdf.format(startDateCell.getDateCellValue()), DateTimeFormatter.ofPattern("yyyy-MM-dd")));
+                    }
+                    if (endDateCell !=null && !StringUtils.isEmpty(endDateCell.getDateCellValue())) {
+                        project.setPlanEndDate(LocalDate.parse(sdf.format(endDateCell.getDateCellValue()), DateTimeFormatter.ofPattern("yyyy-MM-dd")));
+                    }
+                    if (amountCell !=null && !StringUtils.isEmpty(amountCell.getStringCellValue())) {
+                        project.setContractAmount(Double.parseDouble(amountCell.getStringCellValue()));
+                    }
+                    if (isPublicCell != null && !StringUtils.isEmpty(isPublicCell.getStringCellValue())) {
+                        project.setIsPublic("是".equals(isPublicCell.getStringCellValue())?1:0);
+                    }
+                    if(projectMapper.insert(project)>0){
+                        ProjectAuditor projectAuditor=new ProjectAuditor();
+                        projectAuditor.setAuditorId(project.getInchargerId());
+                        projectAuditor.setAuditorName(project.getInchargerName());
+                        projectAuditor.setProjectId(project.getId());
+                        projectAuditorMapper.insert(projectAuditor);
+                    }
+                    importCount++;
+                    //处理子项目
+                    if (subNameCell != null) {
+                        //兼容中英文逗号
+                        String[] subNames = subNameCell.getStringCellValue().trim().split(",|\\,");
+                        if (subNames != null) {
+                            for (String s : subNames) {
+                                if (!StringUtils.isEmpty(s)) {
+                                    SubProject sp = new SubProject();
+                                    sp.setName(s);
+                                    sp.setProjectId(project.getId());
+                                    subProjectMapper.insert(sp);
+                                }
+                            }
                         }
                     }
-                }
-
-
-                if (levelCell != null) {
-                    String levelStr = levelCell.getStringCellValue();
-                    if (!StringUtils.isEmpty(levelStr)) {
-                        project.setLevel(projectLevelMap.get(levelStr));
+                    //参与人
+                    if (participatorCell != null) {
+                        String part = participatorCell.getStringCellValue().trim();
+                        //将项目负责人也添加到参与人当中来
+                        String incharger = inchargerCell.getStringCellValue().trim();
+                        if (!StringUtils.isEmpty(part)) {
+                            String[] partSplit = part.split("\\,|\\,");
+                            if(!StringUtils.isEmpty(incharger)){
+                                String[] inchargerSplit = incharger.split("\\,|\\,");
+                                int strLen1 = partSplit.length;// 保存第一个数组长度
+                                int strLen2 = inchargerSplit.length;
+                                partSplit=Arrays.copyOf(partSplit, strLen1+strLen2);
+                                System.arraycopy(inchargerSplit, 0, partSplit, strLen1, strLen2);
+                            }
+                            for (String str : partSplit) {
+                                Participation p = new Participation();
+                                Optional<User> first = userList.stream().filter(u -> u.getName().equals(str)).findFirst();
+                                if (first.isPresent()) {
+                                    p.setUserId(first.get().getId());
+                                    p.setProjectId(project.getId());
+                                    participationMapper.insert(p);
+                                } else {
+                                    projectMapper.deleteById(project.getId());
+                                    throw new Exception("参与人["+str+"]不存在");
+                                }
+                            }
+                        }
                     }
                 }
-
-                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-                if (startDateCell !=null && !StringUtils.isEmpty(startDateCell.getDateCellValue())) {
-                    project.setPlanStartDate(LocalDate.parse(sdf.format(startDateCell.getDateCellValue()), DateTimeFormatter.ofPattern("yyyy-MM-dd")));
-                }
-                if (endDateCell !=null && !StringUtils.isEmpty(endDateCell.getDateCellValue())) {
-                    project.setPlanEndDate(LocalDate.parse(sdf.format(endDateCell.getDateCellValue()), DateTimeFormatter.ofPattern("yyyy-MM-dd")));
-                }
-                if (amountCell !=null && !StringUtils.isEmpty(amountCell.getStringCellValue())) {
-                    project.setContractAmount(Double.parseDouble(amountCell.getStringCellValue()));
-                }
-                if (isPublicCell != null && !StringUtils.isEmpty(isPublicCell.getStringCellValue())) {
-                    project.setIsPublic("是".equals(isPublicCell.getStringCellValue())?1:0);
-                }
-                if(projectMapper.insert(project)>0){
-                    ProjectAuditor projectAuditor=new ProjectAuditor();
-                    projectAuditor.setAuditorId(project.getInchargerId());
-                    projectAuditor.setAuditorName(project.getInchargerName());
-                    projectAuditor.setProjectId(project.getId());
-                    projectAuditorMapper.insert(projectAuditor);
-                }
-                importCount++;
-                //处理子项目
-                if (subNameCell != null) {
-                    //兼容中英文逗号
-                    String[] subNames = subNameCell.getStringCellValue().trim().split(",|\\,");
-                    if (subNames != null) {
-                        for (String s : subNames) {
-                            if (!StringUtils.isEmpty(s)) {
-                                SubProject sp = new SubProject();
-                                sp.setName(s);
-                                sp.setProjectId(project.getId());
-                                subProjectMapper.insert(sp);
+                msg.data = "成功导入"+importCount+"条数据。";
+                if (existCodeList.size() > 0) {
+                    String collect = existCodeList.stream().collect(Collectors.joining(","));
+                    msg.data += "自动跳过"+existCodeList.size()+"条已存在项目编码:"+collect;
+                }
+            }else if(fileName.endsWith(".xls")){
+                //然后解析表格
+                HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(file));
+                //我们只需要第一个sheet
+                HSSFSheet sheet = workbook.getSheetAt(0);
+                //获取全部人员
+                List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
+                //获取全部供货商分类列表
+                List<ProviderCategory> providerCategoryList = providerCategoryMapper.selectList(new QueryWrapper<ProviderCategory>().eq("company_id", user.getCompanyId()));
+                Company company = companyMapper.selectById(user.getCompanyId());
+                //获取全部客户
+                List<CustomerInfo> customerInfoList = customerInfoMapper.selectList(new QueryWrapper<CustomerInfo>().eq("company_id", user.getCompanyId()));
+                //获取全部供货商
+                List<ProviderInfo> providerInfoList = providerInfoMapper.selectList(new QueryWrapper<ProviderInfo>().eq("company_id", user.getCompanyId()));
+                List<Project> projectList = new ArrayList<Project>();
+                //由于第一行需要指明列对应的标题
+                int rowNum = sheet.getLastRowNum();
+                HashMap<String, Integer> projectLevelMap = new HashMap<>();
+                projectLevelMap.put("正常", 1);
+                projectLevelMap.put("紧急", 2);
+                projectLevelMap.put("重要", 3);
+                projectLevelMap.put("重要且紧急", 4);
+                projectLevelMap.put("低风险", 5);
+                projectLevelMap.put("中风险", 6);
+                projectLevelMap.put("高风险", 7);
+                List<String> existCodeList = new ArrayList<>();
+                int importCount = 0;
+                for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
+                    HSSFRow row = sheet.getRow(rowIndex);
+                    if (row == null) {
+                        continue;
+                    }
+                    //跳过空行
+                    if (ExcelUtil.isRowEmpty(row)) {
+                        continue;
+                    }
+                    //项目编号	项目名称 参与人 负责人 级别 开始日期 截止日期 合同金额
+                    HSSFCell codeCell = row.getCell(0);
+                    HSSFCell categoryCell = row.getCell(1);
+                    HSSFCell isPublicCell = row.getCell(2);
+                    HSSFCell nameCell = row.getCell(3);
+                    HSSFCell subNameCell = row.getCell(4);
+                    HSSFCell participatorCell = row.getCell(5);
+                    HSSFCell inchargerCell = row.getCell(6);
+                    HSSFCell levelCell = row.getCell(7);
+                    HSSFCell customerCell=null;
+                    int i=0;
+                    int k=0;
+                    if(company.getPackageCustomer()==1){
+                        customerCell=row.getCell(8);
+                        i++;
+                    }
+                    if(company.getPackageProvider()==1){
+                        for (int j = 0; j < providerCategoryList.size(); j++) {
+                            if(company.getPackageProvider()==1){
+                                k++;
                             }
                         }
                     }
-                }
-                //参与人
-                if (participatorCell != null) {
-                    String part = participatorCell.getStringCellValue().trim();
-                    //将项目负责人也添加到参与人当中来
-                    String incharger = inchargerCell.getStringCellValue().trim();
-                    if (!StringUtils.isEmpty(part)) {
-                        String[] partSplit = part.split("\\,|\\,");
-                        if(!StringUtils.isEmpty(incharger)){
-                            String[] inchargerSplit = incharger.split("\\,|\\,");
-                            int strLen1 = partSplit.length;// 保存第一个数组长度
-                            int strLen2 = inchargerSplit.length;
-                            partSplit=Arrays.copyOf(partSplit, strLen1+strLen2);
-                            System.arraycopy(inchargerSplit, 0, partSplit, strLen1, strLen2);
+                    HSSFCell startDateCell = row.getCell(8+i+k);
+                    HSSFCell endDateCell = row.getCell(9+i+k);
+                    HSSFCell amountCell = row.getCell(10+i+k);
+
+
+                    if (codeCell != null)codeCell.setCellType(CellType.STRING);
+                    if (nameCell != null)nameCell.setCellType(CellType.STRING);
+                    if (categoryCell != null)categoryCell.setCellType(CellType.STRING);
+                    if (isPublicCell != null)isPublicCell.setCellType(CellType.STRING);
+                    if (subNameCell != null)subNameCell.setCellType(CellType.STRING);
+                    if (participatorCell != null)participatorCell.setCellType(CellType.STRING);
+                    if (inchargerCell != null)inchargerCell.setCellType(CellType.STRING);
+                    if (levelCell != null)levelCell.setCellType(CellType.STRING);
+                    if (customerCell != null)customerCell.setCellType(CellType.STRING);
+                    /*if (startDateCell != null)startDateCell.setCellType(CellType.NUMERIC);
+                    if (endDateCell != null)endDateCell.setCellType(CellType.NUMERIC);*/
+                    if (amountCell != null)amountCell.setCellType(CellType.STRING);
+                    if (nameCell == null) {//项目名称为空的直接跳过
+                        throw new Exception("项目名称不能为空");
+                    }
+                    Project project = new Project();
+                    if (codeCell != null) {
+                        String code = codeCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
+                        if (code.equals("项目编号") && rowIndex == 0) {
+                            //检查是否有子项目列
+                            if (!subNameCell.getStringCellValue().trim().startsWith("子项目")) {
+                                throw new Exception("缺少子项目列,请下载最新模板");
+                            }
+                            //跳过第一行标题
+                            continue;
+                        }
+                        //检查项目是否存在
+                        List<ProjectCategory> projectCategoryList = projectCategoryMapper.selectList(new QueryWrapper<ProjectCategory>().eq("company_id", user.getCompanyId()));
+                        if (categoryCell != null && !StringUtils.isEmpty(categoryCell.getStringCellValue())) {
+                            Optional<ProjectCategory> category = projectCategoryList.stream().filter(pc -> pc.getName().equals(categoryCell.getStringCellValue())).findFirst();
+                            if(!category.isPresent()){
+                                throw  new Exception("项目分类["+categoryCell.getStringCellValue()+"]不存在");
+                            }
+                            project.setCategory(category.get().getId());
+                            project.setCategoryName(categoryCell.getStringCellValue());
+                        }
+                        //检查编号是否已经存在
+                        if (!StringUtils.isEmpty(code)) {
+                            int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
+                            if (cnt > 0) {
+//                            throw new Exception("项目编号存在重复: " + code);
+                                existCodeList.add(code);
+                                //跳过编号重复的数据
+                                continue;
+                            }
                         }
-                        for (String str : partSplit) {
-                            Participation p = new Participation();
-                            Optional<User> first = userList.stream().filter(u -> u.getName().equals(str)).findFirst();
+                        project.setProjectCode(code);
+                    }
+                    String name = nameCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
+                    project.setCompanyId(user.getCompanyId());
+                    project.setCreatorId(userId);
+                    project.setCreatorName(user.getName());
+                    project.setProjectName(name);
+
+                    //处理人员
+                    if (inchargerCell != null) {
+                        String inchargerName = inchargerCell.getStringCellValue().trim();
+                        if (!StringUtils.isEmpty(inchargerName)) {
+                            Optional<User> first = userList.stream().filter(u -> u.getName().equals(inchargerName)).findFirst();
                             if (first.isPresent()) {
-                                p.setUserId(first.get().getId());
-                                p.setProjectId(project.getId());
-                                participationMapper.insert(p);
+                                project.setInchargerId(first.get().getId());
+                                project.setInchargerName(inchargerName);
                             } else {
-                                projectMapper.deleteById(project.getId());
-                                throw new Exception("参与人["+str+"]不存在");
+                                throw new Exception("项目负责人["+inchargerName+"]不存在");
+                            }
+                        }
+                    }
+
+
+                    if (levelCell != null) {
+                        String levelStr = levelCell.getStringCellValue();
+                        if (!StringUtils.isEmpty(levelStr)) {
+                            project.setLevel(projectLevelMap.get(levelStr));
+                        }
+                    }
+                    if(customerCell!=null){
+                        String cellStringCellValue = customerCell.getStringCellValue();
+                        if(!StringUtils.isEmpty(cellStringCellValue)){
+                            Optional<CustomerInfo> first = customerInfoList.stream().filter(ci -> ci.getCustomerName().equals(cellStringCellValue)).findFirst();
+                            if(!first.isPresent()){
+                                msg.setError("客户["+cellStringCellValue+"]不存在");
+                                return msg;
+                            }else {
+                                project.setCustomerId(first.get().getId());
+                                project.setCustomerName(first.get().getCustomerName());
+                            }
+                        }
+                    }
+                    if(company.getPackageProvider()==1){
+                        String nameString = "";
+                        String idString = "";
+                        HSSFCell providerCell;
+                        for (int j = 0; j < providerCategoryList.size(); j++) {
+                            String nameSb = "";
+                            String idSb = "";
+                            providerCell=row.getCell(8+i);
+                            HSSFCell cell = row.getCell(10);
+                            if(providerCell!=null){
+                                providerCell.setCellType(CellType.STRING);
+                                String stringCellValue = providerCell.getStringCellValue();
+                                if(!StringUtils.isEmpty(stringCellValue)){
+                                    String[] split = stringCellValue.split(",");
+                                    for (int i1 = 0; i1 < split.length; i1++) {
+                                        int finalJ = j;
+                                        int finalI = i1;
+                                        Optional<ProviderInfo> first = providerInfoList.stream().filter(pd -> pd.getProviderName().equals(split[finalI])&&pd.getProviderCategoryId().equals(providerCategoryList.get(finalJ).getId())).findFirst();
+                                        if(!first.isPresent()){
+                                            msg.setError("供应商["+split[i1]+"]在供应商分类["+providerCategoryList.get(j).getProviderCategoryName()+"]不存在");
+                                            return msg;
+                                        }else {
+                                            if(i1==split.length-1){
+                                                nameSb+=first.get().getProviderName();
+                                                idSb+=first.get().getId();
+                                            }else {
+                                                nameSb+=first.get().getProviderName()+",";
+                                                idSb+=first.get().getId()+",";
+                                            }
+                                        }
+                                    }
+                                }
+                                i++;
+                            }else {
+                                i++;
+                                continue;
+                            }
+                            if(j==providerCategoryList.size()-1){
+                                nameString+=nameSb;
+                                idString+=idSb;
+                            }else {
+                                nameString+=nameSb+",";
+                                idString+=idSb+",";
+                            }
+                        }
+                        project.setProviderIds(idString);
+                        project.setProviderNames(nameString);
+                    }
+                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                    if (startDateCell !=null && !StringUtils.isEmpty(startDateCell.getDateCellValue())) {
+                        project.setPlanStartDate(LocalDate.parse(sdf.format(startDateCell.getDateCellValue()), DateTimeFormatter.ofPattern("yyyy-MM-dd")));
+                    }
+                    if (endDateCell !=null && !StringUtils.isEmpty(endDateCell.getDateCellValue())) {
+                        project.setPlanEndDate(LocalDate.parse(sdf.format(endDateCell.getDateCellValue()), DateTimeFormatter.ofPattern("yyyy-MM-dd")));
+                    }
+                    if (amountCell !=null && !StringUtils.isEmpty(amountCell.getStringCellValue())) {
+                        project.setContractAmount(Double.parseDouble(amountCell.getStringCellValue()));
+                    }
+                    if (isPublicCell != null && !StringUtils.isEmpty(isPublicCell.getStringCellValue())) {
+                        project.setIsPublic("是".equals(isPublicCell.getStringCellValue())?1:0);
+                    }
+                    if(projectMapper.insert(project)>0){
+                        ProjectAuditor projectAuditor=new ProjectAuditor();
+                        projectAuditor.setAuditorId(project.getInchargerId());
+                        projectAuditor.setAuditorName(project.getInchargerName());
+                        projectAuditor.setProjectId(project.getId());
+                        projectAuditorMapper.insert(projectAuditor);
+                    }
+                    importCount++;
+                    //处理子项目
+                    if (subNameCell != null) {
+                        //兼容中英文逗号
+                        String[] subNames = subNameCell.getStringCellValue().trim().split(",|\\,");
+                        if (subNames != null) {
+                            for (String s : subNames) {
+                                if (!StringUtils.isEmpty(s)) {
+                                    SubProject sp = new SubProject();
+                                    sp.setName(s);
+                                    sp.setProjectId(project.getId());
+                                    subProjectMapper.insert(sp);
+                                }
+                            }
+                        }
+                    }
+                    //参与人
+                    if (participatorCell != null) {
+                        String part = participatorCell.getStringCellValue().trim();
+                        //将项目负责人也添加到参与人当中来
+                        String incharger = inchargerCell.getStringCellValue().trim();
+                        if (!StringUtils.isEmpty(part)) {
+                            String[] partSplit = part.split("\\,|\\,");
+                            if(!StringUtils.isEmpty(incharger)){
+                                String[] inchargerSplit = incharger.split("\\,|\\,");
+                                int strLen1 = partSplit.length;// 保存第一个数组长度
+                                int strLen2 = inchargerSplit.length;
+                                partSplit=Arrays.copyOf(partSplit, strLen1+strLen2);
+                                System.arraycopy(inchargerSplit, 0, partSplit, strLen1, strLen2);
+                            }
+                            for (String str : partSplit) {
+                                Participation p = new Participation();
+                                Optional<User> first = userList.stream().filter(u -> u.getName().equals(str)).findFirst();
+                                if (first.isPresent()) {
+                                    p.setUserId(first.get().getId());
+                                    p.setProjectId(project.getId());
+                                    participationMapper.insert(p);
+                                } else {
+                                    projectMapper.deleteById(project.getId());
+                                    throw new Exception("参与人["+str+"]不存在");
+                                }
                             }
                         }
                     }
                 }
-            }
-            msg.data = "成功导入"+importCount+"条数据。";
-            if (existCodeList.size() > 0) {
-                String collect = existCodeList.stream().collect(Collectors.joining(","));
-                msg.data += "自动跳过"+existCodeList.size()+"条已存在项目编码:"+collect;
+                msg.data = "成功导入"+importCount+"条数据。";
+                if (existCodeList.size() > 0) {
+                    String collect = existCodeList.stream().collect(Collectors.joining(","));
+                    msg.data += "自动跳过"+existCodeList.size()+"条已存在项目编码:"+collect;
+                }
             }
         } catch (IOException e) {
             e.printStackTrace();
@@ -2491,9 +2770,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 headList.add(s);
             }
         }
+        if(company.getPackageCustomer()==1){
+            headList.add("客户");
+        }
         if (company.getPackageProject() == 1) {
             //项目管理专业版以上的,导出的数据更全面
-            headList.add("客户");
             headList.add("项目级别");
             headList.add("合同金额");
         }

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

@@ -2976,7 +2976,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 }
                 allReportByDate = dealDataList;
             }
-            System.out.println(allReportByDate);
             DecimalFormat df = new DecimalFormat("#0.0");
             for (Map<String, Object> map : allReportByDate) {
                 HSSFRow row = sheet.createRow(rowNum);
@@ -3063,13 +3062,20 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     index++;
                 }
                 if(timeType.getSyncCorpwxTime()==1){
-                    for (UserCorpwxTime userCorpwxTime : userCorpwxTimeList) {
-                        String s = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(userCorpwxTime.getCreateDate());
-                        String s1 = timeDf.format(map.get("createDate"));
-                        if(map.get("corpwxUserId").equals(userCorpwxTime.getCorpwxUserid())&&s.equals(s1)){
-                            row.createCell(index).setCellValue(userCorpwxTime.getStartTime()+"-"+userCorpwxTime.getEndTime()+",工作时长"+userCorpwxTime.getWorkHours());
+                    String cellValue = "";
+                    if (map.get("corpwxUserId") != null) {
+                        for (UserCorpwxTime userCorpwxTime : userCorpwxTimeList) {
+                            String s = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(userCorpwxTime.getCreateDate());
+                            String s1 = timeDf.format(map.get("createDate"));
+                            if(map.get("corpwxUserId").equals(userCorpwxTime.getCorpwxUserid())&&s.equals(s1)){
+                                cellValue = userCorpwxTime.getStartTime()+"-"+userCorpwxTime.getEndTime()+",工作时长"+userCorpwxTime.getWorkHours();
+                                break;
+                            }
                         }
+                    } else {
+
                     }
+                    row.createCell(index).setCellValue(cellValue);
                 }
                 rowNum++;
             }

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

@@ -22,6 +22,7 @@
         <result column="indate" property="indate" />
         <result column="is_linked" property="isLinked" />
         <result column="procinst_id" property="procinstId" />
+        <result column="gmt_finished" property="gmtFinished" />
     </resultMap>
     <resultMap id="BaseResultMap1" type="com.management.platform.entity.BusinessTrip">
         <result column="owner_id" property="ownerId" />
@@ -31,7 +32,7 @@
     </resultMap>
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, company_id, owner_id, owner_name, reason, start_date, end_date, way, city_from, city_to, go_back, day_count, remark, status, deny_reason, indate, is_linked, procinst_id
+        id, company_id, owner_id, owner_name, reason, start_date, end_date, way, city_from, city_to, go_back, day_count, remark, status, deny_reason, indate, is_linked, procinst_id, gmt_finished
     </sql>
     <select id="summaryData"  resultMap="BaseResultMap1">
         select owner_id, owner_name, sum(day_count) as day_count, department.department_name as department_name from business_trip

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

@@ -11,11 +11,12 @@
         <result column="manager_id" property="managerId" />
         <result column="report_audit_userid" property="reportAuditUserid" />
         <result column="corpwx_deptid" property="corpwxDeptid" />
+        <result column="corpwx_deptpid" property="corpwxDeptpid" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        department_id, department_name, superior_id, company_id, manager_id, report_audit_userid, corpwx_deptid
+        department_id, department_name, superior_id, company_id, manager_id, report_audit_userid, corpwx_deptid, corpwx_deptpid
     </sql>
 
     <!--根据部门获取成本-->

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

@@ -25,11 +25,12 @@
         <result column="is_final_audit" property="isFinalAudit" />
         <result column="auditor_type" property="auditorType" />
         <result column="procinst_id" property="procinstId" />
+        <result column="gmt_finished" property="gmtFinished" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, company_id, owner_id, owner_name, start_date, end_date, leave_type, status, remark, operator_id, time_hours, time_days, indate, time_type, tel, auditor_id, auditor_name, audit_deptid, is_final_audit, auditor_type, procinst_id
+        id, company_id, owner_id, owner_name, start_date, end_date, leave_type, status, remark, operator_id, time_hours, time_days, indate, time_type, tel, auditor_id, auditor_name, audit_deptid, is_final_audit, auditor_type, procinst_id, gmt_finished
     </sql>
     <select id="summaryData"  resultMap="BaseResultMap">
         select owner_id, owner_name, sum(time_hours) as time_hours, sum(time_days) as time_days from leave_sheet

+ 5 - 0
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/controller/CompanyController.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.management.platform.entity.Company;
 import com.management.platform.entity.CompanyDingding;
+import com.management.platform.entity.TimeType;
 import com.management.platform.entity.WxCorpInfo;
 import com.management.platform.mapper.CompanyDingdingMapper;
 import com.management.platform.mapper.CompanyMapper;
@@ -131,6 +132,10 @@ public class CompanyController {
     public HttpRespMsg setPackageList(Company company) {
         return companyService.setPackageList(company);
     }
+    @RequestMapping("/setTimeTypeSetting")
+    public HttpRespMsg setTimeTypeSetting(TimeType timeType) {
+        return companyService.setTimeTypeSetting(timeType);
+    }
 
     @RequestMapping("/syncDindDingMembs")
     public HttpRespMsg syncDingDingMembs(String corpid) {

+ 37 - 0
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/controller/TimeTypeController.java

@@ -0,0 +1,37 @@
+package com.management.platform.controller;
+
+
+import com.management.platform.mapper.TimeTypeMapper;
+import com.management.platform.util.HttpRespMsg;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-07-15
+ */
+@RestController
+@RequestMapping("/time-type")
+public class TimeTypeController {
+    @Resource
+    TimeTypeMapper timeTypeMapper;
+
+    /**
+     * 获取企业列表,显示到期时间
+     * @return
+     */
+    @RequestMapping("get")
+    public HttpRespMsg get(Integer companyId) {
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.data = timeTypeMapper.selectById(companyId);
+        return msg;
+    }
+}
+

+ 8 - 1
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/entity/Company.java

@@ -19,7 +19,7 @@ import org.springframework.format.annotation.DateTimeFormat;
  * </p>
  *
  * @author Seyason
- * @since 2022-04-01
+ * @since 2022-07-15
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -127,6 +127,13 @@ public class Company extends Model<Company> {
     @TableField(exist = false)
     private String dingdingCorpid;
 
+    /**
+     * 供应商模块
+     */
+    @TableField("package_provider")
+    private Integer packageProvider;
+
+
     @Override
     protected Serializable pkVal() {
         return this.id;

+ 122 - 2
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/entity/TimeType.java

@@ -15,7 +15,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2022-03-22
+ * @since 2022-07-15
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -91,7 +91,7 @@ public class TimeType extends Model<TimeType> {
     private Integer fixMonthcost;
 
     /**
-     * 可补填几个月的, 0-不限制,1-本月,2-上个月,3-上上月
+     * 可补填几个月的, 0-不限制,1-本月,2-上个月,3-上上月,4- 7天内 ,5- 前一天
      */
     @TableField("fill_months")
     private Integer fillMonths;
@@ -108,6 +108,12 @@ public class TimeType extends Model<TimeType> {
     @TableField("custom_degree_name")
     private String customDegreeName;
 
+    /**
+     * 工时填报自定义维度是否必填 0-否 1-是
+     */
+    @TableField("custom_degree_status")
+    private Integer customDegreeStatus;
+
     /**
      * 提醒内容
      */
@@ -144,12 +150,126 @@ public class TimeType extends Model<TimeType> {
     @TableField("custom_data_name")
     private String customDataName;
 
+    /**
+     * 工时填报数值收集字段是否必填 0-否 1-是
+     */
+    @TableField("custom_data_status")
+    private Integer customDataStatus;
+
     /**
      * 财务成本导入是否需要审核
      */
     @TableField("finance_audit")
     private Integer financeAudit;
 
+    /**
+     * 加班倍数
+     */
+    @TableField("overtime_ratio")
+    private Double overtimeRatio;
+
+    /**
+     * 是否同步钉钉考勤打卡和出差
+     */
+    @TableField("sync_dingding")
+    private Integer syncDingding;
+
+    /**
+     * 是否是药研行业
+     */
+    @TableField("is_cro")
+    private Integer isCro;
+
+    /**
+     * 只使用导入功能,不要项目审核
+     */
+    @TableField("only_importreport")
+    private Integer onlyImportreport;
+
+    /**
+     * 填写日报显示钉钉打卡时长
+     */
+    @TableField("show_dd_cardtime")
+    private Integer showDdCardtime;
+
+    /**
+     * 填写日报显示企业微信打卡时长
+     */
+    @TableField("show_corpwx_cardtime")
+    private Integer showCorpwxCardtime;
+
+    /**
+     * 自定义文本信息是否开启
+     */
+    @TableField("custom_text_active")
+    private Integer customTextActive;
+
+    /**
+     * 自定义文本信息字段名称
+     */
+    @TableField("custom_text_name")
+    private String customTextName;
+
+    /**
+     * 自定义文本信息是否必填 0-否 1-是
+     */
+    @TableField("custom_text_status")
+    private Integer customTextStatus;
+
+    /**
+     * 是否锁定每日填报时长
+     */
+    @TableField("lock_worktime")
+    private Integer lockWorktime;
+
+    /**
+     * 填报是否填报加班
+     */
+    @TableField("fill_overtime")
+    private Integer fillOvertime;
+
+    /**
+     * 是否显示填报和审核的时间
+     */
+    @TableField("show_fillaudit_time")
+    private Integer showFillauditTime;
+
+    /**
+     * 是否秘薪处理,即任何人的薪资都显示*
+     */
+    @TableField("is_secret_salary")
+    private Integer isSecretSalary;
+
+    /**
+     * 0-每日提醒当天漏填 1-每日提醒昨天漏填
+     */
+    @TableField("alert_type")
+    private Integer alertType;
+
+    /**
+     * 0-工作内容非必填 1-工作内容必填
+     */
+    @TableField("work_content_state")
+    private Integer workContentState;
+
+    /**
+     * 0-不可提前填报 1-可提前填报
+     */
+    @TableField("fill_ahead")
+    private Integer fillAhead;
+
+    /**
+     * 0-当天 1-第二天 2-第三天
+     */
+    @TableField("timeliness")
+    private Integer timeliness;
+
+    /**
+     * 0-未开启 1-开启
+     */
+    @TableField("main_project_state")
+    private Integer mainProjectState;
+
 
     @Override
     protected Serializable pkVal() {

+ 3 - 0
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/service/CompanyService.java

@@ -2,6 +2,7 @@ package com.management.platform.service;
 
 import com.management.platform.entity.Company;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.management.platform.entity.TimeType;
 import com.management.platform.util.HttpRespMsg;
 
 import javax.servlet.http.HttpServletRequest;
@@ -25,4 +26,6 @@ public interface CompanyService extends IService<Company> {
     HttpRespMsg setPackageList(Company company);
 
     HttpRespMsg dataMigration(HttpServletRequest request,Integer oldCompanyId, Integer targetCompanyId,String oldUserName,String targetUserName);
+
+    HttpRespMsg setTimeTypeSetting(TimeType timeType);
 }

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

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

+ 110 - 23
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/service/impl/CompanyServiceImpl.java

@@ -8,6 +8,7 @@ import com.management.platform.mapper.*;
 import com.management.platform.service.*;
 import com.management.platform.util.HttpRespMsg;
 import com.mysql.cj.util.StringUtils;
+import org.apache.commons.beanutils.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -33,6 +34,8 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
     @Resource
     CompanyMapper companyMapper;
     @Resource
+    TimeTypeMapper timeTypeMapper;
+    @Resource
     OperationLogMapper operationLogMapper;
     @Resource
     HttpServletRequest request;
@@ -106,32 +109,21 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
 
     @Override
     public HttpRespMsg setPackageList(Company company) {
-        Company newCompany = new Company();
-        newCompany.setId(company.getId());
-        newCompany.setPackageExpense(company.getPackageExpense());
-        newCompany.setPackageCustomer(company.getPackageCustomer());
-        newCompany.setPackageProject(company.getPackageProject());
-        newCompany.setPackageEngineering(company.getPackageEngineering());
-        newCompany.setPackageSimple(company.getPackageSimple());
-        newCompany.setPackageContract(company.getPackageContract());
-        newCompany.setPackageEtimecard(company.getPackageEtimecard());
-        newCompany.setPackageOa(company.getPackageOa());
-        newCompany.setPackageFinance(company.getPackageFinance());
-        newCompany.setPackageWorktime(company.getPackageWorktime());
-        companyMapper.updateById(newCompany);
+        companyMapper.updateById(company);
         String str = "变更了使用版本:";
-        if (newCompany.getPackageWorktime()==1) {
+        if (company.getPackageWorktime()==1) {
             str += "工时+";
         }
-        if (newCompany.getPackageProject() == 1) str += "项目协同+";
-        if (newCompany.getPackageOa() == 1) str += "OA+";
-        if (newCompany.getPackageExpense() == 1) str += "费用报销+";
-        if (newCompany.getPackageCustomer() == 1) str += "客户管理+";
-        if (newCompany.getPackageContract() == 1) str += "合同管理+";
-        if (newCompany.getPackageEngineering() == 1) str += "建筑工程+";
-        if (newCompany.getPackageEtimecard()== 1) str += "生产车间+";
-        if (newCompany.getPackageFinance() == 1) str += "财务核算+";
-        if (newCompany.getPackageSimple()== 1) str += "Excel简易版+";
+        if (company.getPackageProject() == 1) str += "项目协同+";
+        if (company.getPackageOa() == 1) str += "OA+";
+        if (company.getPackageExpense() == 1) str += "费用报销+";
+        if (company.getPackageCustomer() == 1) str += "客户管理+";
+        if (company.getPackageContract() == 1) str += "合同管理+";
+        if (company.getPackageEngineering() == 1) str += "建筑工程+";
+        if (company.getPackageEtimecard()== 1) str += "生产车间+";
+        if (company.getPackageFinance() == 1) str += "财务核算+";
+        if (company.getPackageSimple()== 1) str += "Excel简易版+";
+        if (company.getPackageProvider()== 1) str += "供应商+";
         saveLog(str);
         return new HttpRespMsg();
     }
@@ -293,4 +285,99 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
         }
         return msg;
     }
+
+    @Override
+    public HttpRespMsg setTimeTypeSetting(TimeType timeType) {
+        TimeType old = timeTypeMapper.selectById(timeType.getCompanyId());
+        timeTypeMapper.updateById(timeType);
+        Company company = companyMapper.selectById(timeType.getCompanyId());
+        String name = company.getCompanyName();
+        String str = "设置["+name+"],";
+        if (timeType.getSyncCorpwxTime() != null && old.getSyncCorpwxTime().intValue() != timeType.getSyncCorpwxTime().intValue()) {
+            if (timeType.getSyncCorpwxTime() == 0) {
+                str += "关闭了企业微信考勤同步,";
+            } else if (timeType.getSyncCorpwxTime() == 1) {
+                str += "启用了企业微信考勤同步,";
+            }
+        }
+        if (timeType.getSyncDingding() != null && old.getSyncDingding().intValue() != timeType.getSyncDingding().intValue()) {
+            if (timeType.getSyncDingding() == 0) {
+                str += "关闭了钉钉考勤同步,";
+            } else if (timeType.getSyncDingding() == 1) {
+                str += "启用了钉钉考勤同步,";
+            }
+        }
+        if (timeType.getShowCorpwxCardtime() != null && old.getShowCorpwxCardtime().intValue() != timeType.getShowCorpwxCardtime().intValue()) {
+            if (timeType.getShowCorpwxCardtime() == 0) {
+                str += "关闭了显示打卡时长,";
+            } else if (timeType.getShowCorpwxCardtime() == 1) {
+                str += "启用了显示打卡时长,";
+            }
+        }
+        if (timeType.getShowDdCardtime() != null && old.getShowDdCardtime().intValue() != timeType.getShowDdCardtime().intValue()) {
+            if (timeType.getShowDdCardtime() == 0) {
+                str += "关闭了显示打卡时长,";
+            } else if (timeType.getShowDdCardtime() == 1) {
+                str += "启用了显示打卡时长,";
+            }
+        }
+        if (timeType.getShowDdCardtime() != null && old.getShowDdCardtime().intValue() != timeType.getShowDdCardtime().intValue()) {
+            if (timeType.getShowDdCardtime() == 0) {
+                str += "关闭了显示打卡时长,";
+            } else if (timeType.getShowDdCardtime() == 1) {
+                str += "启用了显示打卡时长,";
+            }
+        }
+        if (timeType.getShowFillauditTime() != null && old.getShowFillauditTime().intValue() != timeType.getShowFillauditTime().intValue()) {
+            if (timeType.getShowFillauditTime() == 0) {
+                str += "关闭了显示日报审核流程,";
+            } else if (timeType.getShowFillauditTime() == 1) {
+                str += "启用了显示日报审核流程,";
+            }
+        }
+        if (timeType.getIsSecretSalary() != null && old.getIsSecretSalary().intValue() != timeType.getIsSecretSalary().intValue()) {
+            if (timeType.getIsSecretSalary() == 0) {
+                str += "关闭了秘薪设置,";
+            } else if (timeType.getIsSecretSalary() == 1) {
+                str += "启用了秘薪设置,";
+            }
+        }
+        if (timeType.getMainProjectState() != null && old.getMainProjectState().intValue() != timeType.getMainProjectState().intValue()) {
+            if (timeType.getMainProjectState() == 0) {
+                str += "关闭了主项目设置,";
+            } else if (timeType.getMainProjectState() == 1) {
+                str += "启用了主项目设置,";
+            }
+        }
+        if (timeType.getOnlyImportreport() != null && old.getOnlyImportreport().intValue() != timeType.getOnlyImportreport().intValue()) {
+            if (timeType.getOnlyImportreport() == 0) {
+                str += "关闭了仅导入审核,";
+            } else if (timeType.getOnlyImportreport() == 1) {
+                str += "启用了仅导入审核,";
+            }
+        }
+        if (timeType.getFinanceAudit() != null && old.getFinanceAudit().intValue() != timeType.getFinanceAudit().intValue()) {
+            if (timeType.getFinanceAudit() == 0) {
+                str += "关闭了财务薪资导入审核功能,";
+            } else if (timeType.getFinanceAudit() == 1) {
+                str += "启用了财务薪资导入审核功能,";
+            }
+        }
+        if (timeType.getReportWorkflow() != null && old.getReportWorkflow().intValue() != timeType.getReportWorkflow().intValue()) {
+            if (timeType.getReportWorkflow() == 0) {
+                str += "关闭了审批流设置功能,";
+            } else if (timeType.getReportWorkflow() == 1) {
+                str += "启用了审批流设置功能,";
+            }
+        }
+        if (timeType.getIsCro() != null && old.getIsCro().intValue() != timeType.getIsCro().intValue()) {
+            if (timeType.getIsCro() == 0) {
+                str += "取消CRO企业,";
+            } else if (timeType.getIsCro() == 1) {
+                str += "标志为CRO企业,";
+            }
+        }
+        saveLog(str);
+        return new HttpRespMsg();
+    }
 }

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

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.TimeType;
+import com.management.platform.mapper.TimeTypeMapper;
+import com.management.platform.service.TimeTypeService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2022-07-15
+ */
+@Service
+public class TimeTypeServiceImpl extends ServiceImpl<TimeTypeMapper, TimeType> implements TimeTypeService {
+
+}

+ 1 - 0
fhKeeper/formulahousekeeper/ops-platform/src/main/resources/application.yml

@@ -105,6 +105,7 @@ referer:
     - localhost
     - ttkuaiban.com
     - ops.ttkuaiban.com
+    - 47.101.180.183
 excludeUrls: /wxcorp/*,/wxcorp/*/*,/dingding/*,/error,/testClient,/corpWXAuth,/wx-corp-info/*,/clean/*,/innerRoles/*
 syncDDMembUrl: http://worktime.ttkuaiban.com/api/dingding/syncCorpMembs
 

+ 2 - 1
fhKeeper/formulahousekeeper/ops-platform/src/main/resources/mapper/CompanyMapper.xml

@@ -19,11 +19,12 @@
         <result column="package_engineering" property="packageEngineering" />
         <result column="package_simple" property="packageSimple" />
         <result column="package_finance" property="packageFinance" />
+        <result column="package_provider" property="packageProvider" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, company_name, staff_count_max, expiration_date, set_meal, package_worktime, package_project, package_contract, package_oa, package_etimecard, package_expense, package_customer, package_engineering, package_simple, package_finance
+        id, company_name, staff_count_max, expiration_date, set_meal, package_worktime, package_project, package_contract, package_oa, package_etimecard, package_expense, package_customer, package_engineering, package_simple, package_finance, package_provider
     </sql>
 
 </mapper>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 21 - 1
fhKeeper/formulahousekeeper/ops-platform/src/main/resources/mapper/TimeTypeMapper.xml


+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue

@@ -1095,6 +1095,7 @@ export default {
         },
         // 筛选刷新
         billss() {
+            this.page = 1
             var param = {
                 pageIndex: this.page,
                 pageSize: this.size,

+ 26 - 39
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -203,12 +203,14 @@
               </el-select>
             </div>
             <div>
-              <span style="color: #606266">请假时间</span>
-              <el-date-picker v-model="createDate" type="date" @change="chufas()" value-format="yyyy-MM-dd" placeholder="选择日期" size="small" clearable="false"> </el-date-picker>
+              <!-- <span style="color: #606266">请假时间</span>
+              <el-date-picker v-model="createDate" type="date" @change="chufas()" value-format="yyyy-MM-dd" placeholder="选择日期" size="small" clearable="false"> </el-date-picker> -->
+                <span style="color: #606266">时间段</span>
+                <el-date-picker v-model="createDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="chufas()" value-format="yyyy-MM-dd" placeholder="选择日期" size="small" clearable style="width:280px"></el-date-picker>
             </div>
           </div>
             <el-table v-loading="loading" :data="tableData" style="width: 100%" height="94%">
-                <el-table-column prop="ownerName" label="请假人" min-width="120" fixed="left"></el-table-column>
+                <el-table-column prop="ownerName" :label="'请假人12' + page" min-width="120" fixed="left"></el-table-column>
                 <el-table-column prop="tel" label="电话" min-width="120"></el-table-column>
                 <el-table-column prop="leaveType" label="请假类型" min-width="120">
                   <template slot-scope="scope">
@@ -275,7 +277,7 @@
                 </el-table-column>
             </el-table>
             <div class="poss">
-                <el-pagination
+                <!-- <el-pagination
                   @size-change="handleSizeChange"
                   @current-change="handleCurrentChange"
                   :current-page="currentPage4"
@@ -283,6 +285,15 @@
                   :page-size="20"
                   layout="total, sizes, prev, pager, next"
                   :total="total">
+                </el-pagination> -->
+                <el-pagination
+                  @size-change="handleSizeChange"
+                  @current-change="handleCurrentChange"
+                  :current-page="page"
+                  :page-sizes="[20, 50, 100, 200]"
+                  :page-size="20"
+                  layout="total, sizes, prev, pager, next"
+                  :total="total">
                 </el-pagination>
           </div>
         </div>
@@ -688,15 +699,7 @@ export default {
       displayTable: false,
       users: [], // 人员信息
       flg: true,
-      createDate: '2020-01-01',
-      // pickerOptionsStart: {
-      //   disabledDate: (time) => {
-      //     if (this.addForm.endDate) {
-      //       return time.getTime() > new Date(this.addForm.endDate).getTime() || time.getTime() <= new Date(this.createDate).getTime() - 86400000;
-      //     }
-      //     return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
-      //   },
-      // },
+      createDate: [],
       pickerOptionsEnd: {
           disabledDate: (time) => {
           if (this.addForm.startDate) {
@@ -705,14 +708,6 @@ export default {
           return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
           },
       },
-      // pickerOptionsStarts: {
-      //   disabledDate: (time) => {
-      //     if (this.endData) {
-      //       return time.getTime() > new Date(this.endData).getTime() || time.getTime() <= new Date(this.createDate).getTime() - 86400000;
-      //     }
-      //     return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
-      //   },
-      // },
       pickerOptionsEnds: {
         disabledDate: (time) => {
           if (this.statData) {
@@ -735,19 +730,6 @@ export default {
       loading: false,
       timeChoose: 1,
       permissions: JSON.parse(sessionStorage.getItem("permissions")),
-      // typess: [{
-      //   name: '事假',
-      //   id: 0
-      // },{
-      //   name: '病假',
-      //   id: 1
-      // },{
-      //   name: '年假',
-      //   id: 2
-      // },{
-      //   name: '产假',
-      //   id: 3
-      // }],
       typess: [{name: '事假',id: 0},{name: '病假',id: 1},{name: '年假',id: 2},{name: '产假',id: 3},{name: '婚假',id: 4},{name: '丧假',id: 5},{name: '调休假',id: 6},{name: '陪产假',id: 7},{name: '其他', id: 8}],
       statuss: [{
         name: '审核通过',
@@ -766,7 +748,6 @@ export default {
       ownerIds: '',
       type: '',
       code: '',
-      createDate: '',
       falg: 0,
       dialog: false,
       adform: {},
@@ -1391,7 +1372,7 @@ export default {
     bills(audit, tr){
       if(tr) {
         this.code = ''
-        this.createDate = ''
+        this.createDate = []
         // this.ownerIds = ''
         this.type = ''
         if(tr == 1) {
@@ -1410,10 +1391,13 @@ export default {
       this.displayTable = true;
       this.isAuditList = audit;
       this.loading = true
-      var param = {pageIndex: this.page,
+      this.page = '1'
+      var param = { pageIndex: this.page,
                     pageSize: this.size,
                     status: this.code,
-                    createDate: this.createDate,
+                    // createDate: this.createDate,
+                    startDate: this.createDate == null ? '' : this.createDate[0],
+                    endDate: this.createDate == null ? '' : this.createDate[1],
                     ownerId: this.ownerIds,
                     leaveType: this.type,
                   };
@@ -1445,10 +1429,13 @@ export default {
         });
     },
     billss() {
+      this.page = 1
       var param = {pageIndex: this.page,
                     pageSize: this.size,
                     status: this.code,
-                    startDate: this.createDate,
+                    // startDate: this.createDate,
+                    startDate: this.createDate == null ? '' : this.createDate[0],
+                    endDate: this.createDate == null ? '' : this.createDate[1],
                     ownerId: this.ownerIds,
                     leaveType: this.type,
                   };

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

@@ -2808,8 +2808,8 @@ import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete';
                         delete this.addForm.subTaskList;
                         delete this.addForm.refTaskList;
                         delete this.addForm.progress;
-                        //去掉没有执行人的
-                        this.addForm.executorListFront = this.addForm.executorListFront.filter(exe=>exe.executorId);
+                        //去掉没有执行人的.(因为要有计划工时,执行人可以暂不设置)
+                        // this.addForm.executorListFront = this.addForm.executorListFront.filter(exe=>exe.executorId);
                         this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
                         this.addLoading = true;
                         this.http.post('/task/save',this.addForm,

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -13,7 +13,7 @@
             <el-divider style="margin: 0px 0px !important;height:0.5px;"></el-divider>
             <div class="tree" :style="'height:'+ (tableHeight + 83) + 'px'">
                 <!-- <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" accordion></el-tree> -->
-                <el-tree :data="data" :props="defaultProps" :expand-on-click-node="false" accordion @node-click="handleNodeClick" :default-expanded-keys="jDarr" @node-expand="jieDian" @node-collapse="shutDown" @current-change="chufa">
+                <el-tree :data="data" :props="defaultProps" node-key="id" :expand-on-click-node="false" accordion @node-click="handleNodeClick" :default-expanded-keys="jDarr" @node-expand="jieDian" @node-collapse="shutDown" @current-change="chufa">
                     <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node }" @mouseleave= mouseleave(data,$event) @mouseover= mouseover(data,$event)>
 
                         <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">{{ node.label }}</span>
@@ -2353,7 +2353,7 @@ export default {
               label: "未分配",
             });
             this.data = list;
-            // console.log(list, "部门数据")
+            console.log(list, "部门数据")
             this.option = this.changeArr(list1);
           } else {
             this.$message({

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

@@ -798,7 +798,7 @@
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
-                <el-button type="primary" @click="exportReport" style="width:100%;" >导出</el-button>
+                <el-button type="primary" @click="exportReport" style="width:100%;" :loading="listLoading">导出</el-button>
             </div>
         </el-dialog>
         <!--导出报表条件选择 -->
@@ -1319,6 +1319,7 @@
     export default {
         data() {
             return {
+                exportLoad: false,
                 getPickerOptions: {
                      disabledDate: (time) => {
                         var date = new Date();