Browse Source

[深爱]科目基础资料对接测试

zxl 1 year ago
parent
commit
fed6817775

+ 22 - 4
src/main/java/com/uas/eis/service/Impl/RequestSTKServiceImpl.java

@@ -124,7 +124,16 @@ public class RequestSTKServiceImpl implements RequestSTKService {
     public CashFlowItemsVo getCashFlowItems(QueryCashFlowItemsDto dto) {
         StkCommonDto stkCommonDto = new StkCommonDto();
         stkCommonDto.setParam(dto);
-        HttpResultResponse resultResponse = HuToolUtils.post(QUERY_URL+CASH_FLOW_ITEMS_REQUEST_CODE,stkCommonDto);
+
+        //头部请求参数
+        Map<String,String> headerMap = null;
+        try {
+            headerMap = getHeaderMap(dto);
+        } catch (Exception e) {
+            log.error("STK加密异常:{}",e.getMessage());
+        }
+
+        HttpResultResponse resultResponse = HuToolUtils.post(QUERY_URL+CASH_FLOW_ITEMS_REQUEST_CODE,stkCommonDto,headerMap);
         log.info("深投控,现金流项目,返回结果数据{}",JSONObject.toJSONString(resultResponse));
         if(!resultResponse.getSuccess()){
             log.info("深投控,现金流项目数据异常:{}",resultResponse.getMessage());
@@ -136,7 +145,16 @@ public class RequestSTKServiceImpl implements RequestSTKService {
     public AccountantProjectVo getAccountantProject(QueryAccountantProjectDto dto) {
         StkCommonDto stkCommonDto = new StkCommonDto();
         stkCommonDto.setParam(dto);
-        HttpResultResponse resultResponse = HuToolUtils.post(QUERY_URL+ACCOUNTANT_PROJECT_REQUEST_CODE,stkCommonDto);
+
+        //头部请求参数
+        Map<String,String> headerMap = null;
+        try {
+            headerMap = getHeaderMap(dto);
+        } catch (Exception e) {
+            log.error("STK加密异常:{}",e.getMessage());
+        }
+
+        HttpResultResponse resultResponse = HuToolUtils.post(QUERY_URL+ACCOUNTANT_PROJECT_REQUEST_CODE,stkCommonDto,headerMap);
         log.info("深投控,会计项目,返回结果数据{}",JSONObject.toJSONString(resultResponse));
         if(!resultResponse.getSuccess()){
             log.info("深投控,会计项目数据异常:{}",resultResponse.getMessage());
@@ -177,7 +195,7 @@ public class RequestSTKServiceImpl implements RequestSTKService {
     /**
      * POST请求头部参数封装
      * */
-    public Map<String,String> getHeaderMap(QueryTravellingMerchantDto dto) throws Exception {
+    public Map<String,String> getHeaderMap(Object dto) throws Exception {
 
         //获取签名
         String sign = getSign(dto);
@@ -197,7 +215,7 @@ public class RequestSTKServiceImpl implements RequestSTKService {
     /**
      * 获取深投控加密参数
      * */
-    public String getSign(QueryTravellingMerchantDto dto) throws Exception {
+    public String getSign(Object dto) throws Exception {
 
         //时间戳
         String timestamp = Long.toString(System.currentTimeMillis());

+ 4 - 8
src/main/java/com/uas/eis/task/STKTask.java

@@ -145,7 +145,7 @@ public class STKTask {
     }
 
     //客商获取(当天)
-    @Scheduled(cron = "0 41 18 * * ?")
+    //@Scheduled(cron = "0 41 18 * * ?")
     public void queryCustVendDayQuartz(){
         log.info("开始获取深投控客商状态信息=========start=============");
         Date date = new Date();
@@ -158,12 +158,10 @@ public class STKTask {
         QueryTravellingMerchantDto dto = new QueryTravellingMerchantDto();
         dto.setCode(GET_TRAVELLING_MERCHANT);
         dto.setPage(1);
-        dto.setSize(10);
+        dto.setSize(500);
         dto.setStart_time(start.get(Calendar.YEAR)+"-"+month+"-"+start.get(Calendar.DAY_OF_MONTH)+" 00:00:00");
         dto.setEnd_time(start.get(Calendar.YEAR)+"-"+month+"-"+start.get(Calendar.DAY_OF_MONTH)+" 23:59:59");
 
-        //第一次删除STK_CUSTVEND的数据
-        stkService.delete();
         //是否跳出循环
         Boolean isBreak = true;
         //是否发生异常
@@ -196,8 +194,6 @@ public class STKTask {
             if(!exception){
                 dto.setPage(travellingMerchantVo.getData().getNextPage());
             }
-            //测试
-            isBreak = false;
             log.info("定时任务获取深投控客商信息数据结果2:{}", JSONObject.toJSONString(travellingMerchantVo));
         }
         log.info("开始获取深投控客商状态信息,结束:"+((System.currentTimeMillis()-date.getTime())/1000));
@@ -205,7 +201,7 @@ public class STKTask {
 
 
     //现金流项目
-    @Scheduled(cron = "0 10 18 * * ?")
+    @Scheduled(cron = "0 20 19 * * ?")
     public void queryCashFlowItems(){
         QueryCashFlowItemsDto dto = new QueryCashFlowItemsDto();
         CashFlowItemsVo cashFlowItemsVo = new CashFlowItemsVo();
@@ -216,7 +212,7 @@ public class STKTask {
 
 
     //获取会计科目
-    @Scheduled(cron = "0 12 18 * * ?")
+    @Scheduled(cron = "0 22 19 * * ?")
     public void queryAccountantProject(){
         QueryAccountantProjectDto dto = new QueryAccountantProjectDto();
         AccountantProjectVo accountantProjectVo = new AccountantProjectVo();