订单拉取解析增加redis删除
This commit is contained in:
parent
fc5e0af648
commit
b1f85cd3ab
|
@ -383,6 +383,13 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public R orderInfo(String wmPoiId, String date, String cookie) {
|
||||
try {
|
||||
LocalDate localDate = LocalDate.parse(date);
|
||||
LocalDate prevDay = localDate.minusDays(1);
|
||||
String oldKey = wmPoiId + prevDay.toString();
|
||||
if (redisTemplate.opsForValue().get(oldKey) != null){
|
||||
redisTemplate.delete(oldKey);
|
||||
}
|
||||
|
||||
int pageNum = 1;
|
||||
String getUrl = proxyProperties.gettpsUrl();
|
||||
JSONObject jsonObject = merchantOrders(getUrl,pageNum, date, cookie);
|
||||
|
@ -442,9 +449,9 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
if (redisDaySeq == null) {
|
||||
redisTemplate.opsForValue().set(key, daySeq);
|
||||
} else {
|
||||
// if (Integer.valueOf(daySeq) > Integer.valueOf(redisDaySeq)) {
|
||||
// redisTemplate.opsForValue().set(key, daySeq);
|
||||
// }
|
||||
if (Integer.valueOf(daySeq) > Integer.valueOf(redisDaySeq)) {
|
||||
redisTemplate.opsForValue().set(key, daySeq);
|
||||
}
|
||||
if (daySeq.equals(lastDayseq)) {
|
||||
flag = true;
|
||||
break;
|
||||
|
@ -517,7 +524,7 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
}catch (Exception e){
|
||||
System.out.println("================拉取订单出错:==============="+e.getMessage());
|
||||
// return orderInfo(wmPoiId, date, cookie);
|
||||
return R.fail("=====================拉取订单出错==================");
|
||||
return R.fail("拉取订单出错");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -600,6 +607,9 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
orderInfo.setPrivcyPhone(privacyPhone);
|
||||
orderInfo.setRecipientPhone(recipientPhone);
|
||||
orderInfo.setRecipientBindedPhone(recipientBindedPhone);
|
||||
|
||||
System.out.println("****************订单解析成功:****************"+JSON.toJSONString(orderInfo));
|
||||
|
||||
lsList.add(orderInfo);
|
||||
|
||||
BusReturnVisitInfo returnVisitInfo = new BusReturnVisitInfo();
|
||||
|
@ -614,16 +624,16 @@ public class MeituanServiceImpl implements IMeituanService {
|
|||
e.printStackTrace();
|
||||
continue;
|
||||
}
|
||||
|
||||
lss.add(returnVisitInfo);
|
||||
}
|
||||
}
|
||||
System.out.println("********************************"+JSON.toJSONString(lsList));
|
||||
// if (lsList.size() > 0) {
|
||||
// busOrderInfoMapper.batchInsertOrder(lsList);
|
||||
// }
|
||||
// if (lss.size() > 0) {
|
||||
// busReturnVisitInfoMapper.batchInsertVisit(lss);
|
||||
// }
|
||||
if (lsList.size() > 0) {
|
||||
busOrderInfoMapper.batchInsertOrder(lsList);
|
||||
}
|
||||
if (lss.size() > 0) {
|
||||
busReturnVisitInfoMapper.batchInsertVisit(lss);
|
||||
}
|
||||
}
|
||||
|
||||
private String getOrderCountByType(String getUrl, String wmOrderViewId,String cookie){
|
||||
|
|
Loading…
Reference in New Issue