| | |
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import java.io.*;
|
| | | import java.lang.reflect.Array;
|
| | | import java.net.HttpURLConnection;
|
| | | import java.net.URL;
|
| | | import java.nio.charset.StandardCharsets;
|
| | |
| | |
|
| | |
|
| | | @Transactional
|
| | | // @Scheduled(cron = "0 0 23 * * ?") //每天晚上23点执行一次
|
| | | // @Scheduled(cron = "0 0/2 * * * ? ") // 分钟
|
| | | @Scheduled(cron = "0 0 23 * * ?") //每天晚上23点执行一次
|
| | | // @Scheduled(cron = "0 0/1 * * * ? ") // 分钟
|
| | | //@Scheduled(cron = "0/30 * * * * ?")
|
| | | public void execReportDateSchedule() throws UnsupportedEncodingException {
|
| | | logger.info("【####】上报数据开始...");
|
| | |
| | | con.setRequestProperty("X-Access-Token",token+formatDate.toString());
|
| | | OutputStream os = con.getOutputStream();
|
| | | Map paraMap = new HashMap();
|
| | | paraMap.put("data", AESReportTaskFromWork); /**封装数据*/
|
| | | paraMap.put("data", AESReportTaskFromWork);
|
| | | //组装入参,设置请求体
|
| | | os.write(JSON.toJSONString(paraMap).getBytes());
|
| | | //得到响应码
|
| | |
| | | cjReportCheckRecordFromTaskDTO.setIsDefend(cjRecordFromTask.getDefend());
|
| | | reportRecordFromTaskList.add(cjReportCheckRecordFromTaskDTO);
|
| | | }
|
| | | System.out.println(Arrays.toString(reportRecordFromTaskList.toArray()));
|
| | | //数据加密
|
| | | String AESReportRecordFromTask = encrypt(JSONObject.toJSONString(reportRecordFromTaskList), key.getBytes(), iv.getBytes());
|
| | |
|