完善dou售后
This commit is contained in:
parent
8d5ca873ea
commit
e94d65ccd8
|
|
@ -0,0 +1,113 @@
|
|||
package com.qihang.dou.controller;
|
||||
|
||||
|
||||
import cn.qihangerp.open.dou.DouRefundApiHelper;
|
||||
import cn.qihangerp.open.dou.DouTokenApiHelper;
|
||||
import cn.qihangerp.open.dou.common.ApiResultVo;
|
||||
import cn.qihangerp.open.dou.model.Token;
|
||||
import cn.qihangerp.open.dou.model.after.AfterSale;
|
||||
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.dou.domain.OmsDouRefund;
|
||||
import com.qihang.dou.domain.bo.DouRequest;
|
||||
import com.qihang.dou.service.OmsDouRefundService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
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;
|
||||
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/refund")
|
||||
@RestController
|
||||
public class DouRefundApiController {
|
||||
private static Logger logger = LoggerFactory.getLogger(DouRefundApiController.class);
|
||||
private final DouApiHelper douApiHelper;
|
||||
private final OmsDouRefundService refundService;
|
||||
private final KafkaTemplate<String,Object> kafkaTemplate;
|
||||
@RequestMapping(value = "/pull_refund", method = RequestMethod.POST)
|
||||
public AjaxResult pullRefundList(@RequestBody DouRequest req) throws Exception {
|
||||
if (req.getShopId() == null || req.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
var checkResult = douApiHelper.checkBefore(req.getShopId());
|
||||
if (checkResult.getCode() != ResultVoEnum.SUCCESS.getIndex()) {
|
||||
return AjaxResult.error(checkResult.getCode(), checkResult.getMsg(), checkResult.getData());
|
||||
}
|
||||
|
||||
String accessToken = checkResult.getData().getAccessToken();
|
||||
String url = checkResult.getData().getServerUrl();
|
||||
String appKey = checkResult.getData().getAppKey();
|
||||
String appSercet = checkResult.getData().getAppSecret();
|
||||
|
||||
ApiResultVo<Token> token = DouTokenApiHelper.getToken(appKey, appSercet,checkResult.getData().getSellerShopId());
|
||||
if(token.getCode()==0) {
|
||||
accessToken = token.getData().getAccessToken();
|
||||
}else{
|
||||
return AjaxResult.error(token.getMsg());
|
||||
}
|
||||
|
||||
Long endTime = System.currentTimeMillis() / 1000;//订单更新结束时间
|
||||
Long startTime = endTime-(60 * 60 * 24 * 7);//订单更新开始时间
|
||||
|
||||
int insertSuccess = 0;//新增成功的订单
|
||||
int totalError = 0;
|
||||
int hasExistOrder = 0;//已存在的订单数
|
||||
ApiResultVo<AfterSale> apiResultVo = DouRefundApiHelper.pullAfterSaleList(startTime, endTime, 0, 50, appKey, appSercet, accessToken);
|
||||
|
||||
if (apiResultVo.getCode() != 0) return AjaxResult.error(apiResultVo.getCode(), apiResultVo.getMsg());
|
||||
|
||||
Integer total = apiResultVo.getTotalRecords();
|
||||
//成功
|
||||
if (apiResultVo.getList() != null) {
|
||||
for (var item:apiResultVo.getList()) {
|
||||
OmsDouRefund refund = new OmsDouRefund();
|
||||
|
||||
BeanUtils.copyProperties(item.getAftersaleInfo(), refund);
|
||||
refund.setOrderLogistics(JSONObject.toJSONString(item.getAftersaleInfo().getOrderLogistics()));
|
||||
refund.setAftersaleTags(JSONObject.toJSONString(item.getAftersaleInfo().getAftersaleTags()));
|
||||
refund.setAutoAuditBits(JSONObject.toJSONString(item.getAftersaleInfo().getAutoAuditBits()));
|
||||
refund.setTextPart(JSONObject.toJSONString(item.getTextPart()));
|
||||
refund.setRelatedOrderInfo(JSONObject.toJSONString(item.getOrderInfo().getRelatedOrderInfo()));
|
||||
refund.setOrderSkuOrderId(item.getOrderInfo().getRelatedOrderInfo().get(0).getSkuOrderId());
|
||||
refund.setOrderStatus(item.getOrderInfo().getRelatedOrderInfo().get(0).getOrderStatus());
|
||||
refund.setOrderPayAmount(item.getOrderInfo().getRelatedOrderInfo().get(0).getPayAmount());
|
||||
refund.setOrderPostAmount(item.getOrderInfo().getRelatedOrderInfo().get(0).getPostAmount());
|
||||
refund.setOrderItemNum(item.getOrderInfo().getRelatedOrderInfo().get(0).getItemNum());
|
||||
refund.setOrderProductId(item.getOrderInfo().getRelatedOrderInfo().get(0).getProductId()+"");
|
||||
refund.setOrderProductName(item.getOrderInfo().getRelatedOrderInfo().get(0).getProductName());
|
||||
refund.setOrderProductImage(item.getOrderInfo().getRelatedOrderInfo().get(0).getProductImage());
|
||||
refund.setOrderShopSkuCode(item.getOrderInfo().getRelatedOrderInfo().get(0).getShopSkuCode());
|
||||
refund.setOrderSkuSpec(JSONObject.toJSONString(item.getOrderInfo().getRelatedOrderInfo().get(0).getSkuSpec()));
|
||||
//插入订单数据
|
||||
var result = refundService.saveRefund(req.getShopId(), refund);
|
||||
if (result.getCode() == ResultVoEnum.DataExist.getIndex()) {
|
||||
//已经存在
|
||||
logger.info("/**************主动更新pdd订单:开始更新数据库:" + refund.getAftersaleId() + "存在、更新****************/");
|
||||
kafkaTemplate.send(MqType.REFUND_MQ, JSONObject.toJSONString(MqMessage.build(EnumShopType.DOU, MqType.REFUND_MESSAGE,refund.getAftersaleId().toString())));
|
||||
hasExistOrder++;
|
||||
} else if (result.getCode() == ResultVoEnum.SUCCESS.getIndex()) {
|
||||
logger.info("/**************主动更新pdd订单:开始更新数据库:" + refund.getAftersaleId() + "不存在、新增****************/");
|
||||
kafkaTemplate.send(MqType.REFUND_MQ, JSONObject.toJSONString(MqMessage.build(EnumShopType.DOU, MqType.REFUND_MESSAGE,refund.getAftersaleId().toString())));
|
||||
insertSuccess++;
|
||||
} else {
|
||||
logger.info("/**************主动更新pdd订单:开始更新数据库:" + refund.getAftersaleId() + "报错****************/");
|
||||
totalError++;
|
||||
}
|
||||
}
|
||||
}
|
||||
String msg = "成功,总共找到:" + apiResultVo.getList().size() + "条商品数据,新增:" + insertSuccess + "条,添加错误:" + totalError + "条,更新:" + hasExistOrder + "条";
|
||||
logger.info(msg);
|
||||
return AjaxResult.success(msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.qihang.dou.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.dou.domain.OmsDouRefund;
|
||||
import com.qihang.dou.domain.bo.DouOrderPushBo;
|
||||
import com.qihang.dou.domain.bo.DouRefundBo;
|
||||
import com.qihang.dou.service.OmsDouRefundService;
|
||||
import com.qihang.security.common.BaseController;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.kafka.core.KafkaTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 拼多多订单Controller
|
||||
*
|
||||
* @author qihang
|
||||
* @date 2024-01-02
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/refund")
|
||||
public class DouRefundController extends BaseController
|
||||
{
|
||||
private final KafkaTemplate<String,Object> kafkaTemplate;
|
||||
private final OmsDouRefundService refundService;
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
public TableDataInfo orderList(DouRefundBo bo, PageQuery pageQuery) {
|
||||
PageResult<OmsDouRefund> result = refundService.queryPageList(bo, pageQuery);
|
||||
|
||||
return getDataTable(result);
|
||||
}
|
||||
|
||||
@PostMapping("/push_oms")
|
||||
@ResponseBody
|
||||
public AjaxResult pushOms(@RequestBody DouOrderPushBo 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,263 @@
|
|||
package com.qihang.dou.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 抖店退款表
|
||||
* @TableName oms_dou_refund
|
||||
*/
|
||||
@Data
|
||||
public class OmsDouRefund implements Serializable {
|
||||
/**
|
||||
* 售后订单id,自增
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单所属商户id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 售后id
|
||||
*/
|
||||
private Long aftersaleId;
|
||||
|
||||
/**
|
||||
* 售后订单类型,枚举为-1(历史订单),1(商品单),2(店铺单)
|
||||
*/
|
||||
private Long aftersaleOrderType;
|
||||
|
||||
/**
|
||||
* 售后类型;0-退货退款;1-已发货仅退款;2-未发货仅退款;3-换货;6-价保;7-补寄;8-维修
|
||||
*/
|
||||
private Long aftersaleType;
|
||||
|
||||
/**
|
||||
* 售后状态和请求参数standard_aftersale_status字段对应;3-换货待买家收货;6-待商家同意;7-待买家退货;8-待商家发货;11-待商家二次同意;12-售后成功;14-换货成功;27-商家一次拒绝;28-售后失败;29-商家二次拒绝;
|
||||
*/
|
||||
private Long aftersaleStatus;
|
||||
|
||||
/**
|
||||
* 售后完结时间,完结时间是平台根据商品的类型,售后状态等综合判断生成,当售后单有完结时间返回时售后单不可再做任何操作;未完结售后单的该字段值为0;Unix时间戳:秒
|
||||
*/
|
||||
private Long aftersaleStatusToFinalTime;
|
||||
|
||||
/**
|
||||
*
|
||||
关联的订单ID
|
||||
*/
|
||||
private String relatedId;
|
||||
|
||||
/**
|
||||
* 抖音子订单id
|
||||
*/
|
||||
private String orderSkuOrderId;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
private Integer orderStatus;
|
||||
|
||||
/**
|
||||
* 付款金额
|
||||
*/
|
||||
private Integer orderPayAmount;
|
||||
|
||||
/**
|
||||
*
|
||||
付运费金额
|
||||
*/
|
||||
private Integer orderPostAmount;
|
||||
|
||||
/**
|
||||
* 购买数量
|
||||
*/
|
||||
private Integer orderItemNum;
|
||||
|
||||
/**
|
||||
* 商品名
|
||||
*/
|
||||
private String orderProductName;
|
||||
|
||||
/**
|
||||
* 商品图片
|
||||
*/
|
||||
private String orderProductImage;
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private String orderProductId;
|
||||
|
||||
/**
|
||||
* 商品规格JSON
|
||||
*/
|
||||
private String orderSkuSpec;
|
||||
|
||||
/**
|
||||
* 商家SKU编码
|
||||
*/
|
||||
private String orderShopSkuCode;
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
private Long applyTime;
|
||||
|
||||
/**
|
||||
* 最近更新时间
|
||||
*/
|
||||
private Long updateTime;
|
||||
|
||||
/**
|
||||
* 当前节点逾期时间
|
||||
*/
|
||||
private Long statusDeadline;
|
||||
|
||||
/**
|
||||
* 售后退款金额,单位为分
|
||||
*/
|
||||
private Long refundAmount;
|
||||
|
||||
/**
|
||||
* 售后退运费金额,单位为分
|
||||
*/
|
||||
private Long refundPostAmount;
|
||||
|
||||
/**
|
||||
*
|
||||
售后数量
|
||||
*/
|
||||
private Long aftersaleNum;
|
||||
|
||||
/**
|
||||
* 部分退类型
|
||||
*/
|
||||
private Long partType;
|
||||
|
||||
/**
|
||||
* 售后退款类型,枚举为-1(历史数据默认值),0(订单货款/原路退款),1(货到付款线下退款),2(备用金),3(保证金),4(无需退款),5(平台垫付)
|
||||
*/
|
||||
private Long aftersaleRefundType;
|
||||
|
||||
/**
|
||||
* 退款方式,枚举为1(极速退款助手)、2(售后小助手)、3(售后急速退)、4(闪电退货)
|
||||
*/
|
||||
private Long refundType;
|
||||
|
||||
/**
|
||||
* 仲裁状态,枚举为0(无仲裁记录),1(仲裁中),2(客服同意),3(客服拒绝),4(待商家举证),5(协商期),255(仲裁结束)
|
||||
*/
|
||||
private Long arbitrateStatus;
|
||||
|
||||
/**
|
||||
*
|
||||
售后单创建时间
|
||||
*/
|
||||
private Long createTime;
|
||||
|
||||
/**
|
||||
* 风控理由
|
||||
*/
|
||||
private String riskDecisionReason;
|
||||
|
||||
/**
|
||||
* 风控描述
|
||||
*/
|
||||
private String riskDecisionDescription;
|
||||
|
||||
/**
|
||||
* 退优惠金额
|
||||
*/
|
||||
private Long returnPromotionAmount;
|
||||
|
||||
/**
|
||||
* 退款状态;1-待退款;2-退款中;3-退款成功;4-退款失败;5-追缴成功;
|
||||
*/
|
||||
private Long refundStatus;
|
||||
|
||||
/**
|
||||
* 仲裁责任方 1:商家责任,2:买家责任,3:双方有责,4:平台责任,5:达人责任
|
||||
*/
|
||||
private Long arbitrateBlame;
|
||||
|
||||
/**
|
||||
* 退货物流单号
|
||||
*/
|
||||
private String returnLogisticsCode;
|
||||
|
||||
/**
|
||||
* 退货物流公司名称
|
||||
*/
|
||||
private String returnLogisticsCompanyName;
|
||||
|
||||
/**
|
||||
* 换货SKU信息JSON
|
||||
*/
|
||||
private String exchangeSkuInfo;
|
||||
|
||||
/**
|
||||
* 换货物流公司名称
|
||||
*/
|
||||
private String exchangeLogisticsCompanyName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 买家是否收到货物,0表示未收到,1表示收到
|
||||
*/
|
||||
private Long gotPkg;
|
||||
|
||||
/**
|
||||
* 是否拒签后退款(1:已同意拒签, 2:未同意拒签)
|
||||
*/
|
||||
private Long isAgreeRefuseSign;
|
||||
|
||||
/**
|
||||
* 商家首次发货的正向物流信息JSON
|
||||
*/
|
||||
private String orderLogistics;
|
||||
|
||||
/**
|
||||
* 售后标签(含时效延长、风险预警、豁免体验分等标签)标签在平台侧会有更新,标签仅做展示使用,请勿作为系统判断依赖。JSON
|
||||
*/
|
||||
private String aftersaleTags;
|
||||
|
||||
/**
|
||||
* 售后子类型;8001-以换代修。
|
||||
*/
|
||||
private Long aftersaleSubType;
|
||||
|
||||
/**
|
||||
* 自动审核方式:1-发货前极速退;2-小助手自动同意退款;3-发货后极速退;4-闪电退货;5-跨境零秒退;6-云仓拦截自动退;7-小助手自动同意退货;8-小助手自动同意拒签后退款;9-商家代客填写卡片发起售后;10-治理未发货自动同意退款;11-治理已发货自动同意退款;12-商家快递拦截成功自动退款;13-质检商品免审核;14-协商方案自动同意退款;15-平台卡券自动同意退款;16-三方卡券自动同意退款;17-治理一审自动同意退货退款
|
||||
*/
|
||||
private String autoAuditBits;
|
||||
|
||||
/**
|
||||
* 文案部分JSON
|
||||
*/
|
||||
private String textPart;
|
||||
|
||||
/**
|
||||
* 售后关联的订单信息JSON
|
||||
*/
|
||||
private String relatedOrderInfo;
|
||||
|
||||
/**
|
||||
* 第一次拉取时间
|
||||
*/
|
||||
private Date pullTime;
|
||||
|
||||
/**
|
||||
* 最后一次拉取时间
|
||||
*/
|
||||
private Date pullLastTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.qihang.dou.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DouRefundBo {
|
||||
private Integer shopId;
|
||||
private Integer aftersaleType;
|
||||
private Long orderId;
|
||||
private String aftersaleId;
|
||||
private Integer aftersaleStatus;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.dou.mapper;
|
||||
|
||||
import com.qihang.dou.domain.OmsDouRefund;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_dou_refund(抖店退款表)】的数据库操作Mapper
|
||||
* @createDate 2024-06-20 16:59:03
|
||||
* @Entity com.qihang.dou.domain.OmsDouRefund
|
||||
*/
|
||||
public interface OmsDouRefundMapper extends BaseMapper<OmsDouRefund> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.dou.service;
|
||||
|
||||
import com.qihang.common.common.PageQuery;
|
||||
import com.qihang.common.common.PageResult;
|
||||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.dou.domain.OmsDouRefund;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.qihang.dou.domain.bo.DouRefundBo;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_dou_refund(抖店退款表)】的数据库操作Service
|
||||
* @createDate 2024-06-20 16:59:03
|
||||
*/
|
||||
public interface OmsDouRefundService extends IService<OmsDouRefund> {
|
||||
PageResult<OmsDouRefund> queryPageList(DouRefundBo bo, PageQuery pageQuery);
|
||||
ResultVo<Integer> saveRefund(Long shopId, OmsDouRefund refund);
|
||||
}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
package com.qihang.dou.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.dou.domain.OmsDouRefund;
|
||||
import com.qihang.dou.domain.bo.DouRefundBo;
|
||||
import com.qihang.dou.service.OmsDouRefundService;
|
||||
import com.qihang.dou.mapper.OmsDouRefundMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_dou_refund(抖店退款表)】的数据库操作Service实现
|
||||
* @createDate 2024-06-20 16:59:03
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class OmsDouRefundServiceImpl extends ServiceImpl<OmsDouRefundMapper, OmsDouRefund>
|
||||
implements OmsDouRefundService{
|
||||
private final OmsDouRefundMapper mapper;
|
||||
|
||||
@Override
|
||||
public PageResult<OmsDouRefund> queryPageList(DouRefundBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OmsDouRefund> queryWrapper = new LambdaQueryWrapper<OmsDouRefund>()
|
||||
.eq(bo.getShopId()!=null,OmsDouRefund::getShopId,bo.getShopId())
|
||||
// .eq(bo.getCustomerExpect()!=null,OmsJdAfterSale::getCustomerExpect,bo.getCustomerExpect())
|
||||
// .eq(bo.getOrderId()!=null,OmsJdAfterSale::getOrderId,bo.getOrderId())
|
||||
// .eq(StringUtils.hasText(bo.getServiceId()),OmsJdAfterSale::getServiceId,bo.getServiceId())
|
||||
;
|
||||
|
||||
Page<OmsDouRefund> page = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||
|
||||
return PageResult.build(page);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public ResultVo<Integer> saveRefund(Long shopId, OmsDouRefund refund){
|
||||
List<OmsDouRefund> origin = mapper.selectList(new LambdaQueryWrapper<OmsDouRefund>().eq(OmsDouRefund::getAftersaleId,refund.getAftersaleId()));
|
||||
if(origin!=null&&origin.size()>0){
|
||||
// 存在,修改
|
||||
OmsDouRefund update = new OmsDouRefund();
|
||||
update.setId(origin.get(0).getId());
|
||||
update.setAftersaleOrderType(refund.getAftersaleOrderType());
|
||||
update.setAftersaleType(refund.getAftersaleType());
|
||||
update.setAftersaleStatus(refund.getAftersaleStatus());
|
||||
update.setAftersaleStatusToFinalTime(refund.getAftersaleStatusToFinalTime());
|
||||
update.setOrderStatus(refund.getOrderStatus());
|
||||
update.setUpdateTime(refund.getUpdateTime());
|
||||
update.setStatusDeadline(refund.getStatusDeadline());
|
||||
update.setRefundAmount(refund.getRefundAmount());
|
||||
update.setRefundPostAmount(refund.getRefundPostAmount());
|
||||
update.setAftersaleNum(refund.getAftersaleNum());
|
||||
update.setPartType(refund.getPartType());
|
||||
update.setAftersaleRefundType(refund.getAftersaleRefundType());
|
||||
update.setRefundType(refund.getRefundType());
|
||||
update.setArbitrateStatus(refund.getArbitrateStatus());
|
||||
update.setRefundStatus(refund.getRefundStatus());
|
||||
update.setRiskDecisionReason(refund.getRiskDecisionReason());
|
||||
update.setRiskDecisionDescription(refund.getRiskDecisionDescription());
|
||||
update.setArbitrateBlame(refund.getArbitrateBlame());
|
||||
update.setReturnLogisticsCode(refund.getReturnLogisticsCode());
|
||||
update.setReturnLogisticsCompanyName(refund.getReturnLogisticsCompanyName());
|
||||
update.setExchangeSkuInfo(refund.getExchangeSkuInfo());
|
||||
update.setExchangeLogisticsCompanyName(refund.getExchangeLogisticsCompanyName());
|
||||
update.setRemark(refund.getRemark());
|
||||
update.setGotPkg(refund.getGotPkg());
|
||||
update.setIsAgreeRefuseSign(refund.getIsAgreeRefuseSign());
|
||||
update.setOrderLogistics(refund.getOrderLogistics());
|
||||
update.setAftersaleTags(refund.getAftersaleTags());
|
||||
update.setAftersaleSubType(refund.getAftersaleSubType());
|
||||
update.setAutoAuditBits(refund.getAutoAuditBits());
|
||||
update.setTextPart(refund.getTextPart());
|
||||
update.setRelatedOrderInfo(refund.getRelatedOrderInfo());
|
||||
update.setPullLastTime(new Date());
|
||||
mapper.updateById(update);
|
||||
return ResultVo.error(ResultVoEnum.DataExist, "退款已经存在,更新成功");
|
||||
|
||||
}else{
|
||||
refund.setShopId(shopId);
|
||||
refund.setPullTime(new Date());
|
||||
mapper.insert(refund);
|
||||
return ResultVo.success();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
<?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.dou.mapper.OmsDouRefundMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.dou.domain.OmsDouRefund">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="BIGINT"/>
|
||||
<result property="aftersaleId" column="aftersale_id" jdbcType="BIGINT"/>
|
||||
<result property="aftersaleOrderType" column="aftersale_order_type" jdbcType="BIGINT"/>
|
||||
<result property="aftersaleType" column="aftersale_type" jdbcType="BIGINT"/>
|
||||
<result property="aftersaleStatus" column="aftersale_status" jdbcType="BIGINT"/>
|
||||
<result property="aftersaleStatusToFinalTime" column="aftersale_status_to_final_time" jdbcType="BIGINT"/>
|
||||
<result property="relatedId" column="related_id" jdbcType="VARCHAR"/>
|
||||
<result property="orderSkuOrderId" column="order_sku_order_id" jdbcType="VARCHAR"/>
|
||||
<result property="orderStatus" column="order_status" jdbcType="BIGINT"/>
|
||||
<result property="orderPayAmount" column="order_pay_amount" jdbcType="BIGINT"/>
|
||||
<result property="orderPostAmount" column="order_post_amount" jdbcType="BIGINT"/>
|
||||
<result property="orderItemNum" column="order_item_num" jdbcType="BIGINT"/>
|
||||
<result property="orderProductName" column="order_product_name" jdbcType="VARCHAR"/>
|
||||
<result property="orderProductImage" column="order_product_image" jdbcType="VARCHAR"/>
|
||||
<result property="orderProductId" column="order_product_id" jdbcType="VARCHAR"/>
|
||||
<result property="orderSkuSpec" column="order_sku_spec" jdbcType="VARCHAR"/>
|
||||
<result property="orderShopSkuCode" column="order_shop_sku_code" jdbcType="VARCHAR"/>
|
||||
<result property="applyTime" column="apply_time" jdbcType="BIGINT"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="BIGINT"/>
|
||||
<result property="statusDeadline" column="status_deadline" jdbcType="BIGINT"/>
|
||||
<result property="refundAmount" column="refund_amount" jdbcType="BIGINT"/>
|
||||
<result property="refundPostAmount" column="refund_post_amount" jdbcType="BIGINT"/>
|
||||
<result property="aftersaleNum" column="aftersale_num" jdbcType="BIGINT"/>
|
||||
<result property="partType" column="part_type" jdbcType="BIGINT"/>
|
||||
<result property="aftersaleRefundType" column="aftersale_refund_type" jdbcType="BIGINT"/>
|
||||
<result property="refundType" column="refund_type" jdbcType="BIGINT"/>
|
||||
<result property="arbitrateStatus" column="arbitrate_status" jdbcType="BIGINT"/>
|
||||
<result property="createTime" column="create_time" jdbcType="BIGINT"/>
|
||||
<result property="riskDecisionReason" column="risk_decision_reason" jdbcType="VARCHAR"/>
|
||||
<result property="riskDecisionDescription" column="risk_decision_description" jdbcType="VARCHAR"/>
|
||||
<result property="returnPromotionAmount" column="return_promotion_amount" jdbcType="BIGINT"/>
|
||||
<result property="refundStatus" column="refund_status" jdbcType="BIGINT"/>
|
||||
<result property="arbitrateBlame" column="arbitrate_blame" jdbcType="BIGINT"/>
|
||||
<result property="returnLogisticsCode" column="return_logistics_code" jdbcType="VARCHAR"/>
|
||||
<result property="returnLogisticsCompanyName" column="return_logistics_company_name" jdbcType="VARCHAR"/>
|
||||
<result property="exchangeSkuInfo" column="exchange_sku_info" jdbcType="VARCHAR"/>
|
||||
<result property="exchangeLogisticsCompanyName" column="exchange_logistics_company_name" jdbcType="VARCHAR"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="gotPkg" column="got_pkg" jdbcType="BIGINT"/>
|
||||
<result property="isAgreeRefuseSign" column="is_agree_refuse_sign" jdbcType="BIGINT"/>
|
||||
<result property="orderLogistics" column="order_logistics" jdbcType="VARCHAR"/>
|
||||
<result property="aftersaleTags" column="aftersale_tags" jdbcType="VARCHAR"/>
|
||||
<result property="aftersaleSubType" column="aftersale_sub_type" jdbcType="BIGINT"/>
|
||||
<result property="autoAuditBits" column="auto_audit_bits" jdbcType="VARCHAR"/>
|
||||
<result property="textPart" column="text_part" jdbcType="VARCHAR"/>
|
||||
<result property="relatedOrderInfo" column="related_order_info" jdbcType="VARCHAR"/>
|
||||
<result property="pullTime" column="pull_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="pullLastTime" column="pull_last_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,shop_id,aftersale_id,
|
||||
aftersale_order_type,aftersale_type,aftersale_status,
|
||||
aftersale_status_to_final_time,related_id,order_sku_order_id,
|
||||
order_status,order_pay_amount,order_post_amount,
|
||||
order_item_num,order_product_name,order_product_image,
|
||||
order_product_id,order_sku_spec,order_shop_sku_code,
|
||||
apply_time,update_time,status_deadline,
|
||||
refund_amount,refund_post_amount,aftersale_num,
|
||||
part_type,aftersale_refund_type,refund_type,
|
||||
arbitrate_status,create_time,risk_decision_reason,
|
||||
risk_decision_description,return_promotion_amount,refund_status,
|
||||
arbitrate_blame,return_logistics_code,return_logistics_company_name,
|
||||
exchange_sku_info,exchange_logistics_company_name,remark,
|
||||
got_pkg,is_agree_refuse_sign,order_logistics,
|
||||
aftersale_tags,aftersale_sub_type,auto_audit_bits,
|
||||
text_part,related_order_info,pull_time,
|
||||
pull_last_time
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询抖店订单退款列表
|
||||
export function listDouRefund(query) {
|
||||
return request({
|
||||
url: '/dou/douRefund/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询抖店订单退款详细
|
||||
export function getDouRefund(id) {
|
||||
return request({
|
||||
url: '/dou/douRefund/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增抖店订单退款
|
||||
export function addDouRefund(data) {
|
||||
return request({
|
||||
url: '/dou/douRefund',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改抖店订单退款
|
||||
export function updateDouRefund(data) {
|
||||
return request({
|
||||
url: '/dou/douRefund',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除抖店订单退款
|
||||
export function delDouRefund(id) {
|
||||
return request({
|
||||
url: '/dou/douRefund/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
@ -1,44 +1,27 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询抖店订单退款列表
|
||||
// 查询退款列表
|
||||
export function listRefund(query) {
|
||||
return request({
|
||||
url: '/dou/refund/list',
|
||||
url: '/api/dou-api/refund/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询抖店订单退款详细
|
||||
export function getRefund(id) {
|
||||
return request({
|
||||
url: '/dou/refund/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增抖店订单退款
|
||||
export function addRefund(data) {
|
||||
export function pullRefund(data) {
|
||||
return request({
|
||||
url: '/dou/refund',
|
||||
url: '/api/dou-api/refund/pull_list',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改抖店订单退款
|
||||
export function updateRefund(data) {
|
||||
export function pushOms(data) {
|
||||
return request({
|
||||
url: '/dou/refund',
|
||||
method: 'put',
|
||||
url: '/api/dou-api/refund/push_oms',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除抖店订单退款
|
||||
export function delRefund(id) {
|
||||
return request({
|
||||
url: '/dou/refund/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,9 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="售后单号" prop="aftersaleId">
|
||||
<el-input
|
||||
v-model="queryParams.aftersaleId"
|
||||
placeholder="请输入售后单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号" prop="orderId">
|
||||
<el-input
|
||||
v-model="queryParams.orderId"
|
||||
placeholder="请输入抖音订单id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="店铺" prop="shopId">
|
||||
<el-select v-model="queryParams.shopId" placeholder="请选择店铺" clearable @change="handleQuery">
|
||||
<el-option
|
||||
<el-option
|
||||
v-for="item in shopList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
|
|
@ -28,39 +11,34 @@
|
|||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品ID" prop="productId">
|
||||
<el-form-item label="售后ID" prop="aftersaleId">
|
||||
<el-input
|
||||
v-model="queryParams.productId"
|
||||
placeholder="请输入商品ID"
|
||||
v-model="queryParams.aftersaleId"
|
||||
placeholder="请输入售后ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号" prop="orderId">
|
||||
<el-input
|
||||
v-model="queryParams.orderId"
|
||||
placeholder="请输入订单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="aftersaleType">
|
||||
<el-select v-model="queryParams.aftersaleType" placeholder="请选择类型" clearable @change="handleQuery">
|
||||
|
||||
<el-form-item label="商品编码" prop="goodsNum">
|
||||
<el-input
|
||||
v-model="queryParams.goodsNum"
|
||||
placeholder="请输入商品编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-option label="退货退款" value="0" ></el-option>
|
||||
<el-option label="已发货仅退款" value="1"></el-option>
|
||||
<el-option label="未发货仅退款" value="2"></el-option>
|
||||
<el-option label="换货" value="3"> </el-option>
|
||||
<el-option label="维修" value="8"> </el-option>
|
||||
<el-option label="价保" value="6"> </el-option>
|
||||
<el-option label="缺货补寄" value="7"> </el-option>
|
||||
|
||||
<el-form-item label="物流单号" prop="logisticsCode">
|
||||
<el-input
|
||||
v-model="queryParams.logisticsCode"
|
||||
placeholder="请输入物流单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="售后理由" prop="questionDesc">
|
||||
<el-input
|
||||
v-model="queryParams.questionDesc"
|
||||
placeholder="请输入售后理由"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
|
|
@ -70,127 +48,101 @@
|
|||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['dou:douRefund:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
:loading="pullLoading"
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['dou:douRefund:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['dou:douRefund:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['dou:douRefund:export']"
|
||||
>导出</el-button>
|
||||
</el-col> -->
|
||||
@click="handlePull"
|
||||
>API拉取新退款</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-refresh"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handlePushOms"
|
||||
>手动推送售后</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="douRefundList" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<!-- <el-table-column label="售后订单id,自增" align="center" prop="id" /> -->
|
||||
<el-table-column label="售后ID" align="center" prop="aftersaleId" />
|
||||
<el-table-column label="售后类型" align="center" prop="aftersaleType" >
|
||||
<el-table v-loading="loading" :data="taoRefundList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="${comment}" align="center" prop="id" /> -->
|
||||
<el-table-column label="退款ID" align="center" prop="aftersaleId" />
|
||||
<el-table-column label="类型" align="center" prop="aftersaleType" >
|
||||
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.aftersaleType === 1"> 已发货仅退款</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.aftersaleType === 0"> 退货退款</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.aftersaleType === 1"> 已发货仅退款</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.aftersaleType === 2"> 未发货仅退款</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.aftersaleType === 3"> 换货</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.aftersaleType === 9"> 拦截退货</el-tag>
|
||||
</template>
|
||||
<el-tag size="small" v-if="scope.row.aftersaleType === 6"> 价保</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.aftersaleType === 7"> 补寄</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.aftersaleType === 8"> 维修</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="抖音订单id" align="center" prop="orderId" />
|
||||
<!-- <el-table-column label="抖音子订单id" align="center" prop="subOrderId" /> -->
|
||||
<el-table-column label="店铺" align="center" prop="shopId" >
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.shopId==22">梦小妮牛仔裤</span>
|
||||
<!-- <el-tag size="small"></el-tag>-->
|
||||
{{shopList.find(x=>x.id === scope.row.shopId).name}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品图片" align="center" prop="productPic" />
|
||||
<el-table-column label="商品id" align="center" prop="productId" />
|
||||
<el-table-column label="商品名" align="center" prop="productName" />
|
||||
<!-- <el-table-column label="商品编码" align="center" prop="goodsNum" /> -->
|
||||
<!-- <el-table-column label="该子订单购买的商品 sku_id" align="center" prop="comboId" /> -->
|
||||
<el-table-column label="商品规格" align="center" prop="goodsSpec" />
|
||||
<el-table-column label="商品规格编码" align="center" prop="specNum" />
|
||||
<el-table-column label="退货数量" align="center" prop="comboNum" />
|
||||
<el-table-column label="物流单号" align="center" prop="logisticsCode" />
|
||||
<!-- <el-table-column label="物流公司" align="center" prop="logisticsCompany" /> -->
|
||||
<!-- <el-table-column label="发货时间" align="center" prop="logisticsTime" /> -->
|
||||
<!-- <el-table-column label="收货时间" align="center" prop="receiptTime" /> -->
|
||||
<!-- <el-table-column label="订单取消原因" align="center" prop="cancelReason" /> -->
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="订单总金额 " align="center" prop="orderAmount" />
|
||||
<el-table-column label="退款金额" align="center" prop="comboAmount" />
|
||||
<el-table-column label="售后理由" align="center" prop="questionDesc" />
|
||||
<el-table-column label="申请退货时间" align="center" prop="applyTime" width="180">
|
||||
<el-table-column label="订单号" align="center" prop="relatedId" />
|
||||
<el-table-column label="商品" prop="orderProductName" ></el-table-column>
|
||||
<el-table-column label="退款金额" prop="refundAmount" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{ amountFormatter(null,null,scope.row.refundAmount/100,0) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订单金额" prop="orderPayAmount" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.applyTime, '{y}-{m}-{d}') }}</span>
|
||||
<span>{{ amountFormatter(null,null,scope.row.orderPayAmount/100,0) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="确认状态" align="center" prop="auditStatus" >
|
||||
|
||||
<el-table-column label="售后数量" prop="aftersaleNum" ></el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="退款状态" align="center" prop="refundStatus" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.auditStatus === 0"> 未处理</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.auditStatus === 2"> 已签收</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.auditStatus === 9"> 供应商已退款</el-tag>
|
||||
<!-- 退款状态;1-待退款;2-退款中;3-退款成功;4-退款失败;5-追缴成功; -->
|
||||
<el-tag size="small" v-if="scope.row.refundStatus === 1"> 待退款</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.refundStatus === 2"> 退款中</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.refundStatus === 3"> 退款成功</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.refundStatus === 4"> 退款失败</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.refundStatus === 5"> 追缴成功</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="审核时间" align="center" prop="auditTime" width="180">
|
||||
<el-table-column label="申请时间" align="center" prop="applyTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.auditTime, '{y}-{m}-{d}') }}</span>
|
||||
<span>{{ parseTime(scope.row.applyTime) }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column label="d" align="center" prop="refundStatus" /> -->
|
||||
<!-- 枚举为6(待商家同意),7(待买家退货),11(待商家二次同意),12(售后成功),13(换货待买家收货),14(换货成功),27(商家一次拒绝),28(售后失败),29(商家二次拒绝) -->
|
||||
<!-- <el-table-column label="erp商品ID" align="center" prop="erpGoodsId" /> -->
|
||||
<!-- <el-table-column label="erp商品规格ID" align="center" prop="erpSpecId" /> -->
|
||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['dou:douRefund:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['dou:douRefund:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-button-->
|
||||
<!-- v-if="scope.row.auditStatus === 0 && scope.row.afterSalesType === 1 "-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- @click="handleConfirm(scope.row)"-->
|
||||
<!-- v-hasPermi="['tao:taoRefund:edit']"-->
|
||||
<!-- >退货确认</el-button>-->
|
||||
<!-- <!– <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- v-hasPermi="['tao:taoRefund:remove']"-->
|
||||
<!-- >删除</el-button> –>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
|
|
@ -201,108 +153,16 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改抖店订单退款对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="售后id" prop="aftersaleId">
|
||||
<el-input v-model="form.aftersaleId" placeholder="请输入售后id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="抖音订单id" prop="orderId">
|
||||
<el-input v-model="form.orderId" placeholder="请输入抖音订单id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="抖音子订单id" prop="subOrderId">
|
||||
<el-input v-model="form.subOrderId" placeholder="请输入抖音子订单id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单所属商户id" prop="shopId">
|
||||
<el-input v-model="form.shopId" placeholder="请输入订单所属商户id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品图片" prop="productPic">
|
||||
<el-input v-model="form.productPic" placeholder="请输入商品图片" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品id" prop="productId">
|
||||
<el-input v-model="form.productId" placeholder="请输入商品id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名" prop="productName">
|
||||
<el-input v-model="form.productName" placeholder="请输入商品名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品编码" prop="goodsNum">
|
||||
<el-input v-model="form.goodsNum" placeholder="请输入商品编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="该子订单购买的商品 sku_id" prop="comboId">
|
||||
<el-input v-model="form.comboId" placeholder="请输入该子订单购买的商品 sku_id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品规格" prop="goodsSpec">
|
||||
<el-input v-model="form.goodsSpec" placeholder="请输入商品规格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品规格编码" prop="specNum">
|
||||
<el-input v-model="form.specNum" placeholder="请输入商品规格编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="退货数量" prop="comboNum">
|
||||
<el-input v-model="form.comboNum" placeholder="请输入退货数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物流单号" prop="logisticsCode">
|
||||
<el-input v-model="form.logisticsCode" placeholder="请输入物流单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物流公司" prop="logisticsCompany">
|
||||
<el-input v-model="form.logisticsCompany" placeholder="请输入物流公司" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发货时间" prop="logisticsTime">
|
||||
<el-input v-model="form.logisticsTime" placeholder="请输入发货时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收货时间" prop="receiptTime">
|
||||
<el-input v-model="form.receiptTime" placeholder="请输入收货时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单取消原因" prop="cancelReason">
|
||||
<el-input v-model="form.cancelReason" placeholder="请输入订单取消原因" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="父订单总金额 (单位: 分) 即用户实际支付金额, 不包含运费" prop="orderAmount">
|
||||
<el-input v-model="form.orderAmount" placeholder="请输入父订单总金额 (单位: 分) 即用户实际支付金额, 不包含运费" />
|
||||
</el-form-item>
|
||||
<el-form-item label="金额" prop="comboAmount">
|
||||
<el-input v-model="form.comboAmount" placeholder="请输入金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="售后理由" prop="questionDesc">
|
||||
<el-input v-model="form.questionDesc" placeholder="请输入售后理由" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请退货时间" prop="applyTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.applyTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择申请退货时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核时间" prop="auditTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.auditTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择审核时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="erp商品ID" prop="erpGoodsId">
|
||||
<el-input v-model="form.erpGoodsId" placeholder="请输入erp商品ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="erp商品规格ID" prop="erpSpecId">
|
||||
<el-input v-model="form.erpSpecId" placeholder="请输入erp商品规格ID" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listDouRefund, getDouRefund, delDouRefund, addDouRefund, updateDouRefund } from "@/api/dou/douRefund";
|
||||
import { listRefund,pullRefund,pushOms } from "@/api/dou/refund";
|
||||
import { listShop } from "@/api/shop/shop";
|
||||
import {MessageBox} from "element-ui";
|
||||
import {isRelogin} from "@/utils/request";
|
||||
export default {
|
||||
name: "DouRefund",
|
||||
name: "RefundDou",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
|
@ -317,103 +177,58 @@ export default {
|
|||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 抖店订单退款表格数据
|
||||
douRefundList: [],
|
||||
// 淘宝退款订单表格数据
|
||||
taoRefundList: [],
|
||||
shopList:[],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
pullLoading: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
aftersaleId: null,
|
||||
aftersaleType: null,
|
||||
orderId: null,
|
||||
subOrderId: null,
|
||||
shopId: null,
|
||||
productPic: null,
|
||||
productId: null,
|
||||
productName: null,
|
||||
goodsNum: null,
|
||||
comboId: null,
|
||||
goodsSpec: null,
|
||||
specNum: null,
|
||||
comboNum: null,
|
||||
logisticsCode: null,
|
||||
logisticsCompany: null,
|
||||
logisticsTime: null,
|
||||
receiptTime: null,
|
||||
cancelReason: null,
|
||||
orderAmount: null,
|
||||
comboAmount: null,
|
||||
questionDesc: null,
|
||||
applyTime: null,
|
||||
auditStatus: null,
|
||||
auditTime: null,
|
||||
refundStatus: null,
|
||||
erpGoodsId: null,
|
||||
erpSpecId: null,
|
||||
refundId: null,
|
||||
afterSalesType: null
|
||||
},
|
||||
shopList:[],
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
aftersaleType: [
|
||||
{ required: true, message: "售后类型,枚举为0(退货退款),1(已发货仅退款),2(未发货仅退款),3(换货)不能为空", trigger: "change" }
|
||||
],
|
||||
orderId: [
|
||||
{ required: true, message: "抖音订单id不能为空", trigger: "blur" }
|
||||
],
|
||||
subOrderId: [
|
||||
{ required: true, message: "抖音子订单id不能为空", trigger: "blur" }
|
||||
],
|
||||
shopId: [
|
||||
{ required: true, message: "订单所属商户id不能为空", trigger: "blur" }
|
||||
],
|
||||
comboNum: [
|
||||
num: [
|
||||
{ required: true, message: "退货数量不能为空", trigger: "blur" }
|
||||
],
|
||||
orderAmount: [
|
||||
{ required: true, message: "父订单总金额 (单位: 分) 即用户实际支付金额, 不包含运费不能为空", trigger: "blur" }
|
||||
logisticsCompany: [
|
||||
{ required: true, message: "不能为空", trigger: "change" }
|
||||
],
|
||||
comboAmount: [
|
||||
{ required: true, message: "金额不能为空", trigger: "blur" }
|
||||
logisticsCode: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
auditStatus: [
|
||||
{ required: true, message: "确认状态0:未处理2已签收9供应商已退款不能为空", trigger: "change" }
|
||||
sendTime: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
refundStatus: [
|
||||
{ required: true, message: "枚举为6(待商家同意),7(待买家退货),11(待商家二次同意),12(售后成功),13(换货待买家收货),14(换货成功),27(商家一次拒绝),28(售后失败),29(商家二次拒绝)不能为空", trigger: "change" }
|
||||
],
|
||||
erpGoodsId: [
|
||||
{ required: true, message: "erp商品ID不能为空", trigger: "blur" }
|
||||
],
|
||||
erpSpecId: [
|
||||
{ required: true, message: "erp商品规格ID不能为空", trigger: "blur" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: "更新时间不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listShop({platform:6}).then(response => {
|
||||
this.shopList = response.rows;
|
||||
});
|
||||
this.getList();
|
||||
listShop({platform: 6}).then(response => {
|
||||
this.shopList = response.rows;
|
||||
if (this.shopList && this.shopList.length > 0) {
|
||||
this.queryParams.shopId = this.shopList[0].id
|
||||
}
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询抖店订单退款列表 */
|
||||
amountFormatter(row, column, cellValue, index) {
|
||||
return '¥' + cellValue.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
|
||||
},
|
||||
/** 查询退款列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listDouRefund(this.queryParams).then(response => {
|
||||
this.douRefundList = response.rows;
|
||||
listRefund(this.queryParams).then(response => {
|
||||
this.taoRefundList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
|
|
@ -427,36 +242,11 @@ export default {
|
|||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
aftersaleId: null,
|
||||
aftersaleType: null,
|
||||
orderId: null,
|
||||
subOrderId: null,
|
||||
shopId: null,
|
||||
productPic: null,
|
||||
productId: null,
|
||||
productName: null,
|
||||
goodsNum: null,
|
||||
comboId: null,
|
||||
goodsSpec: null,
|
||||
specNum: null,
|
||||
comboNum: null,
|
||||
logisticsCode: null,
|
||||
logisticsCompany: null,
|
||||
logisticsTime: null,
|
||||
receiptTime: null,
|
||||
cancelReason: null,
|
||||
remark: null,
|
||||
orderAmount: null,
|
||||
comboAmount: null,
|
||||
questionDesc: null,
|
||||
applyTime: null,
|
||||
auditStatus: null,
|
||||
auditTime: null,
|
||||
refundStatus: null,
|
||||
erpGoodsId: null,
|
||||
erpSpecId: null,
|
||||
createTime: null,
|
||||
updateTime: null
|
||||
refundId: null,
|
||||
afterSalesType: null,
|
||||
tid: null,
|
||||
oid: null,
|
||||
refundPhase: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
|
@ -472,61 +262,52 @@ export default {
|
|||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.ids = selection.map(item => item.aftersaleId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加抖店订单退款";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getDouRefund(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改抖店订单退款";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateDouRefund(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addDouRefund(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除抖店订单退款编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delDouRefund(ids);
|
||||
handlePushOms(row) {
|
||||
const ids = row.aftersaleId || this.ids;
|
||||
this.$modal.confirm('是否手动推送到OMS?').then(function() {
|
||||
return pushOms({ids:ids});
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
// this.getList();
|
||||
this.$modal.msgSuccess("推送成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('dou/douRefund/export', {
|
||||
...this.queryParams
|
||||
}, `douRefund_${new Date().getTime()}.xlsx`)
|
||||
handlePull() {
|
||||
if(this.queryParams.shopId){
|
||||
this.pullLoading = true
|
||||
pullRefund({shopId:this.queryParams.shopId,updType:0}).then(response => {
|
||||
console.log('拉取淘宝订单接口返回=====', response)
|
||||
if (response.code === 1401) {
|
||||
MessageBox.confirm('Token已过期,需要重新授权!请前往店铺列表重新获取授权!', '系统提示', {
|
||||
confirmButtonText: '前往授权',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$router.push({path: "/shop/shop_list", query: {type: 3}})
|
||||
// isRelogin.show = false;
|
||||
// store.dispatch('LogOut').then(() => {
|
||||
// location.href = response.data.tokenRequestUrl+'?shopId='+this.queryParams.shopId
|
||||
// })
|
||||
}).catch(() => {
|
||||
isRelogin.show = false;
|
||||
});
|
||||
|
||||
// return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
|
||||
} else {
|
||||
this.$modal.msgSuccess(JSON.stringify(response));
|
||||
this.getList();
|
||||
|
||||
}
|
||||
this.pullLoading = false
|
||||
})
|
||||
}else{
|
||||
this.$modal.msgSuccess("请先选择店铺");
|
||||
}
|
||||
|
||||
// this.$modal.msgSuccess("请先配置API");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue