修复文件ossbug全部改用ossId二次请求方式
This commit is contained in:
@@ -42,7 +42,6 @@ public class SysOaDetailController extends BaseController {
|
||||
/**
|
||||
* 查询进出账明细列表
|
||||
*/
|
||||
@SaCheckPermission("oa:detail:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysOaDetailVo> list(SysOaDetailBo bo, PageQuery pageQuery) {
|
||||
return iSysOaDetailService.queryPageList(bo, pageQuery);
|
||||
@@ -51,7 +50,6 @@ public class SysOaDetailController extends BaseController {
|
||||
/**
|
||||
* 导出进出账明细列表
|
||||
*/
|
||||
@SaCheckPermission("oa:detail:export")
|
||||
@Log(title = "进出账明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(SysOaDetailBo bo, HttpServletResponse response) {
|
||||
@@ -64,7 +62,6 @@ public class SysOaDetailController extends BaseController {
|
||||
*
|
||||
* @param detailId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa:detail:query")
|
||||
@GetMapping("/{detailId}")
|
||||
public R<SysOaDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long detailId) {
|
||||
@@ -74,7 +71,6 @@ public class SysOaDetailController extends BaseController {
|
||||
/**
|
||||
* 新增进出账明细
|
||||
*/
|
||||
@SaCheckPermission("oa:detail:add")
|
||||
@Log(title = "进出账明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
@@ -85,7 +81,6 @@ public class SysOaDetailController extends BaseController {
|
||||
/**
|
||||
* 修改进出账明细
|
||||
*/
|
||||
@SaCheckPermission("oa:detail:edit")
|
||||
@Log(title = "进出账明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
@@ -98,7 +93,6 @@ public class SysOaDetailController extends BaseController {
|
||||
*
|
||||
* @param detailIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa:detail:remove")
|
||||
@Log(title = "进出账明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{detailIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
|
||||
@@ -116,4 +116,8 @@ public class EmployeeOnboardingBo extends BaseEntity {
|
||||
private String nickName;
|
||||
|
||||
private Long status;
|
||||
|
||||
private String checkInFile;
|
||||
private String registerFile;
|
||||
private String trainFile;
|
||||
}
|
||||
|
||||
@@ -49,5 +49,7 @@ public class EmployeeFilesVo {
|
||||
*/
|
||||
private Date uploadTime;
|
||||
|
||||
private Long ossId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -138,5 +138,4 @@ public class SysOaContractVo {
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
private List<SysOss> fileList;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import com.ruoyi.oa.domain.SysOaDetail;
|
||||
import com.ruoyi.oa.domain.SysOaFinance;
|
||||
import com.ruoyi.oa.domain.SysOaProject;
|
||||
import com.ruoyi.system.domain.SysOss;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -241,7 +241,6 @@ public class SysOaProjectVo {
|
||||
*/
|
||||
private Double prePay;
|
||||
|
||||
private List<SysOss> fileList;
|
||||
/**
|
||||
* 代号类型
|
||||
*/
|
||||
|
||||
@@ -111,6 +111,4 @@ public class SysOaTaskItemVo {
|
||||
|
||||
|
||||
private String nickName;
|
||||
|
||||
private List<SysOss> itemFileList;
|
||||
}
|
||||
|
||||
@@ -211,6 +211,4 @@ public class SysOaTaskVo {
|
||||
private List<SysOaTaskItemVo> taskItemVoList;
|
||||
|
||||
private String files;
|
||||
|
||||
private List<SysOss> fileList;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.oa.domain.vo.FileUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件档案管理Mapper接口
|
||||
*
|
||||
@@ -23,4 +25,6 @@ public interface EmployeeFilesMapper extends BaseMapperPlus<EmployeeFilesMapper,
|
||||
Page<FileUser> selectFileUserVoPage(Page<Object> build,@Param(Constants.WRAPPER) Wrapper<SysUser> userLambdaQueryWrapper);
|
||||
|
||||
void deleteByUserId(Long userId);
|
||||
|
||||
List<EmployeeFilesVo> selectVoListPlus(@Param(Constants.WRAPPER) LambdaQueryWrapper<EmployeeFiles> employeeFilesLambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class EmployeeFilesServiceImpl implements IEmployeeFilesService {
|
||||
@Override
|
||||
public Boolean insertByBo(UserFilesVo userFilesVo) {
|
||||
// 删除该用户所有的文件,重新填入
|
||||
// baseMapper.deleteByUserId(userFilesVo.getUserId()); 似乎不用删
|
||||
// baseMapper.deleteByUserId(userFilesVo.getUserId());
|
||||
List<String> fileUrls = new ArrayList<>();
|
||||
if (userFilesVo.getUserId() != null){
|
||||
fileUrls = Arrays.stream( userFilesVo.getFiles().split(","))
|
||||
@@ -93,6 +93,7 @@ public class EmployeeFilesServiceImpl implements IEmployeeFilesService {
|
||||
|
||||
fileUrls.forEach(file -> {
|
||||
EmployeeFiles employeeFiles = new EmployeeFiles();
|
||||
// 此处的filePath已经改为ossId
|
||||
employeeFiles.setFilePath(file);
|
||||
employeeFiles.setUserId(userFilesVo.getUserId());
|
||||
baseMapper.insert(employeeFiles);
|
||||
@@ -138,7 +139,7 @@ public class EmployeeFilesServiceImpl implements IEmployeeFilesService {
|
||||
EmployeeFilesBo employeeFilesBo = new EmployeeFilesBo();
|
||||
employeeFilesBo.setUserId(userId);
|
||||
LambdaQueryWrapper<EmployeeFiles> employeeFilesLambdaQueryWrapper = buildQueryWrapper(employeeFilesBo);
|
||||
List<EmployeeFilesVo> list = baseMapper.selectVoList(employeeFilesLambdaQueryWrapper);
|
||||
List<EmployeeFilesVo> list = baseMapper.selectVoListPlus(employeeFilesLambdaQueryWrapper);
|
||||
userFilesVo.setFileList(list);
|
||||
return userFilesVo;
|
||||
}
|
||||
|
||||
@@ -9,16 +9,22 @@ 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.EmployeeOnboarding;
|
||||
import com.ruoyi.oa.domain.bo.EmployeeOnboardingBo;
|
||||
import com.ruoyi.oa.domain.vo.EmployeeFilesVo;
|
||||
import com.ruoyi.oa.domain.vo.EmployeeOnboardingVo;
|
||||
import com.ruoyi.oa.domain.vo.FileUser;
|
||||
import com.ruoyi.oa.domain.vo.UserFilesVo;
|
||||
import com.ruoyi.oa.mapper.EmployeeOnboardingMapper;
|
||||
import com.ruoyi.oa.service.IEmployeeFilesService;
|
||||
import com.ruoyi.oa.service.IEmployeeOnboardingService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
@@ -38,6 +44,9 @@ public class EmployeeOnboardingServiceImpl implements IEmployeeOnboardingService
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private IEmployeeFilesService employeeFilesService;
|
||||
|
||||
/**
|
||||
* 查询入职管理
|
||||
*/
|
||||
@@ -108,6 +117,24 @@ public class EmployeeOnboardingServiceImpl implements IEmployeeOnboardingService
|
||||
EmployeeOnboarding update = BeanUtil.toBean(bo, EmployeeOnboarding.class);
|
||||
validEntityBeforeSave(update);
|
||||
|
||||
StringBuilder files = new StringBuilder();
|
||||
if (bo.getCheckInFile() != null) {
|
||||
files.append(bo.getCheckInFile())
|
||||
.append(",");
|
||||
|
||||
}
|
||||
if (bo.getRegisterFile() != null) {
|
||||
files.append(bo.getRegisterFile())
|
||||
.append(",");
|
||||
}
|
||||
if (bo.getTrainFile() != null) {
|
||||
files.append(bo.getTrainFile())
|
||||
.append(",");
|
||||
}
|
||||
UserFilesVo filesVo = new UserFilesVo();
|
||||
filesVo.setUserId(bo.getUserId());
|
||||
filesVo.setFiles(String.valueOf(files));
|
||||
employeeFilesService.insertByBo(filesVo);
|
||||
return baseMapper.updateByUserId(update);
|
||||
}
|
||||
|
||||
|
||||
@@ -151,9 +151,11 @@ public class SysOaTaskServiceImpl implements ISysOaTaskService {
|
||||
List<Long> workerIdList = new ArrayList<>();
|
||||
// 拿到所有的执行人id列表进行遍历添加
|
||||
if (bo.getWorkerIds()!=null) {
|
||||
System.out.println(bo.getWorkerIds());
|
||||
workerIdList = Arrays.stream(bo.getWorkerIds().split(","))
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
System.out.println(workerIdList);
|
||||
}else{
|
||||
// 适配文件上传
|
||||
bo.setBeginTime(new Date());
|
||||
@@ -166,13 +168,9 @@ public class SysOaTaskServiceImpl implements ISysOaTaskService {
|
||||
for (Long workerId : workerIdList) {
|
||||
SysOaTask add = BeanUtil.toBean(bo, SysOaTask.class);
|
||||
add.setCreateUserId(LoginHelper.getUserId());
|
||||
validEntityBeforeSave(add);
|
||||
add.setOriginFinishTime(add.getFinishTime());
|
||||
add.setWorkerId(workerId);
|
||||
flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setTaskId(add.getTaskId());
|
||||
}
|
||||
// 判断是否为报工模式
|
||||
if (bo.getStatus()==1L){
|
||||
// 这里新增item数据,为单个条目
|
||||
|
||||
Reference in New Issue
Block a user