|
|
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.trs.project.entity.*;
|
|
|
import com.trs.project.service.*;
|
|
|
+import com.trs.project.util.Base64Util;
|
|
|
+import com.trs.project.util.GpDESUtils;
|
|
|
import com.trs.project.util.RSAUtils;
|
|
|
import com.xxl.job.core.context.XxlJobHelper;
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
@@ -22,6 +24,7 @@ import org.springframework.web.client.RestTemplate;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -144,6 +147,9 @@ public class SampleXxlJob {
|
|
|
@Autowired
|
|
|
private NmResultNoticeService nmResultNoticeService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ZfcgGongaoService zfcgGongaoService;
|
|
|
+
|
|
|
/**
|
|
|
* 1、工程-招标公告与资格预审公告【GC_NOTICEANDFILE】
|
|
|
*/
|
|
|
@@ -492,6 +498,14 @@ public class SampleXxlJob {
|
|
|
detailMethod(0);//1:post 0:get
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 40、政府采购【GONGAO】
|
|
|
+ */
|
|
|
+ @XxlJob("task_gongao")
|
|
|
+ public void gongao() throws Exception {
|
|
|
+ detailMethod(0);//1:post 0:get
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
private void detailMethod(Integer type){
|
|
|
@@ -623,6 +637,7 @@ public class SampleXxlJob {
|
|
|
}
|
|
|
|
|
|
private void updateDatas(String param , JSONArray jsonArray ) {
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
switch (param)
|
|
|
{
|
|
|
case "GC_NOTICEANDFILE"://1、工程-招标公告与资格预审公告【GC_NOTICEANDFILE】
|
|
|
@@ -898,6 +913,36 @@ public class SampleXxlJob {
|
|
|
XxlJobHelper.log(param+":数据入库="+nmResultNotice.size());
|
|
|
nmResultNoticeService.saveOrUpdateBatch(nmResultNotice);
|
|
|
break;
|
|
|
+ case "ZFCG_GONGAO"://38、政府采购【ZfcgGongao】
|
|
|
+ List<Gongao> gongaoList = JSONObject.parseArray(jsonArray.toJSONString(), Gongao.class);
|
|
|
+ List<ZfcgGongao> gongaoDbList = new ArrayList<>();
|
|
|
+ for(Gongao gongao : gongaoList){
|
|
|
+ ZfcgGongao zfcgGongao = new ZfcgGongao();
|
|
|
+ try{
|
|
|
+ zfcgGongao.setNoticeTime((gongao.getNoticeTime()));
|
|
|
+ zfcgGongao.setNoticeName(gongao.getNoticeName());
|
|
|
+ zfcgGongao.setNoticeGuid(gongao.getNoticeGuid());
|
|
|
+ zfcgGongao.setNoticeType(gongao.getNoticeType());
|
|
|
+ zfcgGongao.setRegionName(gongao.getRegionName());
|
|
|
+ zfcgGongao.setSourceDataKey(gongao.getId());
|
|
|
+ zfcgGongao.setRegionCode(gongao.getRegionCode());
|
|
|
+ zfcgGongao.setDataTimestamp(Long.parseLong(simpleDateFormat.format(new Date())));
|
|
|
+ String regionCode = gongao.getRegionCode();
|
|
|
+ if(!"1504".equals(regionCode.substring(0,4))){
|
|
|
+ zfcgGongao.setNoticeContent(Base64Util.decode(gongao.getNoticeContent()));
|
|
|
+ }else {
|
|
|
+ zfcgGongao.setNoticeContent(gongao.getNoticeContent());
|
|
|
+
|
|
|
+ }
|
|
|
+ gongaoDbList.add(zfcgGongao);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ logger.info(param+":数据入库="+gongaoDbList.size());
|
|
|
+ XxlJobHelper.log(param+":数据入库="+gongaoDbList.size());
|
|
|
+ zfcgGongaoService.saveOrUpdateBatch(gongaoDbList);
|
|
|
+ break;
|
|
|
default:
|
|
|
}
|
|
|
}
|