소스 검색

合同附件

devops 2 일 전
부모
커밋
138242d56f
1개의 변경된 파일46개의 추가작업 그리고 9개의 파일을 삭제
  1. 46 9
      src/main/java/com/trs/ggzyexchange/schedul/GcPubContractSchedul.java

+ 46 - 9
src/main/java/com/trs/ggzyexchange/schedul/GcPubContractSchedul.java

@@ -7,16 +7,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.trs.ggzyexchange.api.vo.Result;
 import com.trs.ggzyexchange.controller.BaseController;
-import com.trs.ggzyexchange.entity.GcPerformance;
-import com.trs.ggzyexchange.entity.GcPubContract;
-import com.trs.ggzyexchange.entity.ScheduledTash;
-import com.trs.ggzyexchange.entity.TenderDetailsVo;
+import com.trs.ggzyexchange.entity.*;
 import com.trs.ggzyexchange.enums.ClassIfy;
 import com.trs.ggzyexchange.enums.JobLock;
-import com.trs.ggzyexchange.service.GcNoticeandfileService;
-import com.trs.ggzyexchange.service.GcPubContractService;
-import com.trs.ggzyexchange.service.ScheduledTashService;
-import com.trs.ggzyexchange.service.TenderDetailsVoService;
+import com.trs.ggzyexchange.service.*;
 import com.trs.ggzyexchange.utils.TenderDetailsVoUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.quartz.Job;
@@ -26,6 +20,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -62,6 +57,9 @@ public class GcPubContractSchedul implements Job {
     @Autowired
     private ScheduledTashService scheduledTashService;
 
+    @Autowired
+    private GcAttachmentService gcAttachmentService;
+
     public void queryPageListUpdateEs() throws JsonProcessingException {
         /**
          * 查询当前在定时任务表当中的最新时间
@@ -127,7 +125,7 @@ public class GcPubContractSchedul implements Job {
         IPage<TenderDetailsVo> tenderDetailsVoIPage = gcPubContractService.queryGcBidcandidateAllListByTime(page,time);
         for (TenderDetailsVo record : tenderDetailsVoIPage.getRecords()) {
            try {
-               record.setSourceDataKey("pubc-"+record.getSourceDataKey());
+
                record.setNoticeTypeCode(ClassIfy.CONTRACT_PUBLICITY.getCode());
                record.setNoticeTypeName(ClassIfy.CONTRACT_PUBLICITY.getName());
                //电力交易
@@ -141,6 +139,45 @@ public class GcPubContractSchedul implements Job {
                    record.setTransactionTypeCode(ClassIfy.ENGINEERING_CONSTRUCTION.getCode());
                    record.setTransactionTypeName(ClassIfy.ENGINEERING_CONSTRUCTION.getName());
                }
+
+
+
+
+
+               List<GcAttachment> attachmentList = new ArrayList<GcAttachment>();
+
+
+               //通过标包编号查询对应的附件信息
+               QueryWrapper<GcAttachment> gcAttachmentQueryWrapper = new QueryWrapper<GcAttachment>();
+               gcAttachmentQueryWrapper.eq("ASSOCIATION_CODE", record.getSourceDataKey());
+               List<GcAttachment> list = gcAttachmentService.list(gcAttachmentQueryWrapper);
+               if (!CollectionUtils.isEmpty(list)) {
+                   attachmentList.addAll(list);
+               }
+
+               String noticeContent = record.getNoticeContent();
+               String file = "";
+               if(!CollectionUtils.isEmpty(attachmentList)){
+                   if(attachmentList.size() > 0){
+                       file = "<br>附件:<br>";
+                   }
+               }
+               for (GcAttachment gcAttachment : attachmentList) {
+                   try{
+                       String attachmentName = gcAttachment.getAttachmentName();
+                       String url = gcAttachment.getUrl();
+                       file += "<a  target='_blank' style='color: blue' href='"+ url +"'>"+ attachmentName +"</a><br/>";
+                   }catch (Exception e){
+                       e.printStackTrace();
+                   }
+               }
+               //招标文件拼接地址
+               if(!ObjectUtils.isEmpty(noticeContent) && noticeContent != ""){
+                   file = noticeContent + file;
+               }
+               record.setNoticeContent(file);
+               record.setSourceDataKey("pubc-"+record.getSourceDataKey());
+
                record = tenderDetailsVoService.getTenderDetailsVoAllOrther(record);
                TenderDetailsVoUtils.isNull(record);
            }catch (Exception e){