|
@@ -1074,801 +1074,857 @@ public class AnnualBudgetServiceImpl extends BaseServiceImpl<AnnualBudgetMapper,
|
|
|
/**
|
|
|
* 预算与实际统计-部门支出统计
|
|
|
*/
|
|
|
- public List<BudgetAndPracticalByDeptVO> budgetAndPracticalByDept2(String year) {
|
|
|
- int y = Integer.parseInt(year.substring(0, 4));
|
|
|
- //结果集
|
|
|
- List<BudgetAndPracticalByDeptVO> list = new ArrayList<>();
|
|
|
- List<String> months = Arrays.asList("一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月");
|
|
|
- //
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 预算与实际统计-部门支出统计
|
|
|
- */
|
|
|
- @Override
|
|
|
public List<BudgetAndPracticalByDeptVO> budgetAndPracticalByDept(String year) {
|
|
|
int y = Integer.parseInt(year.substring(0, 4));
|
|
|
//结果集
|
|
|
List<BudgetAndPracticalByDeptVO> list = new ArrayList<>();
|
|
|
List<String> months = Arrays.asList("一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月");
|
|
|
- //获取当年所有已经选择时间的固定计划
|
|
|
- List<ProjectCostBudget> allPlan = budgetService.getAllPlanByYear(y);
|
|
|
- Boolean isBudget = true;
|
|
|
- Map<Integer, List<ProjectCostBudget>> allPlanMap = new HashMap<>();
|
|
|
- Boolean isOtherBudget = true;
|
|
|
- Map<Integer, List<ProjectCostBudget>> otherBudgetMap = new HashMap<>();
|
|
|
- if (allPlan != null && allPlan.size() > 0){
|
|
|
- List<ProjectCostBudget> parentList = new ArrayList<>();
|
|
|
- //如果不为空,根据costType分组
|
|
|
- allPlanMap = allPlan.parallelStream()
|
|
|
- .collect(Collectors.groupingBy(ProjectCostBudget::getCostType));
|
|
|
- //所有父计划id
|
|
|
- Set<Long> parentIds = new HashSet<>();
|
|
|
- Set<Long> longs = allPlan.stream().filter(l -> l.getParentId() == 0).map(ProjectCostBudget::getId).collect(Collectors.toSet());
|
|
|
- Set<Long> longs2 = allPlan.stream().filter(l -> l.getParentId() > 0).map(ProjectCostBudget::getParentId).collect(Collectors.toSet());
|
|
|
- parentIds.addAll(longs);
|
|
|
- parentIds.addAll(longs2);
|
|
|
- parentList = budgetService.listByIds(parentIds);
|
|
|
- Map<Long, List<ProjectCostBudget>> map = allPlan.parallelStream()
|
|
|
- .collect(Collectors.groupingBy(ProjectCostBudget::getParentId));
|
|
|
- parentList = parentList.stream().filter(l->l.getBudgetCountMoney().subtract(l.getBudgetStaffCost()).intValue() != 0).collect(Collectors.toList());
|
|
|
- if (parentList != null && parentList.size() > 0) {
|
|
|
- //循环父计划,统计子计划
|
|
|
- for (ProjectCostBudget budget : parentList) {
|
|
|
- BigDecimal noStaffCost = budget.getBudgetCountMoney().subtract(budget.getBudgetStaffCost());
|
|
|
- //有子计划直接设置
|
|
|
- if (map.get(budget.getId()) != null && map.get(budget.getId()).size() > 0) {
|
|
|
- List<ProjectCostBudget> budgetList = map.get(budget.getId());
|
|
|
- //有子计划才设置,没子计划证明有值
|
|
|
- //最小计划开始时间
|
|
|
- LocalDate start = LocalDate.MAX;
|
|
|
- //最大计划开始时间
|
|
|
- LocalDate end = LocalDate.MIN;
|
|
|
- //总天数
|
|
|
- BigDecimal total = new BigDecimal(0);
|
|
|
- //开始月工作日
|
|
|
- BigDecimal startDays = new BigDecimal(0);
|
|
|
- //结束月工作日
|
|
|
- BigDecimal endDays = new BigDecimal(0);
|
|
|
- for (ProjectCostBudget costBudget : budgetList) {
|
|
|
- if (costBudget.getPlanStartTime().isBefore(start)) {
|
|
|
- start = costBudget.getPlanStartTime();
|
|
|
- }
|
|
|
- if (costBudget.getPlanEndTime().isAfter(end)) {
|
|
|
- end = costBudget.getPlanEndTime();
|
|
|
- }
|
|
|
- total = total.add(costBudget.getPlanDays());
|
|
|
- if (costBudget.getPlanIsTwoMonth() == 0) {
|
|
|
- //如果开始时间和最小计划时间是一个月,则直接算入开始工作日
|
|
|
- if (start.getMonthValue() == costBudget.getPlanStartTime().getMonthValue()) {
|
|
|
- startDays = startDays.add(costBudget.getPlanDays());
|
|
|
- } else {
|
|
|
- //开始时间和最小计划时间不是一个月,算入结束工作日
|
|
|
- endDays = endDays.add(costBudget.getPlanDays());
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- startDays = startDays.add(costBudget.getPlanStartMonthDays());
|
|
|
- endDays = endDays.add(costBudget.getPlanEndMonthDays());
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- budget.setPlanStartTime(start);
|
|
|
- budget.setPlanEndTime(end);
|
|
|
- budget.setPlanDays(total);
|
|
|
- //如果没跨月
|
|
|
- if (start.getMonthValue() == end.getMonthValue()) {
|
|
|
- budget.setPlanIsTwoMonth(0);
|
|
|
- budget.setPlanStartMoney(noStaffCost);
|
|
|
- } else {
|
|
|
- //跨月
|
|
|
- budget.setPlanIsTwoMonth(1);
|
|
|
- BigDecimal decimal = startDays.divide(total, 2, BigDecimal.ROUND_HALF_UP).multiply(noStaffCost).setScale(2, RoundingMode.HALF_UP);
|
|
|
- budget.setPlanStartMoney(decimal);
|
|
|
- budget.setPlanEndMoney(noStaffCost.subtract(decimal));
|
|
|
- }
|
|
|
- }else {
|
|
|
- //没有子计划如果没有跨月则直接把其他支出放入startMoney
|
|
|
- if (budget.getPlanIsTwoMonth() == 0){
|
|
|
- budget.setPlanStartMoney(noStaffCost);
|
|
|
- }else {
|
|
|
- BigDecimal decimal = budget.getPlanStartMonthDays().divide(budget.getPlanDays(), 2, BigDecimal.ROUND_HALF_UP).multiply(noStaffCost).setScale(2, RoundingMode.HALF_UP);
|
|
|
- budget.setPlanStartMoney(decimal);
|
|
|
- budget.setPlanEndMoney(noStaffCost.subtract(decimal));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //根据部门分组
|
|
|
- otherBudgetMap = parentList.parallelStream()
|
|
|
- .collect(Collectors.groupingBy(ProjectCostBudget::getCostType));
|
|
|
- }else {
|
|
|
- isOtherBudget = false;
|
|
|
- }
|
|
|
-
|
|
|
- }else {
|
|
|
- isBudget = false;
|
|
|
- }
|
|
|
+ //获取所有部门
|
|
|
+ List<Dept> depts = baseMapper.getAllDept();
|
|
|
+ //所有预算支出
|
|
|
+ Map<Long, Map<Integer, BigDecimal>> budgetMap = employeeTaskInfoService.getAllBudgetSalaryByYear2(y);
|
|
|
+ //实际人工支出
|
|
|
+ Map<Long, Map<Integer, BigDecimal>> costMap = employeeTaskInfoService.getAllEmployeeSalaryByYear5(y);
|
|
|
//维护支出,返回null证明没有
|
|
|
Map<Integer, List<BigDecimal>> maintainMap = budgetService.getAllMaintainCost9(y);
|
|
|
- Boolean isMaintain = true;
|
|
|
- if (maintainMap == null || maintainMap.size() <= 0){
|
|
|
- isMaintain = false;
|
|
|
- }
|
|
|
- //获取当年所有已经完成的固定计划
|
|
|
- //根据costType分组
|
|
|
- List<ProjectCostBudget> allFinishedPlan = budgetService.getAllFinishedPlanByYear(y);
|
|
|
- Boolean isFinished = true;
|
|
|
- Map<Integer, List<ProjectCostBudget>> finishedMap = new HashMap<>();
|
|
|
- if (allFinishedPlan != null && allFinishedPlan.size() > 0){
|
|
|
- finishedMap = allFinishedPlan.parallelStream()
|
|
|
- .collect(Collectors.groupingBy(ProjectCostBudget::getCostType));
|
|
|
- }else {
|
|
|
- isFinished = false;
|
|
|
- }
|
|
|
- //获取所有部门
|
|
|
- List<Dept> allDept = baseMapper.getAllDept();
|
|
|
- if (allDept == null || allDept.size() <= 0){
|
|
|
- throw new ServiceException("当前没配置部门,无法统计");
|
|
|
- }
|
|
|
- Map<Long, List<Dept>> deptMap = allDept.parallelStream()
|
|
|
- .collect(Collectors.groupingBy(Dept::getId));
|
|
|
//报销支出
|
|
|
- List<EMFinancialReimbursementInfo> allReimburse = projectInfoService.getThisYearReimburse2(y);
|
|
|
- Boolean isReimburse = true;
|
|
|
- Map<Integer, List<EMFinancialReimbursementInfo>> ReimburseMap = new HashMap<>();
|
|
|
- if (allReimburse != null && allReimburse.size() > 0){
|
|
|
- //对部门和费用类型做映射
|
|
|
- for (EMFinancialReimbursementInfo info : allReimburse) {
|
|
|
- if (info.getCreateDept() != null){
|
|
|
- info.setIsTemp(deptMap.get(info.getCreateDept()).get(0).getDeptCategory());
|
|
|
- }else {
|
|
|
- throw new ServiceException("有用户没有部门直接报销,无法统计");
|
|
|
- }
|
|
|
- }
|
|
|
- ReimburseMap = allReimburse.parallelStream()
|
|
|
- .collect(Collectors.groupingBy(EMFinancialReimbursementInfo::getIsTemp));
|
|
|
- }else {
|
|
|
- isReimburse = false;
|
|
|
- }
|
|
|
-
|
|
|
- BigDecimal c1 = new BigDecimal(0);
|
|
|
- BigDecimal c2 = new BigDecimal(0);
|
|
|
- BigDecimal c3 = new BigDecimal(0);
|
|
|
- BigDecimal c4 = new BigDecimal(0);
|
|
|
- BigDecimal c5 = new BigDecimal(0);
|
|
|
- BigDecimal c6 = new BigDecimal(0);
|
|
|
- BigDecimal c7 = new BigDecimal(0);
|
|
|
- BigDecimal c8 = new BigDecimal(0);
|
|
|
- BigDecimal c9 = new BigDecimal(0);
|
|
|
- BigDecimal c10 = new BigDecimal(0);
|
|
|
+ Map<Long, Map<Integer, BigDecimal>> reimburseMap = projectInfoService.getThisYearAllReimburseByYear2(y);
|
|
|
//循环12个月,为每个月设置值
|
|
|
- for (int i = 0; i < 12; i++) {
|
|
|
+ for (int i = 1; i <= 12; i++) {
|
|
|
BudgetAndPracticalByDeptVO vo = new BudgetAndPracticalByDeptVO();
|
|
|
//设置月份
|
|
|
- vo.setTime(months.get(i));
|
|
|
- //设置市场部
|
|
|
- if (isBudget && allPlanMap.get(1) != null && allPlanMap.get(1).size() > 0) {
|
|
|
- List<ProjectCostBudget> b1 = allPlanMap.get(1);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- //循环市场部每一个预算
|
|
|
- for (ProjectCostBudget budget : b1) {
|
|
|
- //如果开始时间或结束时间是当月,则添加预算
|
|
|
- if ((budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPlanEndTime().getMonthValue() == (i + 1) && budget.getPlanEndTime().getYear() == y)) {
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getPlanIsTwoMonth() == 0) {
|
|
|
- big = big.add(budget.getPlanStaffCost());
|
|
|
- } else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y) {
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- } else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big = big.add(budget.getPlanEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setBudget1(big);
|
|
|
- c1 = c1.add(big);
|
|
|
- }else {
|
|
|
- vo.setBudget1(new BigDecimal(0));
|
|
|
- }
|
|
|
- //其他预算金额
|
|
|
- if (isBudget && isOtherBudget && otherBudgetMap.get(1) != null && otherBudgetMap.get(1).size() > 0){
|
|
|
- List<ProjectCostBudget> b1 = otherBudgetMap.get(1);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- //循环市场部每一个预算
|
|
|
- for (ProjectCostBudget budget : b1) {
|
|
|
- //如果开始时间或结束时间是当月,则添加预算
|
|
|
- if ((budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPlanEndTime().getMonthValue() == (i + 1) && budget.getPlanEndTime().getYear() == y)) {
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getPlanIsTwoMonth() == 0) {
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- } else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y) {
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- } else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big = big.add(budget.getPlanEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setBudget1(vo.getBudget1().add(big));
|
|
|
- c1 = c1.add(big);
|
|
|
- }
|
|
|
-
|
|
|
- if (isFinished){
|
|
|
- List<ProjectCostBudget> d1 = finishedMap.get(1);
|
|
|
- if (d1 != null && d1.size() > 0){
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- //循环市场部每一个支出
|
|
|
- for (ProjectCostBudget budget : d1) {
|
|
|
- //如果实际开始时间或实际结束时间是当月,则添加支出
|
|
|
- if ((budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPracticalFinishTime().getMonthValue() == (i+1) && budget.getPracticalFinishTime().getYear() == y)){
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getIsTwoMonth() == 0){
|
|
|
- big = big.add(budget.getActualTotalMoney());
|
|
|
- }else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y){
|
|
|
- big = big.add(budget.getPracticalStartMoney());
|
|
|
- }else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big = big.add(budget.getPracticalEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setPractical1(big);
|
|
|
- c2 = c2.add(big);
|
|
|
- }else {
|
|
|
- vo.setPractical1(new BigDecimal(0));
|
|
|
- }
|
|
|
- }else {
|
|
|
- vo.setPractical1(new BigDecimal(0));
|
|
|
- }
|
|
|
- //设置维护支出
|
|
|
- if (isMaintain && maintainMap.get(1) != null && maintainMap.get(1).size() > 0){
|
|
|
- vo.setBudget1(vo.getBudget1().add(maintainMap.get(1).get(i)));
|
|
|
- vo.setPractical1(vo.getPractical1().add(maintainMap.get(1).get(i)));
|
|
|
- c1 = c1.add(maintainMap.get(1).get(i));
|
|
|
- c2 = c2.add(maintainMap.get(1).get(i));
|
|
|
- }
|
|
|
- //设置报销支出
|
|
|
- if (isReimburse && ReimburseMap.get(1) != null && ReimburseMap.get(1).size() > 0){
|
|
|
- List<EMFinancialReimbursementInfo> infos = ReimburseMap.get(1);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- for (EMFinancialReimbursementInfo info : infos) {
|
|
|
- if (info.getFrDate().getMonth() == i){
|
|
|
- big = big.add(info.getFrMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setPractical1(vo.getPractical1().add(big));
|
|
|
- c2 = c2.add(big);
|
|
|
- }
|
|
|
-
|
|
|
- //设置研发部
|
|
|
- if (isBudget && allPlanMap.get(2) != null && allPlanMap.get(2).size() > 0) {
|
|
|
- List<ProjectCostBudget> b2 = allPlanMap.get(2);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- //循环研发部每一个预算
|
|
|
- for (ProjectCostBudget budget : b2) {
|
|
|
- //如果开始时间或结束时间是当月,则添加预算
|
|
|
- if ((budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPlanEndTime().getMonthValue() == (i+1) && budget.getPlanEndTime().getYear() == y)){
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getPlanIsTwoMonth() == 0){
|
|
|
- big = big.add(budget.getPlanStaffCost());
|
|
|
- }else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y){
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- }else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big = big.add(budget.getPlanEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setBudget2(big);
|
|
|
- c3 = c3.add(big);
|
|
|
- }else {
|
|
|
- vo.setBudget2(new BigDecimal(0));
|
|
|
- }
|
|
|
- //其他预算金额
|
|
|
- if (isBudget && isOtherBudget && otherBudgetMap.get(2) != null && otherBudgetMap.get(2).size() > 0){
|
|
|
- List<ProjectCostBudget> b1 = otherBudgetMap.get(2);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- //循环市场部每一个预算
|
|
|
- for (ProjectCostBudget budget : b1) {
|
|
|
- //如果开始时间或结束时间是当月,则添加预算
|
|
|
- if ((budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPlanEndTime().getMonthValue() == (i + 1) && budget.getPlanEndTime().getYear() == y)) {
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getPlanIsTwoMonth() == 0) {
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- } else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y) {
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- } else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big = big.add(budget.getPlanEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setBudget2(vo.getBudget2().add(big));
|
|
|
- c3 = c3.add(big);
|
|
|
- }
|
|
|
-
|
|
|
- if (isFinished){
|
|
|
- List<ProjectCostBudget> d2 = finishedMap.get(2);
|
|
|
- if (d2 != null && d2.size() > 0){
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- //循环市场部每一个支出
|
|
|
- for (ProjectCostBudget budget : d2) {
|
|
|
- //如果实际开始时间或实际结束时间是当月,则添加支出
|
|
|
- if ((budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPracticalFinishTime().getMonthValue() == (i+1) && budget.getPracticalFinishTime().getYear() == y)){
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getIsTwoMonth() == 0){
|
|
|
- big = big.add(budget.getActualTotalMoney());
|
|
|
- }else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y){
|
|
|
- big = big.add(budget.getPracticalStartMoney());
|
|
|
- }else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big = big.add(budget.getPracticalEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setPractical2(big);
|
|
|
- c4 = c4.add(big);
|
|
|
- }else {
|
|
|
- vo.setPractical2(new BigDecimal(0));
|
|
|
- }
|
|
|
- }else {
|
|
|
- vo.setPractical2(new BigDecimal(0));
|
|
|
- }
|
|
|
- //设置维护支出
|
|
|
- if (isMaintain && maintainMap.get(2) != null && maintainMap.get(2).size() > 0){
|
|
|
- vo.setBudget2(vo.getBudget2().add(maintainMap.get(2).get(i)));
|
|
|
- vo.setPractical2(vo.getPractical2().add(maintainMap.get(2).get(i)));
|
|
|
- c3 = c3.add(maintainMap.get(2).get(i));
|
|
|
- c4 = c4.add(maintainMap.get(2).get(i));
|
|
|
- }
|
|
|
- //设置报销支出
|
|
|
- if (isReimburse && ReimburseMap.get(2) != null && ReimburseMap.get(2).size() > 0){
|
|
|
- List<EMFinancialReimbursementInfo> infos = ReimburseMap.get(2);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- for (EMFinancialReimbursementInfo info : infos) {
|
|
|
- if (info.getFrDate().getMonth() == i){
|
|
|
- big = big.add(info.getFrMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setPractical2(vo.getPractical2().add(big));
|
|
|
- c4 = c4.add(big);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //设置实施部
|
|
|
- if (isBudget && allPlanMap.get(3) != null && allPlanMap.get(3).size() > 0) {
|
|
|
- List<ProjectCostBudget> b3 = allPlanMap.get(3);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- //循环研发部每一个预算
|
|
|
- for (ProjectCostBudget budget : b3) {
|
|
|
- //如果开始时间或结束时间是当月,则添加预算
|
|
|
- if ((budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPlanEndTime().getMonthValue() == (i+1) && budget.getPlanEndTime().getYear() == y)){
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getPlanIsTwoMonth() == 0){
|
|
|
- big = big.add(budget.getPlanStaffCost());
|
|
|
- }else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y){
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- }else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big = big.add(budget.getPlanEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setBudget3(big);
|
|
|
- c5 = c5.add(big);
|
|
|
- }else {
|
|
|
- vo.setBudget3(new BigDecimal(0));
|
|
|
- }
|
|
|
- //其他预算金额
|
|
|
- if (isBudget && isOtherBudget && otherBudgetMap.get(3) != null && otherBudgetMap.get(3).size() > 0){
|
|
|
- List<ProjectCostBudget> b1 = otherBudgetMap.get(3);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- //循环市场部每一个预算
|
|
|
- for (ProjectCostBudget budget : b1) {
|
|
|
- //如果开始时间或结束时间是当月,则添加预算
|
|
|
- if ((budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPlanEndTime().getMonthValue() == (i + 1) && budget.getPlanEndTime().getYear() == y)) {
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getPlanIsTwoMonth() == 0) {
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- } else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y) {
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- } else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big = big.add(budget.getPlanEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setBudget3(vo.getBudget3().add(big));
|
|
|
- c5 = c5.add(big);
|
|
|
- }
|
|
|
-
|
|
|
- if (isFinished){
|
|
|
- List<ProjectCostBudget> d3 = finishedMap.get(3);
|
|
|
- if (d3 != null && d3.size() > 0){
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- //循环每一个支出
|
|
|
- for (ProjectCostBudget budget : d3) {
|
|
|
- //如果实际开始时间或实际结束时间是当月,则添加支出
|
|
|
- if ((budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPracticalFinishTime().getMonthValue() == (i+1) && budget.getPracticalFinishTime().getYear() == y)){
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getIsTwoMonth() == 0){
|
|
|
- big = big.add(budget.getActualTotalMoney());
|
|
|
- }else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y){
|
|
|
- big = big.add(budget.getPracticalStartMoney());
|
|
|
- }else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big = big.add(budget.getPracticalEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setPractical3(big);
|
|
|
- c6 = c6.add(big);
|
|
|
- }else {
|
|
|
- vo.setPractical3(new BigDecimal(0));
|
|
|
- }
|
|
|
- }else {
|
|
|
- vo.setPractical3(new BigDecimal(0));
|
|
|
- }
|
|
|
- //设置维护支出
|
|
|
- if (isMaintain && maintainMap.get(3) != null && maintainMap.get(3).size() > 0){
|
|
|
- vo.setBudget3(vo.getBudget3().add(maintainMap.get(3).get(i)));
|
|
|
- vo.setPractical3(vo.getPractical3().add(maintainMap.get(3).get(i)));
|
|
|
- c5 = c5.add(maintainMap.get(3).get(i));
|
|
|
- c6 = c6.add(maintainMap.get(3).get(i));
|
|
|
- }
|
|
|
- //设置报销支出
|
|
|
- if (isReimburse && ReimburseMap.get(3) != null && ReimburseMap.get(3).size() > 0){
|
|
|
- List<EMFinancialReimbursementInfo> infos = ReimburseMap.get(3);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- for (EMFinancialReimbursementInfo info : infos) {
|
|
|
- if (info.getFrDate().getMonth() == i){
|
|
|
- big = big.add(info.getFrMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setPractical3(vo.getPractical3().add(big));
|
|
|
- c6 = c6.add(big);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //设置维护部
|
|
|
- if (isBudget && allPlanMap.get(4) != null && allPlanMap.get(4).size() > 0) {
|
|
|
- List<ProjectCostBudget> b4 = allPlanMap.get(4);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- //循环每一个预算
|
|
|
- for (ProjectCostBudget budget : b4) {
|
|
|
- //如果开始时间或结束时间是当月,则添加预算
|
|
|
- if ((budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPlanEndTime().getMonthValue() == (i+1) && budget.getPlanEndTime().getYear() == y)){
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getPlanIsTwoMonth() == 0){
|
|
|
- big = big.add(budget.getPlanStaffCost());
|
|
|
- }else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y){
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- }else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big = big.add(budget.getPlanEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setBudget4(big);
|
|
|
- c7 = c7.add(big);
|
|
|
- }else {
|
|
|
- vo.setBudget4(new BigDecimal(0));
|
|
|
- }
|
|
|
- //其他预算金额
|
|
|
- if (isBudget && isOtherBudget && otherBudgetMap.get(4) != null && otherBudgetMap.get(4).size() > 0){
|
|
|
- List<ProjectCostBudget> b1 = otherBudgetMap.get(4);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- //循环市场部每一个预算
|
|
|
- for (ProjectCostBudget budget : b1) {
|
|
|
- //如果开始时间或结束时间是当月,则添加预算
|
|
|
- if ((budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPlanEndTime().getMonthValue() == (i + 1) && budget.getPlanEndTime().getYear() == y)) {
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getPlanIsTwoMonth() == 0) {
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- } else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y) {
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- } else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big = big.add(budget.getPlanEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setBudget4(vo.getBudget4().add(big));
|
|
|
- c7 = c7.add(big);
|
|
|
- }
|
|
|
-
|
|
|
- if (isFinished){
|
|
|
- List<ProjectCostBudget> d4 = finishedMap.get(4);
|
|
|
- if (d4 != null && d4.size() > 0){
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- //循环每一个支出
|
|
|
- for (ProjectCostBudget budget : d4) {
|
|
|
- //如果实际开始时间或实际结束时间是当月,则添加支出
|
|
|
- if ((budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPracticalFinishTime().getMonthValue() == (i+1) && budget.getPracticalFinishTime().getYear() == y)){
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getIsTwoMonth() == 0){
|
|
|
- big = big.add(budget.getActualTotalMoney());
|
|
|
- }else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y){
|
|
|
- big = big.add(budget.getPracticalStartMoney());
|
|
|
- }else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big = big.add(budget.getPracticalEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setPractical4(big);
|
|
|
- c8 = c8.add(big);
|
|
|
- }else {
|
|
|
- vo.setPractical4(new BigDecimal(0));
|
|
|
- }
|
|
|
- }else {
|
|
|
- vo.setPractical4(new BigDecimal(0));
|
|
|
- }
|
|
|
- //设置维护支出
|
|
|
- if (isMaintain && maintainMap.get(4) != null && maintainMap.get(4).size() > 0){
|
|
|
- vo.setBudget4(vo.getBudget4().add(maintainMap.get(4).get(i)));
|
|
|
- vo.setPractical4(vo.getPractical4().add(maintainMap.get(4).get(i)));
|
|
|
- c7 = c7.add(maintainMap.get(4).get(i));
|
|
|
- c8 = c8.add(maintainMap.get(4).get(i));
|
|
|
- }
|
|
|
- //设置报销支出
|
|
|
- if (isReimburse && ReimburseMap.get(4) != null && ReimburseMap.get(4).size() > 0){
|
|
|
- List<EMFinancialReimbursementInfo> infos = ReimburseMap.get(4);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- for (EMFinancialReimbursementInfo info : infos) {
|
|
|
- if (info.getFrDate().getMonth() == i){
|
|
|
- big = big.add(info.getFrMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- vo.setPractical4(vo.getPractical4().add(big));
|
|
|
- c8 = c8.add(big);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //设置管理中心 = 管理支出+外包劳务
|
|
|
- BigDecimal big1 = new BigDecimal(0);
|
|
|
- BigDecimal big2 = new BigDecimal(0);
|
|
|
- if (isBudget && allPlanMap.get(5) != null && allPlanMap.get(5).size() > 0) {
|
|
|
- List<ProjectCostBudget> b5 = allPlanMap.get(5);
|
|
|
- //循环研发部每一个预算
|
|
|
- for (ProjectCostBudget budget : b5) {
|
|
|
- //如果开始时间或结束时间是当月,则添加预算
|
|
|
- if ((budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPlanEndTime().getMonthValue() == (i+1) && budget.getPlanEndTime().getYear() == y)){
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getPlanIsTwoMonth() == 0){
|
|
|
- big1 = big1.add(budget.getPlanStaffCost());
|
|
|
- }else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y){
|
|
|
- big1 = big1.add(budget.getPlanStartMoney());
|
|
|
- }else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big1 = big1.add(budget.getPlanEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //其他预算金额
|
|
|
- if (isBudget && isOtherBudget && otherBudgetMap.get(5) != null && otherBudgetMap.get(5).size() > 0){
|
|
|
- List<ProjectCostBudget> b1 = otherBudgetMap.get(5);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- //循环市场部每一个预算
|
|
|
- for (ProjectCostBudget budget : b1) {
|
|
|
- //如果开始时间或结束时间是当月,则添加预算
|
|
|
- if ((budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPlanEndTime().getMonthValue() == (i + 1) && budget.getPlanEndTime().getYear() == y)) {
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getPlanIsTwoMonth() == 0) {
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- } else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y) {
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- } else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big = big.add(budget.getPlanEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- big1 = big.add(big);
|
|
|
- }
|
|
|
-
|
|
|
- if (isFinished){
|
|
|
- List<ProjectCostBudget> d5 = finishedMap.get(5);
|
|
|
- if (d5 != null && d5.size() > 0){
|
|
|
- //循环市场部每一个支出
|
|
|
- for (ProjectCostBudget budget : d5) {
|
|
|
- //如果实际开始时间或实际结束时间是当月,则添加支出
|
|
|
- if ((budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPracticalFinishTime().getMonthValue() == (i+1) && budget.getPracticalFinishTime().getYear() == y)){
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getIsTwoMonth() == 0){
|
|
|
- big2 = big2.add(budget.getActualTotalMoney());
|
|
|
- }else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y){
|
|
|
- big2 = big2.add(budget.getPracticalStartMoney());
|
|
|
- }else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big2 = big2.add(budget.getPracticalEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (isBudget && allPlanMap.get(6) != null && allPlanMap.get(6).size() > 0) {
|
|
|
- List<ProjectCostBudget> b6 = allPlanMap.get(6);
|
|
|
- //循环研发部每一个预算
|
|
|
- for (ProjectCostBudget budget : b6) {
|
|
|
- //如果开始时间或结束时间是当月,则添加预算
|
|
|
- if ((budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPlanEndTime().getMonthValue() == (i+1) && budget.getPlanEndTime().getYear() == y)){
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getPlanIsTwoMonth() == 0){
|
|
|
- big1 = big1.add(budget.getPlanStaffCost());
|
|
|
- }else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y){
|
|
|
- big1 = big1.add(budget.getPlanStartMoney());
|
|
|
- }else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big1 = big1.add(budget.getPlanEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //其他预算金额
|
|
|
- if (isBudget && isOtherBudget && otherBudgetMap.get(6) != null && otherBudgetMap.get(6).size() > 0){
|
|
|
- List<ProjectCostBudget> b1 = otherBudgetMap.get(6);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- //循环市场部每一个预算
|
|
|
- for (ProjectCostBudget budget : b1) {
|
|
|
- //如果开始时间或结束时间是当月,则添加预算
|
|
|
- if ((budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPlanEndTime().getMonthValue() == (i + 1) && budget.getPlanEndTime().getYear() == y)) {
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getPlanIsTwoMonth() == 0) {
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- } else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y) {
|
|
|
- big = big.add(budget.getPlanStartMoney());
|
|
|
- } else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big = big.add(budget.getPlanEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- big1 = big.add(big);
|
|
|
- }
|
|
|
-
|
|
|
- if (isFinished){
|
|
|
- List<ProjectCostBudget> d6 = finishedMap.get(6);
|
|
|
- if (d6 != null && d6.size() > 0){
|
|
|
- //循环市场部每一个支出
|
|
|
- for (ProjectCostBudget budget : d6) {
|
|
|
- //如果实际开始时间或实际结束时间是当月,则添加支出
|
|
|
- if ((budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y)
|
|
|
- || (budget.getPracticalFinishTime().getMonthValue() == (i+1) && budget.getPracticalFinishTime().getYear() == y)){
|
|
|
- //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
- if (budget.getIsTwoMonth() == 0){
|
|
|
- big2 = big2.add(budget.getActualTotalMoney());
|
|
|
- }else {
|
|
|
- //如果开始月是当前月,则直接使用开始金额
|
|
|
- if (budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y){
|
|
|
- big2 = big2.add(budget.getPracticalStartMoney());
|
|
|
- }else {
|
|
|
- //结束月是当前月,使用结束金额
|
|
|
- big2 = big2.add(budget.getPracticalEndMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //设置维护支出
|
|
|
- if (isMaintain && maintainMap.get(5) != null && maintainMap.get(5).size() > 0){
|
|
|
- big1 = big1.add(maintainMap.get(5).get(i));
|
|
|
- big2 = big2.add(maintainMap.get(5).get(i));
|
|
|
- c9 = c9.add(maintainMap.get(5).get(i));
|
|
|
- c10 = c10.add(maintainMap.get(5).get(i));
|
|
|
- }
|
|
|
- //设置维护支出
|
|
|
- if (isMaintain && maintainMap.get(6) != null && maintainMap.get(6).size() > 0){
|
|
|
- big1 = big1.add(maintainMap.get(6).get(i));
|
|
|
- big2 = big2.add(maintainMap.get(6).get(i));
|
|
|
- c9 = c9.add(maintainMap.get(6).get(i));
|
|
|
- c10 = c10.add(maintainMap.get(6).get(i));
|
|
|
- }
|
|
|
- //设置管理中心报销支出
|
|
|
- if (isReimburse && ReimburseMap.get(5) != null && ReimburseMap.get(5).size() > 0){
|
|
|
- List<EMFinancialReimbursementInfo> infos = ReimburseMap.get(5);
|
|
|
- BigDecimal big = new BigDecimal(0);
|
|
|
- for (EMFinancialReimbursementInfo info : infos) {
|
|
|
- if (info.getFrDate().getMonth() == i){
|
|
|
- big = big.add(info.getFrMoney());
|
|
|
- }
|
|
|
- }
|
|
|
- big2 = big2.add(big);
|
|
|
- }
|
|
|
- vo.setBudget5(big1);
|
|
|
- c9 = c9.add(big1);
|
|
|
- vo.setPractical5(big2);
|
|
|
- c10 = c10.add(big2);
|
|
|
+ vo.setTime(months.get(i-1));
|
|
|
+ List<BigDecimal> big1 = new ArrayList<>();
|
|
|
+ List<BigDecimal> big2 = new ArrayList<>();
|
|
|
+ //循环所有部门,为所有部门设置预算支出和实际支出
|
|
|
+ for (Dept dept : depts) {
|
|
|
+ BigDecimal b1 = new BigDecimal(0);
|
|
|
+ BigDecimal b2 = new BigDecimal(0);
|
|
|
+ //设置预算支出
|
|
|
+ if (budgetMap != null && budgetMap.get(dept.getId()) != null && budgetMap.get(dept.getId()).get(i) != null){
|
|
|
+ b1 = budgetMap.get(dept.getId()).get(i);
|
|
|
+ }
|
|
|
+ big1.add(b1);
|
|
|
+ //设置实际支出
|
|
|
+ if (costMap != null && costMap.get(dept.getId()) != null && costMap.get(dept.getId()).get(i) != null){
|
|
|
+ b2 = costMap.get(dept.getId()).get(i);
|
|
|
+ }
|
|
|
+ if (reimburseMap != null && reimburseMap.get(dept.getId()) != null && reimburseMap.get(dept.getId()).get(i) != null){
|
|
|
+ b2 = b2.add(reimburseMap.get(dept.getId()).get(i));
|
|
|
+ }
|
|
|
+ big2.add(b2);
|
|
|
+ }
|
|
|
+ vo.setBudgetList(big1);
|
|
|
+ vo.setCostList(big2);
|
|
|
list.add(vo);
|
|
|
}
|
|
|
//计算总计
|
|
|
+ List<BigDecimal> big1 = new ArrayList<>();
|
|
|
+ List<BigDecimal> big2 = new ArrayList<>();
|
|
|
+ for (int i = 0; i < depts.size(); i++) {
|
|
|
+ BigDecimal total1 = new BigDecimal(0);
|
|
|
+ BigDecimal total2 = new BigDecimal(0);
|
|
|
+ for (BudgetAndPracticalByDeptVO vo : list) {
|
|
|
+ total1 = total1.add(vo.getBudgetList().get(i));
|
|
|
+ total2 = total2.add(vo.getCostList().get(i));
|
|
|
+ }
|
|
|
+ big1.add(total1);
|
|
|
+ big2.add(total2);
|
|
|
+ }
|
|
|
BudgetAndPracticalByDeptVO vo2 = new BudgetAndPracticalByDeptVO();
|
|
|
vo2.setTime("总计");
|
|
|
- vo2.setBudget1(c1);
|
|
|
- vo2.setPractical1(c2);
|
|
|
- vo2.setBudget2(c3);
|
|
|
- vo2.setPractical2(c4);
|
|
|
- vo2.setBudget3(c5);
|
|
|
- vo2.setPractical3(c6);
|
|
|
- vo2.setBudget4(c7);
|
|
|
- vo2.setPractical4(c8);
|
|
|
- vo2.setBudget5(c9);
|
|
|
- vo2.setPractical5(c10);
|
|
|
+ vo2.setBudgetList(big1);
|
|
|
+ vo2.setCostList(big2);
|
|
|
list.add(vo2);
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 预算与实际统计-部门支出统计
|
|
|
+ */
|
|
|
+// @Override
|
|
|
+// public List<BudgetAndPracticalByDeptVO> budgetAndPracticalByDept(String year) {
|
|
|
+// int y = Integer.parseInt(year.substring(0, 4));
|
|
|
+// //结果集
|
|
|
+// List<BudgetAndPracticalByDeptVO> list = new ArrayList<>();
|
|
|
+// List<String> months = Arrays.asList("一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月");
|
|
|
+// //获取当年所有已经选择时间的固定计划
|
|
|
+// List<ProjectCostBudget> allPlan = budgetService.getAllPlanByYear(y);
|
|
|
+// Boolean isBudget = true;
|
|
|
+// Map<Integer, List<ProjectCostBudget>> allPlanMap = new HashMap<>();
|
|
|
+// Boolean isOtherBudget = true;
|
|
|
+// Map<Integer, List<ProjectCostBudget>> otherBudgetMap = new HashMap<>();
|
|
|
+// if (allPlan != null && allPlan.size() > 0){
|
|
|
+// List<ProjectCostBudget> parentList = new ArrayList<>();
|
|
|
+// //如果不为空,根据costType分组
|
|
|
+// allPlanMap = allPlan.parallelStream()
|
|
|
+// .collect(Collectors.groupingBy(ProjectCostBudget::getCostType));
|
|
|
+// //所有父计划id
|
|
|
+// Set<Long> parentIds = new HashSet<>();
|
|
|
+// Set<Long> longs = allPlan.stream().filter(l -> l.getParentId() == 0).map(ProjectCostBudget::getId).collect(Collectors.toSet());
|
|
|
+// Set<Long> longs2 = allPlan.stream().filter(l -> l.getParentId() > 0).map(ProjectCostBudget::getParentId).collect(Collectors.toSet());
|
|
|
+// parentIds.addAll(longs);
|
|
|
+// parentIds.addAll(longs2);
|
|
|
+// parentList = budgetService.listByIds(parentIds);
|
|
|
+// Map<Long, List<ProjectCostBudget>> map = allPlan.parallelStream()
|
|
|
+// .collect(Collectors.groupingBy(ProjectCostBudget::getParentId));
|
|
|
+// parentList = parentList.stream().filter(l->l.getBudgetCountMoney().subtract(l.getBudgetStaffCost()).intValue() != 0).collect(Collectors.toList());
|
|
|
+// if (parentList != null && parentList.size() > 0) {
|
|
|
+// //循环父计划,统计子计划
|
|
|
+// for (ProjectCostBudget budget : parentList) {
|
|
|
+// BigDecimal noStaffCost = budget.getBudgetCountMoney().subtract(budget.getBudgetStaffCost());
|
|
|
+// //有子计划直接设置
|
|
|
+// if (map.get(budget.getId()) != null && map.get(budget.getId()).size() > 0) {
|
|
|
+// List<ProjectCostBudget> budgetList = map.get(budget.getId());
|
|
|
+// //有子计划才设置,没子计划证明有值
|
|
|
+// //最小计划开始时间
|
|
|
+// LocalDate start = LocalDate.MAX;
|
|
|
+// //最大计划开始时间
|
|
|
+// LocalDate end = LocalDate.MIN;
|
|
|
+// //总天数
|
|
|
+// BigDecimal total = new BigDecimal(0);
|
|
|
+// //开始月工作日
|
|
|
+// BigDecimal startDays = new BigDecimal(0);
|
|
|
+// //结束月工作日
|
|
|
+// BigDecimal endDays = new BigDecimal(0);
|
|
|
+// for (ProjectCostBudget costBudget : budgetList) {
|
|
|
+// if (costBudget.getPlanStartTime().isBefore(start)) {
|
|
|
+// start = costBudget.getPlanStartTime();
|
|
|
+// }
|
|
|
+// if (costBudget.getPlanEndTime().isAfter(end)) {
|
|
|
+// end = costBudget.getPlanEndTime();
|
|
|
+// }
|
|
|
+// total = total.add(costBudget.getPlanDays());
|
|
|
+// if (costBudget.getPlanIsTwoMonth() == 0) {
|
|
|
+// //如果开始时间和最小计划时间是一个月,则直接算入开始工作日
|
|
|
+// if (start.getMonthValue() == costBudget.getPlanStartTime().getMonthValue()) {
|
|
|
+// startDays = startDays.add(costBudget.getPlanDays());
|
|
|
+// } else {
|
|
|
+// //开始时间和最小计划时间不是一个月,算入结束工作日
|
|
|
+// endDays = endDays.add(costBudget.getPlanDays());
|
|
|
+// }
|
|
|
+//
|
|
|
+// } else {
|
|
|
+// startDays = startDays.add(costBudget.getPlanStartMonthDays());
|
|
|
+// endDays = endDays.add(costBudget.getPlanEndMonthDays());
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+// budget.setPlanStartTime(start);
|
|
|
+// budget.setPlanEndTime(end);
|
|
|
+// budget.setPlanDays(total);
|
|
|
+// //如果没跨月
|
|
|
+// if (start.getMonthValue() == end.getMonthValue()) {
|
|
|
+// budget.setPlanIsTwoMonth(0);
|
|
|
+// budget.setPlanStartMoney(noStaffCost);
|
|
|
+// } else {
|
|
|
+// //跨月
|
|
|
+// budget.setPlanIsTwoMonth(1);
|
|
|
+// BigDecimal decimal = startDays.divide(total, 2, BigDecimal.ROUND_HALF_UP).multiply(noStaffCost).setScale(2, RoundingMode.HALF_UP);
|
|
|
+// budget.setPlanStartMoney(decimal);
|
|
|
+// budget.setPlanEndMoney(noStaffCost.subtract(decimal));
|
|
|
+// }
|
|
|
+// }else {
|
|
|
+// //没有子计划如果没有跨月则直接把其他支出放入startMoney
|
|
|
+// if (budget.getPlanIsTwoMonth() == 0){
|
|
|
+// budget.setPlanStartMoney(noStaffCost);
|
|
|
+// }else {
|
|
|
+// BigDecimal decimal = budget.getPlanStartMonthDays().divide(budget.getPlanDays(), 2, BigDecimal.ROUND_HALF_UP).multiply(noStaffCost).setScale(2, RoundingMode.HALF_UP);
|
|
|
+// budget.setPlanStartMoney(decimal);
|
|
|
+// budget.setPlanEndMoney(noStaffCost.subtract(decimal));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// //根据部门分组
|
|
|
+// otherBudgetMap = parentList.parallelStream()
|
|
|
+// .collect(Collectors.groupingBy(ProjectCostBudget::getCostType));
|
|
|
+// }else {
|
|
|
+// isOtherBudget = false;
|
|
|
+// }
|
|
|
+//
|
|
|
+// }else {
|
|
|
+// isBudget = false;
|
|
|
+// }
|
|
|
+// //维护支出,返回null证明没有
|
|
|
+// Map<Integer, List<BigDecimal>> maintainMap = budgetService.getAllMaintainCost9(y);
|
|
|
+// Boolean isMaintain = true;
|
|
|
+// if (maintainMap == null || maintainMap.size() <= 0){
|
|
|
+// isMaintain = false;
|
|
|
+// }
|
|
|
+// //获取当年所有已经完成的固定计划
|
|
|
+// //根据costType分组
|
|
|
+// List<ProjectCostBudget> allFinishedPlan = budgetService.getAllFinishedPlanByYear(y);
|
|
|
+// Boolean isFinished = true;
|
|
|
+// Map<Integer, List<ProjectCostBudget>> finishedMap = new HashMap<>();
|
|
|
+// if (allFinishedPlan != null && allFinishedPlan.size() > 0){
|
|
|
+// finishedMap = allFinishedPlan.parallelStream()
|
|
|
+// .collect(Collectors.groupingBy(ProjectCostBudget::getCostType));
|
|
|
+// }else {
|
|
|
+// isFinished = false;
|
|
|
+// }
|
|
|
+// //获取所有部门
|
|
|
+// List<Dept> allDept = baseMapper.getAllDept();
|
|
|
+// if (allDept == null || allDept.size() <= 0){
|
|
|
+// throw new ServiceException("当前没配置部门,无法统计");
|
|
|
+// }
|
|
|
+// Map<Long, List<Dept>> deptMap = allDept.parallelStream()
|
|
|
+// .collect(Collectors.groupingBy(Dept::getId));
|
|
|
+// //报销支出
|
|
|
+// List<EMFinancialReimbursementInfo> allReimburse = projectInfoService.getThisYearReimburse2(y);
|
|
|
+// Boolean isReimburse = true;
|
|
|
+// Map<Integer, List<EMFinancialReimbursementInfo>> ReimburseMap = new HashMap<>();
|
|
|
+// if (allReimburse != null && allReimburse.size() > 0){
|
|
|
+// //对部门和费用类型做映射
|
|
|
+// for (EMFinancialReimbursementInfo info : allReimburse) {
|
|
|
+// if (info.getCreateDept() != null){
|
|
|
+// info.setIsTemp(deptMap.get(info.getCreateDept()).get(0).getDeptCategory());
|
|
|
+// }else {
|
|
|
+// throw new ServiceException("有用户没有部门直接报销,无法统计");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// ReimburseMap = allReimburse.parallelStream()
|
|
|
+// .collect(Collectors.groupingBy(EMFinancialReimbursementInfo::getIsTemp));
|
|
|
+// }else {
|
|
|
+// isReimburse = false;
|
|
|
+// }
|
|
|
+//
|
|
|
+// BigDecimal c1 = new BigDecimal(0);
|
|
|
+// BigDecimal c2 = new BigDecimal(0);
|
|
|
+// BigDecimal c3 = new BigDecimal(0);
|
|
|
+// BigDecimal c4 = new BigDecimal(0);
|
|
|
+// BigDecimal c5 = new BigDecimal(0);
|
|
|
+// BigDecimal c6 = new BigDecimal(0);
|
|
|
+// BigDecimal c7 = new BigDecimal(0);
|
|
|
+// BigDecimal c8 = new BigDecimal(0);
|
|
|
+// BigDecimal c9 = new BigDecimal(0);
|
|
|
+// BigDecimal c10 = new BigDecimal(0);
|
|
|
+// //循环12个月,为每个月设置值
|
|
|
+// for (int i = 0; i < 12; i++) {
|
|
|
+// BudgetAndPracticalByDeptVO vo = new BudgetAndPracticalByDeptVO();
|
|
|
+// //设置月份
|
|
|
+// vo.setTime(months.get(i));
|
|
|
+// //设置市场部
|
|
|
+// if (isBudget && allPlanMap.get(1) != null && allPlanMap.get(1).size() > 0) {
|
|
|
+// List<ProjectCostBudget> b1 = allPlanMap.get(1);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// //循环市场部每一个预算
|
|
|
+// for (ProjectCostBudget budget : b1) {
|
|
|
+// //如果开始时间或结束时间是当月,则添加预算
|
|
|
+// if ((budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPlanEndTime().getMonthValue() == (i + 1) && budget.getPlanEndTime().getYear() == y)) {
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getPlanIsTwoMonth() == 0) {
|
|
|
+// big = big.add(budget.getPlanStaffCost());
|
|
|
+// } else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y) {
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// } else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big = big.add(budget.getPlanEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setBudget1(big);
|
|
|
+// c1 = c1.add(big);
|
|
|
+// }else {
|
|
|
+// vo.setBudget1(new BigDecimal(0));
|
|
|
+// }
|
|
|
+// //其他预算金额
|
|
|
+// if (isBudget && isOtherBudget && otherBudgetMap.get(1) != null && otherBudgetMap.get(1).size() > 0){
|
|
|
+// List<ProjectCostBudget> b1 = otherBudgetMap.get(1);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// //循环市场部每一个预算
|
|
|
+// for (ProjectCostBudget budget : b1) {
|
|
|
+// //如果开始时间或结束时间是当月,则添加预算
|
|
|
+// if ((budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPlanEndTime().getMonthValue() == (i + 1) && budget.getPlanEndTime().getYear() == y)) {
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getPlanIsTwoMonth() == 0) {
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// } else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y) {
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// } else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big = big.add(budget.getPlanEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setBudget1(vo.getBudget1().add(big));
|
|
|
+// c1 = c1.add(big);
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (isFinished){
|
|
|
+// List<ProjectCostBudget> d1 = finishedMap.get(1);
|
|
|
+// if (d1 != null && d1.size() > 0){
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// //循环市场部每一个支出
|
|
|
+// for (ProjectCostBudget budget : d1) {
|
|
|
+// //如果实际开始时间或实际结束时间是当月,则添加支出
|
|
|
+// if ((budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPracticalFinishTime().getMonthValue() == (i+1) && budget.getPracticalFinishTime().getYear() == y)){
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getIsTwoMonth() == 0){
|
|
|
+// big = big.add(budget.getActualTotalMoney());
|
|
|
+// }else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y){
|
|
|
+// big = big.add(budget.getPracticalStartMoney());
|
|
|
+// }else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big = big.add(budget.getPracticalEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setPractical1(big);
|
|
|
+// c2 = c2.add(big);
|
|
|
+// }else {
|
|
|
+// vo.setPractical1(new BigDecimal(0));
|
|
|
+// }
|
|
|
+// }else {
|
|
|
+// vo.setPractical1(new BigDecimal(0));
|
|
|
+// }
|
|
|
+// //设置维护支出
|
|
|
+// if (isMaintain && maintainMap.get(1) != null && maintainMap.get(1).size() > 0){
|
|
|
+// vo.setBudget1(vo.getBudget1().add(maintainMap.get(1).get(i)));
|
|
|
+// vo.setPractical1(vo.getPractical1().add(maintainMap.get(1).get(i)));
|
|
|
+// c1 = c1.add(maintainMap.get(1).get(i));
|
|
|
+// c2 = c2.add(maintainMap.get(1).get(i));
|
|
|
+// }
|
|
|
+// //设置报销支出
|
|
|
+// if (isReimburse && ReimburseMap.get(1) != null && ReimburseMap.get(1).size() > 0){
|
|
|
+// List<EMFinancialReimbursementInfo> infos = ReimburseMap.get(1);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// for (EMFinancialReimbursementInfo info : infos) {
|
|
|
+// if (info.getFrDate().getMonth() == i){
|
|
|
+// big = big.add(info.getFrMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setPractical1(vo.getPractical1().add(big));
|
|
|
+// c2 = c2.add(big);
|
|
|
+// }
|
|
|
+//
|
|
|
+// //设置研发部
|
|
|
+// if (isBudget && allPlanMap.get(2) != null && allPlanMap.get(2).size() > 0) {
|
|
|
+// List<ProjectCostBudget> b2 = allPlanMap.get(2);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// //循环研发部每一个预算
|
|
|
+// for (ProjectCostBudget budget : b2) {
|
|
|
+// //如果开始时间或结束时间是当月,则添加预算
|
|
|
+// if ((budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPlanEndTime().getMonthValue() == (i+1) && budget.getPlanEndTime().getYear() == y)){
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getPlanIsTwoMonth() == 0){
|
|
|
+// big = big.add(budget.getPlanStaffCost());
|
|
|
+// }else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y){
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// }else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big = big.add(budget.getPlanEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setBudget2(big);
|
|
|
+// c3 = c3.add(big);
|
|
|
+// }else {
|
|
|
+// vo.setBudget2(new BigDecimal(0));
|
|
|
+// }
|
|
|
+// //其他预算金额
|
|
|
+// if (isBudget && isOtherBudget && otherBudgetMap.get(2) != null && otherBudgetMap.get(2).size() > 0){
|
|
|
+// List<ProjectCostBudget> b1 = otherBudgetMap.get(2);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// //循环市场部每一个预算
|
|
|
+// for (ProjectCostBudget budget : b1) {
|
|
|
+// //如果开始时间或结束时间是当月,则添加预算
|
|
|
+// if ((budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPlanEndTime().getMonthValue() == (i + 1) && budget.getPlanEndTime().getYear() == y)) {
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getPlanIsTwoMonth() == 0) {
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// } else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y) {
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// } else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big = big.add(budget.getPlanEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setBudget2(vo.getBudget2().add(big));
|
|
|
+// c3 = c3.add(big);
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (isFinished){
|
|
|
+// List<ProjectCostBudget> d2 = finishedMap.get(2);
|
|
|
+// if (d2 != null && d2.size() > 0){
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// //循环市场部每一个支出
|
|
|
+// for (ProjectCostBudget budget : d2) {
|
|
|
+// //如果实际开始时间或实际结束时间是当月,则添加支出
|
|
|
+// if ((budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPracticalFinishTime().getMonthValue() == (i+1) && budget.getPracticalFinishTime().getYear() == y)){
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getIsTwoMonth() == 0){
|
|
|
+// big = big.add(budget.getActualTotalMoney());
|
|
|
+// }else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y){
|
|
|
+// big = big.add(budget.getPracticalStartMoney());
|
|
|
+// }else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big = big.add(budget.getPracticalEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setPractical2(big);
|
|
|
+// c4 = c4.add(big);
|
|
|
+// }else {
|
|
|
+// vo.setPractical2(new BigDecimal(0));
|
|
|
+// }
|
|
|
+// }else {
|
|
|
+// vo.setPractical2(new BigDecimal(0));
|
|
|
+// }
|
|
|
+// //设置维护支出
|
|
|
+// if (isMaintain && maintainMap.get(2) != null && maintainMap.get(2).size() > 0){
|
|
|
+// vo.setBudget2(vo.getBudget2().add(maintainMap.get(2).get(i)));
|
|
|
+// vo.setPractical2(vo.getPractical2().add(maintainMap.get(2).get(i)));
|
|
|
+// c3 = c3.add(maintainMap.get(2).get(i));
|
|
|
+// c4 = c4.add(maintainMap.get(2).get(i));
|
|
|
+// }
|
|
|
+// //设置报销支出
|
|
|
+// if (isReimburse && ReimburseMap.get(2) != null && ReimburseMap.get(2).size() > 0){
|
|
|
+// List<EMFinancialReimbursementInfo> infos = ReimburseMap.get(2);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// for (EMFinancialReimbursementInfo info : infos) {
|
|
|
+// if (info.getFrDate().getMonth() == i){
|
|
|
+// big = big.add(info.getFrMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setPractical2(vo.getPractical2().add(big));
|
|
|
+// c4 = c4.add(big);
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// //设置实施部
|
|
|
+// if (isBudget && allPlanMap.get(3) != null && allPlanMap.get(3).size() > 0) {
|
|
|
+// List<ProjectCostBudget> b3 = allPlanMap.get(3);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// //循环研发部每一个预算
|
|
|
+// for (ProjectCostBudget budget : b3) {
|
|
|
+// //如果开始时间或结束时间是当月,则添加预算
|
|
|
+// if ((budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPlanEndTime().getMonthValue() == (i+1) && budget.getPlanEndTime().getYear() == y)){
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getPlanIsTwoMonth() == 0){
|
|
|
+// big = big.add(budget.getPlanStaffCost());
|
|
|
+// }else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y){
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// }else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big = big.add(budget.getPlanEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setBudget3(big);
|
|
|
+// c5 = c5.add(big);
|
|
|
+// }else {
|
|
|
+// vo.setBudget3(new BigDecimal(0));
|
|
|
+// }
|
|
|
+// //其他预算金额
|
|
|
+// if (isBudget && isOtherBudget && otherBudgetMap.get(3) != null && otherBudgetMap.get(3).size() > 0){
|
|
|
+// List<ProjectCostBudget> b1 = otherBudgetMap.get(3);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// //循环市场部每一个预算
|
|
|
+// for (ProjectCostBudget budget : b1) {
|
|
|
+// //如果开始时间或结束时间是当月,则添加预算
|
|
|
+// if ((budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPlanEndTime().getMonthValue() == (i + 1) && budget.getPlanEndTime().getYear() == y)) {
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getPlanIsTwoMonth() == 0) {
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// } else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y) {
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// } else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big = big.add(budget.getPlanEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setBudget3(vo.getBudget3().add(big));
|
|
|
+// c5 = c5.add(big);
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (isFinished){
|
|
|
+// List<ProjectCostBudget> d3 = finishedMap.get(3);
|
|
|
+// if (d3 != null && d3.size() > 0){
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// //循环每一个支出
|
|
|
+// for (ProjectCostBudget budget : d3) {
|
|
|
+// //如果实际开始时间或实际结束时间是当月,则添加支出
|
|
|
+// if ((budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPracticalFinishTime().getMonthValue() == (i+1) && budget.getPracticalFinishTime().getYear() == y)){
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getIsTwoMonth() == 0){
|
|
|
+// big = big.add(budget.getActualTotalMoney());
|
|
|
+// }else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y){
|
|
|
+// big = big.add(budget.getPracticalStartMoney());
|
|
|
+// }else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big = big.add(budget.getPracticalEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setPractical3(big);
|
|
|
+// c6 = c6.add(big);
|
|
|
+// }else {
|
|
|
+// vo.setPractical3(new BigDecimal(0));
|
|
|
+// }
|
|
|
+// }else {
|
|
|
+// vo.setPractical3(new BigDecimal(0));
|
|
|
+// }
|
|
|
+// //设置维护支出
|
|
|
+// if (isMaintain && maintainMap.get(3) != null && maintainMap.get(3).size() > 0){
|
|
|
+// vo.setBudget3(vo.getBudget3().add(maintainMap.get(3).get(i)));
|
|
|
+// vo.setPractical3(vo.getPractical3().add(maintainMap.get(3).get(i)));
|
|
|
+// c5 = c5.add(maintainMap.get(3).get(i));
|
|
|
+// c6 = c6.add(maintainMap.get(3).get(i));
|
|
|
+// }
|
|
|
+// //设置报销支出
|
|
|
+// if (isReimburse && ReimburseMap.get(3) != null && ReimburseMap.get(3).size() > 0){
|
|
|
+// List<EMFinancialReimbursementInfo> infos = ReimburseMap.get(3);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// for (EMFinancialReimbursementInfo info : infos) {
|
|
|
+// if (info.getFrDate().getMonth() == i){
|
|
|
+// big = big.add(info.getFrMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setPractical3(vo.getPractical3().add(big));
|
|
|
+// c6 = c6.add(big);
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// //设置维护部
|
|
|
+// if (isBudget && allPlanMap.get(4) != null && allPlanMap.get(4).size() > 0) {
|
|
|
+// List<ProjectCostBudget> b4 = allPlanMap.get(4);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// //循环每一个预算
|
|
|
+// for (ProjectCostBudget budget : b4) {
|
|
|
+// //如果开始时间或结束时间是当月,则添加预算
|
|
|
+// if ((budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPlanEndTime().getMonthValue() == (i+1) && budget.getPlanEndTime().getYear() == y)){
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getPlanIsTwoMonth() == 0){
|
|
|
+// big = big.add(budget.getPlanStaffCost());
|
|
|
+// }else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y){
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// }else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big = big.add(budget.getPlanEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setBudget4(big);
|
|
|
+// c7 = c7.add(big);
|
|
|
+// }else {
|
|
|
+// vo.setBudget4(new BigDecimal(0));
|
|
|
+// }
|
|
|
+// //其他预算金额
|
|
|
+// if (isBudget && isOtherBudget && otherBudgetMap.get(4) != null && otherBudgetMap.get(4).size() > 0){
|
|
|
+// List<ProjectCostBudget> b1 = otherBudgetMap.get(4);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// //循环市场部每一个预算
|
|
|
+// for (ProjectCostBudget budget : b1) {
|
|
|
+// //如果开始时间或结束时间是当月,则添加预算
|
|
|
+// if ((budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPlanEndTime().getMonthValue() == (i + 1) && budget.getPlanEndTime().getYear() == y)) {
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getPlanIsTwoMonth() == 0) {
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// } else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y) {
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// } else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big = big.add(budget.getPlanEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setBudget4(vo.getBudget4().add(big));
|
|
|
+// c7 = c7.add(big);
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (isFinished){
|
|
|
+// List<ProjectCostBudget> d4 = finishedMap.get(4);
|
|
|
+// if (d4 != null && d4.size() > 0){
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// //循环每一个支出
|
|
|
+// for (ProjectCostBudget budget : d4) {
|
|
|
+// //如果实际开始时间或实际结束时间是当月,则添加支出
|
|
|
+// if ((budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPracticalFinishTime().getMonthValue() == (i+1) && budget.getPracticalFinishTime().getYear() == y)){
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getIsTwoMonth() == 0){
|
|
|
+// big = big.add(budget.getActualTotalMoney());
|
|
|
+// }else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y){
|
|
|
+// big = big.add(budget.getPracticalStartMoney());
|
|
|
+// }else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big = big.add(budget.getPracticalEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setPractical4(big);
|
|
|
+// c8 = c8.add(big);
|
|
|
+// }else {
|
|
|
+// vo.setPractical4(new BigDecimal(0));
|
|
|
+// }
|
|
|
+// }else {
|
|
|
+// vo.setPractical4(new BigDecimal(0));
|
|
|
+// }
|
|
|
+// //设置维护支出
|
|
|
+// if (isMaintain && maintainMap.get(4) != null && maintainMap.get(4).size() > 0){
|
|
|
+// vo.setBudget4(vo.getBudget4().add(maintainMap.get(4).get(i)));
|
|
|
+// vo.setPractical4(vo.getPractical4().add(maintainMap.get(4).get(i)));
|
|
|
+// c7 = c7.add(maintainMap.get(4).get(i));
|
|
|
+// c8 = c8.add(maintainMap.get(4).get(i));
|
|
|
+// }
|
|
|
+// //设置报销支出
|
|
|
+// if (isReimburse && ReimburseMap.get(4) != null && ReimburseMap.get(4).size() > 0){
|
|
|
+// List<EMFinancialReimbursementInfo> infos = ReimburseMap.get(4);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// for (EMFinancialReimbursementInfo info : infos) {
|
|
|
+// if (info.getFrDate().getMonth() == i){
|
|
|
+// big = big.add(info.getFrMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// vo.setPractical4(vo.getPractical4().add(big));
|
|
|
+// c8 = c8.add(big);
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// //设置管理中心 = 管理支出+外包劳务
|
|
|
+// BigDecimal big1 = new BigDecimal(0);
|
|
|
+// BigDecimal big2 = new BigDecimal(0);
|
|
|
+// if (isBudget && allPlanMap.get(5) != null && allPlanMap.get(5).size() > 0) {
|
|
|
+// List<ProjectCostBudget> b5 = allPlanMap.get(5);
|
|
|
+// //循环研发部每一个预算
|
|
|
+// for (ProjectCostBudget budget : b5) {
|
|
|
+// //如果开始时间或结束时间是当月,则添加预算
|
|
|
+// if ((budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPlanEndTime().getMonthValue() == (i+1) && budget.getPlanEndTime().getYear() == y)){
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getPlanIsTwoMonth() == 0){
|
|
|
+// big1 = big1.add(budget.getPlanStaffCost());
|
|
|
+// }else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y){
|
|
|
+// big1 = big1.add(budget.getPlanStartMoney());
|
|
|
+// }else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big1 = big1.add(budget.getPlanEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// //其他预算金额
|
|
|
+// if (isBudget && isOtherBudget && otherBudgetMap.get(5) != null && otherBudgetMap.get(5).size() > 0){
|
|
|
+// List<ProjectCostBudget> b1 = otherBudgetMap.get(5);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// //循环市场部每一个预算
|
|
|
+// for (ProjectCostBudget budget : b1) {
|
|
|
+// //如果开始时间或结束时间是当月,则添加预算
|
|
|
+// if ((budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPlanEndTime().getMonthValue() == (i + 1) && budget.getPlanEndTime().getYear() == y)) {
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getPlanIsTwoMonth() == 0) {
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// } else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y) {
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// } else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big = big.add(budget.getPlanEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// big1 = big.add(big);
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (isFinished){
|
|
|
+// List<ProjectCostBudget> d5 = finishedMap.get(5);
|
|
|
+// if (d5 != null && d5.size() > 0){
|
|
|
+// //循环市场部每一个支出
|
|
|
+// for (ProjectCostBudget budget : d5) {
|
|
|
+// //如果实际开始时间或实际结束时间是当月,则添加支出
|
|
|
+// if ((budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPracticalFinishTime().getMonthValue() == (i+1) && budget.getPracticalFinishTime().getYear() == y)){
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getIsTwoMonth() == 0){
|
|
|
+// big2 = big2.add(budget.getActualTotalMoney());
|
|
|
+// }else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y){
|
|
|
+// big2 = big2.add(budget.getPracticalStartMoney());
|
|
|
+// }else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big2 = big2.add(budget.getPracticalEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if (isBudget && allPlanMap.get(6) != null && allPlanMap.get(6).size() > 0) {
|
|
|
+// List<ProjectCostBudget> b6 = allPlanMap.get(6);
|
|
|
+// //循环研发部每一个预算
|
|
|
+// for (ProjectCostBudget budget : b6) {
|
|
|
+// //如果开始时间或结束时间是当月,则添加预算
|
|
|
+// if ((budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPlanEndTime().getMonthValue() == (i+1) && budget.getPlanEndTime().getYear() == y)){
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getPlanIsTwoMonth() == 0){
|
|
|
+// big1 = big1.add(budget.getPlanStaffCost());
|
|
|
+// }else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getPlanStartTime().getMonthValue() == (i+1) && budget.getPlanStartTime().getYear() == y){
|
|
|
+// big1 = big1.add(budget.getPlanStartMoney());
|
|
|
+// }else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big1 = big1.add(budget.getPlanEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// //其他预算金额
|
|
|
+// if (isBudget && isOtherBudget && otherBudgetMap.get(6) != null && otherBudgetMap.get(6).size() > 0){
|
|
|
+// List<ProjectCostBudget> b1 = otherBudgetMap.get(6);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// //循环市场部每一个预算
|
|
|
+// for (ProjectCostBudget budget : b1) {
|
|
|
+// //如果开始时间或结束时间是当月,则添加预算
|
|
|
+// if ((budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPlanEndTime().getMonthValue() == (i + 1) && budget.getPlanEndTime().getYear() == y)) {
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getPlanIsTwoMonth() == 0) {
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// } else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getPlanStartTime().getMonthValue() == (i + 1) && budget.getPlanStartTime().getYear() == y) {
|
|
|
+// big = big.add(budget.getPlanStartMoney());
|
|
|
+// } else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big = big.add(budget.getPlanEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// big1 = big.add(big);
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (isFinished){
|
|
|
+// List<ProjectCostBudget> d6 = finishedMap.get(6);
|
|
|
+// if (d6 != null && d6.size() > 0){
|
|
|
+// //循环市场部每一个支出
|
|
|
+// for (ProjectCostBudget budget : d6) {
|
|
|
+// //如果实际开始时间或实际结束时间是当月,则添加支出
|
|
|
+// if ((budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y)
|
|
|
+// || (budget.getPracticalFinishTime().getMonthValue() == (i+1) && budget.getPracticalFinishTime().getYear() == y)){
|
|
|
+// //如果开始时间和结束时间的月相同,则直接用总预算
|
|
|
+// if (budget.getIsTwoMonth() == 0){
|
|
|
+// big2 = big2.add(budget.getActualTotalMoney());
|
|
|
+// }else {
|
|
|
+// //如果开始月是当前月,则直接使用开始金额
|
|
|
+// if (budget.getRealPlanStartTime().getMonthValue() == (i+1) && budget.getRealPlanStartTime().getYear() == y){
|
|
|
+// big2 = big2.add(budget.getPracticalStartMoney());
|
|
|
+// }else {
|
|
|
+// //结束月是当前月,使用结束金额
|
|
|
+// big2 = big2.add(budget.getPracticalEndMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// //设置维护支出
|
|
|
+// if (isMaintain && maintainMap.get(5) != null && maintainMap.get(5).size() > 0){
|
|
|
+// big1 = big1.add(maintainMap.get(5).get(i));
|
|
|
+// big2 = big2.add(maintainMap.get(5).get(i));
|
|
|
+// c9 = c9.add(maintainMap.get(5).get(i));
|
|
|
+// c10 = c10.add(maintainMap.get(5).get(i));
|
|
|
+// }
|
|
|
+// //设置维护支出
|
|
|
+// if (isMaintain && maintainMap.get(6) != null && maintainMap.get(6).size() > 0){
|
|
|
+// big1 = big1.add(maintainMap.get(6).get(i));
|
|
|
+// big2 = big2.add(maintainMap.get(6).get(i));
|
|
|
+// c9 = c9.add(maintainMap.get(6).get(i));
|
|
|
+// c10 = c10.add(maintainMap.get(6).get(i));
|
|
|
+// }
|
|
|
+// //设置管理中心报销支出
|
|
|
+// if (isReimburse && ReimburseMap.get(5) != null && ReimburseMap.get(5).size() > 0){
|
|
|
+// List<EMFinancialReimbursementInfo> infos = ReimburseMap.get(5);
|
|
|
+// BigDecimal big = new BigDecimal(0);
|
|
|
+// for (EMFinancialReimbursementInfo info : infos) {
|
|
|
+// if (info.getFrDate().getMonth() == i){
|
|
|
+// big = big.add(info.getFrMoney());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// big2 = big2.add(big);
|
|
|
+// }
|
|
|
+// vo.setBudget5(big1);
|
|
|
+// c9 = c9.add(big1);
|
|
|
+// vo.setPractical5(big2);
|
|
|
+// c10 = c10.add(big2);
|
|
|
+// list.add(vo);
|
|
|
+// }
|
|
|
+// //计算总计
|
|
|
+// BudgetAndPracticalByDeptVO vo2 = new BudgetAndPracticalByDeptVO();
|
|
|
+// vo2.setTime("总计");
|
|
|
+// vo2.setBudget1(c1);
|
|
|
+// vo2.setPractical1(c2);
|
|
|
+// vo2.setBudget2(c3);
|
|
|
+// vo2.setPractical2(c4);
|
|
|
+// vo2.setBudget3(c5);
|
|
|
+// vo2.setPractical3(c6);
|
|
|
+// vo2.setBudget4(c7);
|
|
|
+// vo2.setPractical4(c8);
|
|
|
+// vo2.setBudget5(c9);
|
|
|
+// vo2.setPractical5(c10);
|
|
|
+// list.add(vo2);
|
|
|
+// return list;
|
|
|
+// }
|
|
|
+
|
|
|
/**
|
|
|
* 预算与实际统计-总经营
|
|
|
*/
|