|
@@ -61,7 +61,8 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
List<ProjectCostBudget> allBudget = new ArrayList<>();
|
|
|
//施工单位
|
|
|
if (dto.getBuildUnit() != null && dto.getBuildUnit().size() > 0){
|
|
|
- dto.getBuildUnit().stream().forEach(l->{
|
|
|
+ int i = 1;
|
|
|
+ for (ProjectCostBudget l : dto.getBuildUnit()) {
|
|
|
if (l.getDeptId() == null){
|
|
|
throw new ServiceException("请选择费用分摊部门");
|
|
|
}
|
|
@@ -80,18 +81,21 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
if (l.getStaffCount() == null){
|
|
|
throw new ServiceException("请填写投入人员数量");
|
|
|
}
|
|
|
+ l.setSort(i);
|
|
|
+ i++;
|
|
|
if (l.getApprove() != null && (l.getApprove() == 1 || l.getApprove() == 2)){
|
|
|
- return;
|
|
|
+ continue;
|
|
|
}
|
|
|
- l.setProjectId(dto.getProjectId());
|
|
|
- l.setUnitType(1);
|
|
|
- countMoney(l);
|
|
|
- });
|
|
|
+ l.setProjectId(dto.getProjectId());
|
|
|
+ l.setUnitType(1);
|
|
|
+ countMoney(l);
|
|
|
+ }
|
|
|
allBudget.addAll(dto.getBuildUnit());
|
|
|
}
|
|
|
//监理单位
|
|
|
if (dto.getSupervisorUnit() != null && dto.getSupervisorUnit().size() > 0){
|
|
|
- dto.getSupervisorUnit().stream().forEach(l->{
|
|
|
+ int i = 1;
|
|
|
+ for (ProjectCostBudget l : dto.getSupervisorUnit()) {
|
|
|
if (l.getDeptId() == null){
|
|
|
throw new ServiceException("请选择费用分摊部门");
|
|
|
}
|
|
@@ -101,18 +105,30 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
if (l.getProjectProcess() == null){
|
|
|
throw new ServiceException("请选择项目环节");
|
|
|
}
|
|
|
+ if (l.getBudgetDays() == null){
|
|
|
+ throw new ServiceException("请填写预计工作量");
|
|
|
+ }
|
|
|
+ if (l.getPostType() == null){
|
|
|
+ throw new ServiceException("请选择岗位类型");
|
|
|
+ }
|
|
|
+ if (l.getStaffCount() == null){
|
|
|
+ throw new ServiceException("请填写投入人员数量");
|
|
|
+ }
|
|
|
+ l.setSort(i);
|
|
|
+ i++;
|
|
|
if (l.getApprove() != null && (l.getApprove() == 1 || l.getApprove() == 2)){
|
|
|
- return;
|
|
|
+ continue;
|
|
|
}
|
|
|
l.setProjectId(dto.getProjectId());
|
|
|
l.setUnitType(2);
|
|
|
countMoney(l);
|
|
|
- });
|
|
|
+ }
|
|
|
allBudget.addAll(dto.getSupervisorUnit());
|
|
|
}
|
|
|
//建设单位
|
|
|
if (dto.getConstructUnit() != null && dto.getConstructUnit().size() > 0){
|
|
|
- dto.getConstructUnit().stream().forEach(l->{
|
|
|
+ int i = 1;
|
|
|
+ for (ProjectCostBudget l : dto.getConstructUnit()) {
|
|
|
if (l.getDeptId() == null){
|
|
|
throw new ServiceException("请选择费用分摊部门");
|
|
|
}
|
|
@@ -122,13 +138,24 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
if (l.getProjectProcess() == null){
|
|
|
throw new ServiceException("请选择项目环节");
|
|
|
}
|
|
|
+ if (l.getBudgetDays() == null){
|
|
|
+ throw new ServiceException("请填写预计工作量");
|
|
|
+ }
|
|
|
+ if (l.getPostType() == null){
|
|
|
+ throw new ServiceException("请选择岗位类型");
|
|
|
+ }
|
|
|
+ if (l.getStaffCount() == null){
|
|
|
+ throw new ServiceException("请填写投入人员数量");
|
|
|
+ }
|
|
|
+ l.setSort(i);
|
|
|
+ i++;
|
|
|
if (l.getApprove() != null && (l.getApprove() == 1 || l.getApprove() == 2)){
|
|
|
- return;
|
|
|
+ continue;
|
|
|
}
|
|
|
l.setProjectId(dto.getProjectId());
|
|
|
l.setUnitType(3);
|
|
|
countMoney(l);
|
|
|
- });
|
|
|
+ }
|
|
|
allBudget.addAll(dto.getConstructUnit());
|
|
|
}
|
|
|
baseMapper.removeOldBudget(dto.getProjectId());
|
|
@@ -585,12 +612,12 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
|
|
|
/**
|
|
|
* 根据部门类型和日期查询计划
|
|
|
- * @param type
|
|
|
+ * @param
|
|
|
* @param date
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<ProjectCostBudgetVO> getDepartmentPlan(Integer type, String date) {
|
|
|
+ public List<ProjectCostBudgetVO> getDepartmentPlan(Long deptId, String date) {
|
|
|
//初始化时间段
|
|
|
String[] split = date.split("-");
|
|
|
int year = Integer.parseInt(split[0]);
|
|
@@ -611,7 +638,7 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- List<ProjectCostBudgetVO> departmentPlan = baseMapper.getDepartmentPlan(type, startDate, endDate);
|
|
|
+ List<ProjectCostBudgetVO> departmentPlan = baseMapper.getDepartmentPlan(deptId, startDate, endDate);
|
|
|
List<DictInfo> allTaskInfo = budgetMapper.getAllTaskInfo();
|
|
|
Map<Long, List<DictInfo>> taskMap = new HashMap<>();
|
|
|
if (allTaskInfo != null && allTaskInfo.size() > 0) {
|