提交 90e229a4 authored 作者: huyufan's avatar huyufan

同步运单

上级 9c84be1b
package com.clx.performance.param.feign.transport;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.*;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
......@@ -13,10 +10,7 @@ import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;
@Getter
@Setter
@ToString
@NoArgsConstructor
@Data
public class ThirdOrderChildBrokerParam {
@ApiModelProperty(value = "运单编码", dataType="String", required = true)
......
......@@ -144,6 +144,14 @@ public class ThirdComponent {
}
public static String decrypt(String data) {
try {
return EncryptUtil.decrypt(data, TRANSPORT_KEY);
} catch (GeneralSecurityException e) {
throw new RuntimeException(e);
}
}
public static Result<?> encryptPost(String url, String param, Integer httpLogId) {
try {
return HttpUtil.post(url, null,
......
......@@ -98,15 +98,15 @@ public class OrderCancelController {
@ApiOperation(value = "syncTest", notes = "<br>By:胡宇帆")
@GetMapping("/syncTest")
public Result<ThirdOrderChildBrokerResultVO> syncTest(@RequestParam String childNo) {
public Result<String> syncTest(@RequestParam String childNo) {
OrderChild orderChild = orderChildDao.getByChildNo(childNo).get();
OrderGoods orderGoods = orderGoodsDao.getByOrderGoodsNo(orderChild.getOrderGoodsNo()).get();
SettlementOwnerDetail settlementOwnerDetail = settlementOwnerDetailDao.getByChildNo(childNo).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
ThirdOrderChildBrokerParam param = transportSyncService.generateOrderChildSync(orderChild, orderGoods, settlementOwnerDetail);
log.info("=======================生成Param{}", JSONUtil.parse(param));
Result<ThirdOrderChildBrokerResultVO> result = transportFeignService.orderChildSync(param);
return result;
String result = transportFeignService.orderChildSync(param);
return Result.ok(result);
}
......
......@@ -23,9 +23,9 @@ public class TransportServiceImpl implements TransportService {
@Override
public ThirdOrderChildBrokerResultVO orderChildSync(ThirdOrderChildBrokerParam param) {
return Optional.ofNullable(transportFeignService.orderChildSync(param))
.filter(Result::succeed).orElseThrow(ResultCodeEnum.FAIL).getData();
// return Optional.ofNullable(transportFeignService.orderChildSync(param))
// .filter(Result::succeed).orElseThrow(ResultCodeEnum.FAIL).getData();
return null;
}
@Override
......
......@@ -22,7 +22,7 @@ public interface TransportFeignService {
* 运单同步
*/
@RequestMapping(value = "/transport-service/thirdParty/order/orderChildSync", method = RequestMethod.POST)
Result<ThirdOrderChildBrokerResultVO> orderChildSync(@RequestBody ThirdOrderChildBrokerParam param);
String orderChildSync(@RequestBody ThirdOrderChildBrokerParam param);
/**
* 运单支付运费同步
......
......@@ -70,7 +70,7 @@ public class SettlementServiceImpl implements SettlementService {
OrderGoods orderGoods = orderGoodsDao.getByOrderGoodsNo(orderChild.getOrderGoodsNo()).get();
//是否通过风控,调用网络货运
ThirdOrderChildBrokerParam param = transportSyncService.generateOrderChildSync(orderChild, orderGoods, settlementOwnerDetail);
Result<ThirdOrderChildBrokerResultVO> result = transportFeignService.orderChildSync(param);
String result = transportFeignService.orderChildSync(param);
System.out.println(result);
if (SettlementOwnerEnum.InvoiceType.ONLINE.getCode().equals(invoiceType) && settlementOwnerDetail.getPrepayFreight().compareTo(BigDecimal.ZERO) > 0) {
settlementDriverDetail.setPrepayFreightFlag(1);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论