|
@@ -26,9 +26,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
@@ -72,6 +74,9 @@ public class ReferencesService extends ServiceImpl<ReferencesMapper, References>
|
|
throw new UnLoginException("未登录");
|
|
throw new UnLoginException("未登录");
|
|
}
|
|
}
|
|
References references = new References();
|
|
References references = new References();
|
|
|
|
+ if (StringUtils.isEmpty(referencesDTO.getFileGuid())) {
|
|
|
|
+ throw new XiaoShiException("附件不得为空");
|
|
|
|
+ }
|
|
BeanUtils.copyProperties(referencesDTO, references);
|
|
BeanUtils.copyProperties(referencesDTO, references);
|
|
references.setCreateId(personnelVO.getId());
|
|
references.setCreateId(personnelVO.getId());
|
|
references.insert();
|
|
references.insert();
|
|
@@ -205,13 +210,15 @@ public class ReferencesService extends ServiceImpl<ReferencesMapper, References>
|
|
referencesVO.setProjectName(project.getName());
|
|
referencesVO.setProjectName(project.getName());
|
|
}
|
|
}
|
|
|
|
|
|
- SystemFile systemFile = systemFiles
|
|
|
|
- .stream()
|
|
|
|
- .filter(file -> file.getGuid() != null && file.getGuid().equals(item.getFileGuid()))
|
|
|
|
- .findFirst()
|
|
|
|
- .orElse(null);
|
|
|
|
- if (systemFile != null) {
|
|
|
|
- referencesVO.setType(systemFile.getType());
|
|
|
|
|
|
+ if (!CollectionUtils.isEmpty(systemFiles)) {
|
|
|
|
+ SystemFile systemFile = systemFiles
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(file -> file.getGuid() != null && file.getGuid().equals(item.getFileGuid()))
|
|
|
|
+ .findFirst()
|
|
|
|
+ .orElse(null);
|
|
|
|
+ if (systemFile != null) {
|
|
|
|
+ referencesVO.setType(systemFile.getType());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
Personnel personnel = personnels
|
|
Personnel personnel = personnels
|