Преглед изворни кода

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

Lijy пре 2 година
родитељ
комит
5a573b9a48
14 измењених фајлова са 319 додато и 57 уклоњено
  1. 2 15
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/BusinessTripController.java
  2. 10 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java
  3. 1 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/User.java
  4. 4 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectMapper.java
  5. 2 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/BusinessTripService.java
  6. 11 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/BusinessTripServiceImpl.java
  7. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java
  8. 209 9
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  9. 20 8
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml
  10. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/UserMapper.xml
  11. 49 8
      fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue
  12. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue
  13. 7 3
      fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue
  14. BIN
      任务分组相关人员导入模板.xlsx

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

@@ -1,29 +1,16 @@
 package com.management.platform.controller;
 
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.management.platform.entity.BusinessTrip;
-import com.management.platform.entity.Department;
-import com.management.platform.entity.LeaveSheet;
-import com.management.platform.entity.User;
-import com.management.platform.entity.vo.SysRichFunction;
-import com.management.platform.mapper.DepartmentMapper;
-import com.management.platform.mapper.SysFunctionMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.BusinessTripService;
-import com.management.platform.service.DepartmentService;
-import com.management.platform.service.LeaveSheetService;
 import com.management.platform.util.HttpRespMsg;
 import org.springframework.web.bind.annotation.RequestMapping;
-
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -64,8 +51,8 @@ public class BusinessTripController {
     }
 
     @RequestMapping("/list")
-    public HttpRespMsg list(BusinessTrip sheet, @RequestParam Integer pageIndex, @RequestParam Integer pageSize) {
-        return businessTripService.queryList(sheet, pageIndex, pageSize);
+    public HttpRespMsg list(BusinessTrip sheet, @RequestParam Integer pageIndex, @RequestParam Integer pageSize,@RequestParam(defaultValue = "0") Integer checkState) {
+        return businessTripService.queryList(sheet, pageIndex, pageSize,checkState);
     }
 
     @RequestMapping("/approve")

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

@@ -20,6 +20,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -272,6 +273,7 @@ public class TaskController {
     @RequestMapping("/finish")
     public HttpRespMsg finish(Task task) {
         HttpRespMsg msg = new HttpRespMsg();
+        DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         String token = request.getHeader("TOKEN");
         User user = userMapper.selectById(token);
         //进行完成操作时需要检查子任务是否全部完成
@@ -303,7 +305,14 @@ public class TaskController {
                     }
                 }
             }
-
+            TaskComment taskComment=new TaskComment();
+            taskComment.setUserName(user.getName());
+            taskComment.setContent(user.getName()+ df.format(LocalDateTime.now())+"完成了任务");
+            taskComment.setTaskId(task.getId());
+            taskComment.setUserId(user.getId());
+            taskComment.setCreateTime(LocalDateTime.now());
+            taskComment.setType(3);
+            taskCommentMapper.insert(taskComment);
         } else if (task.getTaskStatus() == 1) {
             task.setTaskStatus(0);
         } else {

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

@@ -64,6 +64,7 @@ public class User extends Model<User> {
      * 创建时间
      */
     @TableField("create_time")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
     private LocalDateTime createTime;
 
     /**

+ 4 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectMapper.java

@@ -78,7 +78,7 @@ public interface ProjectMapper extends BaseMapper<Project> {
     //获取导出的项目数据
     List<HashMap<String, Object>> getExportData(Integer companyId, String userId);
 
-    List<Map<String, Object>> getOvertimeDetail(String userId, Integer companyId, String startDate, String endDate, Integer projectId,Integer departmentId,List<Integer> deptIds);
+    List<Map<String, Object>> getOvertimeDetail(String userId, Integer companyId, String startDate, String endDate, Integer projectId,List<Integer> branchDepartment,List<Integer> deptIds);
 
     //获取项目的成本预警和实际工时表
     List<HashMap> getProjectCostAlarm(Integer companyId, Integer pageStart, Integer pageSize, Integer projectId);
@@ -93,7 +93,7 @@ public interface ProjectMapper extends BaseMapper<Project> {
 
     List<Map<String, Object>> getProjectCostByCategory(Integer companyId, String startDate, String endDate, Integer curProjectCategoryId, String userId);
 
-    List<Map<String, Object>> getUserWorkingTimeList(String userId, Integer companyId, String startDate, String endDate, Integer projectId, Integer start, Integer size,Integer departmentId,List<Integer> deptIds);
+    List<Map<String, Object>> getUserWorkingTimeList(String userId, Integer companyId, String startDate, String endDate, Integer projectId, Integer start, Integer size,List<Integer> branchDepartment,List<Integer> deptIds);
 
     long findCountWithUser(String userId, Integer companyId, String startDate, String endDate, Integer projectId, Integer start,Integer size,Integer departmentId,List<Integer> deptIds);
 
@@ -104,9 +104,9 @@ public interface ProjectMapper extends BaseMapper<Project> {
     @Update("update project set status=4 where id=#{id}")
     void suspendProject(Integer id);
 
-    List<Map<String, Object>> getUserWorkingTimeStatic(Integer companyId,String startDate, String endDate, Integer start, Integer size, String userId, Integer departmentId, List<Integer> deptIds);
+    List<Map<String, Object>> getUserWorkingTimeStatic(Integer companyId,String startDate, String endDate, Integer start, Integer size, String userId,List<Integer> branchDepartment, List<Integer> deptIds);
 
-    long findCountWithUserWorkingTime(Integer companyId,String startDate, String endDate, Integer start, Integer size, String userId, Integer departmentId, List<Integer> deptIds);
+    long findCountWithUserWorkingTime(Integer companyId,String startDate, String endDate, Integer start, Integer size, String userId,List<Integer> branchDepartment, List<Integer> deptIds);
 
     List<Map<String, Object>> getTimeCostByMainProject(Integer companyId, String startDate, String endDate, Integer projectId, String userId, List<Integer> deptIds);
 

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

@@ -1,8 +1,7 @@
 package com.management.platform.service;
 
-import com.management.platform.entity.BusinessTrip;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.management.platform.entity.LeaveSheet;
+import com.management.platform.entity.BusinessTrip;
 import com.management.platform.util.HttpRespMsg;
 
 /**
@@ -21,7 +20,7 @@ public interface BusinessTripService extends IService<BusinessTrip> {
 
     HttpRespMsg deny(Integer id, String denyReason);
 
-    HttpRespMsg queryList(BusinessTrip sheet, Integer pageIndex, Integer pageSize);
+    HttpRespMsg queryList(BusinessTrip sheet, Integer pageIndex, Integer pageSize,Integer checkState);
 
     HttpRespMsg delete(Integer id);
 

+ 11 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/BusinessTripServiceImpl.java

@@ -88,12 +88,18 @@ public class BusinessTripServiceImpl extends ServiceImpl<BusinessTripMapper, Bus
 
     @Override
     public HttpRespMsg delete(Integer id) {
+        HttpRespMsg msg=new HttpRespMsg();
+        Integer cut = bustripProjectMapper.selectCount(new QueryWrapper<BustripProject>().eq("bustrip_id", id));
+        if(cut>0){
+            msg.setError("请清空项目关联信息");
+            return msg;
+        }
         businessTripMapper.deleteById(id);
-        return new HttpRespMsg();
+        return msg;
     }
 
     @Override
-    public HttpRespMsg queryList(BusinessTrip sheet, Integer pageIndex, Integer pageSize) {
+    public HttpRespMsg queryList(BusinessTrip sheet, Integer pageIndex, Integer pageSize,Integer checkState) {
         String token = request.getHeader("TOKEN");
         User user = userMapper.selectById(token);
         QueryWrapper<BusinessTrip> queryWrapper = new QueryWrapper<BusinessTrip>();
@@ -142,6 +148,9 @@ public class BusinessTripServiceImpl extends ServiceImpl<BusinessTripMapper, Bus
         if (sheet.getStartDate() != null && sheet.getEndDate() != null) {
             queryWrapper.le("start_date", sheet.getEndDate()).ge("end_date", sheet.getStartDate());
         }
+        if (checkState==1){
+            queryWrapper.ge("day_count",10);
+        }
         IPage<BusinessTrip> listIPager = businessTripMapper.selectPage(new Page<>(pageIndex, pageSize),
                 queryWrapper);
         List<BusinessTrip> records = listIPager.getRecords();

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

@@ -535,7 +535,7 @@ public class DingDingServiceImpl implements DingDingService {
         try {
             String accessToken = null;
             if (isPrivateDeploy) {
-                getPrivateAT(corpid);
+                accessToken = getPrivateAT(corpid);
             } else {
                 accessToken = getValidCorpAccessToken(corpid);
             }

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

@@ -2492,7 +2492,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 }
             }
         }
-        List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId,departmentId,deptIds);
+        List<Integer> branchDepartment =null;
+        if(departmentId!=null){
+            branchDepartment = getBranchDepartment(departmentId, allDepartmentList);
+        }
+        List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId,branchDepartment,deptIds);
         boolean hasViewSalary = sysFunctionService.hasPriviledge(user.getRoleId(), "查看加班成本");
         if (!hasViewSalary) {
             //去掉权限
@@ -4435,7 +4439,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                 }
             }
         }
-        List<Map<String, Object>> list = projectMapper.getUserWorkingTimeList(userId, user.getCompanyId(), startDate, endDate, projectId,start,size,departmentId,deptIds);
+        //获取筛选部门 子部门数据
+        List<Integer> branchDepartment =null;
+        if(departmentId!=null){
+            branchDepartment = getBranchDepartment(departmentId, allDepartmentList);
+        }
+        List<Map<String, Object>> list = projectMapper.getUserWorkingTimeList(userId, user.getCompanyId(), startDate, endDate, projectId,start,size,branchDepartment,deptIds);
         long total=projectMapper.findCountWithUser(userId, user.getCompanyId(), startDate, endDate, projectId,null,null,departmentId,deptIds);
         list.forEach(li->{
             double isPublic = (double) li.get("isPublic");
@@ -4535,8 +4544,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         List<Map<String,Object>> reportList=reportMapper.getUserReportTimelinessRate(targetUser.getCompanyId(),startDate,endDate);
         QueryWrapper<User> queryWrapper=new QueryWrapper();
         queryWrapper.eq("company_id",targetUser.getCompanyId());
+        List<Integer> branchDepartment =null;
         if(departmentId!=null){
-            queryWrapper.eq("department_id",departmentId);
+            branchDepartment = getBranchDepartment(departmentId, allDepartmentList);
+        }
+        if(branchDepartment!=null&&branchDepartment.size()>0){
+            queryWrapper.in("department_id",branchDepartment);
         }
         if(userId!=null){
             queryWrapper.eq("id",userId);
@@ -4779,14 +4792,18 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         }
         long total;
         List<Map<String,Object>> resultList;
+        List<Integer> branchDepartment =null;
+        if(departmentId!=null){
+            branchDepartment = getBranchDepartment(departmentId, allDepartmentList);
+        }
         if(pageIndex!=null&&pageSize!=null){
             Integer size=pageSize;
             Integer start=(pageIndex-1)*size;
-            resultList=projectMapper.getUserWorkingTimeStatic(targetUser.getCompanyId(),startDate,endDate,start,size,userId,departmentId,deptIds);
-            total=projectMapper.findCountWithUserWorkingTime(targetUser.getCompanyId(),startDate,endDate,start,size,userId,departmentId,deptIds);
+            resultList=projectMapper.getUserWorkingTimeStatic(targetUser.getCompanyId(),startDate,endDate,start,size,userId,branchDepartment,deptIds);
+            total=projectMapper.findCountWithUserWorkingTime(targetUser.getCompanyId(),startDate,endDate,start,size,userId,branchDepartment,deptIds);
         }else{
-            resultList=projectMapper.getUserWorkingTimeStatic(targetUser.getCompanyId(),startDate,endDate,null,null,userId,departmentId,deptIds);
-            total=projectMapper.findCountWithUserWorkingTime(targetUser.getCompanyId(),startDate,endDate,null,null,userId,departmentId,deptIds);
+            resultList=projectMapper.getUserWorkingTimeStatic(targetUser.getCompanyId(),startDate,endDate,null,null,userId,branchDepartment,deptIds);
+            total=projectMapper.findCountWithUserWorkingTime(targetUser.getCompanyId(),startDate,endDate,null,null,userId,branchDepartment,deptIds);
         }
         for (Map<String, Object> map : resultList) {
             BigDecimal phBigDecimal =new BigDecimal(String.valueOf(map.get("planHours")==null?0:map.get("planHours")));
@@ -5365,8 +5382,191 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     }
 
     @Override
-    public HttpRespMsg importPersonnelWithGroup(MultipartFile file, HttpServletRequest request) {
-        return null;
+    public HttpRespMsg importPersonnelWithGroup(MultipartFile multipartFile, HttpServletRequest request) {
+        HttpRespMsg msg = new HttpRespMsg();
+        User user = userMapper.selectById(request.getHeader("token"));
+        List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
+        //然后处理文件
+        String fileName = multipartFile.getOriginalFilename();
+        File file = new File(fileName == null ? "file" : fileName);
+        InputStream inputStream = null;
+        OutputStream outputStream = null;
+        try {
+            inputStream = multipartFile.getInputStream();
+            outputStream = new FileOutputStream(file);
+            byte[] buffer = new byte[4096];
+            int temp = 0;
+            while ((temp = inputStream.read(buffer, 0, 4096)) != -1) {
+                outputStream.write(buffer, 0, temp);
+            }
+            inputStream.close();
+            outputStream.close();
+            //然后解析表格
+            XSSFWorkbook workbook = new XSSFWorkbook(file);
+            //我们只需要第一个sheet
+            XSSFSheet sheet = workbook.getSheetAt(0);
+            //由于第一行需要指明列对应的标题
+            int rowNum = sheet.getLastRowNum();
+            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 nameCell = row.getCell(1);
+                XSSFCell groupCell = row.getCell(2);
+                XSSFCell inchargerCell = row.getCell(3);
+                XSSFCell participatorCell = row.getCell(4);
+
+
+                if (codeCell != null) codeCell.setCellType(CellType.STRING);
+                if (nameCell != null) nameCell.setCellType(CellType.STRING);
+                if (groupCell !=null) groupCell.setCellType(CellType.STRING);
+                if (inchargerCell != null) inchargerCell.setCellType(CellType.STRING);
+                if (participatorCell != null) participatorCell.setCellType(CellType.STRING);
+
+                if (codeCell != null) {
+                    String code = codeCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
+                    if (code.equals("项目编号") && rowIndex == 0) {
+                        //跳过第一行标题
+                        continue;
+                    }
+                    //检查编号是否已经存在
+                    if (!StringUtils.isEmpty(code)) {
+                        int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
+                        if (cnt <= 0) {
+                            msg.setError("项目编号["+code+"]不存在");
+                            return msg;
+                        }
+                        List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
+                        if(projectList.size()>0){
+                            Project project = projectList.get(0);
+                            if(nameCell!=null){
+                                String name = nameCell.getStringCellValue();
+                                if(StringUtils.isEmpty(name)){
+                                    msg.setError("项目编号为["+code+"]的项目名称为["+name+"]的项目不存在");
+                                    return msg;
+                                }
+                            }
+                            if(groupCell!=null){
+                                List<TaskGroup> groupList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().eq("project_id", project.getId()).eq("name", groupCell.getStringCellValue()));
+                                if(groupList.size()<=0){
+                                    msg.setError("项目名称为["+project.getProjectName()+"]的任务分组["+groupCell.getStringCellValue()+"]不存在");
+                                    return msg;
+                                }
+                                TaskGroup taskGroup = groupList.get(0);
+                                if(inchargerCell!=null){
+                                    String incharger = inchargerCell.getStringCellValue();
+                                    Optional<User> first = userList.stream().filter(ul -> ul.getName().equals(incharger)).findFirst();
+                                    if(first.isPresent()){
+                                        taskGroup.setInchargerId(first.get().getId());
+                                    }
+                                    taskGroupMapper.updateById(taskGroup);
+                                    if(participatorCell!=null){
+                                        String participator = participatorCell.getStringCellValue();
+                                        String[] split = participator.split(",");
+                                        List<String> list = Arrays.asList(split);
+                                        groupParticipatorMapper.delete(new QueryWrapper<GroupParticipator>().eq("group_id", taskGroup.getId()));
+                                        for (String s : list) {
+                                            Optional<User> optionalUser = userList.stream().filter(ul -> ul.getName().equals(s)).findFirst();
+                                            if(optionalUser.isPresent()){
+                                                GroupParticipator groupParticipator=new GroupParticipator();
+                                                groupParticipator.setUserId(optionalUser.get().getId());
+                                                groupParticipator.setGroupId(taskGroup.getId());
+                                                groupParticipatorMapper.insert(groupParticipator);
+                                            }
+                                        }
+                                        importCount++;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }else {
+                    if(nameCell!=null){
+                        String name = nameCell.getStringCellValue();
+                        List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("project_name", name).eq("company_id", user.getCompanyId()));
+                        Project project = projectList.get(0);
+                        if(StringUtils.isEmpty(name)){
+                            msg.setError("项目名称为["+name+"]的项目不存在");
+                            return msg;
+                        }
+                        if(groupCell!=null){
+                            List<TaskGroup> groupList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().eq("project_id", project.getId()).eq("name", groupCell.getStringCellValue()));
+                            if(groupList.size()<=0){
+                                msg.setError("项目名称为["+project.getProjectName()+"]的任务分组["+groupCell.getStringCellValue()+"]不存在");
+                                return msg;
+                            }
+                            TaskGroup taskGroup = groupList.get(0);
+                            if(inchargerCell!=null){
+                                String incharger = inchargerCell.getStringCellValue();
+                                Optional<User> first = userList.stream().filter(ul -> ul.getName().equals(incharger)).findFirst();
+                                if(first.isPresent()){
+                                    taskGroup.setInchargerId(first.get().getId());
+                                }
+                                taskGroupMapper.updateById(taskGroup);
+                                if(participatorCell!=null){
+                                    String participator = participatorCell.getStringCellValue();
+                                    String[] split = participator.split(",");
+                                    List<String> list = Arrays.asList(split);
+                                    groupParticipatorMapper.delete(new QueryWrapper<GroupParticipator>().eq("group_id", taskGroup.getId()));
+                                    for (String s : list) {
+                                        Optional<User> optionalUser = userList.stream().filter(ul -> ul.getName().equals(s)).findFirst();
+                                        if(optionalUser.isPresent()){
+                                            GroupParticipator groupParticipator=new GroupParticipator();
+                                            groupParticipator.setUserId(optionalUser.get().getId());
+                                            groupParticipator.setGroupId(taskGroup.getId());
+                                            groupParticipatorMapper.insert(groupParticipator);
+                                        }
+                                    }
+                                    importCount++;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            msg.data = "成功导入" + importCount + "条数据。";
+        }catch(IOException e){
+                e.printStackTrace();
+                msg.setError("文件处理出错");
+                return msg;
+            } catch(NullPointerException e){
+                e.printStackTrace();
+                msg.setError("数据格式有误或存在空数据 导入失败");
+                return msg;
+            }catch(InvalidFormatException e){
+                e.printStackTrace();
+                msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
+            }catch(EncryptedDocumentException e){
+                e.printStackTrace();
+                msg.setError("文件加密状态,需要先解除加密状态再上传");
+                return msg;
+            } catch(Exception e){
+                e.printStackTrace();
+                msg.setError("上传失败:" + e.getMessage());
+                return msg;
+            } finally{
+                //关闭流
+                try {
+                    if (outputStream != null && inputStream != null) {
+                        outputStream.close();
+                        inputStream.close();
+                        System.out.println("流已关闭");
+                    }
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+//            file.deleteOnExit();//程序退出时删除临时文件
+                System.out.println(file.delete());
+            }
+            return msg;
     }
 
 

+ 20 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -654,8 +654,11 @@
         <if test="userId != null">
             AND report.`creator_id` = #{userId}
         </if>
-        <if test="departmentId!=null">
-            and report.dept_id=#{departmentId}
+        <if test="branchDepartment!=null and branchDepartment.size()>0">
+            and report.dept_id in
+            <foreach collection="branchDepartment" open="(" close=")" separator="," item="item">
+                #{item}
+            </foreach>
         </if>
         <if test="deptIds!=null and deptIds.size()>0">
             and report.dept_id in
@@ -684,8 +687,11 @@
         <if test="projectId!=null">
             and project.id=#{projectId}
         </if>
-        <if test="departmentId!=null">
-            and report.dept_id=#{departmentId}
+        <if test="branchDepartment!=null and branchDepartment.size()>0">
+            and report.dept_id in
+            <foreach collection="branchDepartment" open="(" close=")" item="item" separator=",">
+                #{item}
+            </foreach>
         </if>
         <if test="deptIds!=null and deptIds.size()>0">
             and report.dept_id in
@@ -888,8 +894,11 @@
         <if test="userId!=null and userId!=''">
             and us.id=#{userId}
         </if>
-        <if test="departmentId!=null">
-            and us.department_id=#{departmentId}
+        <if test="branchDepartment!=null and branchDepartment.size()>0">
+            and us.department_id in
+            <foreach collection="branchDepartment" open="(" close=")" separator="," item="item">
+                #{item}
+            </foreach>
         </if>
         <if test="deptIds!=null and deptIds.size()>0">
             and us.department_id in
@@ -924,8 +933,11 @@
         <if test="userId!=null and userId!=''">
             and us.id=#{userId}
         </if>
-        <if test="departmentId!=null">
-            and us.department_id=#{departmentId}
+        <if test="branchDepartment!=null and branchDepartment.size()>0">
+            and us.department_id in
+            <foreach collection="branchDepartment" open="(" close=")" separator="," item="item">
+                #{item}
+            </foreach>
         </if>
         <if test="deptIds!=null and deptIds.size()>0">
             and us.department_id in

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

@@ -55,7 +55,7 @@
         SELECT a.id, a.role_id as roleId, a.role_name as roleName, a.name, a.phone, a.portrait_url AS portraitUrl, a.role, a.company_id AS companyId, a.cost,
         a.department_id AS departmentId, b.department_name AS departmentName, a.department_cascade AS departmentCascade,
         a.month_cost as monthCost, a.salary_type as salaryType, a.is_active as isActive,date_format(a.`inactive_date`, '%Y-%m-%d') AS inactiveDate, a.cost_apply_date as costApplyDate,a.plate1,a.plate2,a.plate3,a.plate4,a.plate5,
-        a.job_number as jobNumber
+        a.job_number as jobNumber, DATE_FORMAT(a.create_time, '%Y-%m-%d %H:%m')  as createTime
         FROM user AS a
         LEFT JOIN department AS b ON a.department_id = b.department_id
         WHERE a.company_id = #{companyId}
@@ -78,7 +78,7 @@
         SELECT a.id,  a.role_id as roleId, a.role_name as roleName,  a.name, a.phone, a.portrait_url AS portraitUrl, a.role, a.company_id AS companyId, a.cost,
         a.department_id AS departmentId, b.department_name AS departmentName, a.department_cascade AS departmentCascade,
         a.month_cost as monthCost, a.salary_type as salaryType, a.is_active as isActive,date_format(a.`inactive_date`, '%Y-%m-%d') AS inactiveDate, a.cost_apply_date as costApplyDate,a.plate1,a.plate2,a.plate3,a.plate4,a.plate5,
-        a.job_number as jobNumber
+        a.job_number as jobNumber, DATE_FORMAT(a.create_time, '%Y-%m-%d %H:%m')  as createTime
         FROM user AS a
         LEFT JOIN department AS b ON a.department_id = b.department_id
         WHERE a.company_id = #{companyId} AND a.department_id IN

+ 49 - 8
fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue

@@ -186,13 +186,16 @@
                     <div><span style="color: #606266">时间段</span>
                         <el-date-picker v-model="createDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="billss()" value-format="yyyy-MM-dd" placeholder="选择日期" size="small" clearable style="width:280px"></el-date-picker>
                     </div>
+                    <div style="line-height: 32px;margin: 0 20px;">
+                        <el-checkbox v-model="isOverTendays" @change="checkboxChange">10天以上</el-checkbox>
+                    </div>
                     <!-- 从钉钉同步按钮,只有钉钉的用户并且有查看全部权限的管理员才有同步按钮 -->
                     <div style="margin: 0 0 0 20px" v-if="userComLis.dingdingUserid != null && permissions.awayOfficeAll">
                         <el-button size="small" type="primary" @click="dingdingClick()" >从钉钉同步</el-button>
                     </div>
                 </div>
         <!-- 出差列表 -->
-                <el-table :data="tableList" style="width: 100%" height="90%">
+                <el-table :data="tableList" style="width: 100%" height="90%" :loading="tableListLoading">
                     <el-table-column prop="ownerName" label="出差人员" width="100" fixed="left" align="center"></el-table-column>
                     <el-table-column prop="reason" label="出差事由" width="150" header-align="center"></el-table-column>
                     <el-table-column label="出差详情" width="600" align="center">
@@ -222,7 +225,7 @@
                     <el-table-column prop="indate" label="申请时间" width="150" align="center" v-if="!isDingding"></el-table-column>
                     <el-table-column label="出差天数" width="120" align="center">
                         <template slot-scope="scope">
-                            <div>{{scope.row.dayCount}}天</div>
+                            <div><span :style="scope.row.dayCount >= 10 ? 'color:#e62412' : ''">{{scope.row.dayCount}}天</span></div>
                         </template>
                     </el-table-column>
                     <el-table-column prop="startDate" label="出差开始时间" width="150"></el-table-column>
@@ -254,9 +257,10 @@
                             </div>
                         </template>
                     </el-table-column>
-                    <el-table-column v-if="isDingding" label="操作" width="90" fixed="right">
+                    <el-table-column v-if="isDingding" label="操作" width="150" fixed="right">
                         <template slot-scope="scope">
                             <el-button icon="iconfont firerock-iconguanlian" circle size="mini" @click="DingdingEditor(scope.row)"></el-button>
+                            <el-button v-if="permissions.awayOfficeAll || user.manageDeptId" icon="el-icon-delete" circle size="mini" @click="deleteOfDingding(scope.row)"></el-button>
                         </template>
                     </el-table-column>
                 </el-table>
@@ -758,7 +762,10 @@ export default {
             synchronizeLoading: false,
             synchronizationDaying:false,
             createDateList: [],
-            ownerIdsId: ''
+            ownerIdsId: '',
+
+            isOverTendays: false,
+            tableListLoading: false
         }
     },
     created(){
@@ -784,6 +791,36 @@ export default {
         // console.log("session",this.wuduData);
     },
     methods: {
+        checkboxChange(){
+            this.billss()
+        },
+        deleteOfDingding(e) {
+            this.$confirm("确认要删除吗?", "提示", {}).then(() => {
+                this.http.post('/business-trip/delete', {id:e.id},
+                res => {
+                    if (res.code == "ok") {
+                        this.billss();
+                        this.$message({
+                            message: '删除成功',
+                            type: "success"
+                        });
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            });
+        },
+
+
         dingdingClick() {
             this.synchronizationDaying = true
             this.ownerIdsId = this.users[0].id
@@ -938,7 +975,7 @@ export default {
             
         },
         DingdingDelete(row){
-            console.log('row',row);
+            console.log('row',this.relationItem);
             this.$confirm('是否确认删除?','提示',{
                 confirmButtonText: '确定',
                 cancelButtonText: '取消',
@@ -1206,16 +1243,20 @@ export default {
                 ownerId: this.ownerIds,
                 way: this.type,
             };
+            if(this.isOverTendays){
+                param.checkState = 1
+            }
+            this.tableListLoading = true
             this.http.post('/business-trip/list', param,
             res => {
                 if (res.code == "ok") {
                     this.tableList = res.data.records
                     this.total = res.data.total
-                    this.loading = false
+                    this.tableListLoading = false
                     console.log('tablelist',this.tableList);
                     this.$forceUpdate()
                 } else {
-                    this.loading = false
+                    this.tableListLoading = false
                     this.$message({
                         message: res.msg,
                         type: "error"
@@ -1223,7 +1264,7 @@ export default {
                 }
             },
             error => {
-                this.loading = false
+                this.tableListLoading = false
                 this.$message({
                     message: error,
                     type: "error"

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

@@ -60,7 +60,7 @@
                     <div style="margin-left: 80px">
                         <el-select v-model="dateType" style="width:120px;"  slot="prepend" placeholder="请选择">
                             <el-option label="开始时间" :value="0" @click.native="hiddens()"></el-option>
-                            <el-option label="截时间" :value="1" @click.native="hiddens()"></el-option>
+                            <el-option label="截时间" :value="1" @click.native="hiddens()"></el-option>
                         </el-select>
                     </div>
                 </el-form-item>

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

@@ -63,7 +63,9 @@
                         </div>
                     </el-form-item>
                     <el-form-item>
-                        <div style="color:#999;font-size:13px;">共{{total}}人</div>
+                        <div style="color:#999;font-size:13px;">共<span :style="total>user.company.staffCountMax?'color:red;':''">{{total}}</span>人
+                        <span v-if="depData == null || depData.id == -1">(上限:{{user.company.staffCountMax}}人)</span>
+                        </div>
                     </el-form-item>
                     <el-form-item style="float:right;" v-if="permissions.structureCustomConfig">
                         <el-link type="primary" :underline="false" @click="customConfigShow">自定义配置</el-link>
@@ -147,7 +149,7 @@
                 <el-table-column prop="name" label="姓名" ></el-table-column>
                 <el-table-column prop="jobNumber" label="工号" ></el-table-column>
                 <el-table-column prop="phone" label="手机" width="120"></el-table-column>
-                <el-table-column prop="departmentName" label="部门" ></el-table-column>
+                <el-table-column prop="departmentName" label="部门" width="220"></el-table-column>
                 <el-table-column label="角色" width="100">
                     <template slot-scope="scope">{{scope.row.roleName}}</template>
                 </el-table-column>
@@ -159,11 +161,13 @@
                         <el-link v-if="user.timeType.isSecretSalary==0" @click.native="showSalaryList(scope.row)"><i class="iconfont firerock-iconrecord"></i></el-link>
                     </template>
                 </el-table-column>
-                <el-table-column label="状态" width="160">
+                <el-table-column label="状态" width="100">
                     <template slot-scope="scope">
                         <span>{{scope.row.isActive==0 ? '停用(' + scope.row.inactiveDate + ')' : '在职'}}</span>
                     </template>
                 </el-table-column>
+                <el-table-column label="创建时间" width="150" prop="createTime">
+                </el-table-column>
                 <el-table-column label="操作" width="300" fixed="right">
                     <template slot-scope="scope">
                         <el-button size="mini" type="default" v-if="scope.row.roleName == '超级管理员' && user.id == scope.row.id" @click="transferRole(scope.row)">转让</el-button>

BIN
任务分组相关人员导入模板.xlsx