|
@@ -231,7 +231,7 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
int j = 1;
|
|
|
for (PlanRelationReturned returned : returnedList) {
|
|
|
ContractReturnedInfo info = returnedMap.get(returned.getReturnedId()).get(0);
|
|
|
- str.append(j+"."+info.getReturnedCondition()+"。");
|
|
|
+ str.append(j+"."+info.getReturnedCondition()+"、");
|
|
|
}
|
|
|
l.setReturnedValue(str.toString());
|
|
|
}
|
|
@@ -306,7 +306,7 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
vo2.setPlanStartTime(startDate);
|
|
|
vo2.setPlanEndTime(endDate);
|
|
|
//根据任务类型设置父计划的工作天数,固定任务1,临时任务2
|
|
|
- if (taskMap.get(vo2.getPlanTaskType()).get(0).getDictValue().intValue() == 1){
|
|
|
+ if (taskMap.get(vo2.getPlanTaskType()).get(0).getDictValue().intValue() == 2){
|
|
|
vo2.setPlanDays(new BigDecimal(endDate.compareTo(startDate) + 1));
|
|
|
}else {
|
|
|
if (startDate.until(endDate,ChronoUnit.DAYS) > 35){
|
|
@@ -324,7 +324,7 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
}
|
|
|
//如果计划已经完成,则不计算超预算
|
|
|
if (vo2.getTaskFinishedStatus() == null && vo2.getPlanDays() != null && vo2.getBudgetDays() != null){
|
|
|
- if (workDays.intValue() > vo2.getBudgetDays().intValue()) {
|
|
|
+ if (workDays.intValue() > vo2.getBudgetDays().multiply(vo2.getStaffCount()).intValue()) {
|
|
|
vo2.setTaskFinishedStatus(1);
|
|
|
vo2.setOutMoneyTips("成本增加!该项计划完成时间超过当初测算时间工作时长("+(workDays.intValue() - vo2.getBudgetDays().intValue())+"天)");
|
|
|
}
|
|
@@ -482,9 +482,18 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
}
|
|
|
}
|
|
|
List<ProjectCostBudgetVO> departmentPlan = baseMapper.getDepartmentPlan(type, startDate, endDate);
|
|
|
+ List<DictInfo> allTaskInfo = budgetMapper.getAllTaskInfo();
|
|
|
+ Map<Long, List<DictInfo>> taskMap = new HashMap<>();
|
|
|
+ if (allTaskInfo != null && allTaskInfo.size() > 0) {
|
|
|
+ taskMap = allTaskInfo.parallelStream()
|
|
|
+ .collect(Collectors.groupingBy(DictInfo::getId));
|
|
|
+ }else {
|
|
|
+ throw new ServiceException("请选择任务类型");
|
|
|
+ }
|
|
|
if (departmentPlan != null && departmentPlan.size() > 0){
|
|
|
for (ProjectCostBudgetVO vo : departmentPlan) {
|
|
|
- if (vo.getStatus() == 1 || vo.getStatus() == 4){
|
|
|
+ //如果计划未开始,或者已完成,或者是固定计划,则不显示开启暂停
|
|
|
+ if (vo.getStatus() == 1 || vo.getStatus() == 4 || taskMap.get(vo.getPlanTaskType()).get(0).getDictValue() == 2){
|
|
|
vo.setStartOrStop(0);
|
|
|
}else if (vo.getStatus() == 2){
|
|
|
vo.setStartOrStop(1);
|
|
@@ -512,7 +521,7 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
@Override
|
|
|
public Integer getWorkDays(LocalDate startDate, LocalDate endDate,Long planTaskType) {
|
|
|
DictInfo info = baseMapper.getTaskType(planTaskType);
|
|
|
- if (info.getDictValue().intValue() == 1){
|
|
|
+ if (info.getDictValue().intValue() == 2){
|
|
|
return new BigDecimal(startDate.until(endDate,ChronoUnit.DAYS)).intValue() + 1 ;
|
|
|
}else {
|
|
|
return CommonUtil.getWorkDays(startDate, endDate);
|
|
@@ -967,7 +976,7 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
vo2.setPlanTaskTypeValue(taskType.getDictName());
|
|
|
int type = taskType.getDictValue().intValue();
|
|
|
//根据任务类型设置父计划的工作天数,固定任务1,临时任务2
|
|
|
- if (type == 1){
|
|
|
+ if (type == 2){
|
|
|
vo2.setPlanDays(new BigDecimal(vo2.getPlanStartTime().until(vo2.getPlanEndTime(),ChronoUnit.DAYS) + 1));
|
|
|
}else {
|
|
|
if (vo2.getPlanStartTime().until(vo2.getPlanEndTime(),ChronoUnit.DAYS) > 35){
|
|
@@ -1042,7 +1051,7 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
if (l.getPlanDays() != null) {
|
|
|
workDays = workDays.add(l.getPlanDays());
|
|
|
}else {
|
|
|
- if (task.getDictValue().intValue() == 1) {
|
|
|
+ if (task.getDictValue().intValue() == 2) {
|
|
|
l.setPlanDays(new BigDecimal(l.getPlanStartTime().until(l.getPlanEndTime(),ChronoUnit.DAYS) + 1));
|
|
|
} else {
|
|
|
if (l.getPlanStartTime().until(l.getPlanEndTime(), ChronoUnit.DAYS) > 35) {
|
|
@@ -1092,7 +1101,7 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
vo2.setPlanStartTime(startDate);
|
|
|
vo2.setPlanEndTime(endDate);
|
|
|
//根据任务类型设置父计划的工作天数,固定任务1,临时任务2
|
|
|
- if (task.getDictValue().intValue() == 1){
|
|
|
+ if (task.getDictValue().intValue() == 2){
|
|
|
vo2.setPlanDays(new BigDecimal(startDate.until(endDate,ChronoUnit.DAYS)+ 1));
|
|
|
}else {
|
|
|
if (startDate.until(endDate,ChronoUnit.DAYS) > 35){
|