|
@@ -133,7 +133,7 @@ public class UserCorpwxTimeController {
|
|
|
LocalDate localEnd = LocalDate.parse(endDate, standFormatter);
|
|
|
if (participationList.size() > 0) {
|
|
|
List<Integer> collect = participationList.stream().map(Participation::getProjectId).collect(Collectors.toList());
|
|
|
- List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", collect).orderByAsc("id"));
|
|
|
+ List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().in("id", collect).eq("company_id", user.getCompanyId()).orderByAsc("id"));
|
|
|
|
|
|
names = projectList.stream().filter(p->{
|
|
|
if (p.getPlanStartDate() != null) {
|
|
@@ -262,6 +262,7 @@ public class UserCorpwxTimeController {
|
|
|
titles.add(MessageUtils.message("entry.week"));
|
|
|
//titles.add("员工姓名");
|
|
|
titles.add(MessageUtils.message("entry.staffName"));
|
|
|
+ titles.add("部门");
|
|
|
//titles.add("上班时间");
|
|
|
titles.add(MessageUtils.message("entry.goWorkTime"));
|
|
|
//titles.add("下班时间");
|
|
@@ -293,6 +294,7 @@ public class UserCorpwxTimeController {
|
|
|
}else{
|
|
|
dataList.add((String)dataItem.get("username"));
|
|
|
}
|
|
|
+ dataList.add((String)dataItem.get("departmentName"));
|
|
|
dataList.add((String)dataItem.get("startTime"));
|
|
|
dataList.add((String)dataItem.get("endTime"));
|
|
|
// dataList.add(""+(Double)dataItem.get("cardTime"));
|
|
@@ -351,6 +353,7 @@ public class UserCorpwxTimeController {
|
|
|
titles.add("年月");
|
|
|
//titles.add("员工姓名");
|
|
|
titles.add(MessageUtils.message("entry.staffName"));
|
|
|
+ titles.add("部门");
|
|
|
//titles.add("实际工作时长");
|
|
|
titles.add(MessageUtils.message("entry.actualWorkTime"));
|
|
|
titles.add("填报项目时长");
|
|
@@ -368,6 +371,7 @@ public class UserCorpwxTimeController {
|
|
|
}else{
|
|
|
dataList.add((String)dataItem.get("username"));
|
|
|
}
|
|
|
+ dataList.add((String)dataItem.get("departmentName"));
|
|
|
double wt = (Double)dataItem.get("workHours");
|
|
|
double pt = (Double)dataItem.get("projectTime");
|
|
|
dataList.add(""+wt);
|
|
@@ -464,6 +468,7 @@ public class UserCorpwxTimeController {
|
|
|
return msg;
|
|
|
}
|
|
|
List<String> userNameList=new ArrayList<>();
|
|
|
+ boolean hasDept = false;
|
|
|
for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
|
|
|
Row row = sheet.getRow(rowIndex);
|
|
|
if (row == null) {
|
|
@@ -473,6 +478,10 @@ public class UserCorpwxTimeController {
|
|
|
continue;
|
|
|
}
|
|
|
String username = row.getCell(2).getStringCellValue().trim();
|
|
|
+ String deptName = row.getCell(3).getStringCellValue().trim();
|
|
|
+ if (rowIndex == 0 && deptName.equals("部门")) {
|
|
|
+ hasDept = true;
|
|
|
+ }
|
|
|
if(username.equals("员工")){
|
|
|
continue;
|
|
|
}
|
|
@@ -506,8 +515,9 @@ public class UserCorpwxTimeController {
|
|
|
|
|
|
} else {
|
|
|
dataCount++;
|
|
|
+ int deptColumnExtra = hasDept?1:0;
|
|
|
//数据行
|
|
|
- for (int i=1;i<=5; i++) {
|
|
|
+ for (int i=1;i<=5 + deptColumnExtra; i++) {
|
|
|
if (row.getCell(i) != null) {
|
|
|
row.getCell(i).setCellType(CellType.STRING);
|
|
|
}
|
|
@@ -539,8 +549,8 @@ public class UserCorpwxTimeController {
|
|
|
return msg;
|
|
|
}
|
|
|
User reportCreator = any.get();
|
|
|
- String startTime = row.getCell(3).getStringCellValue().trim();
|
|
|
- String endTime = row.getCell(4).getStringCellValue().trim();
|
|
|
+ String startTime = row.getCell(3 + deptColumnExtra).getStringCellValue().trim();
|
|
|
+ String endTime = row.getCell(4 + deptColumnExtra).getStringCellValue().trim();
|
|
|
if (!startTime.contains(":")) {
|
|
|
double t1 = Double.valueOf(startTime) * 24;
|
|
|
//把以小时为单位的时间转化为时分格式, 类似09:00
|
|
@@ -549,7 +559,7 @@ public class UserCorpwxTimeController {
|
|
|
endTime = String.format("%02d:%02d", (int) t2, (int) ((t2 - (int) t2) * 60));
|
|
|
}
|
|
|
|
|
|
- String workHours = row.getCell(5).getStringCellValue().trim();
|
|
|
+ String workHours = row.getCell(5 + deptColumnExtra).getStringCellValue().trim();
|
|
|
double workHoursDouble = Double.valueOf(workHours);
|
|
|
UserCorpwxTime corpwxTime = new UserCorpwxTime();
|
|
|
corpwxTime.setCorpwxUserid(reportCreator.getCorpwxUserid());
|