补充 认证的 逻辑
This commit is contained in:
parent
471dfc0c8d
commit
e0bda00d71
@ -43,4 +43,11 @@ public @interface Auth {
|
|||||||
*/
|
*/
|
||||||
boolean isMobile() default false;
|
boolean isMobile() default false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家APP端
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean isMerchant() default false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,11 +48,7 @@ public class AuthInterceptor implements HandlerMethodArgumentResolver, Applicati
|
|||||||
public boolean supportsParameter(MethodParameter parameter) {
|
public boolean supportsParameter(MethodParameter parameter) {
|
||||||
if (parameter.hasParameterAnnotation(Auth.class)) {
|
if (parameter.hasParameterAnnotation(Auth.class)) {
|
||||||
return true;
|
return true;
|
||||||
} else if (parameter.getMethodAnnotation(Auth.class) != null) {
|
} else return parameter.getMethodAnnotation(Auth.class) != null;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -82,6 +78,9 @@ public class AuthInterceptor implements HandlerMethodArgumentResolver, Applicati
|
|||||||
if (auth.isMobile() && !user.isMobile()) {
|
if (auth.isMobile() && !user.isMobile()) {
|
||||||
throw new ApiException(ResultCode.FORBIDDEN);
|
throw new ApiException(ResultCode.FORBIDDEN);
|
||||||
}
|
}
|
||||||
|
if (auth.isMerchant() && !user.isMerchant()) {
|
||||||
|
throw new ApiException(ResultCode.FORBIDDEN);
|
||||||
|
}
|
||||||
|
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 订单信息表 前端控制器
|
* 订单信息表 后端控制器
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author Xinze
|
* @author Xinze
|
||||||
|
|||||||
@ -61,14 +61,16 @@ public class UserReturnController extends BaseControllerImpl {
|
|||||||
@ApiOperation(value = "添加退款退货-部分退货,卖家也可以决定不退货退款,买家申请退款不支持。卖家可以主动退款。", notes = "添加退款退货-发货退货,卖家也可以决定不退货退款,买家申请退款不支持。卖家可以主动退款。")
|
@ApiOperation(value = "添加退款退货-部分退货,卖家也可以决定不退货退款,买家申请退款不支持。卖家可以主动退款。", notes = "添加退款退货-发货退货,卖家也可以决定不退货退款,买家申请退款不支持。卖家可以主动退款。")
|
||||||
@RequestMapping(value = "/addItem", method = RequestMethod.GET)
|
@RequestMapping(value = "/addItem", method = RequestMethod.GET)
|
||||||
public CommonResult addItem(OrderReturnVo orderReturnVo) {
|
public CommonResult addItem(OrderReturnVo orderReturnVo) {
|
||||||
OrderReturnInputVo orderReturnInput = BeanUtil.copyProperties(orderReturnVo, OrderReturnInputVo.class);
|
OrderReturnInputVo orderReturnInputVo = BeanUtil.copyProperties(orderReturnVo, OrderReturnInputVo.class);
|
||||||
OrderReturnItemInputVo orderReturnItemInput = new OrderReturnItemInputVo();
|
|
||||||
orderReturnItemInput.setOrder_item_id(orderReturnVo.getOrder_item_id());
|
|
||||||
orderReturnItemInput.setReturn_item_num(orderReturnVo.getReturn_item_num());
|
|
||||||
orderReturnItemInput.setReturn_refund_amount(orderReturnVo.getReturn_refund_amount());
|
|
||||||
orderReturnInput.getReturn_items().add(orderReturnItemInput);
|
|
||||||
|
|
||||||
return shopOrderReturnService.addItem(orderReturnInput);
|
OrderReturnItemInputVo orderReturnItemInputVo = new OrderReturnItemInputVo();
|
||||||
|
orderReturnItemInputVo.setOrder_item_id(orderReturnVo.getOrder_item_id());
|
||||||
|
orderReturnItemInputVo.setReturn_item_num(orderReturnVo.getReturn_item_num());
|
||||||
|
orderReturnItemInputVo.setReturn_refund_amount(orderReturnVo.getReturn_refund_amount());
|
||||||
|
|
||||||
|
orderReturnInputVo.getReturn_items().add(orderReturnItemInputVo);
|
||||||
|
|
||||||
|
return shopOrderReturnService.addItem(orderReturnInputVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "添加退款退货-整单退货", notes = "添加退款退货-整单退货")
|
@ApiOperation(value = "添加退款退货-整单退货", notes = "添加退款退货-整单退货")
|
||||||
@ -80,7 +82,7 @@ public class UserReturnController extends BaseControllerImpl {
|
|||||||
throw new ApiUserException(I18nUtil._("用户信息异常!"));
|
throw new ApiUserException(I18nUtil._("用户信息异常!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return shopOrderReturnService.addWholeItems(order_id);
|
return shopOrderReturnService.addWholeItems(order_id, false, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "取消退款订单", notes = "取消退款订单")
|
@ApiOperation(value = "取消退款订单", notes = "取消退款订单")
|
||||||
|
|||||||
@ -40,6 +40,10 @@ public interface ShopOrderReturnService extends IBaseService<ShopOrderReturn> {
|
|||||||
|
|
||||||
long getReturnNum(List<Integer> return_state_id, Integer store_id, Integer subsite_id);
|
long getReturnNum(List<Integer> return_state_id, Integer store_id, Integer subsite_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param orderReturnInputVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
CommonResult addItem(OrderReturnInputVo orderReturnInputVo);
|
CommonResult addItem(OrderReturnInputVo orderReturnInputVo);
|
||||||
|
|
||||||
Map getReturnDetail(String return_id);
|
Map getReturnDetail(String return_id);
|
||||||
@ -145,12 +149,20 @@ public interface ShopOrderReturnService extends IBaseService<ShopOrderReturn> {
|
|||||||
boolean ifDenyReturn(Long order_item_id);
|
boolean ifDenyReturn(Long order_item_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加退款退货-整单退货
|
* 该方法用于处理整单退货申请,具体功能如下:
|
||||||
|
* 根据订单ID获取订单信息,若为空则抛异常。
|
||||||
|
* 检查订单是否已付款,未付款则不允许退货。
|
||||||
|
* 查询该订单是否已有未取消的退款单,如有则不能再次申请。
|
||||||
|
* 获取订单对应的商品列表,若为空则提示无商品。
|
||||||
|
* 构建退货请求对象 OrderReturnInputVo,包含订单商品信息(每个商品的数量和金额)。
|
||||||
|
* 调用 addItem 方法提交退货申请
|
||||||
*
|
*
|
||||||
* @param order_id
|
* @param orderId
|
||||||
|
* @param isSystemOpt 是否系统自动操作
|
||||||
|
* @param remark 退单备注
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
CommonResult addWholeItems(String order_id);
|
CommonResult addWholeItems(String orderId, Boolean isSystemOpt, String remark);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退货单转单-供应商
|
* 退货单转单-供应商
|
||||||
|
|||||||
@ -9,8 +9,11 @@ import cn.hutool.json.JSONObject;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
|
import com.suisung.mall.common.api.ResultCode;
|
||||||
import com.suisung.mall.common.api.StateCode;
|
import com.suisung.mall.common.api.StateCode;
|
||||||
import com.suisung.mall.common.constant.CommonConstant;
|
import com.suisung.mall.common.constant.CommonConstant;
|
||||||
|
import com.suisung.mall.common.domain.UserDto;
|
||||||
|
import com.suisung.mall.common.exception.ApiException;
|
||||||
import com.suisung.mall.common.feignService.AccountService;
|
import com.suisung.mall.common.feignService.AccountService;
|
||||||
import com.suisung.mall.common.feignService.PayService;
|
import com.suisung.mall.common.feignService.PayService;
|
||||||
import com.suisung.mall.common.feignService.SnsService;
|
import com.suisung.mall.common.feignService.SnsService;
|
||||||
@ -120,14 +123,10 @@ public class ShopOrderInfoServiceImpl extends BaseServiceImpl<ShopOrderInfoMappe
|
|||||||
public Map dashboard() {
|
public Map dashboard() {
|
||||||
|
|
||||||
Map data = dashboardSeller();
|
Map data = dashboardSeller();
|
||||||
Map map = new HashMap();
|
|
||||||
|
|
||||||
data.put("data", map);
|
data.put("data", new JSONObject().set("market",
|
||||||
|
new JSONObject().set("hall_num", 0).set("seller_num", 0))
|
||||||
Map market = new HashMap();
|
);
|
||||||
market.put("hall_num", 0);
|
|
||||||
market.put("seller_num", 0);
|
|
||||||
map.put("market", market);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
String hall_enable = accountBaseConfigService.getConfig("hall_enable");
|
String hall_enable = accountBaseConfigService.getConfig("hall_enable");
|
||||||
@ -554,14 +553,20 @@ public class ShopOrderInfoServiceImpl extends BaseServiceImpl<ShopOrderInfoMappe
|
|||||||
|
|
||||||
private Map dashboardSeller() {
|
private Map dashboardSeller() {
|
||||||
|
|
||||||
Map data = new HashMap();
|
UserDto userDto = getCurrentUser();
|
||||||
Integer store_id = Convert.toInt(getCurrentUser().getStore_id());
|
if (userDto == null) {
|
||||||
Integer chain_id = Convert.toInt(getCurrentUser().getChain_id());
|
throw new ApiException(ResultCode.FORBIDDEN);
|
||||||
Integer subsite_id = Convert.toInt(getCurrentUser().getSite_id());
|
}
|
||||||
|
|
||||||
|
Integer store_id = Convert.toInt(userDto.getStore_id());
|
||||||
|
Integer chain_id = Convert.toInt(userDto.getChain_id());
|
||||||
|
Integer subsite_id = Convert.toInt(userDto.getSite_id());
|
||||||
|
|
||||||
// List<Map> notice = snsService.getMsgUser(user_id);
|
// List<Map> notice = snsService.getMsgUser(user_id);
|
||||||
//
|
//
|
||||||
|
|
||||||
|
Map data = new HashMap();
|
||||||
|
|
||||||
Map order = new HashMap();
|
Map order = new HashMap();
|
||||||
|
|
||||||
// todo
|
// todo
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.core.util.PhoneUtil;
|
import cn.hutool.core.util.PhoneUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -901,17 +902,15 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
/**
|
/**
|
||||||
* 支付订单,顺丰同城配送超时,自动取消订单并退款,加库存
|
* 支付订单,顺丰同城配送超时,自动取消订单并退款,加库存
|
||||||
*
|
*
|
||||||
* @param orderId
|
* @param orderId <p>
|
||||||
* @param returnFlag 退货类型(ENUM): 0-不用退货;1-需要退货
|
* RETURN_PROCESS_SUBMIT = 3100; //【客户】提交退单1ReturnReturn
|
||||||
* <p>
|
* RETURN_PROCESS_CHECK = 3105; //退单审核1ReturnReturn
|
||||||
* RETURN_PROCESS_SUBMIT = 3100; //【客户】提交退单1ReturnReturn
|
* RETURN_PROCESS_RECEIVED = 3110; //收货确认0ReturnReturn
|
||||||
* RETURN_PROCESS_CHECK = 3105; //退单审核1ReturnReturn
|
* RETURN_PROCESS_REFUND = 3115; //退款确认0ReturnReturn
|
||||||
* RETURN_PROCESS_RECEIVED = 3110; //收货确认0ReturnReturn
|
* RETURN_PROCESS_RECEIPT_CONFIRMATION = 3120; //[【客户】收款确认0 ReturnReturn
|
||||||
* RETURN_PROCESS_REFUND = 3115; //退款确认0ReturnReturn
|
* RETURN_PROCESS_FINISH = 3125; //完成1退货退款
|
||||||
* RETURN_PROCESS_RECEIPT_CONFIRMATION = 3120; //[【客户】收款确认0 ReturnReturn
|
* RETURN_PROCESS_REFUSED = 3130; //-商家拒绝退货
|
||||||
* RETURN_PROCESS_FINISH = 3125; //完成1退货退款
|
* RETURN_PROCESS_CANCEL = 3135; //-买家取消退款
|
||||||
* RETURN_PROCESS_REFUSED = 3130; //-商家拒绝退货
|
|
||||||
* RETURN_PROCESS_CANCEL = 3135; //-买家取消退款
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GlobalTransactional
|
@GlobalTransactional
|
||||||
@ -919,7 +918,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
public Boolean sfExpressExpiredForceRefund(String orderId) {
|
public Boolean sfExpressExpiredForceRefund(String orderId) {
|
||||||
|
|
||||||
// 先整单退货申请
|
// 先整单退货申请
|
||||||
CommonResult commonResult = addWholeItems(orderId);
|
CommonResult commonResult = addWholeItems(orderId, true, "配送异常,系统自动退款!");
|
||||||
commonResult.checkFenResult();
|
commonResult.checkFenResult();
|
||||||
|
|
||||||
QueryWrapper<ShopOrderReturn> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ShopOrderReturn> queryWrapper = new QueryWrapper<>();
|
||||||
@ -929,7 +928,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
throw new ApiException(I18nUtil._("订单信息异常!"));
|
throw new ApiException(I18nUtil._("订单信息异常!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
shopOrderReturn.setReturn_flag(0);
|
shopOrderReturn.setReturn_flag(0); // 0-不用退货;1-需要退货
|
||||||
shopOrderReturn.setReturn_buyer_message("配送异常,系统自动退款");
|
shopOrderReturn.setReturn_buyer_message("配送异常,系统自动退款");
|
||||||
shopOrderReturn.setReturn_store_message("配送异常,系统自动退款");
|
shopOrderReturn.setReturn_store_message("配送异常,系统自动退款");
|
||||||
|
|
||||||
@ -1995,13 +1994,15 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
* 构建退货请求对象 OrderReturnInputVo,包含订单商品信息(每个商品的数量和金额)。
|
* 构建退货请求对象 OrderReturnInputVo,包含订单商品信息(每个商品的数量和金额)。
|
||||||
* 调用 addItem 方法提交退货申请
|
* 调用 addItem 方法提交退货申请
|
||||||
*
|
*
|
||||||
* @param order_id
|
* @param orderId
|
||||||
|
* @param isSystemOpt 是否系统自动操作
|
||||||
|
* @param remark 退单备注
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public CommonResult addWholeItems(String order_id) {
|
public CommonResult addWholeItems(String orderId, Boolean isSystemOpt, String remark) {
|
||||||
ShopOrderInfo orderInfo = shopOrderInfoService.get(order_id);
|
ShopOrderInfo orderInfo = shopOrderInfoService.get(orderId);
|
||||||
|
|
||||||
if (orderInfo == null) {
|
if (orderInfo == null) {
|
||||||
throw new ApiException(I18nUtil._("此订单信息为空!"));
|
throw new ApiException(I18nUtil._("此订单信息为空!"));
|
||||||
@ -2011,9 +2012,17 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
throw new ApiException(I18nUtil._("该订单未付款,无法申请!"));
|
throw new ApiException(I18nUtil._("该订单未付款,无法申请!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isSystemOpt == null) {
|
||||||
|
isSystemOpt = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StrUtil.isBlank(remark)) {
|
||||||
|
remark = "整单退!";
|
||||||
|
}
|
||||||
|
|
||||||
// 判断此订单商品是否已有退款单。
|
// 判断此订单商品是否已有退款单。
|
||||||
QueryWrapper<ShopOrderReturn> returnQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<ShopOrderReturn> returnQueryWrapper = new QueryWrapper<>();
|
||||||
returnQueryWrapper.eq("order_id", order_id).ne("return_state_id", StateCode.RETURN_PROCESS_CANCEL);
|
returnQueryWrapper.eq("order_id", orderId).ne("return_state_id", StateCode.RETURN_PROCESS_CANCEL);
|
||||||
List<ShopOrderReturn> shopOrderReturns = find(returnQueryWrapper);
|
List<ShopOrderReturn> shopOrderReturns = find(returnQueryWrapper);
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(shopOrderReturns)) {
|
if (CollectionUtil.isNotEmpty(shopOrderReturns)) {
|
||||||
@ -2021,24 +2030,27 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
}
|
}
|
||||||
|
|
||||||
QueryWrapper<ShopOrderItem> itemQueryWrapperOne = new QueryWrapper<>();
|
QueryWrapper<ShopOrderItem> itemQueryWrapperOne = new QueryWrapper<>();
|
||||||
itemQueryWrapperOne.eq("order_id", order_id);
|
itemQueryWrapperOne.eq("order_id", orderId);
|
||||||
List<ShopOrderItem> itemList = shopOrderItemService.find(itemQueryWrapperOne);
|
List<ShopOrderItem> itemList = shopOrderItemService.find(itemQueryWrapperOne);
|
||||||
|
|
||||||
if (CollectionUtil.isEmpty(itemList)) {
|
if (CollectionUtil.isEmpty(itemList)) {
|
||||||
throw new ApiException(I18nUtil._("订单商品表为空!"));
|
throw new ApiException(I18nUtil._("订单商品表为空!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 生成退款单
|
// 生成退款单
|
||||||
OrderReturnInputVo orderReturnInputVo = new OrderReturnInputVo();
|
OrderReturnInputVo orderReturnInputVo = new OrderReturnInputVo();
|
||||||
orderReturnInputVo.setOrder_id(order_id);
|
orderReturnInputVo.setOrder_id(orderId);
|
||||||
orderReturnInputVo.setReturn_tel(""); // 为什么不获取订单用户的手机号码
|
orderReturnInputVo.setReturn_tel(""); // 为什么不获取订单用户的手机号码
|
||||||
orderReturnInputVo.setReturn_buyer_message(I18nUtil._("整单退!"));
|
orderReturnInputVo.setReturn_buyer_message(I18nUtil._(remark));
|
||||||
orderReturnInputVo.setUser_id(orderInfo.getBuyer_user_id());
|
orderReturnInputVo.setUser_id(orderInfo.getBuyer_user_id());
|
||||||
|
orderReturnInputVo.setSystem_opear(isSystemOpt);
|
||||||
|
|
||||||
for (ShopOrderItem orderItem : itemList) {
|
for (ShopOrderItem orderItem : itemList) {
|
||||||
OrderReturnItemInputVo returnItemInputVo = new OrderReturnItemInputVo();
|
OrderReturnItemInputVo returnItemInputVo = new OrderReturnItemInputVo();
|
||||||
returnItemInputVo.setOrder_item_id(orderItem.getOrder_item_id());
|
returnItemInputVo.setOrder_item_id(orderItem.getOrder_item_id());
|
||||||
returnItemInputVo.setReturn_item_num(orderItem.getOrder_item_quantity());
|
returnItemInputVo.setReturn_item_num(orderItem.getOrder_item_quantity());
|
||||||
returnItemInputVo.setReturn_refund_amount(orderItem.getOrder_item_payment_amount());
|
returnItemInputVo.setReturn_refund_amount(orderItem.getOrder_item_payment_amount());
|
||||||
|
|
||||||
orderReturnInputVo.getReturn_items().add(returnItemInputVo);
|
orderReturnInputVo.getReturn_items().add(returnItemInputVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2170,12 +2182,65 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
/**
|
/**
|
||||||
* 商家退货退款,支持全单或个别商品退货
|
* 商家退货退款,支持全单或个别商品退货
|
||||||
*
|
*
|
||||||
* @param params
|
* @param params json格式数据 {orderId:"DD-20250706-1", OrderReturnInputVo}
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CommonResult doRefundForMch(JSONObject params) {
|
public CommonResult doRefundForMch(JSONObject params) {
|
||||||
return null;
|
if (params == null) {
|
||||||
|
return CommonResult.failed("缺少必要参数");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 订单Id 必填参数
|
||||||
|
String orderId = params.getStr("order_id");
|
||||||
|
if (StrUtil.isBlank(orderId)) {
|
||||||
|
return CommonResult.failed("缺少订单信息!");
|
||||||
|
}
|
||||||
|
|
||||||
|
UserDto userDto = getCurrentUser();
|
||||||
|
if (userDto == null) {
|
||||||
|
throw new ApiException(ResultCode.NEED_LOGIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
ShopOrderInfo orderInfo = shopOrderInfoService.get(orderId);
|
||||||
|
if (orderInfo == null) {
|
||||||
|
return CommonResult.failed("此订单信息为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (orderInfo.getOrder_is_paid().equals(StateCode.ORDER_PAID_STATE_NO)) {
|
||||||
|
return CommonResult.failed("该订单未付款,无法申请!");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (orderInfo.getStore_id().equals(userDto.getStore_id())) {
|
||||||
|
return CommonResult.failed("订单不是当前店铺的,无权退货!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 如果不是全单退,传入 orderReturnInputVoList
|
||||||
|
OrderReturnInputVo orderReturnInputVo = JSONUtil.toBean(params.getStr("orderReturnVo"), OrderReturnInputVo.class);
|
||||||
|
if (orderReturnInputVo != null && !CollUtil.isEmpty(orderReturnInputVo.getReturn_items())) {
|
||||||
|
// 判断原来订单里是否包含传入的退单记录
|
||||||
|
}
|
||||||
|
|
||||||
|
// 全单退流程分支
|
||||||
|
// 整单退货申请
|
||||||
|
CommonResult commonResult = addWholeItems(orderId, true, "商家整单退款!");
|
||||||
|
commonResult.checkFenResult();
|
||||||
|
|
||||||
|
QueryWrapper<ShopOrderReturn> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("order_id", orderId);
|
||||||
|
ShopOrderReturn shopOrderReturn = findOne(queryWrapper);
|
||||||
|
if (shopOrderReturn == null) {
|
||||||
|
throw new ApiException(I18nUtil._("订单信息异常!"));
|
||||||
|
}
|
||||||
|
|
||||||
|
shopOrderReturn.setReturn_flag(0); // 0-不用退货;1-需要退货
|
||||||
|
shopOrderReturn.setReturn_buyer_message("配送异常,系统自动退款");
|
||||||
|
shopOrderReturn.setReturn_store_message("配送异常,系统自动退款");
|
||||||
|
|
||||||
|
// 退货审核(商家同意退款,仅仅退款,因为商品还没有配送出去)
|
||||||
|
Boolean success = processReviewList(shopOrderReturn, 0);
|
||||||
|
return success ? CommonResult.success() : CommonResult.failed();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
24
pom.xml
24
pom.xml
@ -317,18 +317,18 @@
|
|||||||
<!-- sentinel配置 -->
|
<!-- sentinel配置 -->
|
||||||
<sentinel.transport.dashboard>114.132.210.208:8718</sentinel.transport.dashboard>
|
<sentinel.transport.dashboard>114.132.210.208:8718</sentinel.transport.dashboard>
|
||||||
<!-- mysql配置 -->
|
<!-- mysql配置 -->
|
||||||
<!-- <mysql.host>42.194.196.179</mysql.host>-->
|
<mysql.host>42.194.196.179</mysql.host>
|
||||||
<!-- <mysql.port>3306</mysql.port>-->
|
<mysql.port>3306</mysql.port>
|
||||||
<!-- <mysql.db>mall_dev</mysql.db>-->
|
<mysql.db>mall_dev</mysql.db>
|
||||||
<!-- <mysql.user>webdev</mysql.user>-->
|
<mysql.user>webdev</mysql.user>
|
||||||
<!-- <mysql.pwd>jbFr9YewcA9Mihx6fnw51Kzq</mysql.pwd>-->
|
<mysql.pwd>jbFr9YewcA9Mihx6fnw51Kzq</mysql.pwd>
|
||||||
<!-- <mysql.driver>com.mysql.cj.jdbc.Driver</mysql.driver>-->
|
<mysql.driver>com.mysql.cj.jdbc.Driver</mysql.driver>
|
||||||
<mysql.host>42.194.196.179</mysql.host>
|
<!-- <mysql.host>42.194.196.179</mysql.host>-->
|
||||||
<mysql.port>3306</mysql.port>
|
<!-- <mysql.port>3306</mysql.port>-->
|
||||||
<mysql.db>mall_prod</mysql.db>
|
<!-- <mysql.db>mall_prod</mysql.db>-->
|
||||||
<mysql.user>root</mysql.user>
|
<!-- <mysql.user>root</mysql.user>-->
|
||||||
<mysql.pwd>J0XivNvAcR14}pA6Cysm.E27</mysql.pwd>
|
<!-- <mysql.pwd>J0XivNvAcR14}pA6Cysm.E17</mysql.pwd>-->
|
||||||
<mysql.driver>com.mysql.cj.jdbc.Driver</mysql.driver>
|
<!-- <mysql.driver>com.mysql.cj.jdbc.Driver</mysql.driver>-->
|
||||||
<!-- redis配置 -->
|
<!-- redis配置 -->
|
||||||
<redis.host>114.132.210.208</redis.host>
|
<redis.host>114.132.210.208</redis.host>
|
||||||
<redis.database>15</redis.database>
|
<redis.database>15</redis.database>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user