进度控制开发,任务模式bug修正
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.OaProgressDetail;
|
||||
import com.ruoyi.oa.domain.vo.OaProgressDetailVo;
|
||||
import com.ruoyi.oa.domain.bo.OaProgressDetailBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 进度扩展Service接口
|
||||
*
|
||||
* @author hdka2
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
public interface IOaProgressDetailService {
|
||||
|
||||
/**
|
||||
* 查询进度扩展
|
||||
*/
|
||||
OaProgressDetailVo queryById(Long detailId);
|
||||
|
||||
/**
|
||||
* 查询进度扩展列表
|
||||
*/
|
||||
TableDataInfo<OaProgressDetailVo> queryPageList(OaProgressDetailBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询进度扩展列表
|
||||
*/
|
||||
List<OaProgressDetailVo> queryList(OaProgressDetailBo bo);
|
||||
|
||||
/**
|
||||
* 新增进度扩展
|
||||
*/
|
||||
Boolean insertByBo(OaProgressDetailBo bo);
|
||||
|
||||
/**
|
||||
* 修改进度扩展
|
||||
*/
|
||||
Boolean updateByBo(OaProgressDetailBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除进度扩展信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.OaProgressDetail;
|
||||
import com.ruoyi.oa.domain.vo.OaProgressVo;
|
||||
import com.ruoyi.oa.domain.bo.OaProgressBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 进度管理Service接口
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
public interface IOaProgressService {
|
||||
|
||||
/**
|
||||
* 查询进度管理
|
||||
*/
|
||||
OaProgressVo queryById(Long progressId);
|
||||
|
||||
/**
|
||||
* 查询进度管理列表
|
||||
*/
|
||||
TableDataInfo<OaProgressVo> queryPageList(OaProgressBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询进度管理列表
|
||||
*/
|
||||
List<OaProgressVo> queryList(OaProgressBo bo);
|
||||
|
||||
/**
|
||||
* 新增进度管理
|
||||
*/
|
||||
Boolean insertByBo(OaProgressBo bo);
|
||||
|
||||
/**
|
||||
* 修改进度管理
|
||||
*/
|
||||
Boolean updateByBo(OaProgressBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除进度管理信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 获取关键字
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<OaProgressDetail> getKeyList();
|
||||
|
||||
}
|
||||
@@ -66,4 +66,12 @@ public interface ISysOaProjectService {
|
||||
List<SysOaProjectVo> getProjectDataByMonthAndDate();
|
||||
|
||||
TableDataInfo<SysOaProjectVo> queryFiles(SysOaWarehouseDetailBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询进度使用的查询接口
|
||||
* @param bo
|
||||
* @param pageQuery
|
||||
* @return
|
||||
*/
|
||||
TableDataInfo<SysOaProjectVo> queryPageList2(SysOaProjectBo bo, PageQuery pageQuery);
|
||||
}
|
||||
|
||||
@@ -20,9 +20,8 @@ import com.ruoyi.oa.domain.EmployeeFiles;
|
||||
import com.ruoyi.oa.mapper.EmployeeFilesMapper;
|
||||
import com.ruoyi.oa.service.IEmployeeFilesService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 文件档案管理Service业务层处理
|
||||
@@ -85,10 +84,16 @@ public class EmployeeFilesServiceImpl implements IEmployeeFilesService {
|
||||
public Boolean insertByBo(UserFilesVo userFilesVo) {
|
||||
// 删除该用户所有的文件,重新填入
|
||||
// baseMapper.deleteByUserId(userFilesVo.getUserId()); 似乎不用删
|
||||
List<EmployeeFilesVo> fileList = userFilesVo.getFileList();
|
||||
fileList.forEach(file -> {
|
||||
EmployeeFiles employeeFiles = BeanUtil.toBean(file, EmployeeFiles.class);
|
||||
employeeFiles.setFilePath(file.getFilePath());
|
||||
List<String> fileUrls = new ArrayList<>();
|
||||
if (userFilesVo.getUserId() != null){
|
||||
fileUrls = Arrays.stream( userFilesVo.getFiles().split(","))
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
fileUrls.forEach(file -> {
|
||||
EmployeeFiles employeeFiles = new EmployeeFiles();
|
||||
employeeFiles.setFilePath(file);
|
||||
employeeFiles.setUserId(userFilesVo.getUserId());
|
||||
baseMapper.insert(employeeFiles);
|
||||
});
|
||||
|
||||
@@ -8,6 +8,9 @@ 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.EmployeeFiles;
|
||||
import com.ruoyi.oa.domain.vo.EmployeeFilesVo;
|
||||
import com.ruoyi.oa.mapper.EmployeeFilesMapper;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import liquibase.pro.packaged.A;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -38,6 +41,9 @@ public class EmployeeOffboardingServiceImpl implements IEmployeeOffboardingServi
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private EmployeeFilesMapper filesMapper;
|
||||
|
||||
/**
|
||||
* 查询离职管理
|
||||
*/
|
||||
@@ -58,7 +64,11 @@ public class EmployeeOffboardingServiceImpl implements IEmployeeOffboardingServi
|
||||
Page<EmployeeOffboardingVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
result.getRecords().forEach(item -> {
|
||||
SysUser sysUser = userService.selectUserByIdAndNotDelFlag(item.getUserId());
|
||||
item.setNickName(sysUser.getUserName());
|
||||
item.setNickName(sysUser.getNickName());
|
||||
LambdaQueryWrapper<EmployeeFiles> queryWrapper = Wrappers.lambdaQuery();
|
||||
queryWrapper.eq(EmployeeFiles::getUserId, sysUser.getUserId());
|
||||
List<EmployeeFilesVo> employeeFiles = filesMapper.selectVoList(queryWrapper);
|
||||
item.setFileList(employeeFiles);
|
||||
});
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
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 lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.OaProgressDetailBo;
|
||||
import com.ruoyi.oa.domain.vo.OaProgressDetailVo;
|
||||
import com.ruoyi.oa.domain.OaProgressDetail;
|
||||
import com.ruoyi.oa.mapper.OaProgressDetailMapper;
|
||||
import com.ruoyi.oa.service.IOaProgressDetailService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 进度扩展Service业务层处理
|
||||
*
|
||||
* @author hdka2
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class OaProgressDetailServiceImpl implements IOaProgressDetailService {
|
||||
|
||||
private final OaProgressDetailMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询进度扩展
|
||||
*/
|
||||
@Override
|
||||
public OaProgressDetailVo queryById(Long detailId){
|
||||
return baseMapper.selectVoById(detailId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询进度扩展列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<OaProgressDetailVo> queryPageList(OaProgressDetailBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OaProgressDetail> lqw = buildQueryWrapper(bo);
|
||||
Page<OaProgressDetailVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询进度扩展列表
|
||||
*/
|
||||
@Override
|
||||
public List<OaProgressDetailVo> queryList(OaProgressDetailBo bo) {
|
||||
LambdaQueryWrapper<OaProgressDetail> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<OaProgressDetail> buildQueryWrapper(OaProgressDetailBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OaProgressDetail> lqw = Wrappers.lambdaQuery();
|
||||
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());
|
||||
lqw.eq(bo.getPlanEndDate() != null, OaProgressDetail::getPlanEndDate, bo.getPlanEndDate());
|
||||
lqw.eq(bo.getActualStartDate() != null, OaProgressDetail::getActualStartDate, bo.getActualStartDate());
|
||||
lqw.eq(bo.getActualEndDate() != null, OaProgressDetail::getActualEndDate, bo.getActualEndDate());
|
||||
lqw.eq(bo.getCompletePercent() != null, OaProgressDetail::getCompletePercent, bo.getCompletePercent());
|
||||
lqw.eq(bo.getPlanPayDate() != null, OaProgressDetail::getPlanPayDate, bo.getPlanPayDate());
|
||||
lqw.eq(bo.getPayAmount() != null, OaProgressDetail::getPayAmount, bo.getPayAmount());
|
||||
lqw.eq(bo.getPaidAmount() != null, OaProgressDetail::getPaidAmount, bo.getPaidAmount());
|
||||
lqw.eq(bo.getDetailStatus() != null, OaProgressDetail::getDetailStatus, bo.getDetailStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增进度扩展
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(OaProgressDetailBo bo) {
|
||||
OaProgressDetail add = BeanUtil.toBean(bo, OaProgressDetail.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setDetailId(add.getDetailId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改进度扩展
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(OaProgressDetailBo bo) {
|
||||
OaProgressDetail update = BeanUtil.toBean(bo, OaProgressDetail.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(OaProgressDetail entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除进度扩展
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
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.OaProgressDetail;
|
||||
import com.ruoyi.oa.domain.bo.OaProgressDetailBo;
|
||||
import com.ruoyi.oa.service.IOaProgressDetailService;
|
||||
import com.ruoyi.oa.service.ISysOaProjectService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.OaProgressBo;
|
||||
import com.ruoyi.oa.domain.vo.OaProgressVo;
|
||||
import com.ruoyi.oa.domain.OaProgress;
|
||||
import com.ruoyi.oa.mapper.OaProgressMapper;
|
||||
import com.ruoyi.oa.service.IOaProgressService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 进度管理Service业务层处理
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-04-14
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class OaProgressServiceImpl implements IOaProgressService {
|
||||
|
||||
private final OaProgressMapper baseMapper;
|
||||
|
||||
private final IOaProgressDetailService detailService;
|
||||
|
||||
private final ISysOaProjectService projectService;
|
||||
|
||||
/**
|
||||
* 查询进度管理
|
||||
*/
|
||||
@Override
|
||||
public OaProgressVo queryById(Long progressId){
|
||||
return baseMapper.selectVoById(progressId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询进度管理列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<OaProgressVo> queryPageList(OaProgressBo bo, PageQuery pageQuery) {
|
||||
QueryWrapper<OaProgress> lqw = buildQueryWrapper(bo);
|
||||
Page<OaProgressVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询进度管理列表
|
||||
*/
|
||||
@Override
|
||||
public List<OaProgressVo> queryList(OaProgressBo bo) {
|
||||
QueryWrapper<OaProgress> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private QueryWrapper<OaProgress> buildQueryWrapper(OaProgressBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
QueryWrapper<OaProgress> lqw = Wrappers.query();
|
||||
lqw.eq("op.del_flag", 0);
|
||||
lqw.eq(bo.getProjectId() != null, "op.project_id", bo.getProjectId());
|
||||
lqw.eq(bo.getType() != null, "op.type", bo.getType());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getProgressName()), "op.progress_name", bo.getProgressName());
|
||||
lqw.eq(bo.getParentId() != null, "op.parent_id", bo.getParentId());
|
||||
lqw.eq(bo.getStatus() != null, "op.status", bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增进度管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(OaProgressBo bo) {
|
||||
OaProgress add = BeanUtil.toBean(bo, OaProgress.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
List<OaProgressDetailBo> detailList = bo.getDetailList();
|
||||
for (OaProgressDetailBo detailBo : detailList) {
|
||||
detailBo.setProgressId(add.getProgressId());
|
||||
detailService.insertByBo(detailBo);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改进度管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(OaProgressBo bo) {
|
||||
OaProgress update = BeanUtil.toBean(bo, OaProgress.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(OaProgress entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除进度管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OaProgressDetail> getKeyList() {
|
||||
return baseMapper.getKeyList();
|
||||
}
|
||||
}
|
||||
@@ -206,6 +206,19 @@ public class SysOaProjectServiceImpl implements ISysOaProjectService {
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 进度使用的查询接口
|
||||
* @param bo
|
||||
* @param pageQuery
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<SysOaProjectVo> queryPageList2(SysOaProjectBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysOaProject> lqw = buildQueryWrapper(bo);
|
||||
Page<SysOaProjectVo> result = baseMapper.selectVoAndProgress(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
private QueryWrapper<SysOaProject> buildOutWareQueryWrapper(SysOaWarehouseDetailBo bo) {
|
||||
QueryWrapper<SysOaProject> lqw = Wrappers.query();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getProjectName()), "sop.projec_name", bo.getProjectName());
|
||||
|
||||
@@ -158,10 +158,11 @@ public class SysOaTaskServiceImpl implements ISysOaTaskService {
|
||||
List<Long> workerIdList = new ArrayList<>();
|
||||
// 拿到所有的执行人id列表进行遍历添加
|
||||
if (bo.getWorkerId()!=null) {
|
||||
workerIdList = Arrays.stream( bo.getWorkerIds().split(","))
|
||||
workerIdList = Arrays.stream(bo.getWorkerIds().split(","))
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
}else{
|
||||
// 适配文件上传
|
||||
bo.setBeginTime(new Date());
|
||||
bo.setCompletedTime(new Date());
|
||||
bo.setFinishTime(new Date());
|
||||
|
||||
Reference in New Issue
Block a user