Commit 83e3f2d954e982ed07259d206e991d86d5563938
1 parent
87806423
update:付款暂存
Showing
6 changed files
with
92 additions
and
99 deletions
etrade-order/src/main/java/com/diligrp/etrade/order/api/OrderController.java
@@ -746,21 +746,21 @@ public class OrderController { | @@ -746,21 +746,21 @@ public class OrderController { | ||
746 | } | 746 | } |
747 | 747 | ||
748 | 748 | ||
749 | - /** | ||
750 | - * 查询是否可以微信支付 | ||
751 | - * @param order | ||
752 | - * @return | ||
753 | - */ | ||
754 | - @RequestMapping(value = "/checkWechatPayEnable",method = {RequestMethod.POST},produces="application/json;charset=UTF-8") | ||
755 | - public Message<Boolean> getOneOrderDetail(@RequestBody OrderDto order){ | ||
756 | - try{ | ||
757 | - Boolean enable = orderService.checkWechatPayEnable(order.getMarketId(),order.getShopId()); | ||
758 | - return Message.success(enable); | ||
759 | - }catch (PlatformServiceException pe) { | ||
760 | - LOGGER.warn("服务异常{}:{}",pe.getCode(), pe.getMessage()); | ||
761 | - return Message.success(false); | ||
762 | - } | ||
763 | - } | 749 | +// /** |
750 | +// * 查询是否可以微信支付 | ||
751 | +// * @param order | ||
752 | +// * @return | ||
753 | +// */ | ||
754 | +// @RequestMapping(value = "/checkWechatPayEnable",method = {RequestMethod.POST},produces="application/json;charset=UTF-8") | ||
755 | +// public Message<Boolean> getOneOrderDetail(@RequestBody OrderDto order){ | ||
756 | +// try{ | ||
757 | +// Boolean enable = orderService.checkWechatPayEnable(order.getMarketId(),order.getShopId()); | ||
758 | +// return Message.success(enable); | ||
759 | +// }catch (PlatformServiceException pe) { | ||
760 | +// LOGGER.warn("服务异常{}:{}",pe.getCode(), pe.getMessage()); | ||
761 | +// return Message.success(false); | ||
762 | +// } | ||
763 | +// } | ||
764 | 764 | ||
765 | /** | 765 | /** |
766 | * 查询核销状态 | 766 | * 查询核销状态 |
etrade-order/src/main/java/com/diligrp/etrade/order/model/ShopCartMessage.java
@@ -298,12 +298,4 @@ public class ShopCartMessage extends BaseDo implements Serializable { | @@ -298,12 +298,4 @@ public class ShopCartMessage extends BaseDo implements Serializable { | ||
298 | public void setCheckFlag(Integer checkFlag) { | 298 | public void setCheckFlag(Integer checkFlag) { |
299 | this.checkFlag = checkFlag; | 299 | this.checkFlag = checkFlag; |
300 | } | 300 | } |
301 | - | ||
302 | - public Long getShopCartId() { | ||
303 | - return shopCartId; | ||
304 | - } | ||
305 | - | ||
306 | - public void setShopCartId(Long shopCartId) { | ||
307 | - this.shopCartId = shopCartId; | ||
308 | - } | ||
309 | } | 301 | } |
310 | \ No newline at end of file | 302 | \ No newline at end of file |
etrade-order/src/main/java/com/diligrp/etrade/order/service/OrderService.java
@@ -244,13 +244,13 @@ public interface OrderService { | @@ -244,13 +244,13 @@ public interface OrderService { | ||
244 | */ | 244 | */ |
245 | OrderPaymentCheckDto checkPayState(String paymentId,Long marketId); | 245 | OrderPaymentCheckDto checkPayState(String paymentId,Long marketId); |
246 | 246 | ||
247 | - /** | ||
248 | - * 检测商户是否可以进行微信支付 | ||
249 | - * @param marketId | ||
250 | - * @param shopId | ||
251 | - * @return | ||
252 | - */ | ||
253 | - Boolean checkWechatPayEnable(Long marketId, Long shopId); | 247 | +// /** |
248 | +// * 检测商户是否可以进行微信支付 | ||
249 | +// * @param marketId | ||
250 | +// * @param shopId | ||
251 | +// * @return | ||
252 | +// */ | ||
253 | +// Boolean checkWechatPayEnable(Long marketId, Long shopId); | ||
254 | 254 | ||
255 | /** | 255 | /** |
256 | * 获取订单状态 | 256 | * 获取订单状态 |
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/OrderServiceImpl.java
@@ -989,18 +989,18 @@ public class OrderServiceImpl implements OrderService { | @@ -989,18 +989,18 @@ public class OrderServiceImpl implements OrderService { | ||
989 | return orderPaymentCheckDto; | 989 | return orderPaymentCheckDto; |
990 | } | 990 | } |
991 | 991 | ||
992 | - @Override | ||
993 | - public Boolean checkWechatPayEnable(Long marketId, Long shopId) { | ||
994 | - if(weChatPayRpcResolver.checkWeChatPayChannel(new WeChatPayFunctionDto(null,null,marketId))){ | ||
995 | - ShopCo shopCo = new ShopCo(); | ||
996 | - shopCo.setId(shopId); | ||
997 | - ShopVo shopVo = shopService.detail(shopCo); | ||
998 | - if(StringUtils.isNotBlank(shopVo.getWxMerchantNumber())){ | ||
999 | - return true; | ||
1000 | - } | ||
1001 | - } | ||
1002 | - return false; | ||
1003 | - } | 992 | +// @Override |
993 | +// public Boolean checkWechatPayEnable(Long marketId, Long shopId) { | ||
994 | +// if(weChatPayRpcResolver.checkWeChatPayChannel(new WeChatPayFunctionDto(null,null,marketId))){ | ||
995 | +// ShopCo shopCo = new ShopCo(); | ||
996 | +// shopCo.setId(shopId); | ||
997 | +// ShopVo shopVo = shopService.detail(shopCo); | ||
998 | +// if(StringUtils.isNotBlank(shopVo.getWxMerchantNumber())){ | ||
999 | +// return true; | ||
1000 | +// } | ||
1001 | +// } | ||
1002 | +// return false; | ||
1003 | +// } | ||
1004 | 1004 | ||
1005 | @Override | 1005 | @Override |
1006 | public OrderDto checkOrderState(String code) { | 1006 | public OrderDto checkOrderState(String code) { |
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/ShopCartMessageServiceImpl.java
@@ -137,6 +137,7 @@ public class ShopCartMessageServiceImpl implements IShopCartMessageService { | @@ -137,6 +137,7 @@ public class ShopCartMessageServiceImpl implements IShopCartMessageService { | ||
137 | AssertUtils.isTrue(shopCartMessageOld.getType().equals(shopCartMessageDto.getType()), "历史购物车商品信息与新增购物车商品信息卖货方式不同"); | 137 | AssertUtils.isTrue(shopCartMessageOld.getType().equals(shopCartMessageDto.getType()), "历史购物车商品信息与新增购物车商品信息卖货方式不同"); |
138 | shopCartMessageDto.setId(shopCartMessageOld.getId()); | 138 | shopCartMessageDto.setId(shopCartMessageOld.getId()); |
139 | shopCartMessageDto.setVersion(shopCartMessageOld.getVersion()); | 139 | shopCartMessageDto.setVersion(shopCartMessageOld.getVersion()); |
140 | + shopCartMessageDto.setCheckFlag(shopCartMessageOld.getCheckFlag()); | ||
140 | //如果是处理离线缓存数据,bo=true,总重量做覆盖,不是处理离线数据,总重量做增量 | 141 | //如果是处理离线缓存数据,bo=true,总重量做覆盖,不是处理离线数据,总重量做增量 |
141 | if (bo) { | 142 | if (bo) { |
142 | //如果缓存时间在更新之前之前,说明缓存数据不是最新数据,则不进行更新操作 | 143 | //如果缓存时间在更新之前之前,说明缓存数据不是最新数据,则不进行更新操作 |
etrade-rpc/src/main/java/com/diligrp/etrade/rpc/resolver/WeChatPayRpcResolver.java
@@ -34,10 +34,10 @@ public class WeChatPayRpcResolver { | @@ -34,10 +34,10 @@ public class WeChatPayRpcResolver { | ||
34 | public static final String PAY_STATE_CHECK ="wechat.payment.service:state"; | 34 | public static final String PAY_STATE_CHECK ="wechat.payment.service:state"; |
35 | /** 微信支付关闭订单 */ | 35 | /** 微信支付关闭订单 */ |
36 | public static final String PAY_STATE_CLOSE ="wechat.payment.service:close"; | 36 | public static final String PAY_STATE_CLOSE ="wechat.payment.service:close"; |
37 | - /** 微信支付历史交易查询 */ | ||
38 | - public static final String PAY_STATE_INFO ="wechat.payment.service:statement"; | ||
39 | - /** 微信支付退款 */ | ||
40 | - public static final String REFUND_STATE_INFO ="wechat.payment.service:refund"; | 37 | +// /** 微信支付历史交易查询 */ |
38 | +// public static final String PAY_STATE_INFO ="wechat.payment.service:statement"; | ||
39 | +// /** 微信支付退款 */ | ||
40 | +// public static final String REFUND_STATE_INFO ="wechat.payment.service:refund"; | ||
41 | 41 | ||
42 | @Autowired | 42 | @Autowired |
43 | private PayRpc payRpc; | 43 | private PayRpc payRpc; |
@@ -102,61 +102,61 @@ public class WeChatPayRpcResolver { | @@ -102,61 +102,61 @@ public class WeChatPayRpcResolver { | ||
102 | } | 102 | } |
103 | } | 103 | } |
104 | 104 | ||
105 | - /** | ||
106 | - * 微信流水查询 | ||
107 | - * @param weChatPayFunctionDto | ||
108 | - * @return | ||
109 | - */ | ||
110 | - public Message<WeChatPayInfoDto> weChatPayInfo(WeChatPayFunctionDto weChatPayFunctionDto){ | ||
111 | - //组装headers | ||
112 | - HttpHeaders prepareHeaders = creatHeader(weChatPayFunctionDto.getMarketId().toString(), PAY_STATE_INFO); | ||
113 | - Message<WeChatPayInfoDto> cancelJsonObject = payRpc.wechatPayInfo(weChatPayFunctionDto, prepareHeaders); | ||
114 | - if(!cancelJsonObject.getCode().equals(200)){ | ||
115 | - log.info("微信流水查询入参{},请求体头部为{},请求结果为{}",weChatPayFunctionDto,prepareHeaders,cancelJsonObject); | ||
116 | - throw new PlatformServiceException(ErrorCode.SYSTEM_UNKNOWN_ERROR, "微信流水查询失败:" + cancelJsonObject.getMessage()); | ||
117 | - }else { | ||
118 | - return cancelJsonObject; | ||
119 | - } | ||
120 | - } | 105 | +// /** |
106 | +// * 微信流水查询 | ||
107 | +// * @param weChatPayFunctionDto | ||
108 | +// * @return | ||
109 | +// */ | ||
110 | +// public Message<WeChatPayInfoDto> weChatPayInfo(WeChatPayFunctionDto weChatPayFunctionDto){ | ||
111 | +// //组装headers | ||
112 | +// HttpHeaders prepareHeaders = creatHeader(weChatPayFunctionDto.getMarketId().toString(), PAY_STATE_INFO); | ||
113 | +// Message<WeChatPayInfoDto> cancelJsonObject = payRpc.wechatPayInfo(weChatPayFunctionDto, prepareHeaders); | ||
114 | +// if(!cancelJsonObject.getCode().equals(200)){ | ||
115 | +// log.info("微信流水查询入参{},请求体头部为{},请求结果为{}",weChatPayFunctionDto,prepareHeaders,cancelJsonObject); | ||
116 | +// throw new PlatformServiceException(ErrorCode.SYSTEM_UNKNOWN_ERROR, "微信流水查询失败:" + cancelJsonObject.getMessage()); | ||
117 | +// }else { | ||
118 | +// return cancelJsonObject; | ||
119 | +// } | ||
120 | +// } | ||
121 | 121 | ||
122 | - /** | ||
123 | - * 查询微信支付通道是否配置 | ||
124 | - * @param weChatPayFunctionDto | ||
125 | - * @return | ||
126 | - */ | ||
127 | - public Boolean checkWeChatPayChannel(WeChatPayFunctionDto weChatPayFunctionDto){ | ||
128 | - //组装headers | ||
129 | - try { | ||
130 | - HttpHeaders prepareHeaders = creatHeader(weChatPayFunctionDto.getMarketId().toString(), PAY_STATE_INFO); | ||
131 | - Message<WeChatPayFunctionBackDto> cancelJsonObject = payRpc.checkWeChatPayChannel(weChatPayFunctionDto, prepareHeaders); | ||
132 | - if (!cancelJsonObject.getCode().equals(200)) { | ||
133 | - log.info("微信流水查询入参{},请求体头部为{},请求结果为{}", weChatPayFunctionDto, prepareHeaders, cancelJsonObject); | ||
134 | - return false; | ||
135 | - } else { | ||
136 | - return true; | ||
137 | - } | ||
138 | - }catch (Exception e){ | ||
139 | - log.warn("通道查询异常",e); | ||
140 | - return false; | ||
141 | - } | ||
142 | - } | 122 | +// /** |
123 | +// * 查询微信支付通道是否配置 | ||
124 | +// * @param weChatPayFunctionDto | ||
125 | +// * @return | ||
126 | +// */ | ||
127 | +// public Boolean checkWeChatPayChannel(WeChatPayFunctionDto weChatPayFunctionDto){ | ||
128 | +// //组装headers | ||
129 | +// try { | ||
130 | +// HttpHeaders prepareHeaders = creatHeader(weChatPayFunctionDto.getMarketId().toString(), PAY_STATE_INFO); | ||
131 | +// Message<WeChatPayFunctionBackDto> cancelJsonObject = payRpc.checkWeChatPayChannel(weChatPayFunctionDto, prepareHeaders); | ||
132 | +// if (!cancelJsonObject.getCode().equals(200)) { | ||
133 | +// log.info("微信流水查询入参{},请求体头部为{},请求结果为{}", weChatPayFunctionDto, prepareHeaders, cancelJsonObject); | ||
134 | +// return false; | ||
135 | +// } else { | ||
136 | +// return true; | ||
137 | +// } | ||
138 | +// }catch (Exception e){ | ||
139 | +// log.warn("通道查询异常",e); | ||
140 | +// return false; | ||
141 | +// } | ||
142 | +// } | ||
143 | 143 | ||
144 | - /** | ||
145 | - * 微信退款 | ||
146 | - * @param weChatPayTradeDto | ||
147 | - * @return | ||
148 | - */ | ||
149 | - public Message<EcapWeChatRefundVo> refund(WeChatPayTradeDto weChatPayTradeDto){ | ||
150 | - //组装headers | ||
151 | - HttpHeaders prepareHeaders = creatHeader(weChatPayTradeDto.getMarketId().toString(), REFUND_STATE_INFO); | ||
152 | - Message<EcapWeChatRefundVo> cancelJsonObject = payRpc.refund(weChatPayTradeDto, prepareHeaders); | ||
153 | - if(!cancelJsonObject.getCode().equals(200)){ | ||
154 | - log.info("微信流水查询入参{},请求体头部为{},请求结果为{}",weChatPayTradeDto,prepareHeaders,cancelJsonObject); | ||
155 | - throw new PlatformServiceException(ErrorCode.SYSTEM_UNKNOWN_ERROR, "微信流水查询失败:" + cancelJsonObject.getMessage()); | ||
156 | - }else { | ||
157 | - return cancelJsonObject; | ||
158 | - } | ||
159 | - } | 144 | +// /** |
145 | +// * 微信退款 | ||
146 | +// * @param weChatPayTradeDto | ||
147 | +// * @return | ||
148 | +// */ | ||
149 | +// public Message<EcapWeChatRefundVo> refund(WeChatPayTradeDto weChatPayTradeDto){ | ||
150 | +// //组装headers | ||
151 | +// HttpHeaders prepareHeaders = creatHeader(weChatPayTradeDto.getMarketId().toString(), REFUND_STATE_INFO); | ||
152 | +// Message<EcapWeChatRefundVo> cancelJsonObject = payRpc.refund(weChatPayTradeDto, prepareHeaders); | ||
153 | +// if(!cancelJsonObject.getCode().equals(200)){ | ||
154 | +// log.info("微信流水查询入参{},请求体头部为{},请求结果为{}",weChatPayTradeDto,prepareHeaders,cancelJsonObject); | ||
155 | +// throw new PlatformServiceException(ErrorCode.SYSTEM_UNKNOWN_ERROR, "微信流水查询失败:" + cancelJsonObject.getMessage()); | ||
156 | +// }else { | ||
157 | +// return cancelJsonObject; | ||
158 | +// } | ||
159 | +// } | ||
160 | /** | 160 | /** |
161 | * 组装headers | 161 | * 组装headers |
162 | * @param marketId | 162 | * @param marketId |