Pārlūkot izejas kodu

招标预公示附件

mycopy123@163.com 4 mēneši atpakaļ
vecāks
revīzija
0c441e5288

+ 3 - 8
src/main/java/com/trs/ggzyexchange/schedul/GcNoticeandfileSchedul.java

@@ -19,6 +19,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
 
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -282,10 +283,7 @@ public class  GcNoticeandfileSchedul  implements Job {
 //                        gcAttachmentQueryWrapper.eq("isshow", "0");//add
                         gcAttachmentQueryWrapper.eq("ASSOCIATION_CODE", record.getSourceDataKey());
                         List<GcAttachment> list = gcAttachmentService.list(gcAttachmentQueryWrapper);
-                        if (attachmentList.size() > 0) {
-                            break;
-                        }
-                        if (!ObjectUtils.isEmpty(list)) {
+                        if (!CollectionUtils.isEmpty(list)) {
                             attachmentList.addAll(list);
                         }
                     }else{
@@ -307,9 +305,6 @@ public class  GcNoticeandfileSchedul  implements Job {
                                         //gcAttachmentQueryWrapper.eq("BID_SECTION_CODE",bidSectionCode);
                                         gcAttachmentQueryWrapper.like("BID_SECTION_CODE",bidSectionCodeClean2);
                                         List<GcAttachment> list = gcAttachmentService.list(gcAttachmentQueryWrapper);
-                                        if(attachmentList.size() > 0){
-                                            break;
-                                        }
                                         if(!ObjectUtils.isEmpty(list)){
                                             attachmentList.addAll(list);
                                         }
@@ -325,7 +320,7 @@ public class  GcNoticeandfileSchedul  implements Job {
 
                     String noticeContent = record.getNoticeContent();
                     String file = "";
-                    if(!ObjectUtils.isEmpty(attachmentList)){
+                    if(!CollectionUtils.isEmpty(attachmentList)){
                         if(attachmentList.size() > 0){
                             file = "<br>附件:<br>";
                         }

+ 39 - 2
src/main/java/com/trs/ggzyexchange/schedul/GcTenderbidfilepublicitySchedul.java

@@ -17,6 +17,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 java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -41,6 +42,9 @@ public class GcTenderbidfilepublicitySchedul implements Job {
     @Autowired
     private GcNoticeandfileService gcNoticeandfileService;
 
+    @Autowired
+    private GcAttachmentService gcAttachmentService;
+
     private Logger logger = LoggerFactory.getLogger(ZfcgGongao.class);
 
     public void queryPageListUpdateEs() throws JsonProcessingException {
@@ -197,7 +201,40 @@ public class GcTenderbidfilepublicitySchedul implements Job {
                 e.printStackTrace();
             }
 
-            String finalNoticeContent = "";
+            List<GcAttachment> attachmentList = new ArrayList<GcAttachment>();
+            //通过标包编号查询对应的附件信息
+            QueryWrapper<GcAttachment> gcAttachmentQueryWrapper = new QueryWrapper<GcAttachment>();
+            gcAttachmentQueryWrapper.eq("ATTACHMENT_SET_CODE","GC_TENDERBIDFILEPUBLICITY");//add
+            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);
+
+
+            /*String finalNoticeContent = "";
             String noticeContent = record.getNoticeContent();
             if(!ObjectUtils.isEmpty(noticeContent)){
                 finalNoticeContent = noticeContent;
@@ -211,7 +248,7 @@ public class GcTenderbidfilepublicitySchedul implements Job {
                 }
                 finalNoticeContent = finalNoticeContent + file;
             }
-            record.setNoticeContent(finalNoticeContent);
+            record.setNoticeContent(finalNoticeContent);*/
 
             TenderDetailsVo aNull = TenderDetailsVoUtils.isNull(record);
             tenderDetailsVos.add(aNull);

+ 0 - 1
src/main/resources/mapper/GcNoticeandfileMapper.xml

@@ -154,7 +154,6 @@
                 and gcn.DATA_TIMESTAMP &gt; #{time}
             </if>
         </where>
-
     </select>
 
     <select id="maxDataTimeStamp" resultType="java.lang.Long">