|
@@ -6,8 +6,10 @@ import com.aliyun.oss.OSSClient;
|
|
|
import com.aliyun.oss.model.OSSObject;
|
|
|
import com.aliyun.oss.model.SimplifiedObjectMeta;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
import com.jeeplus.sys.utils.UserUtils;
|
|
|
import com.jeeplus.test.oss.domain.WorkAttachment;
|
|
@@ -93,9 +95,9 @@ public class OssService extends ServiceImpl<OssServiceMapper,WorkAttachment> {
|
|
|
//排序赋值
|
|
|
workAttachment.setSort(i);
|
|
|
//基础信息赋值
|
|
|
- workAttachment.setCreateBy(id);
|
|
|
+ workAttachment.getCreateBy().setId(id);
|
|
|
workAttachment.setCreateDate(new Date());
|
|
|
- workAttachment.setUpdateBy(id);
|
|
|
+ workAttachment.getUpdateBy().setId(id);
|
|
|
workAttachment.setUpdateDate(new Date());
|
|
|
workAttachment.setDelFlag(0);
|
|
|
i++;
|
|
@@ -140,18 +142,14 @@ public class OssService extends ServiceImpl<OssServiceMapper,WorkAttachment> {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<WorkAttachment> findFileList(String attachmentId) {
|
|
|
+
|
|
|
log.info("文件查询开始,入参:{}" , attachmentId);
|
|
|
- LambdaQueryWrapper<WorkAttachment> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- lambdaQueryWrapper.eq(WorkAttachment::getAttachmentId, attachmentId);
|
|
|
- lambdaQueryWrapper.orderByAsc(WorkAttachment::getSort);
|
|
|
- List<WorkAttachment> list = ossServiceMapper.selectList(lambdaQueryWrapper);
|
|
|
+ QueryWrapper<WorkAttachment> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq ("a.attachment_id", attachmentId );
|
|
|
+ List<WorkAttachment> list = ossServiceMapper.findList(queryWrapper);
|
|
|
//创建人和文件名称处理
|
|
|
if (CollectionUtil.isNotEmpty(list)) {
|
|
|
temporaryUrl(list);
|
|
|
- for (WorkAttachment workAttachment : list) {
|
|
|
- UserDTO userDTO = UserUtils.get(workAttachment.getCreateBy());
|
|
|
- workAttachment.setCreateBy(userDTO.getName());
|
|
|
- }
|
|
|
}
|
|
|
log.info("文件查询结束,查询结果:{}" , JSONObject.toJSONString(list));
|
|
|
return list;
|