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

同步运单

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