|
@ -12,13 +12,16 @@ import org.jeecg.common.logistics.service.WeChatLogisticsService; |
|
|
import org.jeecg.common.logistics.util.WeChatLogisticsRequestBuilder; |
|
|
import org.jeecg.common.logistics.util.WeChatLogisticsRequestBuilder; |
|
|
import org.jeecg.modules.commonConfig.service.ICommonConfigService; |
|
|
import org.jeecg.modules.commonConfig.service.ICommonConfigService; |
|
|
import org.jeecg.modules.commonOrder.entity.CommonOrder; |
|
|
import org.jeecg.modules.commonOrder.entity.CommonOrder; |
|
|
|
|
|
import org.jeecg.modules.commonOrder.service.ICommonOrderService; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
import javax.annotation.PostConstruct; |
|
|
import javax.annotation.PostConstruct; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.List; |
|
|
import java.util.UUID; |
|
|
import java.util.UUID; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@Slf4j |
|
|
@Slf4j |
|
|
@Component |
|
|
@Component |
|
@ -36,6 +39,8 @@ public class LogisticsUtil { |
|
|
private WeChatLogisticsService weChatLogisticsService; |
|
|
private WeChatLogisticsService weChatLogisticsService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ICommonConfigService commonConfigService; |
|
|
private ICommonConfigService commonConfigService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ICommonOrderService orderService; |
|
|
|
|
|
|
|
|
public LogisticsUtil() { |
|
|
public LogisticsUtil() { |
|
|
// 默认构造函数 |
|
|
// 默认构造函数 |
|
@ -82,6 +87,15 @@ public class LogisticsUtil { |
|
|
try { |
|
|
try { |
|
|
ArrayList<String> address = getAddress(order.getAddress()); |
|
|
ArrayList<String> address = getAddress(order.getAddress()); |
|
|
|
|
|
|
|
|
|
|
|
List<String> titles = orderService |
|
|
|
|
|
.lambdaQuery() |
|
|
|
|
|
.eq(CommonOrder::getType, 0) |
|
|
|
|
|
.eq(CommonOrder::getPid, order.getId()) |
|
|
|
|
|
.select(CommonOrder::getTitle) |
|
|
|
|
|
.list().stream().map(n -> n.getTitle()) |
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DopOrder dto = new DopOrder(); |
|
|
DopOrder dto = new DopOrder(); |
|
|
|
|
|
|
|
|
dto.setCustOrderNo(order.getId()); // 客户订单号 |
|
|
dto.setCustOrderNo(order.getId()); // 客户订单号 |
|
@ -90,10 +104,10 @@ public class LogisticsUtil { |
|
|
|
|
|
|
|
|
// 创建包裹信息 |
|
|
// 创建包裹信息 |
|
|
DopPackageInfo packageInfo = new DopPackageInfo(); |
|
|
DopPackageInfo packageInfo = new DopPackageInfo(); |
|
|
packageInfo.setCargoName("货物名"); |
|
|
|
|
|
|
|
|
packageInfo.setCargoName(String.join(",", titles)); |
|
|
packageInfo.setDeliveryType("4"); |
|
|
packageInfo.setDeliveryType("4"); |
|
|
packageInfo.setTotalNumber(1); |
|
|
packageInfo.setTotalNumber(1); |
|
|
packageInfo.setTotalVolume(0.01); |
|
|
|
|
|
|
|
|
packageInfo.setTotalVolume(1); |
|
|
packageInfo.setTotalWeight(10); |
|
|
packageInfo.setTotalWeight(10); |
|
|
packageInfo.setPackageService("纸"); |
|
|
packageInfo.setPackageService("纸"); |
|
|
dto.setPackageInfo(packageInfo); |
|
|
dto.setPackageInfo(packageInfo); |
|
|