|  |  | @ -1,6 +1,7 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  | package com.glxp.udidl.admin.service.dataSync; |  |  |  | package com.glxp.udidl.admin.service.dataSync; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import cn.hutool.core.bean.BeanUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.core.util.StrUtil; |  |  |  | import cn.hutool.core.util.StrUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import cn.hutool.json.JSONUtil; |  |  |  | import cn.hutool.json.JSONUtil; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.alibaba.fastjson.JSON; |  |  |  | import com.alibaba.fastjson.JSON; | 
			
		
	
	
		
		
			
				
					|  |  | @ -11,10 +12,7 @@ import com.glxp.udidl.admin.entity.udi.ProductInfoEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.entity.udid.Device; |  |  |  | import com.glxp.udidl.admin.entity.udid.Device; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.entity.udid.JobLog; |  |  |  | import com.glxp.udidl.admin.entity.udid.JobLog; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.entity.udid.TokenEntity; |  |  |  | import com.glxp.udidl.admin.entity.udid.TokenEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.req.udid.DeviceRequest; |  |  |  | import com.glxp.udidl.admin.req.udid.*; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.req.udid.DownloadDiRequest; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.req.udid.DownloadHistoryRequest; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.req.udid.TokenRequest; |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.res.BaseResponse; |  |  |  | import com.glxp.udidl.admin.res.BaseResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.res.udid.DataSetHistoryResult; |  |  |  | import com.glxp.udidl.admin.res.udid.DataSetHistoryResult; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.res.udid.DataSetResult; |  |  |  | import com.glxp.udidl.admin.res.udid.DataSetResult; | 
			
		
	
	
		
		
			
				
					|  |  | @ -24,11 +22,9 @@ import com.glxp.udidl.admin.service.info.CompanyService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.service.inout.DeviceService; |  |  |  | import com.glxp.udidl.admin.service.inout.DeviceService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.service.inout.ProductInfoService; |  |  |  | import com.glxp.udidl.admin.service.inout.ProductInfoService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.service.udi.JobLogService; |  |  |  | import com.glxp.udidl.admin.service.udi.JobLogService; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.util.DateUtil; |  |  |  | import com.glxp.udidl.admin.util.*; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.util.HttpClient; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.util.RedisUtil; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.udidl.admin.util.ResultVOUtils; |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | import lombok.extern.slf4j.Slf4j; |  |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import org.apache.commons.lang3.exception.ExceptionUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.stereotype.Service; |  |  |  | import org.springframework.stereotype.Service; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | import javax.annotation.Resource; |  |  |  | import javax.annotation.Resource; | 
			
		
	
	
		
		
			
				
					|  |  | @ -46,14 +42,9 @@ import java.util.stream.Collectors; | 
			
		
	
		
		
			
				
					
					|  |  |  | public class DeviceDownloadService { |  |  |  | public class DeviceDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     private String token = ""; |  |  |  |     private String token = ""; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     private int reCount = 0; |  |  |  |     private int reCount = 0; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     private CompanyEntity companyEntity; |  |  |  |     private CompanyEntity companyEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     private String url = "sharing/get"; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     private CompanyService companyService; |  |  |  |     private CompanyService companyService; | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
	
		
		
			
				
					|  |  | @ -73,6 +64,10 @@ public class DeviceDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     private static List<Map<String, String>> tokenList = new ArrayList<>(); |  |  |  |     private static List<Map<String, String>> tokenList = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     OkHttpCli okHttpCli; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     /** |  |  |  |     /** | 
			
		
	
		
		
			
				
					
					|  |  |  |      * 获取当前token |  |  |  |      * 获取当前token | 
			
		
	
		
		
			
				
					
					|  |  |  |      * |  |  |  |      * | 
			
		
	
	
		
		
			
				
					|  |  | @ -86,8 +81,10 @@ public class DeviceDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  |             TokenRequest tokenRequest = new TokenRequest(); |  |  |  |             TokenRequest tokenRequest = new TokenRequest(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             tokenRequest.setAppId(companyEntity.getAppId()); |  |  |  |             tokenRequest.setAppId(companyEntity.getAppId()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             tokenRequest.setAppSecret(companyEntity.getAppSecret()); |  |  |  |             tokenRequest.setAppSecret(companyEntity.getAppSecret()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             tokenRequest.setTyshxydm(companyEntity.getTyshxydm()); |  |  |  |             tokenRequest.setTYSHXYDM(companyEntity.getTyshxydm()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             String response = HttpClient.post("token/get", tokenRequest); |  |  |  |             String json = JSONUtil.toJsonStr(tokenRequest); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             String response = okHttpCli.doPostJson(UdidConfig.apiUrl + "token/get", json); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | //            String response = HttpClient.post("token/get", tokenRequest);
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             TokenEntity tokenEntity = (TokenEntity) JSONObject.parseObject(response, TokenEntity.class); |  |  |  |             TokenEntity tokenEntity = (TokenEntity) JSONObject.parseObject(response, TokenEntity.class); | 
			
		
	
		
		
			
				
					
					|  |  |  |             token = tokenEntity.getAccessToken(); |  |  |  |             token = tokenEntity.getAccessToken(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             redisUtil.setEx("UDISYNC_TOKEN", token, 1 * 60 * 60 * 6); |  |  |  |             redisUtil.setEx("UDISYNC_TOKEN", token, 1 * 60 * 60 * 6); | 
			
		
	
	
		
		
			
				
					|  |  | @ -97,7 +94,8 @@ public class DeviceDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public String getTokenNow(TokenRequest tokenRequest) { |  |  |  |     public String getTokenNow(TokenRequest tokenRequest) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         try { |  |  |  |         try { | 
			
		
	
		
		
			
				
					
					|  |  |  |             String response = HttpClient.post("token/get", tokenRequest); |  |  |  |             String json = JSONUtil.toJsonStr(tokenRequest); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             String response = okHttpCli.doPostJson(UdidConfig.apiUrl + "token/get", json); | 
			
		
	
		
		
			
				
					
					|  |  |  |             TokenEntity tokenEntity = (TokenEntity) JSONObject.parseObject(response, TokenEntity.class); |  |  |  |             TokenEntity tokenEntity = (TokenEntity) JSONObject.parseObject(response, TokenEntity.class); | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (tokenEntity.getReturnCode() == 1) { |  |  |  |             if (tokenEntity.getReturnCode() == 1) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 token = tokenEntity.getAccessToken(); |  |  |  |                 token = tokenEntity.getAccessToken(); | 
			
		
	
	
		
		
			
				
					|  |  | @ -107,6 +105,7 @@ public class DeviceDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         } catch (Exception e) { |  |  |  |         } catch (Exception e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             log.error(ExceptionUtils.getStackTrace(e)); | 
			
		
	
		
		
			
				
					
					|  |  |  |             log.error("国家库网络服务器异常", e); |  |  |  |             log.error("国家库网络服务器异常", e); | 
			
		
	
		
		
			
				
					
					|  |  |  |             return "国家库网络服务器异常!"; |  |  |  |             return "国家库网络服务器异常!"; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
	
		
		
			
				
					|  |  | @ -122,12 +121,13 @@ public class DeviceDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  |     public DataSetSingleResult downloadByDi(String deviceId) { |  |  |  |     public DataSetSingleResult downloadByDi(String deviceId) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         DataSetSingleResult result = new DataSetSingleResult(); |  |  |  |         DataSetSingleResult result = new DataSetSingleResult(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         DownloadDiRequest downloadDiRequest = new DownloadDiRequest(); |  |  |  |         DownloadDiRequest downloadDiRequest = new DownloadDiRequest(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         downloadDiRequest.setAccessToken(getToken()); |  |  |  |         downloadDiRequest.setZXXSDYCPBS(deviceId); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         downloadDiRequest.setPrimaryDeviceId(deviceId); |  |  |  |         String json = JSONUtil.toJsonStr(downloadDiRequest); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         String response = ""; |  |  |  |         String response = ""; | 
			
		
	
		
		
			
				
					
					|  |  |  |         try { |  |  |  |         try { | 
			
		
	
		
		
			
				
					
					|  |  |  |             response = HttpClient.post("sharing/single", downloadDiRequest); |  |  |  |             response = okHttpCli.doPostJson(UdidConfig.apiUrl + "sharing/single", json, getHeaders()); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         } catch (Exception e) { |  |  |  |         } catch (Exception e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             log.error(ExceptionUtils.getStackTrace(e)); | 
			
		
	
		
		
			
				
					
					|  |  |  |             log.error("下载产品标识详情数据异常,响应结果:{}", response); |  |  |  |             log.error("下载产品标识详情数据异常,响应结果:{}", response); | 
			
		
	
		
		
			
				
					
					|  |  |  |             result.setReturnCode(-1); |  |  |  |             result.setReturnCode(-1); | 
			
		
	
		
		
			
				
					
					|  |  |  |             result.setReturnMsg(e.getMessage()); |  |  |  |             result.setReturnMsg(e.getMessage()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -136,6 +136,14 @@ public class DeviceDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  |         return JSONObject.parseObject(response, DataSetSingleResult.class); |  |  |  |         return JSONObject.parseObject(response, DataSetSingleResult.class); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public String[] getHeaders() { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         List<String> header = new ArrayList<>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         header.add("accessToken"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         header.add(getToken()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         String[] strArray = new String[header.size()]; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return header.toArray(strArray); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     /** |  |  |  |     /** | 
			
		
	
		
		
			
				
					
					|  |  |  |      * 获取单条数据 |  |  |  |      * 获取单条数据 | 
			
		
	
		
		
			
				
					
					|  |  |  |      * |  |  |  |      * | 
			
		
	
	
		
		
			
				
					|  |  | @ -146,15 +154,18 @@ public class DeviceDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  |      */ |  |  |  |      */ | 
			
		
	
		
		
			
				
					
					|  |  |  |     private DataSetResult getData(String rangeValue, int requestType, int page) { |  |  |  |     private DataSetResult getData(String rangeValue, int requestType, int page) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         DataSetResult result = new DataSetResult(); |  |  |  |         DataSetResult result = new DataSetResult(); | 
			
		
	
		
		
			
				
					
					|  |  |  |         DeviceRequest deviceRequest = new DeviceRequest(); |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         deviceRequest.setAccessToken(getToken()); |  |  |  |         DeviceV3Request deviceRequest = DeviceV3Request.builder() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         deviceRequest.setRequestType(requestType + ""); |  |  |  |                 .dataType("1") | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         deviceRequest.setRangeValue(rangeValue); |  |  |  |                 .currentPageNumber(page) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         deviceRequest.setCurrentPageNumber(page + ""); |  |  |  |                 .ZXXSDYCPBS(null) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 .rangeValue(rangeValue).build(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         String response = ""; |  |  |  |         String response = ""; | 
			
		
	
		
		
			
				
					
					|  |  |  |         try { |  |  |  |         try { | 
			
		
	
		
		
			
				
					
					|  |  |  |             Thread.sleep(3 * 1000); |  |  |  |             Thread.sleep(3 * 1000); | 
			
		
	
		
		
			
				
					
					|  |  |  |             response = HttpClient.post(url, deviceRequest); |  |  |  |             String json = JSONUtil.toJsonStr(deviceRequest); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             response = okHttpCli.doPostJson(UdidConfig.apiUrl + "sharing/get", json, getHeaders()); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } catch (InterruptedException e) { |  |  |  |         } catch (InterruptedException e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             result.setReturnCode(-1); |  |  |  |             result.setReturnCode(-1); | 
			
		
	
		
		
			
				
					
					|  |  |  |             result.setReturnMsg(e.getMessage()); |  |  |  |             result.setReturnMsg(e.getMessage()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -170,17 +181,18 @@ public class DeviceDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  |      * @return |  |  |  |      * @return | 
			
		
	
		
		
			
				
					
					|  |  |  |      */ |  |  |  |      */ | 
			
		
	
		
		
			
				
					
					|  |  |  |     private synchronized DataSetResult getData(DeviceRequest deviceRequest, int page) { |  |  |  |     private synchronized DataSetResult getData(DeviceRequest deviceRequest, int page) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         deviceRequest.setAccessToken(getToken()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         deviceRequest.setCurrentPageNumber(page + ""); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         String response = ""; |  |  |  |         String response = ""; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |         DeviceV3Request deviceV3Request = new DeviceV3Request(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         BeanUtil.copyProperties(deviceRequest, deviceV3Request); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         deviceV3Request.setCurrentPageNumber(page); | 
			
		
	
		
		
			
				
					
					|  |  |  |         String key = "downloadUdiData"; |  |  |  |         String key = "downloadUdiData"; | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (redisUtil.getLock(key)) { |  |  |  |         if (redisUtil.getLock(key)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             log.info("获取到锁"); |  |  |  |             log.info("获取到锁"); | 
			
		
	
		
		
			
				
					
					|  |  |  |             redisUtil.setEx("downloadUdiData", "1", 5); |  |  |  |             redisUtil.setEx("downloadUdiData", "1", 5); | 
			
		
	
		
		
			
				
					
					|  |  |  |             //目前限制为5秒访问一次
 |  |  |  |             //目前限制为5秒访问一次
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             log.info("获取到锁的参数:" + page); |  |  |  |             log.info("获取到锁的参数:" + page); | 
			
		
	
		
		
			
				
					
					|  |  |  |             response = HttpClient.post(url, deviceRequest); |  |  |  |             String json = JSONUtil.toJsonStr(deviceV3Request); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             response = okHttpCli.doPostJson(UdidConfig.apiUrl + "sharing/get", json, getHeaders()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             log.info("获取到结果," + response); |  |  |  |             log.info("获取到结果," + response); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         log.info("开始解析结果"); |  |  |  |         log.info("开始解析结果"); | 
			
		
	
	
		
		
			
				
					|  |  | @ -300,6 +312,7 @@ public class DeviceDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 try { |  |  |  |                 try { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     dataSetResult = getData(deviceRequest, page); |  |  |  |                     dataSetResult = getData(deviceRequest, page); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 } catch (Exception e) { |  |  |  |                 } catch (Exception e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     log.error(ExceptionUtils.getStackTrace(e)); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     jobLog.setStatus(1); |  |  |  |                     jobLog.setStatus(1); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     jobLog.setType(Constant.LOG_TYPE_ERROR); |  |  |  |                     jobLog.setType(Constant.LOG_TYPE_ERROR); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     jobLog.setMsg("下载失败:" + e.getMessage()); |  |  |  |                     jobLog.setMsg("下载失败:" + e.getMessage()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -334,7 +347,7 @@ public class DeviceDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  |                             jobLog.setLastUploadRequest(JSONUtil.toJsonStr(deviceRequest)); |  |  |  |                             jobLog.setLastUploadRequest(JSONUtil.toJsonStr(deviceRequest)); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             jobLogService.update(jobLog); |  |  |  |                             jobLogService.update(jobLog); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } catch (Exception e) { |  |  |  |                         } catch (Exception e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                             log.error("插入数据失败", e); |  |  |  |                             log.error(ExceptionUtils.getStackTrace(e)); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                             jobLog.setStatus(1); |  |  |  |                             jobLog.setStatus(1); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             jobLog.setType(Constant.LOG_TYPE_ERROR); |  |  |  |                             jobLog.setType(Constant.LOG_TYPE_ERROR); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             jobLog.setMsg("数据写入失败" + e.getMessage()); |  |  |  |                             jobLog.setMsg("数据写入失败" + e.getMessage()); | 
			
		
	
	
		
		
			
				
					|  |  | @ -414,7 +427,8 @@ public class DeviceDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  |             String response = ""; |  |  |  |             String response = ""; | 
			
		
	
		
		
			
				
					
					|  |  |  |             try { |  |  |  |             try { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 Thread.sleep(3 * 1000); |  |  |  |                 Thread.sleep(3 * 1000); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 response = HttpClient.post(historyUrl, deviceHistoryRequest); |  |  |  |                 String json = JSONUtil.toJsonStr(deviceHistoryRequest); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 response = okHttpCli.doPostJson(UdidConfig.apiUrl + historyUrl, json, getHeaders()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             } catch (InterruptedException e) { |  |  |  |             } catch (InterruptedException e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 log.error(e.getMessage(), e); |  |  |  |                 log.error(e.getMessage(), e); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 results.setCode(-1); |  |  |  |                 results.setCode(-1); | 
			
		
	
	
		
		
			
				
					|  |  | @ -544,7 +558,7 @@ public class DeviceDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  |             jobLog.setCreateTime(new Date()); |  |  |  |             jobLog.setCreateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             jobLogService.insert(jobLog); |  |  |  |             jobLogService.insert(jobLog); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } catch (Exception e) { |  |  |  |         } catch (Exception e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             log.error(e.getMessage(), e); |  |  |  |             log.error(ExceptionUtils.getStackTrace(e)); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             JobLog jobLog = new JobLog(); |  |  |  |             JobLog jobLog = new JobLog(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL); |  |  |  |             jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL); | 
			
		
	
		
		
			
				
					
					|  |  |  |             jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD); |  |  |  |             jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD); | 
			
		
	
	
		
		
			
				
					|  |  | @ -610,7 +624,7 @@ public class DeviceDownloadService { | 
			
		
	
		
		
			
				
					
					|  |  |  |             jobLog.setCreateTime(new Date()); |  |  |  |             jobLog.setCreateTime(new Date()); | 
			
		
	
		
		
			
				
					
					|  |  |  |             jobLogService.insert(jobLog); |  |  |  |             jobLogService.insert(jobLog); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } catch (Exception e) { |  |  |  |         } catch (Exception e) { | 
			
		
	
		
		
			
				
					
					|  |  |  |             log.error(e.getMessage(), e); |  |  |  |             log.error(ExceptionUtils.getStackTrace(e)); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             JobLog jobLog = new JobLog(); |  |  |  |             JobLog jobLog = new JobLog(); | 
			
		
	
		
		
			
				
					
					|  |  |  |             jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL); |  |  |  |             jobLog.setDownloadType(Constant.DOWNLOAD_TYPE_MANUAL); | 
			
		
	
		
		
			
				
					
					|  |  |  |             jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD); |  |  |  |             jobLog.setTaskType(Constant.JOB_TASK_TYPE_DOWNLOAD); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |