zhouy 2 år sedan
förälder
incheckning
9e82cb2ca5

+ 16 - 0
src/main/java/com/uas/eis/dto/BaseReq.java

@@ -0,0 +1,16 @@
+package com.uas.eis.dto;
+
+import com.uas.api.crypto.util.MD5Util;
+import lombok.Data;
+
+@Data
+public class BaseReq {
+    private String signName;
+    private String supplyCode;
+    private Long timeStamp;
+    public void configSign(){
+        this.setTimeStamp(System.currentTimeMillis() / 1000);
+        this.setSignName(MD5Util.encrypt("scpdonlim"+this.supplyCode+this.timeStamp));
+    }
+}
+

+ 22 - 0
src/main/java/com/uas/eis/dto/BaseResp.java

@@ -0,0 +1,22 @@
+package com.uas.eis.dto;
+
+public class BaseResp {
+    private Integer code;
+    private String msg;
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

+ 139 - 0
src/main/java/com/uas/eis/dto/SaleDownLoadDTO.java

@@ -0,0 +1,139 @@
+package com.uas.eis.dto;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class SaleDownLoadDTO {
+    private Long poId;
+    private Long poNo;
+    private String orgName;
+    private String orderType;
+    private String supplyCode;
+    private String supplyName;
+    @JSONField(format = "yyyy-MM-dd HH24:mi:ss")
+    private Date prepareDate;
+    private String preparePeople;
+    private String remark;
+    @JSONField(format = "yyyy-MM-dd HH24:mi:ss")
+    private Date createTime;
+    @JSONField(format = "yyyy-MM-dd HH24:mi:ss")
+    private String updateTime;
+    private Integer materialNum;
+    private Double totalAmount;
+    private List<OrderDetail> orderDetail;
+
+    class OrderDetail {
+        private Long poRowId;
+        private Long poNo;
+        private Integer rowNo;
+        private String materialNoOwner;
+        private String materialNo;
+        private String materialName;
+        private String materialSpecification;
+        private Integer materialNum;
+        private Double singleAmount;
+        private Double totalAmount;
+        private Date planArrivalTime;
+        private String remark;
+
+        public Long getPoRowId() {
+            return poRowId;
+        }
+
+        public void setPoRowId(Long poRowId) {
+            this.poRowId = poRowId;
+        }
+
+        public Long getPoNo() {
+            return poNo;
+        }
+
+        public void setPoNo(Long poNo) {
+            this.poNo = poNo;
+        }
+
+        public Integer getRowNo() {
+            return rowNo;
+        }
+
+        public void setRowNo(Integer rowNo) {
+            this.rowNo = rowNo;
+        }
+
+        public String getMaterialNoOwner() {
+            return materialNoOwner;
+        }
+
+        public void setMaterialNoOwner(String materialNoOwner) {
+            this.materialNoOwner = materialNoOwner;
+        }
+
+        public String getMaterialNo() {
+            return materialNo;
+        }
+
+        public void setMaterialNo(String materialNo) {
+            this.materialNo = materialNo;
+        }
+
+        public String getMaterialName() {
+            return materialName;
+        }
+
+        public void setMaterialName(String materialName) {
+            this.materialName = materialName;
+        }
+
+        public String getMaterialSpecification() {
+            return materialSpecification;
+        }
+
+        public void setMaterialSpecification(String materialSpecification) {
+            this.materialSpecification = materialSpecification;
+        }
+
+        public Integer getMaterialNum() {
+            return materialNum;
+        }
+
+        public void setMaterialNum(Integer materialNum) {
+            this.materialNum = materialNum;
+        }
+
+        public Double getSingleAmount() {
+            return singleAmount;
+        }
+
+        public void setSingleAmount(Double singleAmount) {
+            this.singleAmount = singleAmount;
+        }
+
+        public Double getTotalAmount() {
+            return totalAmount;
+        }
+
+        public void setTotalAmount(Double totalAmount) {
+            this.totalAmount = totalAmount;
+        }
+
+        public Date getPlanArrivalTime() {
+            return planArrivalTime;
+        }
+
+        public void setPlanArrivalTime(Date planArrivalTime) {
+            this.planArrivalTime = planArrivalTime;
+        }
+
+        public String getRemark() {
+            return remark;
+        }
+
+        public void setRemark(String remark) {
+            this.remark = remark;
+        }
+    }
+}

+ 19 - 0
src/main/java/com/uas/eis/dto/SaleDownLoadReq.java

@@ -0,0 +1,19 @@
+package com.uas.eis.dto;
+import lombok.Data;
+import lombok.ToString;
+
+import java.util.HashMap;
+import java.util.Map;
+@Data
+@ToString(callSuper = true)
+public class SaleDownLoadReq extends BaseReq {
+    private String queryTime;
+    public Map<String, Object> build(){
+       Map<String,Object> map = new HashMap<>();
+       map.put("signName", this.getSignName());
+       map.put("supplyCode", this.getSupplyCode());
+       map.put("queryTime", this.queryTime);
+       map.put("timeStamp", this.getTimeStamp());
+       return map;
+    }
+}

+ 16 - 0
src/main/java/com/uas/eis/dto/SaleDownLoadResp.java

@@ -0,0 +1,16 @@
+package com.uas.eis.dto;
+
+import java.util.List;
+
+public class SaleDownLoadResp extends BaseResp {
+
+    private List<SaleDownLoadDTO> data;
+
+    public List<SaleDownLoadDTO> getData() {
+        return data;
+    }
+
+    public void setData(List<SaleDownLoadDTO> data) {
+        this.data = data;
+    }
+}

+ 13 - 0
src/main/java/com/uas/eis/exception/DonLimException.java

@@ -0,0 +1,13 @@
+package com.uas.eis.exception;
+
+import com.uas.eis.dto.BaseResp;
+import org.codehaus.jackson.map.Serializers;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+public class DonLimException extends RuntimeException {
+
+    public DonLimException(BaseResp resp) {
+        super(String.valueOf(resp.getMsg()));
+    }
+}

+ 26 - 0
src/main/java/com/uas/eis/task/BaseTask.java

@@ -0,0 +1,26 @@
+package com.uas.eis.task;
+
+import com.uas.eis.dto.BaseReq;
+import com.uas.eis.dto.BaseResp;
+import com.uas.eis.exception.DonLimException;
+import com.uas.eis.utils.FlexJsonUtil;
+import com.uas.eis.utils.HttpUtils;
+import org.springframework.http.*;
+import org.springframework.web.client.RestTemplate;
+
+public  abstract class BaseTask {
+    protected final static RestTemplate restTemplate = HttpUtils.createTemplate();
+    protected void assertOK(ResponseEntity<? extends BaseResp> resp) {
+        if (resp.getStatusCode() != HttpStatus.OK) {
+            throw new DonLimException(resp.getBody());
+        }
+        if (resp.getBody().getCode() != 0) {
+            throw new DonLimException(resp.getBody());
+        }
+    }
+    public HttpEntity configHttpEntity(BaseReq req) {
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.APPLICATION_JSON);
+       return new HttpEntity<String>(FlexJsonUtil.toJsonDeep(req),headers);
+    }
+}

+ 0 - 108
src/main/java/com/uas/eis/task/DataSyncTask.java

@@ -1,108 +0,0 @@
-package com.uas.eis.task;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.serializer.SerializerFeature;
-import com.uas.eis.config.DonlimConfig;
-import com.uas.eis.dao.BaseDao;
-import com.uas.eis.entity.PNSSendData;
-import com.uas.eis.entity.PNSSendResp;
-import com.uas.eis.utils.FlexJsonUtil;
-import com.uas.eis.utils.HttpUtil;
-import net.sf.json.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.http.HttpStatus;
-import org.springframework.jdbc.core.BeanPropertyRowMapper;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-import org.springframework.util.StringUtils;
-
-import java.util.HashMap;
-import java.util.List;
-
-@Component
-public class DataSyncTask {
-    private final Logger logger = LoggerFactory.getLogger(this.getClass());
-
-    private int  pageSize = 50;
-    @Autowired
-    private DonlimConfig donlimConfig;
-    @Autowired
-    private BaseDao baseDao;
-
-    @Scheduled(cron = "0 0/5 * * * ?")
-    public void UploadSaleData(){
-        logger.info("Sale Upload Start---");
-        List<PNSSendData> saleUploads = getSaleDataUpload();
-        if(saleUploads.size() < 1 ) {
-            return;
-        }
-        //分页上传
-        int a =  saleUploads.size() / pageSize;
-        int b =  saleUploads.size() % pageSize;
-        int pages = a + (b>0?1:0);
-        HashMap<String, String> reqHeader = new HashMap<>();
-        reqHeader.put("fromsys","ISP");
-         JSONObject pageReq = new JSONObject();
-         pageReq.put("if_name","ISPP-PSI-UPLOAD");
-         pageReq.put("if_key" , pnsConfig.getIf_key());
-         pageReq.put("total_page", String.valueOf(pages));
-         pageReq.put("total_data_count", String.valueOf(saleUploads.size()));
-         logger.info("Sale Upload totalSize {}", pages);
-        for(int i = 0 ; i < pages; i++) {
-            pageReq.put("current_page", String.valueOf(i+1));
-            if((i+1)*pageSize > saleUploads.size()) {
-                pageReq.put("current_data_count", String.valueOf(b));
-                pageReq.put("detail", JSONArray.toJSONString(saleUploads.subList(i*pageSize, i*pageSize+b), SerializerFeature.WriteMapNullValue));
-            }else {
-                pageReq.put("current_data_count", String.valueOf(pageSize));
-                pageReq.put("detail", JSONArray.toJSONString(saleUploads.subList(i*pageSize, (i+1)*pageSize),SerializerFeature.WriteMapNullValue));
-            }
-            try {
-               HttpUtil.Response response = HttpUtil.sendPostRequest(pnsConfig.getRoute(), reqHeader, pageReq.toString());
-               logger.info("{}, statusCode{},{}",response.getResponseText(), response.getStatusCode(), response.getStatusCode() == HttpStatus.OK.value());
-                if (response.getStatusCode() == HttpStatus.OK.value()) {
-                    String data = response.getResponseText();
-                    logger.info("{}", StringUtils.hasText(data));
-                    if (StringUtils.hasText(data)) {
-                        PNSSendResp resp = FlexJsonUtil.fromJson(String.valueOf(FlexJsonUtil.fromJson(data).get("result")), PNSSendResp.class);
-                        if(resp.getSuccess()) {
-                            logger.info("Sale Upload success Size {}", i);
-                            pageReq.put("if_batch_no",resp.getIf_batch_no());
-                        }
-                    }
-                }
-            } catch (Exception e) {
-                logger.info(e.getMessage());
-                e.printStackTrace();
-
-            }
-
-        }
-    }
-
-    public List<PNSSendData> getSaleDataUpload() {
-        try {
-            List<PNSSendData> sendSales = baseDao
-                    .getJdbcTemplate()
-                    .query("SELECT * FROM PNS_SENDDATADETAIL WHERE MAIN_ID=1 AND UPLOAD=0 ", new BeanPropertyRowMapper<PNSSendData>(PNSSendData.class));
-            int num = 0;
-            for(PNSSendData sendSale : sendSales) {
-                num ++;
-                if(num > pageSize) {
-                    num = 1;
-                }
-                sendSale.setRow_number(num); //分页处理序号问题
-                sendSale.setCust_id(pnsConfig.getCust_id());
-                sendSale.setCust_name("华商龙商务互联");
-                sendSale.setYmonth("2023-04");
-            }
-            baseDao.execute("UPDATE PNS_SENDDATADETAIL SET UPLOAD=1");
-            return sendSales;
-        } catch (EmptyResultDataAccessException e) {
-            return null;
-        }
-    };
-}

+ 36 - 0
src/main/java/com/uas/eis/task/SaleDownLoadTask.java

@@ -0,0 +1,36 @@
+package com.uas.eis.task;
+import com.uas.eis.config.DonlimConfig;
+import com.uas.eis.dto.SaleDownLoadDTO;
+import com.uas.eis.dto.SaleDownLoadReq;
+import com.uas.eis.dto.SaleDownLoadResp;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.*;
+import org.springframework.stereotype.Component;
+import java.util.List;
+
+@Component
+public class SaleDownLoadTask extends BaseTask {
+    @Autowired
+    private DonlimConfig donlimConfig;
+
+    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+    public void execute() {
+        SaleDownLoadReq req = new SaleDownLoadReq();
+        req.setSupplyCode(donlimConfig.getSupplyCode());
+        req.configSign();
+        req.setQueryTime("2023-06-10 12:30:00");
+        try {
+            HttpHeaders headers = new HttpHeaders();
+            headers.setContentType(MediaType.APPLICATION_JSON);
+            ResponseEntity<SaleDownLoadResp> resp = restTemplate.postForEntity(donlimConfig.getRoute()+"/order/orderList", configHttpEntity(req), SaleDownLoadResp.class);
+            assertOK(resp);
+            logger.info("SaleDownLoad code {} ,msg {} ",resp.getBody().getCode(),resp.getBody().getMsg());
+            List<SaleDownLoadDTO> downLoadDTOS = resp.getBody().getData();
+            logger.info("SaleDownLoad dataSize {}", downLoadDTOS.size());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 4 - 0
src/main/java/com/uas/eis/task/SaleOutTask.java

@@ -0,0 +1,4 @@
+package com.uas.eis.task;
+
+public class SaleOutTask extends BaseTask{
+}

+ 6 - 3
src/main/java/com/uas/eis/utils/HttpUtil.java

@@ -78,7 +78,7 @@ public class HttpUtil {
 	 * @throws KeyManagementException  
 	 */  
 	public static SSLContext createIgnoreVerifySSL() throws NoSuchAlgorithmException, KeyManagementException {  
-	    SSLContext sc = SSLContext.getInstance("SSLv3");  
+	    SSLContext sc = SSLContext.getInstance("TLSv1");
 	  
 	    // 实现一个X509TrustManager接口,用于绕过验证,不用修改里面的方法  
 	    X509TrustManager trustManager = new X509TrustManager() {  
@@ -487,8 +487,10 @@ public class HttpUtil {
 			throws Exception {
 
 		HttpPost request = new HttpPost(getRequestUrl(url, sign, signKey));
-		for (Map.Entry<String, String> entry : header.entrySet()) {
-			request.setHeader(entry.getKey(), entry.getValue());
+		if(header != null) {
+			for (Map.Entry<String, String> entry : header.entrySet()) {
+				request.setHeader(entry.getKey(), entry.getValue());
+			}
 		}
 		//采用绕过验证的方式处理https请求
 		SSLContext sslcontext = createIgnoreVerifySSL();
@@ -506,6 +508,7 @@ public class HttpUtil {
 		CloseableHttpResponse response = null;
 		try {
 			request.setEntity(new StringEntity(body));
+			request.setHeader("content-type","application/json");
 			response = httpClient.execute(request);
 			return Response.getResponse(response);
 		} finally {

+ 128 - 0
src/main/java/com/uas/eis/utils/HttpUtils.java

@@ -0,0 +1,128 @@
+package com.uas.eis.utils;
+
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.alibaba.fastjson.support.config.FastJsonConfig;
+import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
+import org.springframework.http.MediaType;
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
+import org.springframework.web.client.RestTemplate;
+
+import javax.net.ssl.*;
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.nio.charset.StandardCharsets;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+public class HttpUtils {
+
+    public static RestTemplate createTemplate() {
+        RestTemplate restTemplate = new RestTemplate(new HttpsClientRequestFactory());
+
+        List<HttpMessageConverter<?>> converters = restTemplate.getMessageConverters().stream()
+                .filter(item -> !(item instanceof MappingJackson2HttpMessageConverter)
+                        && !(item instanceof StringHttpMessageConverter))
+                .collect(Collectors.toList());
+        converters.add(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));
+
+        FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter();
+        List<MediaType> supportedMediaTypes = new ArrayList<>();
+        supportedMediaTypes.add(MediaType.APPLICATION_JSON);
+        supportedMediaTypes.add(MediaType.APPLICATION_ATOM_XML);
+        supportedMediaTypes.add(MediaType.APPLICATION_FORM_URLENCODED);
+        supportedMediaTypes.add(MediaType.APPLICATION_OCTET_STREAM);
+        supportedMediaTypes.add(MediaType.APPLICATION_XHTML_XML);
+        supportedMediaTypes.add(MediaType.APPLICATION_XML);
+        supportedMediaTypes.add(MediaType.IMAGE_GIF);
+        supportedMediaTypes.add(MediaType.IMAGE_JPEG);
+        supportedMediaTypes.add(MediaType.IMAGE_PNG);
+        supportedMediaTypes.add(MediaType.TEXT_HTML);
+        supportedMediaTypes.add(MediaType.TEXT_PLAIN);
+        supportedMediaTypes.add(MediaType.TEXT_XML);
+        supportedMediaTypes.add(MediaType.MULTIPART_FORM_DATA);
+        fastConverter.setSupportedMediaTypes(supportedMediaTypes);
+        FastJsonConfig fastJsonConfig = new FastJsonConfig();
+        //WriteNullListAsEmpty  :List字段如果为null,输出为[],而非null
+        //WriteNullStringAsEmpty : 字符类型字段如果为null,输出为"",而非null
+        //DisableCircularReferenceDetect :消除对同一对象循环引用的问题,默认为false(如果不配置有可能会进入死循环)
+        //WriteNullBooleanAsFalse:Boolean字段如果为null,输出为false,而非null
+        //WriteMapNullValue:是否输出值为null的字段,默认为false
+        fastJsonConfig.setSerializerFeatures(
+                SerializerFeature.DisableCircularReferenceDetect,
+                SerializerFeature.WriteMapNullValue
+        );
+        fastConverter.setFastJsonConfig(fastJsonConfig);
+        converters.add(fastConverter);
+        restTemplate.setMessageConverters(converters);
+
+        return restTemplate;
+    }
+
+    static class HttpsClientRequestFactory extends SimpleClientHttpRequestFactory {
+
+        static class MySSLSocketFactory extends SSLSocketFactory {
+
+            private final SSLSocketFactory delegate;
+
+            public MySSLSocketFactory(SSLSocketFactory delegate) {
+                this.delegate = delegate;
+            }
+
+            @Override
+            public String[] getDefaultCipherSuites() {
+                return delegate.getDefaultCipherSuites();
+            }
+
+            @Override
+            public String[] getSupportedCipherSuites() {
+                return delegate.getSupportedCipherSuites();
+            }
+
+            @Override
+            public Socket createSocket(final Socket socket, final String host, final int port, final boolean autoClose) throws IOException {
+                final Socket underlyingSocket = delegate.createSocket(socket, host, port, autoClose);
+                return overrideProtocol(underlyingSocket);
+            }
+
+            @Override
+            public Socket createSocket(final String host, final int port) throws IOException {
+                final Socket underlyingSocket = delegate.createSocket(host, port);
+                return overrideProtocol(underlyingSocket);
+            }
+
+            @Override
+            public Socket createSocket(final String host, final int port, final InetAddress localAddress, final int localPort) throws
+                    IOException {
+                final Socket underlyingSocket = delegate.createSocket(host, port, localAddress, localPort);
+                return overrideProtocol(underlyingSocket);
+            }
+
+            @Override
+            public Socket createSocket(final InetAddress host, final int port) throws IOException {
+                final Socket underlyingSocket = delegate.createSocket(host, port);
+                return overrideProtocol(underlyingSocket);
+            }
+
+            @Override
+            public Socket createSocket(final InetAddress host, final int port, final InetAddress localAddress, final int localPort) throws
+                    IOException {
+                final Socket underlyingSocket = delegate.createSocket(host, port, localAddress, localPort);
+                return overrideProtocol(underlyingSocket);
+            }
+
+            private Socket overrideProtocol(final Socket socket) {
+                if (!(socket instanceof SSLSocket)) {
+                    throw new RuntimeException("An instance of SSLSocket is expected");
+                }
+                ((SSLSocket) socket).setEnabledProtocols(new String[]{"TLSv1"});
+                return socket;
+            }
+        }
+    }
+}

+ 3 - 3
src/main/resources/application-prod.yml

@@ -4,7 +4,7 @@ spring:
         driverClassName: oracle.jdbc.OracleDriver
         username: DATACENTER
         password: select!#%*(
-        url: jdbc:oracle:thin:@usoft.f3322.net:11526:orcl
+        url: jdbc:oracle:thin:@10.1.81.208:11526:orcl
         initialSize: 1
         maxActive: 3
         maxWait: 30000
@@ -31,5 +31,5 @@ action:
 
 extral:
     donlim:
-        route: https://tscp.donlim.com/supply-api/open
-        supplyCode: 230517Vxy3rDjP5VgcNoyoknUnrHTw
+        route: http://scp.donlim.com/supply-api/open
+        supplyCode: VAJ008

+ 38 - 0
src/test/java/com/uas/eis/Test.java

@@ -0,0 +1,38 @@
+package com.uas.eis;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.uas.eis.entity.PNSSendData;
+import com.uas.eis.entity.PNSSendResp;
+import com.uas.eis.utils.FlexJsonUtil;
+import com.uas.eis.utils.HttpUtil;
+import flexjson.JSONSerializer;
+import flexjson.transformer.DateTransformer;
+import org.springframework.http.HttpStatus;
+
+import java.util.Calendar;
+import java.util.Date;
+
+public class Test {
+    public static void main(String[] args) {
+        PNSSendData data = new PNSSendData();
+        data.setConfirm_date(new Date());
+        System.out.println(JSON.toJSONString(data, SerializerFeature.WriteMapNullValue));
+        System.out.println(new JSONSerializer().exclude("*.class").transform(new DateTransformer("yyyy-MM-dd"),"confirm_date")
+                .deepSerialize(data));
+        JSONObject O = new JSONObject();
+        JSONObject b = new JSONObject();
+         b.put("if_name","ISP-CUSTDATA-UPLOAD");
+         b.put("if_batch_no","230519lsIOtGWYc8aqr98azcRVcW3o");
+         b.put("success",true);
+         O.put("result", b);
+        PNSSendResp resp = FlexJsonUtil.fromJson(String.valueOf(FlexJsonUtil.fromJson(O.toJSONString()).get("result")), PNSSendResp.class);
+        System.out.println(resp.getSuccess());
+        HttpUtil.Response r =  new HttpUtil.Response();
+        r.setStatusCode(200);
+        System.out.println(r.getStatusCode() == HttpStatus.OK.value());
+
+
+      }
+}

+ 3 - 4
src/test/java/com/uas/eis/UasEisApplicationTests.java

@@ -1,6 +1,6 @@
 package com.uas.eis;
 
-import com.uas.eis.task.DataSyncTask;
+import com.uas.eis.task.SaleDownLoadTask;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -10,13 +10,12 @@ import org.springframework.test.context.junit4.SpringRunner;
 @SpringBootTest(classes = {UasEisApplication.class})
 public class UasEisApplicationTests {
 	@Autowired
-	private DataSyncTask dataSyncTask;
+	private SaleDownLoadTask saleDownLoadTask;
 
 
 	@Test
 	public void Test() {
-		pnsDataSyncTask.UploadSaleData();
-
+		saleDownLoadTask.execute();
 	}
 
 }