提交 9de2d9a8 authored 作者: 000516's avatar 000516

跨越回单添加日期

上级 d32484e9
package com.sfa.job.domain.order.dao.impl;
import com.alibaba.fastjson2.JSONArray;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.sfa.common.core.enums.ECode;
import com.sfa.common.core.exception.CheckedException;
......@@ -9,6 +8,7 @@ import com.sfa.job.domain.order.dao.IOrdersSentDao;
import com.sfa.job.domain.order.entity.OrdersSent;
import com.sfa.job.domain.order.mapper.OrdersSentMapper;
import com.sfa.job.pojo.response.OrdersSentDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -20,6 +20,7 @@ import java.util.Objects;
* @date : 2025-07-10 16
* @describe :
*/
@Slf4j
@DS("bi")
@Service
public class OrdersSentDaoImpl implements IOrdersSentDao {
......@@ -69,6 +70,7 @@ public class OrdersSentDaoImpl implements IOrdersSentDao {
@Override
public void updateByExpressNo(OrdersSentDto ordersSentDto) {
log.info("更新发货单信息:{}", ordersSentDto);
OrdersSent ordersSent = BeanUtils.transitionDto(ordersSentDto, OrdersSent.class);
ordersSentMapper.updateByExpressNo(ordersSent);
}
......
......@@ -64,6 +64,7 @@ public class OrdersSentQueryServiceImpl implements IOrdersSentQueryService {
log.info("今日暂无,需回单单据");
return;
}
log.info("开始回单,近45天共{}张单据",sents.size());
// 按物流公司分类
Map<String, List<OrdersSentDto>> transportMap = sents.stream().collect(Collectors.groupingBy(OrdersSentDto::getTransport));
getOrderSentReceiptBy109(transportMap.get("109"));
......@@ -71,25 +72,29 @@ public class OrdersSentQueryServiceImpl implements IOrdersSentQueryService {
private void getOrderSentReceiptBy109(List<OrdersSentDto> ordersSentDtos) {
if (CollectionUtils.isEmpty(ordersSentDtos)) {
log.info("今日[109-跨越]暂无,需回单单据");
log.info("[109-跨越]暂无,需回单单据");
return;
}
// 填写Object完整路径(不包含Bucket名称),例:[path]/[文件名.扩展名]
String ossON = "wuliu/" + DateUtils.getYearMonth() + "/跨越/";
// 将ordersSentDtos按长度分割,每10个分割
List<List<OrdersSentDto>> split = ordersSentDtos.stream().collect(Collectors.groupingBy(it -> ordersSentDtos.indexOf(it) / 10)).values().stream().collect(Collectors.toList());
log.info("[109-跨越]需回单{}张,分{}组",ordersSentDtos.size(),split.size());
for (List<OrdersSentDto> os : split) {
List<String> exNos = os.stream().map(it -> it.getExpressNo()).collect(Collectors.toList());
log.info("[109-跨越]开始处理:{}",JSONObject.toJSONString(exNos));
JSONArray waybillBaseInfo = kyeUtil.getWaybillBaseInfo(exNos);
if (CollectionUtils.isEmpty(waybillBaseInfo)){
log.info("[109-跨越]以上批次,未查询到物流信息");
continue;
}
log.info("[109-跨越]以上批次,查询到{}条物流信息",waybillBaseInfo.size());
for (Object o : waybillBaseInfo) {
disReceipt((JSONObject) o,ossON);
}
// todo
break;
}
}
......@@ -161,7 +166,7 @@ public class OrdersSentQueryServiceImpl implements IOrdersSentQueryService {
ordersSentDao.updatePushqcByAhSentNo(sent.getAhSentNo());
log.info("end push qc sent no [{}] 物流轨迹", sent.getAhSentNo());
}catch (Exception e) {
log.error("勤策推送物流地址失败,物流信息:{}", JSONObject.toJSONString(sent));
log.error("勤策推送物流地址失败,物流信息:{},异常信息:{}", JSONObject.toJSONString(sent),e.getMessage());
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论