|
@@ -1,20 +1,18 @@
|
|
|
package cn.cslg.report.service.business.InvalidReReport;
|
|
|
|
|
|
import cn.cslg.report.common.model.dto.ProofAddNewDTO;
|
|
|
-import cn.cslg.report.common.model.dto.UploadFileDTO;
|
|
|
import cn.cslg.report.common.model.dto.invalidReReport.ProofQueryDTO;
|
|
|
import cn.cslg.report.common.model.vo.PersonnelVO;
|
|
|
import cn.cslg.report.common.model.vo.invalidReReport.ProofVO;
|
|
|
-import cn.cslg.report.common.utils.*;
|
|
|
+import cn.cslg.report.common.utils.CacheUtils;
|
|
|
+import cn.cslg.report.common.utils.DataUtils;
|
|
|
+import cn.cslg.report.common.utils.Response;
|
|
|
import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
|
|
|
-import cn.cslg.report.entity.Template;
|
|
|
+import cn.cslg.report.common.utils.ThrowException;
|
|
|
import cn.cslg.report.entity.invalidReReport.Proof;
|
|
|
import cn.cslg.report.mapper.InvalidReReport.ProofMapper;
|
|
|
-import cn.cslg.report.mapper.TemplateMapper;
|
|
|
import cn.cslg.report.service.business.ReportFileService;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.Query;
|
|
|
-import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
@@ -24,7 +22,6 @@ import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
-import javax.mail.Multipart;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -85,44 +82,43 @@ public class ProofService extends ServiceImpl<ProofMapper, Proof> {
|
|
|
|
|
|
/**
|
|
|
* 分页查询证据
|
|
|
+ *
|
|
|
* @param proofAddNewDTO
|
|
|
* @return
|
|
|
*/
|
|
|
- public String queryProof(ProofQueryDTO proofAddNewDTO){
|
|
|
- Integer reportId =proofAddNewDTO.getReportId();
|
|
|
- Integer current =proofAddNewDTO.getCurrent();
|
|
|
- Integer size =proofAddNewDTO.getSize();
|
|
|
- String orderType =proofAddNewDTO.getOrderType();
|
|
|
- if(reportId==null||current==null||size==null){
|
|
|
- return "" ;
|
|
|
+ public String queryProof(ProofQueryDTO proofAddNewDTO) {
|
|
|
+ Integer reportId = proofAddNewDTO.getReportId();
|
|
|
+ Integer current = proofAddNewDTO.getCurrent();
|
|
|
+ Integer size = proofAddNewDTO.getSize();
|
|
|
+ String orderType = proofAddNewDTO.getOrderType();
|
|
|
+ if (reportId == null || current == null || size == null) {
|
|
|
+ return "";
|
|
|
}
|
|
|
- LambdaQueryWrapper<Proof> wrapper =new LambdaQueryWrapper<>();
|
|
|
- wrapper.eq(Proof::getReportId,reportId);
|
|
|
- if("desc".equals(orderType)){
|
|
|
+ LambdaQueryWrapper<Proof> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(Proof::getReportId, reportId);
|
|
|
+ if ("desc".equals(orderType)) {
|
|
|
wrapper.orderByDesc(Proof::getSort);
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
wrapper.orderByAsc(Proof::getSort);
|
|
|
}
|
|
|
- List<Proof> proofs =this.page(new Page<>(current,size),wrapper).getRecords();
|
|
|
- List<ProofVO> proofVOS =this.loadProof(proofs);
|
|
|
+ List<Proof> proofs = this.page(new Page<>(current, size), wrapper).getRecords();
|
|
|
+ List<ProofVO> proofVOS = this.loadProof(proofs);
|
|
|
long count = this.count(wrapper);
|
|
|
return Response.success(proofVOS, DataUtils.setPageColumn(size, current, Math.toIntExact(count)));
|
|
|
}
|
|
|
|
|
|
- private List<ProofVO> loadProof(List<Proof> proofs){
|
|
|
- List<ProofVO> proofVOS =new ArrayList<>();
|
|
|
- proofs.forEach(item->{
|
|
|
- ProofVO proofVO =new ProofVO();
|
|
|
- if(item.getProofType().equals(1)) {
|
|
|
+ private List<ProofVO> loadProof(List<Proof> proofs) {
|
|
|
+ List<ProofVO> proofVOS = new ArrayList<>();
|
|
|
+ proofs.forEach(item -> {
|
|
|
+ ProofVO proofVO = new ProofVO();
|
|
|
+ if (item.getProofType().equals(1)) {
|
|
|
proofVO.setProofType("专利文献");
|
|
|
proofVO.setProofName(item.getPatentNo());
|
|
|
- }
|
|
|
- else if(item.getProofType().equals(2)){
|
|
|
+ } else if (item.getProofType().equals(2)) {
|
|
|
proofVO.setProofType("非专利文献");
|
|
|
proofVO.setProofName(item.getProofName());
|
|
|
}
|
|
|
- proofVO.setSortStr("D"+item.getSort());
|
|
|
+ proofVO.setSortStr("D" + item.getSort());
|
|
|
proofVOS.add(proofVO);
|
|
|
});
|
|
|
return proofVOS;
|