|
@@ -1037,7 +1037,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
//获取查询者所在公司每个项目的工时成本
|
|
//获取查询者所在公司每个项目的工时成本
|
|
@Override
|
|
@Override
|
|
- public HttpRespMsg getTimeCost(String startDate, String endDate, String userId, HttpServletRequest request) {
|
|
|
|
|
|
+ public HttpRespMsg getTimeCost(String startDate, String endDate, String userIds, HttpServletRequest request) {
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
try {
|
|
try {
|
|
//根据系统配置的员工成本计算方式,按固定时薪还是固定月薪,分情况计算。
|
|
//根据系统配置的员工成本计算方式,按固定时薪还是固定月薪,分情况计算。
|
|
@@ -1080,8 +1080,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
- List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, null, userId,deptIds,null, deptRelatedProjectIds);
|
|
|
|
|
|
+ List<String> userIdList=new ArrayList<>();
|
|
|
|
+ if(userIds!=null&&userIds.length()>0){
|
|
|
|
+ String[] split = userIds.split(",");
|
|
|
|
+ userIdList = Arrays.asList(split);
|
|
|
|
+ }
|
|
|
|
+ List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, null, userIdList,deptIds,null, deptRelatedProjectIds);
|
|
BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
for (Map<String, Object> map : list) {
|
|
for (Map<String, Object> map : list) {
|
|
if (!map.containsKey("cost")) {
|
|
if (!map.containsKey("cost")) {
|
|
@@ -1120,7 +1124,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
//导出查询者所在公司每个项目的工时成本,包括项目人员明细统计
|
|
//导出查询者所在公司每个项目的工时成本,包括项目人员明细统计
|
|
@Override
|
|
@Override
|
|
- public HttpRespMsg exportTimeCost(String exportContent,String startDate, String endDate,Integer projectId, String userId, Boolean projectSum,Integer type,Integer deptId, Integer stateKey,HttpServletRequest request) {
|
|
|
|
|
|
+ public HttpRespMsg exportTimeCost(String exportContent,String startDate, String endDate,Integer projectId, String userIds, Boolean projectSum,Integer type,Integer deptId, Integer stateKey,HttpServletRequest request) {
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
try {
|
|
try {
|
|
User targetUser = userMapper.selectById(request.getHeader("Token"));
|
|
User targetUser = userMapper.selectById(request.getHeader("Token"));
|
|
@@ -1178,7 +1182,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
System.out.println(filterDeptIds);
|
|
System.out.println(filterDeptIds);
|
|
- List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, projectId, userId,deptIds,filterDeptIds,deptRelatedProjectIds);
|
|
|
|
|
|
+ List<String> userIdList=new ArrayList<>();
|
|
|
|
+ if(userIds!=null&&userIds.length()>0){
|
|
|
|
+ String[] split = userIds.split(",");
|
|
|
|
+ userIdList = Arrays.asList(split);
|
|
|
|
+ }
|
|
|
|
+ List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, projectId, userIdList,deptIds,filterDeptIds,deptRelatedProjectIds);
|
|
BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
List<List<String>> allList=null ;
|
|
List<List<String>> allList=null ;
|
|
List<String> sumRow = null;
|
|
List<String> sumRow = null;
|
|
@@ -1256,7 +1265,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
} else {
|
|
} else {
|
|
finalDeptIds = deptIds;
|
|
finalDeptIds = deptIds;
|
|
}
|
|
}
|
|
- List<Map<String, Object>> membList = projectMapper.getProjectCost(companyId,startDate, endDate, curProjectId,stateKey, userId,finalDeptIds,filterDeptIds);
|
|
|
|
|
|
+ List<Map<String, Object>> membList = projectMapper.getProjectCost(companyId,startDate, endDate, curProjectId,stateKey, userIdList,finalDeptIds,filterDeptIds);
|
|
map.put("membList", membList);
|
|
map.put("membList", membList);
|
|
for (Map<String, Object> membMap : membList) {
|
|
for (Map<String, Object> membMap : membList) {
|
|
double pTotalTime = 0;
|
|
double pTotalTime = 0;
|
|
@@ -1366,7 +1375,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
allList=new ArrayList<>();
|
|
allList=new ArrayList<>();
|
|
allList.add(headList);
|
|
allList.add(headList);
|
|
//统计当前所有项目所有人的时间成本投入
|
|
//统计当前所有项目所有人的时间成本投入
|
|
- List<Map<String, Object>> membList = projectMapper.getProjectCostGroupByProject(companyId,startDate, endDate, projectId,userId,deptIds);
|
|
|
|
|
|
+ List<Map<String, Object>> membList = projectMapper.getProjectCostGroupByProject(companyId,startDate, endDate, projectId,userIdList,deptIds);
|
|
for (User user : userList) {
|
|
for (User user : userList) {
|
|
BigDecimal moneyCost = BigDecimal.valueOf(0);
|
|
BigDecimal moneyCost = BigDecimal.valueOf(0);
|
|
double costTime = 0;
|
|
double costTime = 0;
|
|
@@ -5644,7 +5653,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public HttpRespMsg getTimeCostByCategory(String startDate, String endDate, String userId, HttpServletRequest request) {
|
|
|
|
|
|
+ public HttpRespMsg getTimeCostByCategory(String startDate, String endDate, String userIds, HttpServletRequest request) {
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
try {
|
|
try {
|
|
User targetUser = userMapper.selectById(request.getHeader("Token"));
|
|
User targetUser = userMapper.selectById(request.getHeader("Token"));
|
|
@@ -5676,7 +5685,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
- List<Map<String, Object>> list = projectMapper.getTimeCostByCategory(companyId, startDate, endDate, null, userId,deptIds);
|
|
|
|
|
|
+ List<String> userIdList=new ArrayList<>();
|
|
|
|
+ if(userIds!=null&&userIds.length()>0){
|
|
|
|
+ String[] split = userIds.split(",");
|
|
|
|
+ userIdList = Arrays.asList(split);
|
|
|
|
+ }
|
|
|
|
+ List<Map<String, Object>> list = projectMapper.getTimeCostByCategory(companyId, startDate, endDate, null,userIdList,deptIds);
|
|
BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
for (Map<String, Object> map : list) {
|
|
for (Map<String, Object> map : list) {
|
|
if (!map.containsKey("cost")) {
|
|
if (!map.containsKey("cost")) {
|
|
@@ -5712,7 +5726,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public HttpRespMsg exportTimeCostByCategory(String exportContent,String startDate, String endDate, Integer projectCategoryId, String userId, Boolean projectSum, Integer type, HttpServletRequest request) {
|
|
|
|
|
|
+ public HttpRespMsg exportTimeCostByCategory(String exportContent,String startDate, String endDate, Integer projectCategoryId, String userIds, Boolean projectSum, Integer type, HttpServletRequest request) {
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
try {
|
|
try {
|
|
//根据系统配置的员工成本计算方式,按固定时薪还是固定月薪,分情况计算。
|
|
//根据系统配置的员工成本计算方式,按固定时薪还是固定月薪,分情况计算。
|
|
@@ -5745,7 +5759,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- List<Map<String, Object>> list = projectMapper.getTimeCostByCategory(companyId, startDate, endDate, projectCategoryId, userId,deptIds);
|
|
|
|
|
|
+ List<String> userIdList=new ArrayList<>();
|
|
|
|
+ if(userIds!=null&&userIds.length()>0){
|
|
|
|
+ String[] split = userIds.split(",");
|
|
|
|
+ userIdList = Arrays.asList(split);
|
|
|
|
+ }
|
|
|
|
+ List<Map<String, Object>> list = projectMapper.getTimeCostByCategory(companyId, startDate, endDate, projectCategoryId, userIdList,deptIds);
|
|
BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
List<List<String>> allList=null ;
|
|
List<List<String>> allList=null ;
|
|
List<String> sumRow = null;
|
|
List<String> sumRow = null;
|
|
@@ -5863,7 +5882,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
allList=new ArrayList<>();
|
|
allList=new ArrayList<>();
|
|
allList.add(headList);
|
|
allList.add(headList);
|
|
//统计当前所有项目所有人的时间成本投入
|
|
//统计当前所有项目所有人的时间成本投入
|
|
- List<Map<String, Object>> membList = projectMapper.getProjectCostGroupByCategory(companyId,startDate,endDate, projectCategoryId,userId,deptIds);
|
|
|
|
|
|
+ List<Map<String, Object>> membList = projectMapper.getProjectCostGroupByCategory(companyId,startDate,endDate, projectCategoryId,userIdList,deptIds);
|
|
for (User user : userList) {
|
|
for (User user : userList) {
|
|
BigDecimal moneyCost = BigDecimal.valueOf(0);
|
|
BigDecimal moneyCost = BigDecimal.valueOf(0);
|
|
double costTime = 0;
|
|
double costTime = 0;
|