Commit 4e00e149 by 周晓航

修改判断逻辑

Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent c901851a
...@@ -1778,7 +1778,7 @@ public class OrderAdapter { ...@@ -1778,7 +1778,7 @@ public class OrderAdapter {
// fisherman 虚拟券商品是否可退款配置校验 // fisherman 虚拟券商品是否可退款配置校验
if (orderBean.getBizType().compareTo(BizTypeEnum.SALE_COUPON.getBizType()) == 0) { if (orderBean.getBizType().compareTo(BizTypeEnum.SALE_COUPON.getBizType()) == 0) {
return this.checkRefundButtionBizTypeIs6(orderBean.getCompanyId(), orderBean.getBizType(), return this.checkRefundButtionBizTypeIs6(orderBean.getCompanyId(), orderBean.getBizType(),
orderBean.getStatus(),wxAppId, new Date(orderBean.getGmtCreate())); orderBean.getStatus(),wxAppId, new Date(orderBean.getGmtCreate()), orderBean.getOrderType());
} }
boolean canRefund = false; boolean canRefund = false;
...@@ -1862,12 +1862,14 @@ public class OrderAdapter { ...@@ -1862,12 +1862,14 @@ public class OrderAdapter {
* @param createTime * @param createTime
* @return * @return
*/ */
public boolean checkRefundButtionBizTypeIs6(String partnerId, Integer bizType, Integer orderState, String wxAppId, Date createTime) { public boolean checkRefundButtionBizTypeIs6(String partnerId, Integer bizType, Integer orderState, String wxAppId, Date createTime, Integer orderType) {
if (bizType.compareTo(BizTypeEnum.SALE_COUPON.getBizType()) != 0 || orderState.compareTo(OrderStatusV1.COMPLETE.getV1Code()) != 0) { if (bizType.compareTo(BizTypeEnum.SALE_COUPON.getBizType()) != 0 || orderState.compareTo(OrderStatusV1.COMPLETE.getV1Code()) != 0) {
return false; return false;
} }
String redisKey = MessageFormat.format(OrderRedisKeyConstant.ORDER_REFUND_CONFIG, partnerId, wxAppId); String redisKey = MessageFormat.format(OrderRedisKeyConstant.ORDER_REFUND_CONFIG, partnerId, wxAppId);
String hashKey = OrderRedisKeyConstant.HashKeyForOrderRefundConfig.EAT_IN; String hashKey = OrderType.TAKE_OUT.getCode().equals(orderType)
? OrderRedisKeyConstant.HashKeyForOrderRefundConfig.TAKE_OUT
: OrderRedisKeyConstant.HashKeyForOrderRefundConfig.EAT_IN;;
String configStr = redisCache.hashGet(redisKey, hashKey); String configStr = redisCache.hashGet(redisKey, hashKey);
if (StringUtils.isNotEmpty(configStr)) { if (StringUtils.isNotEmpty(configStr)) {
OrderRefundConfigEntity config = JSON.parseObject(configStr, OrderRefundConfigEntity.class); OrderRefundConfigEntity config = JSON.parseObject(configStr, OrderRefundConfigEntity.class);
......
...@@ -3562,7 +3562,7 @@ public class OrderServiceImpl implements Orderservice { ...@@ -3562,7 +3562,7 @@ public class OrderServiceImpl implements Orderservice {
// fisherman 查询配置是否能退款 未完成 // fisherman 查询配置是否能退款 未完成
boolean isTrue = orderAdapter.checkRefundButtionBizTypeIs6(orderBean.getCompanyId(), orderBean.getBizType(), boolean isTrue = orderAdapter.checkRefundButtionBizTypeIs6(orderBean.getCompanyId(), orderBean.getBizType(),
orderBean.getStatus(),userLoginInfoDto.getWxAppId(), new Date(orderBean.getGmtCreate())); orderBean.getStatus(),userLoginInfoDto.getWxAppId(), new Date(orderBean.getGmtCreate()), orderBean.getOrderType());
if (isTrue) { if (isTrue) {
return ResponseUtil.success(); return ResponseUtil.success();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment