|
@@ -339,13 +339,27 @@ public class AnnualBudgetServiceImpl extends BaseServiceImpl<AnnualBudgetMapper,
|
|
|
if (vo3.getAnnualContractTarget() == null || vo3.getAnnualContractTarget().compareTo(BigDecimal.ZERO) == 0 || vo3.getYearReturned().compareTo(BigDecimal.ZERO) == 0){
|
|
|
vo3.setContractSchedule(0);
|
|
|
}else {
|
|
|
- vo3.setContractSchedule(vo3.getYearReturned().divide(vo3.getAnnualContractTarget(),2,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).intValue());
|
|
|
+ int value = vo3.getYearReturned().divide(vo3.getAnnualContractTarget(), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).intValue();
|
|
|
+ if (value < 0){
|
|
|
+ value = 0;
|
|
|
+ }
|
|
|
+ if (value > 100){
|
|
|
+ value = 100;
|
|
|
+ }
|
|
|
+ vo3.setContractSchedule(value);
|
|
|
}
|
|
|
//利润进度统计
|
|
|
if (vo3.getAnnualProfitTarget() == null || vo3.getAnnualProfitTarget().compareTo(BigDecimal.ZERO) == 0 || vo3.getYearProfit().compareTo(BigDecimal.ZERO) == 0){
|
|
|
vo3.setProfitSchedule(0);
|
|
|
}else {
|
|
|
- vo3.setProfitSchedule(vo3.getYearProfit().divide(vo3.getAnnualProfitTarget(),2,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).intValue());
|
|
|
+ int value = vo3.getYearProfit().divide(vo3.getAnnualProfitTarget(), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).intValue();
|
|
|
+ if (value < 0){
|
|
|
+ value = 0;
|
|
|
+ }
|
|
|
+ if (value > 100){
|
|
|
+ value = 100;
|
|
|
+ }
|
|
|
+ vo3.setProfitSchedule(value);
|
|
|
}
|
|
|
return vo3;
|
|
|
}
|
|
@@ -458,6 +472,8 @@ public class AnnualBudgetServiceImpl extends BaseServiceImpl<AnnualBudgetMapper,
|
|
|
}
|
|
|
//获取当月所有计划,和计划工资
|
|
|
List<ProjectCostBudgetVO2> planByMonth = budgetService.getPlanByMonth(date);
|
|
|
+ planByMonth = planByMonth.stream().filter(l->l.getPlanCountMoney() != null).collect(Collectors.toList());
|
|
|
+ planByMonth = planByMonth.stream().filter(l->new BigDecimal(0).compareTo(l.getPlanCountMoney()) != 0).collect(Collectors.toList());
|
|
|
if (planByMonth != null && planByMonth.size() > 0) {
|
|
|
List<DeptMonthPlanRatioVO> vos = new ArrayList<>();
|
|
|
//月计划包含的项目
|
|
@@ -500,12 +516,18 @@ public class AnnualBudgetServiceImpl extends BaseServiceImpl<AnnualBudgetMapper,
|
|
|
//设置投入比
|
|
|
if (new BigDecimal(0).compareTo(businessCount) != 0){
|
|
|
vo.setBusinessRatio(business.divide(businessCount, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).intValue() + "%");
|
|
|
+ }else {
|
|
|
+ vo.setBusinessRatio("0%");
|
|
|
}
|
|
|
if (new BigDecimal(0).compareTo(devCount) != 0) {
|
|
|
vo.setDevRatio(dev.divide(devCount, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).intValue() + "%");
|
|
|
+ }else {
|
|
|
+ vo.setDevRatio("0%");
|
|
|
}
|
|
|
if (new BigDecimal(0).compareTo(maintainCount) != 0) {
|
|
|
vo.setMaintainRatio(maintain.divide(maintainCount, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).intValue() + "%");
|
|
|
+ }else {
|
|
|
+ vo.setMaintainRatio("0%");
|
|
|
}
|
|
|
//插入结果集
|
|
|
vos.add(vo);
|
|
@@ -571,17 +593,17 @@ public class AnnualBudgetServiceImpl extends BaseServiceImpl<AnnualBudgetMapper,
|
|
|
*/
|
|
|
@Override
|
|
|
public List<ProjectIncomeCostRatioVO> portalProjectCostRatio(String date) {
|
|
|
- if ("汇总所有".equals(date)){
|
|
|
- date = "";
|
|
|
- }
|
|
|
+// if ("汇总所有".equals(date)){
|
|
|
+// date = "";
|
|
|
+// }
|
|
|
//获取项目列表
|
|
|
- List<ControlProjectInfo> list = projectInfoService.list();
|
|
|
+ List<ControlProjectInfo> list = projectInfoService.listByYear(Integer.parseInt(date.substring(0,4)));
|
|
|
if (list == null || list.size() <= 0){
|
|
|
return null;
|
|
|
}
|
|
|
List<ProjectIncomeCostRatioVO> vos = new ArrayList<>();
|
|
|
- //按月获取闭环任务,根据项目分组
|
|
|
- List<ProjectCostBudget> costByMonth = budgetService.getPlanPracticalCostByMonth(date);
|
|
|
+ //按年获取闭环任务,根据项目分组
|
|
|
+ List<ProjectCostBudget> costByMonth = budgetService.getPlanPracticalCostByMonth(date.substring(0,4));
|
|
|
if (costByMonth == null || costByMonth.size() <= 0){
|
|
|
//没有闭环任务,为每个项目设置为0
|
|
|
for (ControlProjectInfo info : list) {
|
|
@@ -617,13 +639,13 @@ public class AnnualBudgetServiceImpl extends BaseServiceImpl<AnnualBudgetMapper,
|
|
|
date = "";
|
|
|
}
|
|
|
//获取项目列表
|
|
|
- List<ControlProjectInfo> list = projectInfoService.list();
|
|
|
+ List<ControlProjectInfo> list = projectInfoService.listByYear(Integer.parseInt(date.substring(0,4)));
|
|
|
if (list == null || list.size() <= 0){
|
|
|
return null;
|
|
|
}
|
|
|
//获取所有回款,根据项目分组
|
|
|
List<ProjectIncomeCostRatioVO> vos = new ArrayList<>();
|
|
|
- List<ContractReturnedInfo> returnedByMonth = returnedInfoService.getProjectReturnedByMonth(date);
|
|
|
+ List<ContractReturnedInfo> returnedByMonth = returnedInfoService.getProjectReturnedByMonth(date.substring(0,4));
|
|
|
if (returnedByMonth == null || returnedByMonth.size() <= 0){
|
|
|
//没有闭环任务,为每个项目设置为0
|
|
|
for (ControlProjectInfo info : list) {
|
|
@@ -647,7 +669,7 @@ public class AnnualBudgetServiceImpl extends BaseServiceImpl<AnnualBudgetMapper,
|
|
|
big = big.add(returnedInfo.getPracticalReturnedMoney());
|
|
|
}
|
|
|
}
|
|
|
- vo.setProjectCost(big.intValue());
|
|
|
+ vo.setProjectIncome(big.intValue());
|
|
|
vos.add(vo);
|
|
|
}
|
|
|
return vos;
|