进度控制开发,任务模式bug修正
This commit is contained in:
@@ -107,5 +107,7 @@ public class OaProgressVo {
|
||||
private Long nowLevelId;
|
||||
// 项目合同金额
|
||||
private Double funds;
|
||||
private Date endTime;
|
||||
private Date payEndTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ public class OaProgressDetailServiceImpl implements IOaProgressDetailService {
|
||||
private LambdaQueryWrapper<OaProgressDetail> buildQueryWrapper(OaProgressDetailBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OaProgressDetail> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(OaProgressDetail::getDelFlag,0L);
|
||||
lqw.eq(bo.getProgressId() != null, OaProgressDetail::getProgressId, bo.getProgressId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDetailName()), OaProgressDetail::getDetailName, bo.getDetailName());
|
||||
lqw.eq(bo.getPlanStartDate() != null, OaProgressDetail::getPlanStartDate, bo.getPlanStartDate());
|
||||
|
||||
@@ -9,10 +9,13 @@ import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.oa.domain.bo.OaProgressBo;
|
||||
import com.ruoyi.oa.domain.bo.SysOaProjectBo;
|
||||
import com.ruoyi.oa.domain.bo.SysOaTaskBo;
|
||||
import com.ruoyi.oa.domain.vo.OaProgressVo;
|
||||
import com.ruoyi.oa.domain.vo.SysOaProjectVo;
|
||||
import com.ruoyi.oa.domain.vo.SysOaTaskVo;
|
||||
import com.ruoyi.oa.service.IOaProgressService;
|
||||
import com.ruoyi.oa.service.ISysOaProjectService;
|
||||
import com.ruoyi.oa.service.ISysOaTaskService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -41,6 +44,8 @@ public class SysOaRemindServiceImpl implements ISysOaRemindService {
|
||||
|
||||
private final ISysOaProjectService projectService;
|
||||
|
||||
private final IOaProgressService progressService;
|
||||
|
||||
/**
|
||||
* 查询事件提醒
|
||||
*/
|
||||
@@ -104,6 +109,36 @@ public class SysOaRemindServiceImpl implements ISysOaRemindService {
|
||||
sysOaRemindVo.setTaskTime(row.getFinishTime());
|
||||
sysOaRemindVos.add(sysOaRemindVo);
|
||||
}
|
||||
|
||||
// 查询邻近过期进度
|
||||
OaProgressBo oaProgressBo = new OaProgressBo();
|
||||
oaProgressBo.setType(1L);
|
||||
List<OaProgressVo> rows1 = progressService.queryPageList(oaProgressBo, pageQuery).getRows();
|
||||
for (OaProgressVo row : rows1) {
|
||||
if (row.getRemainTime()!=null && row.getRemainTime()<3L){
|
||||
SysOaRemindVo sysOaRemindVo = new SysOaRemindVo();
|
||||
sysOaRemindVo.setType("progress-project");
|
||||
sysOaRemindVo.setContent(row.getProgressName());
|
||||
sysOaRemindVo.setRemainTime(row.getRemainTime());
|
||||
sysOaRemindVo.setTaskTime(row.getEndTime());
|
||||
sysOaRemindVos.add(sysOaRemindVo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 查询邻近过期进度
|
||||
oaProgressBo.setType(2L);
|
||||
List<OaProgressVo> rows2 = progressService.queryPageList(oaProgressBo, pageQuery).getRows();
|
||||
for (OaProgressVo row : rows2) {
|
||||
if (row.getRemainTime()!=null && row.getRemainTime()<3L){
|
||||
SysOaRemindVo sysOaRemindVo = new SysOaRemindVo();
|
||||
sysOaRemindVo.setType("progress-money");
|
||||
sysOaRemindVo.setContent(row.getProgressName());
|
||||
sysOaRemindVo.setRemainTime(row.getRemainTime());
|
||||
sysOaRemindVo.setTaskTime(row.getPayEndTime());
|
||||
sysOaRemindVos.add(sysOaRemindVo);
|
||||
}
|
||||
}
|
||||
return R.ok(sysOaRemindVos);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,23 @@
|
||||
ORDER BY d.plan_start_date ASC
|
||||
LIMIT 1
|
||||
) AS remainTime,
|
||||
|
||||
(
|
||||
SELECT d.plan_end_date
|
||||
FROM oa_progress_detail d
|
||||
WHERE d.progress_id = op.progress_id
|
||||
AND d.detail_status = 0
|
||||
ORDER BY d.plan_start_date ASC
|
||||
LIMIT 1
|
||||
) AS endTime,
|
||||
|
||||
(
|
||||
SELECT d.plan_pay_date
|
||||
FROM oa_progress_detail d
|
||||
WHERE d.progress_id = op.progress_id
|
||||
ORDER BY d.plan_pay_date ASC
|
||||
LIMIT 1
|
||||
) AS payEndTime,
|
||||
-- 计算当前 progress 对应的 detail 完成比例:满足 detail_status = 1 的条数 / 总条数(避免除0)
|
||||
(
|
||||
SELECT IF(COUNT(*) = 0, 0, ROUND(SUM(CASE WHEN d.detail_status = 1 THEN 1 ELSE 0 END) / COUNT(*), 2))
|
||||
|
||||
Reference in New Issue
Block a user