|
@@ -1860,7 +1860,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
String token = request.getHeader("TOKEN");
|
|
|
User user = userMapper.selectById(token);
|
|
|
- List<Map<String, Object>> list = projectMapper.getOvertimeList(userId, user.getCompanyId(), startDate, endDate, projectId);
|
|
|
+ List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId);
|
|
|
boolean hasViewSalary = sysFunctionService.hasPriviledge(user.getRoleId(), "查看加班成本");
|
|
|
if (!hasViewSalary) {
|
|
|
//去掉权限
|
|
@@ -1869,6 +1869,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
item.remove("cost");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
msg.data = list;
|
|
|
return msg;
|
|
|
}
|
|
@@ -1879,11 +1880,19 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
try {
|
|
|
String token = request.getHeader("TOKEN");
|
|
|
User user = userMapper.selectById(token);
|
|
|
- List<Map<String, Object>> list = projectMapper.getOvertimeList(userId, user.getCompanyId(), startDate, endDate, projectId);
|
|
|
+ TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
+ List<Map<String, Object>> list = projectMapper.getOvertimeDetail(userId, user.getCompanyId(), startDate, endDate, projectId);
|
|
|
boolean hasViewSalary = sysFunctionService.hasPriviledge(user.getRoleId(), "查看加班成本");
|
|
|
BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
|
List<String> headList = new ArrayList<String>();
|
|
|
- headList.add("人员");
|
|
|
+ headList.add("序号");
|
|
|
+ headList.add("项目编号");
|
|
|
+ headList.add("项目名称");
|
|
|
+ headList.add(timeType.getCustomDegreeName());
|
|
|
+ headList.add("姓名");
|
|
|
+ headList.add("部门");
|
|
|
+ headList.add("工作日期");
|
|
|
+ headList.add("部门");
|
|
|
headList.add("加班工时(h)");
|
|
|
if (hasViewSalary) {
|
|
|
headList.add("加班成本(元)");
|
|
@@ -1892,16 +1901,19 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<List<String>> allList = new ArrayList<List<String>>();
|
|
|
allList.add(headList);
|
|
|
double totalCostTime = 0;
|
|
|
+ int seq = 1;
|
|
|
for (Map<String, Object> map : list) {
|
|
|
totalMoneyCost = totalMoneyCost.add((BigDecimal)map.get("cost"));
|
|
|
totalCostTime += (Double)map.get("overtimeHours");
|
|
|
List<String> rowData = new ArrayList<String>();
|
|
|
+ rowData.add(""+seq);
|
|
|
rowData.add((String)map.get("username"));
|
|
|
rowData.add(((Double)map.get("overtimeHours")).toString());
|
|
|
if (hasViewSalary) {
|
|
|
rowData.add(((BigDecimal)map.get("cost")).toString());
|
|
|
}
|
|
|
allList.add(rowData);
|
|
|
+ seq++;
|
|
|
}
|
|
|
String total = totalMoneyCost.toString();
|
|
|
//合计
|