|
@@ -298,30 +298,16 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
|
|
}
|
|
}
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- throw new Exception("存在目标部门没有内部工时,导致公共工时无法分摊:targetDeptId=="+assignToDeptId);
|
|
|
|
|
|
+ Department dept = departmentMapper.selectById(assignToDeptId);
|
|
|
|
+ throw new Exception("存在目标部门没有内部工时,导致公共工时无法分摊:部门=="+dept.getDepartmentName()+",deptId=="+assignToDeptId);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
//本部门也没有协作其他部门产生工单工时
|
|
//本部门也没有协作其他部门产生工单工时
|
|
- throw new Exception("公共工时无法分配,因为本部门没有协作其他部门产生工单工时,deptId=="+deptId);
|
|
|
|
|
|
+ Department dept = departmentMapper.selectById(deptId);
|
|
|
|
+ throw new Exception("公共工时无法分配,因为本部门没有协作其他部门产生工单工时,部门=="+dept.getDepartmentName()+",deptId=="+deptId);
|
|
}
|
|
}
|
|
-
|
|
|
|
-// List<FmwDetail> fmwDetails = insertDataList.stream().filter(fmwDetail -> fmwDetail.getDeptId().equals(deptId)).collect(Collectors.toList());
|
|
|
|
-// double assistDeptTotalTime = fmwDetails.stream().reduce(0.0, (a, b) -> a + b.getAssistTime(), Double::sum);
|
|
|
|
-// if (assistDeptTotalTime > 0) {
|
|
|
|
-// //计算总工时: 用维修组装工时,调试工时和等料工时相加
|
|
|
|
-// insertDataList.forEach(fmwDetail -> {
|
|
|
|
-// //计算每一个项目的部门内部工时占比,按比例分摊公共工时
|
|
|
|
-// if (fmwDetail.getProjectId().equals(publicReportDeptItem.getProjectId())) {
|
|
|
|
-// double curProjectTime = fmwDetail.getMaintanceTime() + fmwDetail.getDebugTime() + fmwDetail.getWaitingTime();
|
|
|
|
-// double assignTime = curProjectTime / assistDeptTotalTime * publicReportDeptItem.getWorkingTime();
|
|
|
|
-// fmwDetail.setPublicTime(assignTime);
|
|
|
|
-// }
|
|
|
|
-// });
|
|
|
|
-// } else {
|
|
|
|
-// throw new Exception("存在部门公共工时无法分配,来源deptId=="+deptId);
|
|
|
|
-// }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|