完善视频号售后
This commit is contained in:
parent
e94d65ccd8
commit
4780a7463d
|
|
@ -0,0 +1,114 @@
|
||||||
|
package com.qihang.wei.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.qihangerp.open.wei.RefundApiHelper;
|
||||||
|
import cn.qihangerp.open.wei.common.ApiResultVo;
|
||||||
|
import cn.qihangerp.open.wei.model.AfterSaleOrder;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.qihang.common.common.AjaxResult;
|
||||||
|
import com.qihang.common.common.ResultVoEnum;
|
||||||
|
import com.qihang.common.enums.EnumShopType;
|
||||||
|
import com.qihang.common.enums.HttpStatus;
|
||||||
|
import com.qihang.common.mq.MqMessage;
|
||||||
|
import com.qihang.common.mq.MqType;
|
||||||
|
import com.qihang.security.common.BaseController;
|
||||||
|
import com.qihang.wei.bo.PullRequest;
|
||||||
|
import com.qihang.wei.domain.OmsWeiRefund;
|
||||||
|
import com.qihang.wei.service.OmsWeiRefundService;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.kafka.core.KafkaTemplate;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@RequestMapping("/refund")
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class WeiRefundApiController extends BaseController {
|
||||||
|
private final WeiApiCommon apiCommon;
|
||||||
|
private final OmsWeiRefundService refundService;
|
||||||
|
private final KafkaTemplate<String,Object> kafkaTemplate;
|
||||||
|
|
||||||
|
@RequestMapping(value = "/pull_list", method = RequestMethod.POST)
|
||||||
|
public AjaxResult pullList(@RequestBody PullRequest params) throws Exception {
|
||||||
|
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||||
|
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||||
|
}
|
||||||
|
|
||||||
|
Date currDateTime = new Date();
|
||||||
|
long beginTime = System.currentTimeMillis();
|
||||||
|
|
||||||
|
var checkResult = apiCommon.checkBefore(params.getShopId());
|
||||||
|
if (checkResult.getCode() != ResultVoEnum.SUCCESS.getIndex()) {
|
||||||
|
return AjaxResult.error(checkResult.getCode(), checkResult.getMsg(),checkResult.getData());
|
||||||
|
}
|
||||||
|
String accessToken = checkResult.getData().getAccessToken();
|
||||||
|
String serverUrl = checkResult.getData().getServerUrl();
|
||||||
|
String appKey = checkResult.getData().getAppKey();
|
||||||
|
String appSecret = checkResult.getData().getAppSecret();
|
||||||
|
|
||||||
|
// 获取最后更新时间
|
||||||
|
LocalDateTime endTime = LocalDateTime.now();
|
||||||
|
LocalDateTime startTime = endTime.minusDays(1);
|
||||||
|
|
||||||
|
int insertSuccess = 0;//新增成功的订单
|
||||||
|
int totalError = 0;
|
||||||
|
int hasExistOrder = 0;//已存在的订单数
|
||||||
|
|
||||||
|
ApiResultVo<AfterSaleOrder> apiResultVo = RefundApiHelper.pullRefundList(startTime, endTime, accessToken);
|
||||||
|
|
||||||
|
if(apiResultVo.getCode() == 0) {
|
||||||
|
// 拉取到了数据 拉取详情
|
||||||
|
if(apiResultVo.getList()!=null) {
|
||||||
|
for (var refundInfo : apiResultVo.getList()) {
|
||||||
|
|
||||||
|
OmsWeiRefund refund = new OmsWeiRefund();
|
||||||
|
refund.setOrderId(refundInfo.getOrder_id());
|
||||||
|
refund.setAfterSaleOrderId(refundInfo.getAfter_sale_order_id());
|
||||||
|
refund.setShopId(params.getShopId());
|
||||||
|
refund.setStatus(refundInfo.getStatus());
|
||||||
|
refund.setOpenid(refundInfo.getOpenid());
|
||||||
|
refund.setUnionid(refundInfo.getUnionid());
|
||||||
|
refund.setProductId(refundInfo.getProduct_info().getString("product_id"));
|
||||||
|
refund.setSkuId(refundInfo.getProduct_info().getString("sku_id"));
|
||||||
|
refund.setCount(refundInfo.getProduct_info().getInteger("count"));
|
||||||
|
refund.setFastRefund(refundInfo.getProduct_info().getString("fast_refund"));
|
||||||
|
refund.setRefundAmount(refundInfo.getRefund_info().getInteger("amount"));
|
||||||
|
refund.setRefundReason(refundInfo.getRefund_info().getInteger("refund_reason"));
|
||||||
|
refund.setReturnWaybillId(refundInfo.getReturn_info().getString("waybill_id"));
|
||||||
|
refund.setReturnDeliveryName(refundInfo.getReturn_info().getString("delivery_name"));
|
||||||
|
refund.setReturnDeliveryId(refundInfo.getReturn_info().getString("delivery_id"));
|
||||||
|
refund.setMerchantUploadInfo(JSONObject.toJSONString(refundInfo.getMerchant_upload_info()));
|
||||||
|
refund.setCreateTime(refundInfo.getCreate_time());
|
||||||
|
refund.setUpdateTime(refundInfo.getUpdate_time());
|
||||||
|
refund.setReason(refundInfo.getReason());
|
||||||
|
refund.setReasonText(refundInfo.getReason_text());
|
||||||
|
refund.setType(refundInfo.getType());
|
||||||
|
refund.setComplaintId(refundInfo.getComplaint_id());
|
||||||
|
refund.setRefundResp(JSONObject.toJSONString(refundInfo.getRefund_resp()));
|
||||||
|
refund.setDetails(JSONObject.toJSONString(refundInfo.getDetails()));
|
||||||
|
|
||||||
|
var result = refundService.saveRefund(params.getShopId(), refund);
|
||||||
|
if (result.getCode() == ResultVoEnum.DataExist.getIndex()) {
|
||||||
|
//已经存在
|
||||||
|
kafkaTemplate.send(MqType.REFUND_MQ, JSONObject.toJSONString(MqMessage.build(EnumShopType.DOU, MqType.REFUND_MESSAGE,refund.getAfterSaleOrderId())));
|
||||||
|
hasExistOrder++;
|
||||||
|
} else if (result.getCode() == ResultVoEnum.SUCCESS.getIndex()) {
|
||||||
|
kafkaTemplate.send(MqType.REFUND_MQ, JSONObject.toJSONString(MqMessage.build(EnumShopType.DOU, MqType.REFUND_MESSAGE,refund.getAfterSaleOrderId())));
|
||||||
|
insertSuccess++;
|
||||||
|
} else {
|
||||||
|
totalError++;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.qihang.wei.controller;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.qihang.common.common.AjaxResult;
|
||||||
|
import com.qihang.common.common.PageQuery;
|
||||||
|
import com.qihang.common.common.PageResult;
|
||||||
|
import com.qihang.common.common.TableDataInfo;
|
||||||
|
import com.qihang.common.enums.EnumShopType;
|
||||||
|
import com.qihang.common.mq.MqMessage;
|
||||||
|
import com.qihang.common.mq.MqType;
|
||||||
|
import com.qihang.security.common.BaseController;
|
||||||
|
import com.qihang.wei.bo.WeiOrderPushBo;
|
||||||
|
import com.qihang.wei.domain.OmsWeiRefund;
|
||||||
|
import com.qihang.wei.service.OmsWeiRefundService;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.kafka.core.KafkaTemplate;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/refund")
|
||||||
|
public class WeiRefundController extends BaseController {
|
||||||
|
private final OmsWeiRefundService refundService;
|
||||||
|
private final KafkaTemplate<String,Object> kafkaTemplate;
|
||||||
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||||
|
public TableDataInfo goodsList(OmsWeiRefund bo, PageQuery pageQuery) {
|
||||||
|
PageResult<OmsWeiRefund> result = refundService.queryPageList(bo, pageQuery);
|
||||||
|
|
||||||
|
return getDataTable(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/push_oms")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult pushOms(@RequestBody WeiOrderPushBo bo) {
|
||||||
|
// TODO:需要优化消息格式
|
||||||
|
if(bo!=null && bo.getIds()!=null) {
|
||||||
|
for(String id: bo.getIds()) {
|
||||||
|
// mqUtils.sendApiMessage(MqMessage.build(EnumShopType.DOU, MqType.REFUND_MESSAGE, id));
|
||||||
|
kafkaTemplate.send(MqType.REFUND_MQ, JSONObject.toJSONString(MqMessage.build(EnumShopType.DOU, MqType.REFUND_MESSAGE,id)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,166 @@
|
||||||
|
package com.qihang.wei.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频号小店退款
|
||||||
|
* @TableName oms_wei_refund
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OmsWeiRefund implements Serializable {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺id
|
||||||
|
*/
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 售后单号
|
||||||
|
*/
|
||||||
|
private String afterSaleOrderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 售后单当前状态,参考:
|
||||||
|
USER_CANCELD 用户取消申请
|
||||||
|
MERCHANT_PROCESSING 商家受理中
|
||||||
|
MERCHANT_REJECT_REFUND 商家拒绝退款
|
||||||
|
MERCHANT_REJECT_RETURN 商家拒绝退货退款
|
||||||
|
USER_WAIT_RETURN 待买家退货
|
||||||
|
RETURN_CLOSED 退货退款关闭
|
||||||
|
MERCHANT_WAIT_RECEIPT 待商家收货
|
||||||
|
MERCHANT_OVERDUE_REFUND 商家逾期未退款
|
||||||
|
MERCHANT_REFUND_SUCCESS 退款完成
|
||||||
|
MERCHANT_RETURN_SUCCESS 退货退款完成
|
||||||
|
PLATFORM_REFUNDING 平台退款中
|
||||||
|
PLATFORM_REFUND_FAIL 平台退款失败
|
||||||
|
USER_WAIT_CONFIRM 待用户确认
|
||||||
|
MERCHANT_REFUND_RETRY_FAIL 商家打款失败,客服关闭售后
|
||||||
|
MERCHANT_FAIL 售后关闭
|
||||||
|
USER_WAIT_CONFIRM_UPDATE 待用户处理商家协商
|
||||||
|
USER_WAIT_HANDLE_MERCHANT_AFTER_SALE 待用户处理商家代发起的售后申请
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 买家身份标识
|
||||||
|
*/
|
||||||
|
private String openid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 买家在开放平台的唯一标识符,若当前视频号小店已绑定到微信开放平台账号下会返回
|
||||||
|
*/
|
||||||
|
private String unionid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品spuid
|
||||||
|
*/
|
||||||
|
private String productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品skuid
|
||||||
|
*/
|
||||||
|
private String skuId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 售后数量
|
||||||
|
*/
|
||||||
|
private Integer count;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否极速退款RefundInfo
|
||||||
|
*/
|
||||||
|
private String fastRefund;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标明售后单退款直接原因, 枚举值参考 RefundReason
|
||||||
|
*/
|
||||||
|
private Integer refundReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款金额(分)
|
||||||
|
*/
|
||||||
|
private Integer refundAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 快递单号
|
||||||
|
*/
|
||||||
|
private String returnWaybillId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流公司id
|
||||||
|
*/
|
||||||
|
private String returnDeliveryId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物流公司名称
|
||||||
|
*/
|
||||||
|
private String returnDeliveryName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 售后相关商品信息JSON
|
||||||
|
*/
|
||||||
|
private String merchantUploadInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 售后单创建时间戳
|
||||||
|
*/
|
||||||
|
private Integer createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 售后单更新时间戳
|
||||||
|
*/
|
||||||
|
private Integer updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款原因
|
||||||
|
*/
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款原因解释
|
||||||
|
*/
|
||||||
|
private String reasonText;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 售后类型。REFUND:退款;RETURN:退货退款。
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单号,该字段可用于获取订单
|
||||||
|
*/
|
||||||
|
private String orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* detail json
|
||||||
|
*/
|
||||||
|
private String details;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纠纷id,该字段可用于获取纠纷信息
|
||||||
|
*/
|
||||||
|
private String complaintId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信支付退款的响应
|
||||||
|
*/
|
||||||
|
private String refundResp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送状态(0未推送;1推送成功;2推送失败)
|
||||||
|
*/
|
||||||
|
private Integer pullStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单审核时间
|
||||||
|
*/
|
||||||
|
private Date pullTime;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.qihang.wei.mapper;
|
||||||
|
|
||||||
|
import com.qihang.wei.domain.OmsWeiRefund;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TW
|
||||||
|
* @description 针对表【oms_wei_refund(视频号小店退款)】的数据库操作Mapper
|
||||||
|
* @createDate 2024-06-20 17:07:27
|
||||||
|
* @Entity com.qihang.wei.domain.OmsWeiRefund
|
||||||
|
*/
|
||||||
|
public interface OmsWeiRefundMapper extends BaseMapper<OmsWeiRefund> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.qihang.wei.service;
|
||||||
|
|
||||||
|
import com.qihang.common.common.PageQuery;
|
||||||
|
import com.qihang.common.common.PageResult;
|
||||||
|
import com.qihang.common.common.ResultVo;
|
||||||
|
import com.qihang.wei.domain.OmsWeiRefund;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TW
|
||||||
|
* @description 针对表【oms_wei_refund(视频号小店退款)】的数据库操作Service
|
||||||
|
* @createDate 2024-06-20 17:07:27
|
||||||
|
*/
|
||||||
|
public interface OmsWeiRefundService extends IService<OmsWeiRefund> {
|
||||||
|
PageResult<OmsWeiRefund> queryPageList(OmsWeiRefund bo, PageQuery pageQuery);
|
||||||
|
ResultVo<Integer> saveRefund(Long shopId, OmsWeiRefund refund);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
package com.qihang.wei.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.qihang.common.common.PageQuery;
|
||||||
|
import com.qihang.common.common.PageResult;
|
||||||
|
import com.qihang.common.common.ResultVo;
|
||||||
|
import com.qihang.common.common.ResultVoEnum;
|
||||||
|
import com.qihang.wei.domain.OmsWeiRefund;
|
||||||
|
import com.qihang.wei.mapper.OmsWeiOrderItemMapper;
|
||||||
|
import com.qihang.wei.service.OmsWeiRefundService;
|
||||||
|
import com.qihang.wei.mapper.OmsWeiRefundMapper;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TW
|
||||||
|
* @description 针对表【oms_wei_refund(视频号小店退款)】的数据库操作Service实现
|
||||||
|
* @createDate 2024-06-20 17:07:27
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class OmsWeiRefundServiceImpl extends ServiceImpl<OmsWeiRefundMapper, OmsWeiRefund>
|
||||||
|
implements OmsWeiRefundService{
|
||||||
|
private final OmsWeiRefundMapper mapper;
|
||||||
|
private final OmsWeiOrderItemMapper orderItemMapper;
|
||||||
|
// private final MQClientService mqClientService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<OmsWeiRefund> queryPageList(OmsWeiRefund bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<OmsWeiRefund> queryWrapper = new LambdaQueryWrapper<OmsWeiRefund>()
|
||||||
|
.eq(bo.getShopId()!=null,OmsWeiRefund::getShopId,bo.getShopId())
|
||||||
|
.eq(StringUtils.hasText(bo.getOrderId()),OmsWeiRefund::getOrderId,bo.getOrderId())
|
||||||
|
;
|
||||||
|
|
||||||
|
Page<OmsWeiRefund> page = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||||
|
|
||||||
|
return PageResult.build(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public ResultVo<Integer> saveRefund(Long shopId, OmsWeiRefund refund) {
|
||||||
|
try {
|
||||||
|
List<OmsWeiRefund> refunds = mapper.selectList(new LambdaQueryWrapper<OmsWeiRefund>().eq(OmsWeiRefund::getAfterSaleOrderId, refund.getAfterSaleOrderId()));
|
||||||
|
OmsWeiRefund newRefund = new OmsWeiRefund();
|
||||||
|
if (refunds != null && refunds.size() > 0) {
|
||||||
|
newRefund = refunds.get(0);
|
||||||
|
// 存在,修改
|
||||||
|
OmsWeiRefund update = new OmsWeiRefund();
|
||||||
|
update.setId(refunds.get(0).getId());
|
||||||
|
update.setOrderId(refund.getOrderId());
|
||||||
|
update.setStatus(refund.getStatus());
|
||||||
|
update.setUpdateTime(refund.getUpdateTime());
|
||||||
|
update.setReturnWaybillId(refund.getReturnWaybillId());
|
||||||
|
update.setReturnDeliveryName(refund.getReturnDeliveryName());
|
||||||
|
update.setReturnDeliveryId(refund.getReturnDeliveryId());
|
||||||
|
update.setComplaintId(refund.getComplaintId());
|
||||||
|
mapper.updateById(update);
|
||||||
|
|
||||||
|
return ResultVo.error(ResultVoEnum.DataExist, "退款已经存在,更新成功");
|
||||||
|
} else {
|
||||||
|
newRefund = refund;
|
||||||
|
// 不存在,新增
|
||||||
|
refund.setShopId(shopId);
|
||||||
|
mapper.insert(refund);
|
||||||
|
return ResultVo.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
return ResultVo.error(ResultVoEnum.SystemException, "系统异常:" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.qihang.wei.mapper.OmsWeiRefundMapper">
|
||||||
|
|
||||||
|
<resultMap id="BaseResultMap" type="com.qihang.wei.domain.OmsWeiRefund">
|
||||||
|
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||||
|
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||||
|
<result property="afterSaleOrderId" column="after_sale_order_id" jdbcType="VARCHAR"/>
|
||||||
|
<result property="status" column="status" jdbcType="VARCHAR"/>
|
||||||
|
<result property="openid" column="openid" jdbcType="VARCHAR"/>
|
||||||
|
<result property="unionid" column="unionid" jdbcType="VARCHAR"/>
|
||||||
|
<result property="productId" column="product_id" jdbcType="VARCHAR"/>
|
||||||
|
<result property="skuId" column="sku_id" jdbcType="VARCHAR"/>
|
||||||
|
<result property="count" column="count" jdbcType="INTEGER"/>
|
||||||
|
<result property="fastRefund" column="fast_refund" jdbcType="VARCHAR"/>
|
||||||
|
<result property="refundReason" column="refund_reason" jdbcType="INTEGER"/>
|
||||||
|
<result property="refundAmount" column="refund_amount" jdbcType="INTEGER"/>
|
||||||
|
<result property="returnWaybillId" column="return_waybill_id" jdbcType="VARCHAR"/>
|
||||||
|
<result property="returnDeliveryId" column="return_delivery_id" jdbcType="VARCHAR"/>
|
||||||
|
<result property="returnDeliveryName" column="return_delivery_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="merchantUploadInfo" column="merchant_upload_info" jdbcType="VARCHAR"/>
|
||||||
|
<result property="createTime" column="create_time" jdbcType="INTEGER"/>
|
||||||
|
<result property="updateTime" column="update_time" jdbcType="INTEGER"/>
|
||||||
|
<result property="reason" column="reason" jdbcType="VARCHAR"/>
|
||||||
|
<result property="reasonText" column="reason_text" jdbcType="VARCHAR"/>
|
||||||
|
<result property="type" column="type" jdbcType="VARCHAR"/>
|
||||||
|
<result property="orderId" column="order_id" jdbcType="VARCHAR"/>
|
||||||
|
<result property="details" column="details" jdbcType="VARCHAR"/>
|
||||||
|
<result property="complaintId" column="complaint_id" jdbcType="VARCHAR"/>
|
||||||
|
<result property="refundResp" column="refund_resp" jdbcType="VARCHAR"/>
|
||||||
|
<result property="pullStatus" column="pull_status" jdbcType="INTEGER"/>
|
||||||
|
<result property="pullTime" column="pull_time" jdbcType="TIMESTAMP"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id,shop_id,after_sale_order_id,
|
||||||
|
status,openid,unionid,
|
||||||
|
product_id,sku_id,count,
|
||||||
|
fast_refund,refund_reason,refund_amount,
|
||||||
|
return_waybill_id,return_delivery_id,return_delivery_name,
|
||||||
|
merchant_upload_info,create_time,update_time,
|
||||||
|
reason,reason_text,type,
|
||||||
|
order_id,details,complaint_id,
|
||||||
|
refund_resp,pull_status,pull_time
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
||||||
|
|
@ -57,23 +57,23 @@
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
:loading="pullLoading"
|
:loading="pullLoading"
|
||||||
type="danger"
|
type="success"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-download"
|
icon="el-icon-download"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handlePull"
|
@click="handlePull"
|
||||||
>API拉取新退款</el-button>
|
>API拉取新退款</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="1.5">-->
|
<el-col :span="1.5">
|
||||||
<!-- <el-button-->
|
<el-button
|
||||||
<!-- type="primary"-->
|
type="primary"
|
||||||
<!-- plain-->
|
plain
|
||||||
<!-- icon="el-icon-refresh"-->
|
icon="el-icon-refresh"
|
||||||
<!-- size="mini"-->
|
size="mini"
|
||||||
<!-- :disabled="multiple"-->
|
:disabled="multiple"
|
||||||
<!-- @click="handlePushOms"-->
|
@click="handlePushOms"
|
||||||
<!-- >同步到ERP</el-button>-->
|
>手动推送售后</el-button>
|
||||||
<!-- </el-col>-->
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
|
@ -231,6 +231,7 @@ import { listShop } from "@/api/shop/shop";
|
||||||
import {MessageBox} from "element-ui";
|
import {MessageBox} from "element-ui";
|
||||||
import {isRelogin} from "@/utils/request";
|
import {isRelogin} from "@/utils/request";
|
||||||
import {listShopRefund, orderIntercept, pullRefund, returnedConfirm} from "@/api/wei/refund";
|
import {listShopRefund, orderIntercept, pullRefund, returnedConfirm} from "@/api/wei/refund";
|
||||||
|
import {pushOms} from "@/api/tao/taoRefund";
|
||||||
export default {
|
export default {
|
||||||
name: "RefundWei",
|
name: "RefundWei",
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -284,10 +285,13 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
listShop({platform:2}).then(response => {
|
listShop({platform: 2}).then(response => {
|
||||||
this.shopList = response.rows;
|
this.shopList = response.rows;
|
||||||
});
|
if (this.shopList && this.shopList.length > 0) {
|
||||||
|
this.queryParams.shopId = this.shopList[0].id
|
||||||
|
}
|
||||||
this.getList();
|
this.getList();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询淘宝退款订单列表 */
|
/** 查询淘宝退款订单列表 */
|
||||||
|
|
@ -324,10 +328,19 @@ export default {
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.refundId)
|
this.ids = selection.map(item => item.afterSaleOrderId)
|
||||||
this.single = selection.length!==1
|
this.single = selection.length!==1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
|
handlePushOms(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否手动推送到OMS?').then(function() {
|
||||||
|
return pushOms({ids:ids});
|
||||||
|
}).then(() => {
|
||||||
|
// this.getList();
|
||||||
|
this.$modal.msgSuccess("推送成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
handlePull() {
|
handlePull() {
|
||||||
if(this.queryParams.shopId){
|
if(this.queryParams.shopId){
|
||||||
this.pullLoading = true
|
this.pullLoading = true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue