Browse Source

发布时间调整

mycopy123@163.com 3 months ago
parent
commit
2d6f26feb7

+ 96 - 4
src/main/java/com/trs/ggzyexchange/schedul/GcBidpublicitySchedul.java

@@ -11,10 +11,7 @@ import com.trs.ggzyexchange.controller.BaseController;
 import com.trs.ggzyexchange.entity.*;
 import com.trs.ggzyexchange.enums.ClassIfy;
 import com.trs.ggzyexchange.enums.JobLock;
-import com.trs.ggzyexchange.service.GcBidpublicityService;
-import com.trs.ggzyexchange.service.GcNoticeandfileService;
-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;
@@ -63,6 +60,9 @@ public class GcBidpublicitySchedul  implements Job {
     @Autowired
     private ScheduledTashService scheduledTashService;
 
+    @Autowired
+    private GcAttachmentService gcAttachmentService;
+
     public void queryPageListUpdateEs() throws JsonProcessingException {
         /**
          * 查询当前在定时任务表当中的最新时间
@@ -142,6 +142,98 @@ public class GcBidpublicitySchedul  implements Job {
                 record.setTransactionTypeCode(ClassIfy.ENGINEERING_CONSTRUCTION.getCode());
                 record.setTransactionTypeName(ClassIfy.ENGINEERING_CONSTRUCTION.getName());
                 record = tenderDetailsVoService.getTenderDetailsVoAllOrther(record);
+
+
+
+                String bidSectionCodes = record.getBidSectionCodes();
+                if(!ObjectUtils.isEmpty(bidSectionCodes)) {
+                    int i1 = bidSectionCodes.indexOf(",");
+                    int i2 = bidSectionCodes.indexOf(";");
+                    int i3 = bidSectionCodes.indexOf("<br>");
+                    int i4 = bidSectionCodes.indexOf("ltbrgt");
+                    String splitBidSectionCode = null;
+                    String[] split = null;
+                    boolean flag = false;
+                    if (i1 > 0) {
+                        splitBidSectionCode = bidSectionCodes.split(",")[0];
+                        split = bidSectionCodes.split(",");
+                        flag = true;
+                    }
+                    if (i2 > 0) {
+                        splitBidSectionCode = bidSectionCodes.split(";")[0];
+                        split = bidSectionCodes.split(";");
+                        flag = true;
+                    }
+                    if (i3 > 0) {
+                        splitBidSectionCode = bidSectionCodes.split("<br>")[0];
+                        split = bidSectionCodes.split("<br>");
+                        flag = true;
+                    }
+                    if (i4 > 0) {
+                        splitBidSectionCode = bidSectionCodes.split("ltbrgt")[0];
+                        split = bidSectionCodes.split("ltbrgt");
+                        flag = true;
+                    }
+                    if (!flag) {
+                        splitBidSectionCode = bidSectionCodes;
+                        split = bidSectionCodes.split(",");
+                    }
+
+                    List<GcAttachment> attachmentList = new ArrayList<GcAttachment>();
+                    if (!ObjectUtils.isEmpty(split)) {
+                        if (split.length >= 1) {
+                            for (String bidSectionCode : split) {
+                                try {
+                                    String bidSectionCodeClean = bidSectionCode.replaceAll(">", "").replaceAll("<", "");
+                                    String bidSectionCodeClean2 = bidSectionCodeClean.replaceAll("gt", "").replaceAll("lt", "");
+                                    //通过标包编号查询对应的附件信息
+                                    QueryWrapper<GcAttachment> gcAttachmentQueryWrapper = new QueryWrapper<GcAttachment>();
+                                    gcAttachmentQueryWrapper.eq("ATTACHMENT_SET_CODE", "WIN_BID_NOTICE");//add
+                                    gcAttachmentQueryWrapper.eq("isshow", "0");//add
+                                    //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);
+                                    }
+
+                                } catch (Exception e) {
+                                    e.printStackTrace();
+                                }
+                            }
+                        }
+                    }
+                    String noticeContent = record.getNoticeContent();
+                    String file = "";
+                    if (!ObjectUtils.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);
+                }
+
+
+
+
+
+
                 TenderDetailsVoUtils.isNull(record);
             }catch (Exception e){
                 e.printStackTrace();

+ 6 - 1
src/main/java/com/trs/ggzyexchange/schedul/GcNoticeandfileSchedul.java

@@ -267,7 +267,12 @@ public class  GcNoticeandfileSchedul  implements Job {
                                     String bidSectionCodeClean2 = bidSectionCodeClean.replaceAll("gt","").replaceAll("lt","");
                                     //通过标包编号查询对应的附件信息
                                     QueryWrapper<GcAttachment> gcAttachmentQueryWrapper = new QueryWrapper<GcAttachment>();
-                                    gcAttachmentQueryWrapper.eq("ATTACHMENT_SET_CODE","TENDER_NOTICE");//add
+                                    if("2".equals(record.getNoticeNature())){
+                                        gcAttachmentQueryWrapper.eq("ATTACHMENT_SET_CODE","CHANGE_NOTICE");//add
+                                    }else{
+                                        gcAttachmentQueryWrapper.eq("ATTACHMENT_SET_CODE","TENDER_NOTICE");//add
+                                    }
+
                                     //gcAttachmentQueryWrapper.eq("isshow", "0");//add
                                     //gcAttachmentQueryWrapper.eq("BID_SECTION_CODE",bidSectionCode);
                                     gcAttachmentQueryWrapper.like("BID_SECTION_CODE",bidSectionCodeClean2);

+ 4 - 2
src/main/java/com/trs/ggzyexchange/utils/TenderDetailsVoUtils.java

@@ -45,7 +45,7 @@ public class TenderDetailsVoUtils {
             noticeSendTime = CommonConstant.SET_TIME;
         }
 
-        String createDate = tenderDetailsVo.getCreateDate();
+        /*String createDate = tenderDetailsVo.getCreateDate();
         try {
             createDate = passDate(createDate);
         } catch (ParseException e) {
@@ -60,7 +60,9 @@ public class TenderDetailsVoUtils {
             }
         }else {
             tenderDetailsVo.setNoticeSendTime(noticeSendTime);
-        }
+        }*/
+
+        tenderDetailsVo.setNoticeSendTime(noticeSendTime);
 
         String regionCode = tenderDetailsVo.getRegionCode();
         tenderDetailsVo.setRegionCode(StrUtil.nullToEmpty(regionCode));