Commit 5bf9a1012d96e856c41f66f6e62964c29d7804a0
1 parent
c136701e
update:推送微信发货留存手动触发接口
Showing
4 changed files
with
43 additions
and
10 deletions
etrade-order/src/main/java/com/diligrp/etrade/order/api/OrderController.java
... | ... | @@ -774,4 +774,21 @@ public class OrderController { |
774 | 774 | } |
775 | 775 | } |
776 | 776 | |
777 | + /** | |
778 | + * 查询核销状态 | |
779 | + * @param orderDto | |
780 | + * @return | |
781 | + */ | |
782 | + @RequestMapping(value = "/sendToWeChatDelivery",method = {RequestMethod.POST},produces="application/json;charset=UTF-8") | |
783 | + public Message sendToWeChatDelivery(@RequestBody OrderGetDto orderDto){ | |
784 | + try{ | |
785 | + return Message.success(orderService.SendToWeChatPay(orderDto)); | |
786 | + }catch (PlatformServiceException pe) { | |
787 | + LOGGER.warn("服务异常{}:{}",pe.getCode(), pe.getMessage()); | |
788 | + return Message.failure("服务暂时不在线,请稍后"); | |
789 | + } | |
790 | + } | |
791 | + | |
792 | + | |
793 | + | |
777 | 794 | } | ... | ... |
etrade-order/src/main/java/com/diligrp/etrade/order/service/OrderService.java
... | ... | @@ -225,6 +225,13 @@ public interface OrderService { |
225 | 225 | * @param weChatPayTradeBackDto |
226 | 226 | */ |
227 | 227 | List<Order> wxChatPayCallBack(WeChatPayTradeCallBackDto weChatPayTradeBackDto); |
228 | + | |
229 | + /** | |
230 | + * 测试推送发货接口 | |
231 | + * @param orderDto | |
232 | + */ | |
233 | + Integer SendToWeChatPay(OrderGetDto orderDto); | |
234 | + | |
228 | 235 | /** |
229 | 236 | * 微信支付失败回调 |
230 | 237 | * @param weChatPayTradeBackDto | ... | ... |
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/OrderDeliveryServiceImpl.java
... | ... | @@ -148,11 +148,7 @@ public class OrderDeliveryServiceImpl implements OrderDeliveryService { |
148 | 148 | WeChatPayFunctionDto weChatPayFunctionDto = new WeChatPayFunctionDto(); |
149 | 149 | weChatPayFunctionDto.setMarketId(marketId); |
150 | 150 | weChatPayFunctionDto.setPaymentId(paymentId); |
151 | - if(OrderAchieveType.BUYER_SELF.getCodeInteger().equals(deliveryType)){ | |
152 | - weChatPayFunctionDto.setLogisticsType(WeChatPayDeliverType.SELF_GET.getCode()); | |
153 | - }else{ | |
154 | - weChatPayFunctionDto.setLogisticsType(WeChatPayDeliverType.MARKET_SEND.getCode()); | |
155 | - } | |
151 | + weChatPayFunctionDto.setLogisticsType(deliveryType); | |
156 | 152 | return weChatPayRpcResolver.deliver(weChatPayFunctionDto); |
157 | 153 | } |
158 | 154 | ... | ... |
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/OrderServiceImpl.java
... | ... | @@ -938,6 +938,23 @@ public class OrderServiceImpl implements OrderService { |
938 | 938 | return orderList; |
939 | 939 | } |
940 | 940 | |
941 | + @Override | |
942 | + public Integer SendToWeChatPay(OrderGetDto orderDto){ | |
943 | + Order order = getOneOrder(orderDto); | |
944 | + if(order.getDeliverySendState()==null|| | |
945 | + !OrderConstant.SEND_TO_DELIVERY_SUCCESS.equals(order.getDeliverySendState())){ | |
946 | + OrderPayment orderPayment = orderPaymentService.getOrderPaymentById(order.getId(), order.getMarketId(), OrderPaymentState.FINISH_PAY.getCodeInteger()); | |
947 | + if(OrderPaymentAllChannel.BUYER_WX_CHANNEL.getCodeInteger().equals(orderPayment.getPayChannel())){ | |
948 | + Integer sendState = sendToWeChatPayDeliver(order.getMarketId(), orderPayment.getTradeId(), WeChatPayDeliverType.MARKET_SEND.getCode()); | |
949 | + orderMapper.updateDeliverySendStateByPaymentId(sendState,orderPayment.getTradeId()); | |
950 | + return sendState; | |
951 | + } | |
952 | + }else{ | |
953 | + return OrderConstant.SEND_TO_DELIVERY_SUCCESS; | |
954 | + } | |
955 | + return OrderConstant.SEND_TO_DELIVERY_FAIL; | |
956 | + } | |
957 | + | |
941 | 958 | private Integer sendToWeChatPayDeliver(Long marketId, String paymentId, Integer deliveryType) { |
942 | 959 | Message<WeChatPayInfoDto> weChatPayInfoDtoMessage = sendToPayRpcDeliver(marketId, paymentId, deliveryType); |
943 | 960 | if(!weChatPayInfoDtoMessage.getCode().equals(200)){ |
... | ... | @@ -951,11 +968,7 @@ public class OrderServiceImpl implements OrderService { |
951 | 968 | WeChatPayFunctionDto weChatPayFunctionDto = new WeChatPayFunctionDto(); |
952 | 969 | weChatPayFunctionDto.setMarketId(marketId); |
953 | 970 | weChatPayFunctionDto.setPaymentId(paymentId); |
954 | - if(OrderAchieveType.BUYER_SELF.getCodeInteger().equals(deliveryType)){ | |
955 | - weChatPayFunctionDto.setLogisticsType(WeChatPayDeliverType.SELF_GET.getCode()); | |
956 | - }else{ | |
957 | - weChatPayFunctionDto.setLogisticsType(WeChatPayDeliverType.MARKET_SEND.getCode()); | |
958 | - } | |
971 | + weChatPayFunctionDto.setLogisticsType(deliveryType); | |
959 | 972 | return weChatPayRpcResolver.deliver(weChatPayFunctionDto); |
960 | 973 | } |
961 | 974 | ... | ... |