|
|
@ -3,6 +3,7 @@ package com.epmet.service.project.impl; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.dao.project.ProjectDao; |
|
|
|
import com.epmet.dto.form.LoginUserDetailsFormDTO; |
|
|
|
import com.epmet.dto.result.LoginUserDetailsResultDTO; |
|
|
@ -20,6 +21,7 @@ import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.text.NumberFormat; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
@ -54,6 +56,15 @@ public class ProjectServiceImpl implements ProjectService { |
|
|
|
//将小数转成百分比
|
|
|
|
resultDTO.setPendingRatio(percent.format(pendingRatio.doubleValue())); |
|
|
|
resultDTO.setClosedRatio(percent.format(resultDTO.getClosedRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue())); |
|
|
|
} else { |
|
|
|
resultDTO.setAgencyId(agencyId); |
|
|
|
Date date = DateUtils.getBeforeDay(new Date()); |
|
|
|
resultDTO.setDateName(DateUtils.format(date, "yyyy.MM.dd")); |
|
|
|
resultDTO.setProjectTotal(NumConstant.ZERO); |
|
|
|
resultDTO.setPendingTotal(NumConstant.ZERO); |
|
|
|
resultDTO.setPendingRatio("0%"); |
|
|
|
resultDTO.setClosedTotal(NumConstant.ZERO); |
|
|
|
resultDTO.setClosedRatio("0%"); |
|
|
|
} |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
@ -78,6 +89,17 @@ public class ProjectServiceImpl implements ProjectService { |
|
|
|
//先四舍五入保留四位小数再把小数转成百分比
|
|
|
|
sum.setRatio(percent.format(sum.getRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue())); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
ProjectSummaryInfoResultDTO pending = new ProjectSummaryInfoResultDTO(); |
|
|
|
pending.setName(ProjectConstant.PENDING); |
|
|
|
pending.setValue(NumConstant.ZERO); |
|
|
|
pending.setRatio("0%"); |
|
|
|
resultList.add(pending); |
|
|
|
ProjectSummaryInfoResultDTO closed = new ProjectSummaryInfoResultDTO(); |
|
|
|
closed.setName(ProjectConstant.CLOSED); |
|
|
|
closed.setValue(NumConstant.ZERO); |
|
|
|
closed.setRatio("0%"); |
|
|
|
resultList.add(closed); |
|
|
|
} |
|
|
|
return resultList; |
|
|
|
} |
|
|
|