|
@@ -401,7 +401,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
if(providerCategory.isPresent()){
|
|
if(providerCategory.isPresent()){
|
|
map.put("providerCateGoryName",providerCategory.get().getProviderCategoryName());
|
|
map.put("providerCateGoryName",providerCategory.get().getProviderCategoryName());
|
|
}else {
|
|
}else {
|
|
- map.put("providerCateGoryName","未分类");
|
|
|
|
|
|
+ //map.put("providerCateGoryName","未分类");
|
|
|
|
+ map.put("providerCateGoryName",MessageUtils.message("excel.unclassified"));
|
|
}
|
|
}
|
|
map.put("providerInfoName",providerInfo.get().getProviderName());
|
|
map.put("providerInfoName",providerInfo.get().getProviderName());
|
|
}
|
|
}
|
|
@@ -445,7 +446,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
list.add(projectVO);
|
|
list.add(projectVO);
|
|
}
|
|
}
|
|
List<String> stringList = providerCategoryList.stream().distinct().map(ProviderCategory::getProviderCategoryName).collect(Collectors.toList());
|
|
List<String> stringList = providerCategoryList.stream().distinct().map(ProviderCategory::getProviderCategoryName).collect(Collectors.toList());
|
|
- stringList.add("未分类");
|
|
|
|
|
|
+ //stringList.add("未分类");
|
|
|
|
+ stringList.add(MessageUtils.message("excel.unclassified"));
|
|
Long total = projectIPage.getTotal();
|
|
Long total = projectIPage.getTotal();
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
map.put("records", list);
|
|
map.put("records", list);
|
|
@@ -2331,7 +2333,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
itemList.add(parent);
|
|
itemList.add(parent);
|
|
btLastItemId =businessTripList.get(i).getOwnerId();
|
|
btLastItemId =businessTripList.get(i).getOwnerId();
|
|
}
|
|
}
|
|
- curItem.id = "出差_"+businessTripList.get(i).getId();
|
|
|
|
|
|
+ //curItem.id = "出差_"+businessTripList.get(i).getId();
|
|
|
|
+ curItem.id = MessageUtils.message("leave.busTra") + "_" + businessTripList.get(i).getId();
|
|
curItem.userId = businessTripList.get(i).getOwnerId();
|
|
curItem.userId = businessTripList.get(i).getOwnerId();
|
|
//curItem.text = "出差";
|
|
//curItem.text = "出差";
|
|
curItem.text = MessageUtils.message("leave.busTra");
|
|
curItem.text = MessageUtils.message("leave.busTra");
|
|
@@ -2409,7 +2412,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
itemList.add(parent);
|
|
itemList.add(parent);
|
|
btLastItemId = String.valueOf(bustripProject.getProjectId());
|
|
btLastItemId = String.valueOf(bustripProject.getProjectId());
|
|
}
|
|
}
|
|
- curItem.id = "出差_" + businessTrip.getId();
|
|
|
|
|
|
+ //curItem.id = "出差_" + businessTrip.getId();
|
|
|
|
+ curItem.id = MessageUtils.message("leave.busTra") + "_" + businessTrip.getId();
|
|
curItem.userId = businessTrip.getOwnerId();
|
|
curItem.userId = businessTrip.getOwnerId();
|
|
//curItem.text = "出差/" + businessTrip.getOwnerName();
|
|
//curItem.text = "出差/" + businessTrip.getOwnerName();
|
|
curItem.text = MessageUtils.message("leave.busTra")+"/" + businessTrip.getOwnerName();
|
|
curItem.text = MessageUtils.message("leave.busTra")+"/" + businessTrip.getOwnerName();
|
|
@@ -2439,7 +2443,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
String end_date = sdf.format((Date) map.get("end_date"));
|
|
String end_date = sdf.format((Date) map.get("end_date"));
|
|
String projectId = ""+ (Integer) map.get("id");
|
|
String projectId = ""+ (Integer) map.get("id");
|
|
System.out.println(map);
|
|
System.out.println(map);
|
|
- String exeId = "任务_"+map.get("task_id") +"_"+ (type==0?(Integer) map.get("exe_id"):userId);
|
|
|
|
|
|
+ //String exeId = "任务_"+map.get("task_id") +"_"+ (type==0?(Integer) map.get("exe_id"):userId);
|
|
|
|
+ String exeId = MessageUtils.message("excel.task") + "_"+map.get("task_id") +"_"+ (type==0?(Integer) map.get("exe_id"):userId);
|
|
String taskId = ""+ (Integer) map.get("task_id");
|
|
String taskId = ""+ (Integer) map.get("task_id");
|
|
|
|
|
|
GanttDataItem curItem = new GanttDataItem();;
|
|
GanttDataItem curItem = new GanttDataItem();;
|
|
@@ -3066,9 +3071,10 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
boolean exists=false;
|
|
boolean exists=false;
|
|
if (codeCell != null) {
|
|
if (codeCell != null) {
|
|
String code = codeCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
|
|
String code = codeCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
|
|
- if (code.equals("项目编号") && rowIndex == 0) {
|
|
|
|
|
|
+ if ((code.equals("项目编号") || code.equals("project No")) && rowIndex == 0) {
|
|
//检查是否有子项目列
|
|
//检查是否有子项目列
|
|
- if (!subNameCell.getStringCellValue().trim().startsWith("子项目")) {
|
|
|
|
|
|
+ //if (!subNameCell.getStringCellValue().trim().startsWith("子项目")) {
|
|
|
|
+ if (!subNameCell.getStringCellValue().trim().startsWith(MessageUtils.message("Template.subProject"))) {
|
|
throw new Exception("缺少子项目列,请下载最新模板");
|
|
throw new Exception("缺少子项目列,请下载最新模板");
|
|
}
|
|
}
|
|
//跳过第一行标题
|
|
//跳过第一行标题
|
|
@@ -3138,7 +3144,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
project.setContractAmount(Double.parseDouble(amountCell.getStringCellValue()));
|
|
project.setContractAmount(Double.parseDouble(amountCell.getStringCellValue()));
|
|
}
|
|
}
|
|
if (isPublicCell != null && !StringUtils.isEmpty(isPublicCell.getStringCellValue())) {
|
|
if (isPublicCell != null && !StringUtils.isEmpty(isPublicCell.getStringCellValue())) {
|
|
- project.setIsPublic("是".equals(isPublicCell.getStringCellValue())?1:0);
|
|
|
|
|
|
+ project.setIsPublic(MessageUtils.message("excel.yes").equals(isPublicCell.getStringCellValue())?1:0);
|
|
}
|
|
}
|
|
if(exists){
|
|
if(exists){
|
|
Project updateProject = projectMapper.selectList(new QueryWrapper<Project>().eq("project_code", project.getProjectCode()).eq("company_id", user.getCompanyId())).get(0);
|
|
Project updateProject = projectMapper.selectList(new QueryWrapper<Project>().eq("project_code", project.getProjectCode()).eq("company_id", user.getCompanyId())).get(0);
|
|
@@ -3496,14 +3502,15 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
boolean exists=false;
|
|
boolean exists=false;
|
|
if (codeCell != null) {
|
|
if (codeCell != null) {
|
|
String code = codeCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
|
|
String code = codeCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
|
|
- if (code.equals("项目编号") && rowIndex == 0) {
|
|
|
|
|
|
+ if ((code.equals("项目编号") || code.equals("project No")) && rowIndex == 0) {
|
|
//检查是否有子项目列
|
|
//检查是否有子项目列
|
|
- if (subNameCell!=null&&!subNameCell.getStringCellValue().trim().startsWith("子项目")&&timeType.getMainProjectState()!=1) {
|
|
|
|
|
|
+ //if (subNameCell!=null&&!subNameCell.getStringCellValue().trim().startsWith("子项目")&&timeType.getMainProjectState()!=1) {
|
|
|
|
+ if (subNameCell!=null&&!subNameCell.getStringCellValue().trim().startsWith(MessageUtils.message("Template.subProject"))&&timeType.getMainProjectState()!=1) {
|
|
//throw new Exception("缺少子项目列,请下载最新模板");
|
|
//throw new Exception("缺少子项目列,请下载最新模板");
|
|
throw new Exception(MessageUtils.message("Template.lackSonProject"));
|
|
throw new Exception(MessageUtils.message("Template.lackSonProject"));
|
|
}
|
|
}
|
|
//检查是否有主项目列
|
|
//检查是否有主项目列
|
|
- if (mainNameCell!=null&&!mainNameCell.getStringCellValue().trim().startsWith("主项目")&&timeType.getMainProjectState()==1) {
|
|
|
|
|
|
+ if (mainNameCell!=null&&!mainNameCell.getStringCellValue().trim().startsWith(MessageUtils.message("entry.mainProject"))&&timeType.getMainProjectState()==1) {
|
|
//throw new Exception("缺少主项目列,请下载最新模板");
|
|
//throw new Exception("缺少主项目列,请下载最新模板");
|
|
throw new Exception(MessageUtils.message("Template.lackMasterRow"));
|
|
throw new Exception(MessageUtils.message("Template.lackMasterRow"));
|
|
}
|
|
}
|
|
@@ -3698,7 +3705,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
project.setContractAmount(Double.parseDouble(amountCell.getStringCellValue()));
|
|
project.setContractAmount(Double.parseDouble(amountCell.getStringCellValue()));
|
|
}
|
|
}
|
|
if (isPublicCell != null && !StringUtils.isEmpty(isPublicCell.getStringCellValue())) {
|
|
if (isPublicCell != null && !StringUtils.isEmpty(isPublicCell.getStringCellValue())) {
|
|
- project.setIsPublic("是".equals(isPublicCell.getStringCellValue())?1:0);
|
|
|
|
|
|
+ project.setIsPublic(MessageUtils.message("excel.yes").equals(isPublicCell.getStringCellValue())?1:0);
|
|
}
|
|
}
|
|
if(timeType.getMainProjectState()!=1){
|
|
if(timeType.getMainProjectState()!=1){
|
|
//处理子项目
|
|
//处理子项目
|
|
@@ -4354,7 +4361,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
List<List<String>> allList = new ArrayList<List<String>>();
|
|
List<List<String>> allList = new ArrayList<List<String>>();
|
|
allList.add(headList);
|
|
allList.add(headList);
|
|
- String[] levelArray = new String[]{"正常","紧急","重要","重要且紧急","低风险","中风险","高风险"};
|
|
|
|
|
|
+ //String[] levelArray = new String[]{"正常","紧急","重要","重要且紧急","低风险","中风险","高风险"};
|
|
|
|
+ String[] levelArray = new String[]{MessageUtils.message("excel.normal"), MessageUtils.message("excel.urgent"),MessageUtils.message("excel.important"),MessageUtils.message("excel.impAndUrg"),MessageUtils.message("excel.lowRisk"),MessageUtils.message("excel.MedRisk"),MessageUtils.message("excel.highRisk")};
|
|
LocalDateTime c=LocalDateTime.now();
|
|
LocalDateTime c=LocalDateTime.now();
|
|
//获取项目级别数据
|
|
//获取项目级别数据
|
|
List<ProjectLevel> projectLevelList = projectLevelMapper.selectList(new QueryWrapper<ProjectLevel>().eq("company_id", user.getCompanyId()));
|
|
List<ProjectLevel> projectLevelList = projectLevelMapper.selectList(new QueryWrapper<ProjectLevel>().eq("company_id", user.getCompanyId()));
|
|
@@ -6729,7 +6737,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
if (codeCell != null) {
|
|
if (codeCell != null) {
|
|
String code = codeCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
|
|
String code = codeCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
|
|
- if (code.equals("项目编号") && rowIndex == 0) {
|
|
|
|
|
|
+ if ((code.equals("项目编号") || code.equals("project No")) && rowIndex == 0) {
|
|
//跳过第一行标题
|
|
//跳过第一行标题
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -7220,44 +7228,11 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- //分页查询员工月度工时表
|
|
|
|
- @Override
|
|
|
|
- public HttpRespMsg getEmpMonthHours(Integer pageIndex, Integer pageSize, String month,Integer departmentId,String userId, HttpServletRequest request) {
|
|
|
|
- HttpRespMsg httpRespMsg =new HttpRespMsg();
|
|
|
|
- User targetUser = userMapper.selectById(request.getHeader("token"));
|
|
|
|
- List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "全部人员月度工时表");
|
|
|
|
- List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "负责部门月度工时表");
|
|
|
|
- List<Integer> deptIds=null;
|
|
|
|
- List<Department> allDepartmentList=departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id",targetUser.getCompanyId()));
|
|
|
|
- List<Department> userDepartmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", targetUser.getId()).eq("company_id",targetUser.getCompanyId()));
|
|
|
|
- List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", targetUser.getId()));
|
|
|
|
- //判断查看权限
|
|
|
|
- if(functionAllList.size()==0){
|
|
|
|
- deptIds=new ArrayList<>();
|
|
|
|
- deptIds.add(-1);
|
|
|
|
- if(functionDeptList.size()>0){
|
|
|
|
- List<Integer> collect = userDepartmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
- collect.addAll(otherCollect);
|
|
|
|
- //将该用户管理的所有部门以及部门的子部门id添加到deptIds集合中
|
|
|
|
- for (Integer integer : collect) {
|
|
|
|
- List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
|
- deptIds.addAll(branchDepartment);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ //人员月度分页功能
|
|
|
|
+ private HashMap<String,List> EmpMonthHoursPage(Integer pageIndex, Integer pageSize,User targetUser,String userId,String startDate,String endDate,List<Integer> branchDepartment,List<Integer> deptIds){
|
|
|
|
+ HashMap<String, List> resultMap = new HashMap<>();
|
|
long total;
|
|
long total;
|
|
List<Map<String,Object>> resultList;
|
|
List<Map<String,Object>> resultList;
|
|
- List<Integer> branchDepartment =null;
|
|
|
|
- //若用户传入departmentId参数,则查询该部门所有子部门,添加到branchDepartment集合中
|
|
|
|
- if(departmentId!=null){
|
|
|
|
- branchDepartment = getBranchDepartment(departmentId, allDepartmentList);
|
|
|
|
- }
|
|
|
|
- String startDate = null;
|
|
|
|
- String endDate = null;
|
|
|
|
- LocalDate time = LocalDate.parse(month, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
|
- startDate = time.with(TemporalAdjusters.firstDayOfMonth()).toString();
|
|
|
|
- endDate = time.with(TemporalAdjusters.lastDayOfMonth()).toString();
|
|
|
|
int days = WorkDayCalculateUtils.getWorkDaysListInRange(startDate, endDate, 0).size();
|
|
int days = WorkDayCalculateUtils.getWorkDaysListInRange(startDate, endDate, 0).size();
|
|
//分页查询用户计划工时和实际工时
|
|
//分页查询用户计划工时和实际工时
|
|
if(pageIndex!=null&&pageSize!=null){
|
|
if(pageIndex!=null&&pageSize!=null){
|
|
@@ -7274,11 +7249,20 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
float standardHours = Float.parseFloat(resultList.get(0).get("allday").toString())*days;
|
|
float standardHours = Float.parseFloat(resultList.get(0).get("allday").toString())*days;
|
|
LocalDate localStartDate = LocalDate.parse(startDate, dateTimeFormatter);
|
|
LocalDate localStartDate = LocalDate.parse(startDate, dateTimeFormatter);
|
|
LocalDate localEndDate = LocalDate.parse(endDate, dateTimeFormatter);
|
|
LocalDate localEndDate = LocalDate.parse(endDate, dateTimeFormatter);
|
|
|
|
+ List<LeaveSheet> sumLeave = leaveSheetMapper.selectLeave(targetUser.getCompanyId(), startDate, endDate);
|
|
for (Map<String, Object> map : resultList) {
|
|
for (Map<String, Object> map : resultList) {
|
|
//计算算请假时间
|
|
//计算算请假时间
|
|
|
|
+ standardHours = new BigDecimal(standardHours).setScale(1,BigDecimal.ROUND_HALF_UP).floatValue();
|
|
map.put("standardHours",standardHours);
|
|
map.put("standardHours",standardHours);
|
|
- map.put("workingTime",map.get("workingTime")==null?0:map.get("workingTime"));
|
|
|
|
- List<LeaveSheet> leaveSheets = leaveSheetMapper.selectLeave(map.get("userId").toString(),startDate,endDate);
|
|
|
|
|
|
+ float workingTime = map.get("workingTime")==null?0:Float.parseFloat(map.get("workingTime").toString());
|
|
|
|
+ workingTime = new BigDecimal(workingTime).setScale(1,BigDecimal.ROUND_HALF_UP).floatValue();
|
|
|
|
+ map.put("workingTime",workingTime);
|
|
|
|
+ List<LeaveSheet> leaveSheets = new ArrayList<>();
|
|
|
|
+ for (LeaveSheet leaveSheet : sumLeave) {
|
|
|
|
+ if (map.get("userId").toString().equals(leaveSheet.getOwnerId())){
|
|
|
|
+ leaveSheets.add(leaveSheet);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
float leaveTime = 0;
|
|
float leaveTime = 0;
|
|
for (LeaveSheet leaveSheet : leaveSheets) {
|
|
for (LeaveSheet leaveSheet : leaveSheets) {
|
|
//当请假时间在当前月内的
|
|
//当请假时间在当前月内的
|
|
@@ -7304,15 +7288,99 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ leaveTime = new BigDecimal(leaveTime).setScale(1,BigDecimal.ROUND_HALF_UP).floatValue();
|
|
map.put("leaveTime",leaveTime);
|
|
map.put("leaveTime",leaveTime);
|
|
//是否满足工时
|
|
//是否满足工时
|
|
- if (Float.parseFloat(map.get("workingTime").toString()) < standardHours){
|
|
|
|
|
|
+ if (workingTime + leaveTime < standardHours){
|
|
map.put("whether",0);
|
|
map.put("whether",0);
|
|
}else{
|
|
}else{
|
|
map.put("whether",1);
|
|
map.put("whether",1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ resultMap.put("resultList",resultList);
|
|
|
|
+ ArrayList<Long> totalList = new ArrayList<>();
|
|
|
|
+ totalList.add(total);
|
|
|
|
+ resultMap.put("totalList",totalList);
|
|
|
|
+ return resultMap;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //分页查询人员月度工时表
|
|
|
|
+ @Override
|
|
|
|
+ public HttpRespMsg getEmpMonthHours(Integer pageIndex, Integer pageSize, String month,Integer departmentId,String userId,Integer whether,HttpServletRequest request) {
|
|
|
|
+ HttpRespMsg httpRespMsg =new HttpRespMsg();
|
|
|
|
+ User targetUser = userMapper.selectById(request.getHeader("token"));
|
|
|
|
+ List<SysRichFunction> functionAllList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "全部人员月度工时表");
|
|
|
|
+ List<SysRichFunction> functionDeptList = sysFunctionMapper.getRoleFunctions(targetUser.getRoleId(), "负责部门月度工时表");
|
|
|
|
+ List<Integer> deptIds=null;
|
|
|
|
+ List<Department> allDepartmentList=departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id",targetUser.getCompanyId()));
|
|
|
|
+ List<Department> userDepartmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", targetUser.getId()).eq("company_id",targetUser.getCompanyId()));
|
|
|
|
+ List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", targetUser.getId()));
|
|
|
|
+ //判断查看权限
|
|
|
|
+ if(functionAllList.size()==0){
|
|
|
|
+ deptIds=new ArrayList<>();
|
|
|
|
+ deptIds.add(-1);
|
|
|
|
+ if(functionDeptList.size()>0){
|
|
|
|
+ List<Integer> collect = userDepartmentList.stream().distinct().map(dm -> dm.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
|
+ collect.addAll(otherCollect);
|
|
|
|
+ //将该用户管理的所有部门以及部门的子部门id添加到deptIds集合中
|
|
|
|
+ for (Integer integer : collect) {
|
|
|
|
+ List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
|
+ deptIds.addAll(branchDepartment);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ long total = 0;
|
|
|
|
+ List<Map<String,Object>> resultList = null;
|
|
|
|
+ List<Integer> branchDepartment =null;
|
|
|
|
+ //若用户传入departmentId参数,则查询该部门所有子部门,添加到branchDepartment集合中
|
|
|
|
+ if(departmentId!=null){
|
|
|
|
+ branchDepartment = getBranchDepartment(departmentId, allDepartmentList);
|
|
|
|
+ }
|
|
|
|
+ String startDate = null;
|
|
|
|
+ String endDate = null;
|
|
|
|
+ LocalDate time = LocalDate.parse(month, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
|
+ startDate = time.with(TemporalAdjusters.firstDayOfMonth()).toString();
|
|
|
|
+ endDate = time.with(TemporalAdjusters.lastDayOfMonth()).toString();
|
|
|
|
+ //是否传入筛选条件(满不满足工时)
|
|
|
|
+ if (whether==null){
|
|
|
|
+ Map<String, List> resultMap = EmpMonthHoursPage(pageIndex,pageSize,targetUser,userId,startDate,endDate,branchDepartment,deptIds);
|
|
|
|
+ resultList = resultMap.get("resultList");
|
|
|
|
+ total = Long.parseLong(resultMap.get("totalList").get(0).toString());
|
|
|
|
+ }else {
|
|
|
|
+ Map<String, List> whetherMap = EmpMonthHoursPage(null,null,targetUser,userId,startDate,endDate,branchDepartment,deptIds);
|
|
|
|
+ resultList = whetherMap.get("resultList");
|
|
|
|
+ if (whether == 1){
|
|
|
|
+ ArrayList<Map<String, Object>> yes = new ArrayList<>();
|
|
|
|
+ for (Map<String, Object> stringObjectMap : resultList) {
|
|
|
|
+ if ("1".equals(stringObjectMap.get("whether").toString())){
|
|
|
|
+ yes.add(stringObjectMap);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //计算总页数
|
|
|
|
+ total = yes.size();
|
|
|
|
+ if (pageIndex!=null && pageSize!=null){
|
|
|
|
+ resultList = yes.stream().skip((pageIndex - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
|
|
|
+ }else {
|
|
|
|
+ resultList = yes;
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ ArrayList<Map<String, Object>> no = new ArrayList<>();
|
|
|
|
+ for (Map<String, Object> stringObjectMap : resultList) {
|
|
|
|
+ if ("0".equals(stringObjectMap.get("whether").toString())){
|
|
|
|
+ no.add(stringObjectMap);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //计算总页数
|
|
|
|
+ total = no.size();
|
|
|
|
+ if (pageIndex!=null && pageSize!=null){
|
|
|
|
+ resultList = no.stream().skip((pageIndex - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
|
|
|
|
+ }else {
|
|
|
|
+ resultList = no;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
Map<String,Object> map=new HashMap<>();
|
|
Map<String,Object> map=new HashMap<>();
|
|
map.put("result",resultList);
|
|
map.put("result",resultList);
|
|
map.put("total",total);
|
|
map.put("total",total);
|
|
@@ -7322,50 +7390,57 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
//导出员工月度工时表
|
|
//导出员工月度工时表
|
|
@Override
|
|
@Override
|
|
- public HttpRespMsg exportEmpMonthHours(String month, HttpServletRequest request, String userId, Integer departmentId){
|
|
|
|
|
|
+ public HttpRespMsg exportEmpMonthHours(String month, HttpServletRequest request, String userId, Integer departmentId,Integer whether){
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
|
|
- String startDate = null;
|
|
|
|
- String endDate = null;
|
|
|
|
LocalDate time = LocalDate.parse(month, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
LocalDate time = LocalDate.parse(month, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
- startDate = time.with(TemporalAdjusters.firstDayOfMonth()).toString();
|
|
|
|
- endDate = time.with(TemporalAdjusters.lastDayOfMonth()).toString();
|
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
|
|
- HttpRespMsg httpRespMsg = getEmpMonthHours(null, null,month,departmentId,userId,request);
|
|
|
|
|
|
+ HttpRespMsg httpRespMsg = getEmpMonthHours(null, null,month,departmentId,userId,whether,request);
|
|
Map<String,Object> data = (Map<String, Object>) httpRespMsg.data;
|
|
Map<String,Object> data = (Map<String, Object>) httpRespMsg.data;
|
|
List<Map<String,Object>> resultList= (List<Map<String, Object>>) data.get("result");
|
|
List<Map<String,Object>> resultList= (List<Map<String, Object>>) data.get("result");
|
|
List<List<String>> dataList=new ArrayList<>();
|
|
List<List<String>> dataList=new ArrayList<>();
|
|
List<String> titleList=new ArrayList<>();
|
|
List<String> titleList=new ArrayList<>();
|
|
- titleList.add("姓名");
|
|
|
|
- titleList.add("工号");
|
|
|
|
- titleList.add("标准工时");
|
|
|
|
- titleList.add("实际工时");
|
|
|
|
- titleList.add("请假工时");
|
|
|
|
- titleList.add("是否满足工时");
|
|
|
|
|
|
+// titleList.add("姓名");
|
|
|
|
+// titleList.add("部门");
|
|
|
|
+// titleList.add("工号");
|
|
|
|
+// titleList.add("标准工时");
|
|
|
|
+// titleList.add("实际工时");
|
|
|
|
+// titleList.add("请假工时");
|
|
|
|
+// titleList.add("是否满足工时");
|
|
|
|
+ titleList.add(MessageUtils.message("entry.name"));
|
|
|
|
+ titleList.add(MessageUtils.message("excel.department"));
|
|
|
|
+ titleList.add(MessageUtils.message("entry.No"));
|
|
|
|
+ titleList.add(MessageUtils.message("excel.standard"));
|
|
|
|
+ titleList.add(MessageUtils.message("excel.actual"));
|
|
|
|
+ titleList.add(MessageUtils.message("excel.leave"));
|
|
|
|
+ titleList.add(MessageUtils.message("excel.leave"));
|
|
|
|
+ titleList.add(MessageUtils.message("excel.workWeather"));
|
|
dataList.add(titleList);
|
|
dataList.add(titleList);
|
|
for (Map<String, Object> map : resultList) {
|
|
for (Map<String, Object> map : resultList) {
|
|
List<String> item=new ArrayList<>();
|
|
List<String> item=new ArrayList<>();
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
item.add("$userName="+(map.get("corwxUserId")==null?"":map.get("corwxUserId"))+"$");
|
|
item.add("$userName="+(map.get("corwxUserId")==null?"":map.get("corwxUserId"))+"$");
|
|
- item.add(String.valueOf(StringUtils.isEmpty(map.get("jobNumber"))?"":map.get("jobNumber")));
|
|
|
|
- //item.add("$deprtmentName="+(map.get("corpwxDeptId")==null?"":map.get("corpwxDeptId"))+"$");
|
|
|
|
|
|
+ item.add("$deprtmentName="+(map.get("corpwxDeptId")==null?"":map.get("corpwxDeptId"))+"$");
|
|
}else {
|
|
}else {
|
|
item.add((String) map.get("name"));
|
|
item.add((String) map.get("name"));
|
|
- item.add(String.valueOf(StringUtils.isEmpty(map.get("jobNumber"))?"":map.get("jobNumber")));
|
|
|
|
- //item.add((String) map.get("departmentName")==null?"":(String) map.get("departmentName"));
|
|
|
|
|
|
+ item.add((String) map.get("departmentName")==null?"":(String) map.get("departmentName"));
|
|
}
|
|
}
|
|
|
|
+ item.add(String.valueOf(StringUtils.isEmpty(map.get("jobNumber"))?"":map.get("jobNumber")));
|
|
item.add(String.valueOf(map.get("standardHours")).equals("null")?"":String.valueOf(map.get("standardHours")));
|
|
item.add(String.valueOf(map.get("standardHours")).equals("null")?"":String.valueOf(map.get("standardHours")));
|
|
item.add(String.valueOf(map.get("workingTime")).equals("null")?"":String.valueOf(map.get("workingTime")));
|
|
item.add(String.valueOf(map.get("workingTime")).equals("null")?"":String.valueOf(map.get("workingTime")));
|
|
item.add(String.valueOf(map.get("leaveTime")).equals("null")?"":String.valueOf(map.get("leaveTime")));
|
|
item.add(String.valueOf(map.get("leaveTime")).equals("null")?"":String.valueOf(map.get("leaveTime")));
|
|
if (map.get("whether").toString().equals("1")){
|
|
if (map.get("whether").toString().equals("1")){
|
|
- item.add("是");
|
|
|
|
|
|
+ //item.add("是");
|
|
|
|
+ item.add(MessageUtils.message("excel.yes"));
|
|
}else{
|
|
}else{
|
|
- item.add("否");
|
|
|
|
|
|
+ //item.add("否");
|
|
|
|
+ item.add(MessageUtils.message("excel.no"));
|
|
}
|
|
}
|
|
dataList.add(item);
|
|
dataList.add(item);
|
|
}
|
|
}
|
|
//生成excel文件导出
|
|
//生成excel文件导出
|
|
- String fileName = "员工"+time.getMonthValue()+"月工时表"+System.currentTimeMillis();
|
|
|
|
|
|
+ //String fileName = "人员"+time.getMonthValue()+"月度工时表"+System.currentTimeMillis();
|
|
|
|
+ String fileName = MessageUtils.message("entry.personnel") +time.getMonthValue()+MessageUtils.message("fileName.monthWork")+System.currentTimeMillis();
|
|
try {
|
|
try {
|
|
return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
|
|
return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName , dataList, path);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|