Commit 37554da8 by 周晓航

仅支持 餐饮订单操作该接口

parent 81d21bf1
......@@ -3574,18 +3574,20 @@ public class OrderServiceImpl implements Orderservice {
if (CollectionUtils.isEmpty(orderRefundVo.getOrderCodes())) {
return ResponseUtil.error(ResponseResult.ORDER_QUERYORDER_ERROR.getCode(), "未传递订单号");
}
BaseResponse finalResp = new BaseResponse();
Map<String, String> resultMap = new HashMap<>();
orderRefundVo.getOrderCodes().forEach(orderCode -> {
BaseResponse resp = this.batchDevelopRefund(orderRefundVo, orderCode);
if (Objects.equals(resp.getCode(), ResponseResult.SUCCESS.getCode())) {
resultMap.put(orderCode, "成功");
} else {
resultMap.put(orderCode, resp.getMessage());
try {
BaseResponse resp = this.batchDevelopRefund(orderRefundVo, orderCode);
if (Objects.equals(resp.getCode(), ResponseResult.SUCCESS.getCode())) {
resultMap.put(orderCode, "成功");
} else {
resultMap.put(orderCode, resp.getMessage());
}
}catch (Exception e){
resultMap.put(orderCode, e.getMessage());
}
});
return finalResp;
return ResponseUtil.success(resultMap);
}
private BaseResponse batchDevelopRefund(OrderDevelopRefundVo orderRefundVo, String orderCode) {
......@@ -3611,21 +3613,9 @@ public class OrderServiceImpl implements Orderservice {
if (NewOrderStatus.CLOSED.getIndex().equals(orderBean.getStatusV2())) {
return ResponseUtil.error(ResponseResult.ORDER__ERRORREFUND.getCode(), "订单已取消,无法退款");
}
// 微商城订单
if (Objects.equals(BizTypeEnum.MALL.getBizType(), orderBean.getBizType()) || Objects.equals("23", orderBean.getOrderClient())) {
// 完成/配送中 可以选择退货退款
List<Integer> refundGoodsCodes = Arrays.asList(
NewOrderStatus.DELIVERING.getIndex(), NewOrderStatus.COMPLETE.getIndex());
if (!refundGoodsCodes.contains(orderBean.getStatusV2()) && !Objects.equals(RefundModeEnum.UN_REFUND_GOODS.getIndex(), orderRefundVo.getRefundMode())) {
return ResponseUtil.error(ResponseResult.ORDER__ERRORREFUND.getCode(), "还未发货,请选择只退款不退货");
}
// 拼团类型
if (Objects.equals(MarketTypeEnum.GROUPB.getIndex().byteValue(), orderBean.getMarketingType())
&& (StringUtils.isBlank(orderBean.getSpellGroupCode()) || StringUtils.isBlank(orderBean.getSpellGroupActivityCode()))) {
return ResponseUtil.error(ResponseResult.SPELL_GROUP_QUERY_GROUP_WORK_ERROR);
}
} else if (NewOrderStatus.DELIVERING.getIndex().equals(orderBean.getStatusV2())) {
return ResponseUtil.error(ResponseResult.ORDER__ERRORREFUND.getCode(), "订单配送中,退款请联系售后!");
// fisherman 仅仅支持 餐饮类订单进行操作
if (BizTypeEnum.ORDINARY.getBizType().compareTo(orderBean.getBizType()) !=0) {
return ResponseUtil.error(ResponseResult.ORDER__ERRORREFUND.getCode(), "仅支持餐饮订单操作");
}
// fisherman 该接口的调用 肯定是因已经商户确认要退款的操作, 所以不走正常的 是否可退款判断
......
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