|
@@ -1987,7 +1987,15 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+ public static long toUNix(LocalDateTime localDateTime) {
|
|
|
|
+ // 转换为ZonedDateTime
|
|
|
|
+ ZonedDateTime zonedDateTime = localDateTime.atZone(ZoneId.systemDefault());
|
|
|
|
+ // 转换为Instant
|
|
|
|
+ Instant instant = zonedDateTime.toInstant();
|
|
|
|
+ // 获取UNIX时间戳
|
|
|
|
+ long unixTimestamp = instant.getEpochSecond();
|
|
|
|
+ return unixTimestamp;
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 批量获取审批单号
|
|
* 批量获取审批单号
|
|
@@ -1999,12 +2007,10 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
DateTimeFormatter df=DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
LocalDateTime startDateTime = LocalDate.parse(startDate, df).atTime(LocalTime.MIN);
|
|
LocalDateTime startDateTime = LocalDate.parse(startDate, df).atTime(LocalTime.MIN);
|
|
LocalDateTime endDateTime = LocalDate.parse(endDate, df).atTime(LocalTime.MAX);
|
|
LocalDateTime endDateTime = LocalDate.parse(endDate, df).atTime(LocalTime.MAX);
|
|
- long startTime = startDateTime.toInstant(ZoneOffset.of("+8")).toEpochMilli() -
|
|
|
|
- LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli();
|
|
|
|
- long endTime = endDateTime.toInstant(ZoneOffset.of("+8")).toEpochMilli() -
|
|
|
|
- LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli();
|
|
|
|
|
|
+ long startTime = toUNix(startDateTime);
|
|
|
|
+ long endTime = toUNix(endDateTime);
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",companyId));
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",companyId));
|
|
- String url=BATCH_GET_APPROVAL_INFO.replace("ACCESS_TOKEN",getCorpAccessToken(wxCorpInfo));
|
|
|
|
|
|
+ String url=BATCH_GET_APPROVAL_INFO.replace("ACCESS_TOKEN",getCorpAgentAccessToken(wxCorpInfo));
|
|
HttpHeaders headers = new HttpHeaders();
|
|
HttpHeaders headers = new HttpHeaders();
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
@@ -2022,14 +2028,18 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
JSONArray jsonArray=new JSONArray();
|
|
JSONArray jsonArray=new JSONArray();
|
|
String resp = ResponseEntity.getBody();
|
|
String resp = ResponseEntity.getBody();
|
|
JSONObject jsonObject = JSONObject.parseObject(resp);
|
|
JSONObject jsonObject = JSONObject.parseObject(resp);
|
|
- JSONArray sp_no_list = jsonObject.getJSONArray("sp_no_list");
|
|
|
|
- jsonArray.addAll(sp_no_list);
|
|
|
|
- if(jsonObject.containsKey("new_next_cursor")){
|
|
|
|
- String new_next_cursor = jsonObject.getString("new_next_cursor");
|
|
|
|
- JSONArray approvalInfo = getApprovalInfo(companyId, startDate, endDate, new_next_cursor, filterArray);
|
|
|
|
- jsonArray.addAll(approvalInfo);
|
|
|
|
|
|
+ if(jsonObject.getString("errmsg").equals("ok")){
|
|
|
|
+ JSONArray sp_no_list = jsonObject.getJSONArray("sp_no_list");
|
|
|
|
+ jsonArray.addAll(sp_no_list);
|
|
|
|
+ if(jsonObject.containsKey("new_next_cursor")){
|
|
|
|
+ String new_next_cursor = jsonObject.getString("new_next_cursor");
|
|
|
|
+ JSONArray approvalInfo = getApprovalInfo(companyId, startDate, endDate, new_next_cursor, filterArray);
|
|
|
|
+ jsonArray.addAll(approvalInfo);
|
|
|
|
+ }
|
|
|
|
+ System.out.println(jsonArray);
|
|
|
|
+ return jsonArray;
|
|
}
|
|
}
|
|
- return jsonArray;
|
|
|
|
|
|
+ System.out.println(jsonObject.getString("errmsg"));
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -2038,7 +2048,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
@Override
|
|
@Override
|
|
public String getApprovalInfoDetail(Integer companyId,String spNo) throws Exception {
|
|
public String getApprovalInfoDetail(Integer companyId,String spNo) throws Exception {
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",companyId));
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",companyId));
|
|
- String url=GET_APPROVAL_DETAIL.replace("ACCESS_TOKEN",getCorpAccessToken(wxCorpInfo));
|
|
|
|
|
|
+ String url=GET_APPROVAL_DETAIL.replace("ACCESS_TOKEN",getCorpAgentAccessToken(wxCorpInfo));
|
|
HttpHeaders headers = new HttpHeaders();
|
|
HttpHeaders headers = new HttpHeaders();
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|
|
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
|