进度管理大屏
This commit is contained in:
@ -1,6 +1,5 @@
|
|||||||
package org.dromara.bigscreen.controller;
|
package org.dromara.bigscreen.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -27,7 +26,6 @@ import java.util.List;
|
|||||||
* @author lilemy
|
* @author lilemy
|
||||||
* @date 2025-12-15 11:35
|
* @date 2025-12-15 11:35
|
||||||
*/
|
*/
|
||||||
@SaIgnore
|
|
||||||
@Validated
|
@Validated
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
|||||||
@ -41,6 +41,11 @@ public class ProjectImageProgressDetailVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private BigDecimal totalProgress;
|
private BigDecimal totalProgress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成率
|
||||||
|
*/
|
||||||
|
private BigDecimal completionRate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单位
|
* 单位
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -581,6 +581,7 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
vo.setPlanProgress(c.getPlanTotal());
|
vo.setPlanProgress(c.getPlanTotal());
|
||||||
vo.setActualProgress(c.getCompleted());
|
vo.setActualProgress(c.getCompleted());
|
||||||
vo.setTotalProgress(c.getTotal());
|
vo.setTotalProgress(c.getTotal());
|
||||||
|
vo.setCompletionRate(BigDecimalUtil.toPercentage(c.getCompleted(), c.getTotal()));
|
||||||
return vo;
|
return vo;
|
||||||
}).toList();
|
}).toList();
|
||||||
}
|
}
|
||||||
@ -615,6 +616,7 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
BigDecimal total = children.stream().map(PgsProgressCategory::getTotal)
|
BigDecimal total = children.stream().map(PgsProgressCategory::getTotal)
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
vo.setTotalProgress(total);
|
vo.setTotalProgress(total);
|
||||||
|
vo.setCompletionRate(BigDecimalUtil.toPercentage(completed, total));
|
||||||
detailVoList.add(vo);
|
detailVoList.add(vo);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -645,6 +647,7 @@ public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
|||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.findFirst().orElse(null);
|
.findFirst().orElse(null);
|
||||||
vo.setUnit(unit);
|
vo.setUnit(unit);
|
||||||
|
vo.setCompletionRate(BigDecimalUtil.toPercentage(actual, total));
|
||||||
detailVoList.add(vo);
|
detailVoList.add(vo);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user