|
@@ -21,6 +21,7 @@ import org.springblade.control.service.IProjectCostBudgetService;
|
|
|
import org.springblade.control.service.IProjectInfoService;
|
|
|
import org.springblade.control.service.IProjectProcessService;
|
|
|
import org.springblade.control.vo.*;
|
|
|
+import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
@@ -60,6 +61,15 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
//施工单位
|
|
|
if (dto.getBuildUnit() != null && dto.getBuildUnit().size() > 0){
|
|
|
dto.getBuildUnit().stream().forEach(l->{
|
|
|
+ if (l.getDeptId() == null){
|
|
|
+ throw new ServiceException("请选择费用分摊部门");
|
|
|
+ }
|
|
|
+ if (l.getCostType() == null){
|
|
|
+ throw new ServiceException("请选择费用分类");
|
|
|
+ }
|
|
|
+ if (l.getProjectProcess() == null){
|
|
|
+ throw new ServiceException("请选择项目环节");
|
|
|
+ }
|
|
|
l.setProjectId(dto.getProjectId());
|
|
|
l.setUnitType(1);
|
|
|
countMoney(l);
|
|
@@ -69,6 +79,15 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
//监理单位
|
|
|
if (dto.getSupervisorUnit() != null && dto.getSupervisorUnit().size() > 0){
|
|
|
dto.getSupervisorUnit().stream().forEach(l->{
|
|
|
+ if (l.getDeptId() == null){
|
|
|
+ throw new ServiceException("请选择费用分摊部门");
|
|
|
+ }
|
|
|
+ if (l.getCostType() == null){
|
|
|
+ throw new ServiceException("请选择费用分类");
|
|
|
+ }
|
|
|
+ if (l.getProjectProcess() == null){
|
|
|
+ throw new ServiceException("请选择项目环节");
|
|
|
+ }
|
|
|
l.setProjectId(dto.getProjectId());
|
|
|
l.setUnitType(2);
|
|
|
countMoney(l);
|
|
@@ -78,6 +97,15 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
//建设单位
|
|
|
if (dto.getConstructUnit() != null && dto.getConstructUnit().size() > 0){
|
|
|
dto.getConstructUnit().stream().forEach(l->{
|
|
|
+ if (l.getDeptId() == null){
|
|
|
+ throw new ServiceException("请选择费用分摊部门");
|
|
|
+ }
|
|
|
+ if (l.getCostType() == null){
|
|
|
+ throw new ServiceException("请选择费用分类");
|
|
|
+ }
|
|
|
+ if (l.getProjectProcess() == null){
|
|
|
+ throw new ServiceException("请选择项目环节");
|
|
|
+ }
|
|
|
l.setProjectId(dto.getProjectId());
|
|
|
l.setUnitType(3);
|
|
|
countMoney(l);
|
|
@@ -142,6 +170,13 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
vo.setProjectId(id);
|
|
|
//获取项目下所有已审批的计划
|
|
|
List<ProjectCostBudgetVO2> list = baseMapper.getApprovePlan(id);
|
|
|
+ list.stream().forEach(l->{
|
|
|
+ if (l.getPlanTaskType() != null || l.getPlanTaskDesc() != null || l.getPlanDays() != null){
|
|
|
+ l.setIsShowChildren(0);
|
|
|
+ }else {
|
|
|
+ l.setIsShowChildren(1);
|
|
|
+ }
|
|
|
+ });
|
|
|
//获取项目下所有的子计划
|
|
|
List<ProjectCostBudgetVO2> childrenList = baseMapper.getAllChildrenPlan(id);
|
|
|
if (childrenList != null && childrenList.size() >0) {
|
|
@@ -734,7 +769,7 @@ public class ProjectCostBudgetServiceImpl extends BaseServiceImpl<ProjectCostBud
|
|
|
public void countMoney(ProjectCostBudget budget){
|
|
|
BigDecimal postMoney;
|
|
|
if (budget.getPostType() != null && budget.getPostType() > 0){
|
|
|
- Integer money = baseMapper.getPostMoney(budget.getPostType());
|
|
|
+ Double money = baseMapper.getPostMoney(budget.getPostType());
|
|
|
postMoney = new BigDecimal(money);
|
|
|
}else {
|
|
|
postMoney = new BigDecimal("0");
|