36dffeef 刘嘉

菠萝派接口-检测退款接口

1 个父辈 b4c2c689
......@@ -106,7 +106,27 @@ public interface PineappleDao {
*/
List<CourierCompany> getCourierCompanyByName(Map<String,Object> params);
/**
* 根据订单号查询退货信息
* @param orderSn
* @return
*/
List<MemberProductBack> getMemberProductBackByOrderSn(@Param("orderSn") String orderSn);
/**
* 根据订单号查询换货信息
* @param orderSn
* @return
*/
List<MemberProductExchange> getMemberProductExchangeByOrderSn(@Param("orderSn") String orderSn);
/**
* 根据订单ID查询投诉表
* @param id
* @return
*/
List<SellerComplaint> getSellerComplaintByOrderId(@Param("orderId") Integer id);
}
......
......@@ -310,4 +310,133 @@
from `courier_company`
where company_name LIKE concat('%',#{name},'%') AND seller_id =#{sellerId}
</select>
<!--退货表实体-->
<resultMap id="memberProductBackResult" type="com.sibu.orderHelper.integral.pineapple.model.MemberProductBack">
<result property="id" column="id" />
<result property="sellerId" column="seller_id" />
<result property="sellerName" column="seller_name" />
<result property="orderId" column="order_id" />
<result property="orderSn" column="order_sn" />
<result property="orderProductId" column="order_product_id" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="memberId" column="member_id" />
<result property="memberName" column="member_name" />
<result property="provinceId" column="province_id" />
<result property="cityId" column="city_id" />
<result property="areaId" column="area_id" />
<result property="addressAll" column="address_all" />
<result property="addressInfo" column="address_info" />
<result property="zipCode" column="zip_code" />
<result property="contactPhone" column="contact_phone" />
<result property="contactName" column="contact_name" />
<result property="logisticsId" column="logistics_id" />
<result property="logisticsName" column="logistics_name" />
<result property="logisticsMark" column="logistics_mark" />
<result property="logisticsNumber" column="logistics_number" />
<result property="question" column="question" />
<result property="image" column="image" />
<result property="stateReturn" column="state_return" />
<result property="stateMoney" column="state_money" />
<result property="number" column="number" />
<result property="backMoney" column="back_money" />
<result property="backIntegral" column="back_integral" />
<result property="backIntegralMoney" column="back_integral_money" />
<result property="backCouponUserId" column="back_coupon_user_id" />
<result property="backMoneyTime" column="back_money_time" />
<result property="optId" column="opt_id" />
<result property="optName" column="opt_name" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<!--根据订单号查询换货信息-->
<select id="getMemberProductBackByOrderSn" parameterType="java.lang.String" resultMap="memberProductBackResult">
SELECT * FROM member_product_back WHERE order_sn = #{orderSn} AND state_return IN ('1','2','3','4') ORDER BY create_time
</select>
<!--换货实体类-->
<resultMap id="memberProductExchangeResult" type="com.sibu.orderHelper.integral.pineapple.model.MemberProductExchange">
<result property="id" column="id" />
<result property="sellerId" column="seller_id" />
<result property="sellerName" column="seller_name" />
<result property="orderId" column="order_id" />
<result property="orderSn" column="order_sn" />
<result property="orderProductId" column="order_product_id" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="memberId" column="member_id" />
<result property="memberName" column="member_name" />
<result property="provinceId" column="province_id" />
<result property="cityId" column="city_id" />
<result property="areaId" column="area_id" />
<result property="addressAll" column="address_all" />
<result property="addressInfo" column="address_info" />
<result property="zipCode" column="zip_code" />
<result property="changeName" column="change_name" />
<result property="phone" column="phone" />
<result property="logisticsId" column="logistics_id" />
<result property="logisticsName" column="logistics_name" />
<result property="logisticsMark" column="logistics_mark" />
<result property="logisticsNumber" column="logistics_number" />
<result property="provinceId2" column="province_id2" />
<result property="cityId2" column="city_id2" />
<result property="areaId2" column="area_id2" />
<result property="addressAll2" column="address_all2" />
<result property="addressInfo2" column="address_info2" />
<result property="zipCode2" column="zip_code2" />
<result property="changeName2" column="change_name2" />
<result property="phone2" column="phone2" />
<result property="logisticsId2" column="logistics_id2" />
<result property="logisticsName2" column="logistics_name2" />
<result property="logisticsMark2" column="logistics_mark2" />
<result property="logisticsNumber2" column="logistics_number2" />
<result property="number" column="number" />
<result property="question" column="question" />
<result property="image" column="image" />
<result property="name" column="name" />
<result property="state" column="state" />
<result property="optId" column="opt_id" />
<result property="optName" column="opt_name" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<!--根据订单号查询换货信息-->
<select id="getMemberProductExchangeByOrderSn" parameterType="java.lang.String" resultMap="memberProductExchangeResult">
SELECT * FROM member_product_exchange WHERE order_sn = #{orderSn} AND state IN ('1','2','3','4') ORDER BY create_time
</select>
<!-- 投诉表实体-->
<resultMap id="sellerComplaintResult" type="com.sibu.orderHelper.integral.pineapple.model.SellerComplaint">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="orderId" column="order_id" />
<result property="orderProductId" column="order_product_id" />
<result property="productBackId" column="product_back_id" />
<result property="productExchangeId" column="product_exchange_id" />
<result property="content" column="content" />
<result property="image" column="image" />
<result property="complaintTime" column="complaint_time" />
<result property="sellerId" column="seller_id" />
<result property="sellerComplaintTime" column="seller_complaint_time" />
<result property="sellerCompContent" column="seller_comp_content" />
<result property="sellerCompImage" column="seller_comp_image" />
<result property="state" column="state" />
<result property="optId" column="opt_id" />
<result property="optContent" column="opt_content" />
<result property="userContent" column="user_content" />
<result property="createTime" column="create_time" />
<result property="optTime" column="opt_time" />
</resultMap>
<!-- 根据条件查询投诉表-->
<select id="getSellerComplaintById" parameterType="java.lang.Integer" resultMap="sellerComplaintResult">
SELECT * FROM seller_complaint WHERE order_id = #{orderId} AND state IN (1,3,4) ORDER BY create_time
</select>
</mapper>
\ No newline at end of file
......
......@@ -2,7 +2,9 @@ package com.sibu.orderHelper.enums;
import com.alibaba.druid.util.StringUtils;
import com.sibu.orderHelper.integral.pineapple.enums.MemberProductBackEnum;
import com.sibu.orderHelper.integral.pineapple.enums.OrderStatusEnum;
import com.sibu.orderHelper.integral.pineapple.model.MemberProductBack;
import org.apache.commons.lang3.EnumUtils;
import java.util.ArrayList;
......@@ -15,14 +17,16 @@ import java.util.List;
* @description 菠萝派商城退款验证退款状态举类
*/
public enum PineappleRefundEnum {
JH_01("JH_01", "买家已经申请退款等待卖家同意",Arrays.asList(OrderRefundStatusEnum.WAIT_SELLER_AUDIT.getCode())),
JH_02("JH_02", "卖家已经同意退款等待买家退货", Arrays.asList(OrderRefundStatusEnum.WAIT_CUSTOMER_REFUND_GOODS.getCode(),OrderRefundStatusEnum.AGREE_CHANGE_GOODS.getCode())),
JH_03("JH_03", "买家已经退货等待卖家确认收货",Arrays.asList(OrderRefundStatusEnum.WAIT_SELLER_RECEIVE_GOODS.getCode(),OrderRefundStatusEnum.WAIT_SELLER_AUDIT_RECEIVE_GOODS.getCode())),
JH_04("JH_04", "卖家拒绝退款",Arrays.asList(OrderRefundStatusEnum.WAIT_CUSTOMER_AUDIT.getCode(),OrderRefundStatusEnum.DISAGREE_REFUNDING_MONEY.getCode(),OrderRefundStatusEnum.DISAGREE_CHANGE_GOODS.getCode(),OrderRefundStatusEnum.DENY_CHANGE_GOODS.getCode())),
JH_05("JH_05", "退款关闭",new ArrayList<>()),
JH_06("JH_06", "退款成功",Arrays.asList(OrderRefundStatusEnum.SELLER_REFUNDING_MONEY_SUCCESS.getCode())),
JH_01("JH_01", "买家已经申请退款等待卖家同意",Arrays.asList(MemberProductBackEnum.Pending.getCode())),
JH_02("JH_02", "卖家已经同意退款等待买家退货", Arrays.asList(MemberProductBackEnum.AuditSucceess.getCode())),
JH_03("JH_03", "买家已经退货等待卖家确认收货",Arrays.asList(MemberProductBackEnum.MemberDeliver.getCode())),
JH_04("JH_04", "卖家拒绝退款",Arrays.asList()),
JH_05("JH_05", "退款关闭",new ArrayList<>(MemberProductBackEnum.Inattentive.getCode())),
JH_06("JH_06", "退款成功",Arrays.asList()),
JH_07("JH_07", "没有退款",new ArrayList<>()),
JH_99("JH_99", "其他",new ArrayList<>());
JH_99("JH_99", "其他",new ArrayList<>(MemberProductBackEnum.ShopDelivery.getCode()));
private String code; // 错误代码
private String msg; // 错误消息
......
package com.sibu.orderHelper.integral.pineapple.enums;
import com.alibaba.druid.util.StringUtils;
import org.apache.commons.lang3.EnumUtils;
import java.util.List;
/**
* @author LauKa
* @contact a062431@vip.qq.com
* @date 2018/05/15
* @description 新系统退款表状态 1、未处理;2、审核通过;3、用户发货,4、店铺收货;5、不予处理'
*/
public enum MemberProductBackEnum {
Pending(1, "未处理"), AuditSucceess(2, "审核通过"), MemberDeliver(3, "用户发货"),
ShopDelivery(4, "店铺收货"), Inattentive(5, "不予处理");
private int code; // 错误代码
private String msg; // 错误消息
public int getCode() {
return code;
}
public String getMsg() {
return msg;
}
MemberProductBackEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public static MemberProductBackEnum valueOf(int code) { // 手写的从int到enum的转换函数
List<MemberProductBackEnum> enums = EnumUtils.getEnumList(MemberProductBackEnum.class);
MemberProductBackEnum result = enums.stream()
.filter(p -> p.getCode() == code)
.findFirst()
.orElse(null);
return result;
}
public static MemberProductBackEnum resolve(String code) {
List<MemberProductBackEnum> enums = EnumUtils.getEnumList(MemberProductBackEnum.class);
MemberProductBackEnum result = enums.stream()
.filter(p -> StringUtils.equalsIgnoreCase(String.valueOf(p.getCode()), code))
.findFirst()
.orElse(null);
return result;
}
}
package com.sibu.orderHelper.integral.pineapple.enums;
import com.alibaba.druid.util.StringUtils;
import org.apache.commons.lang3.EnumUtils;
import java.util.List;
/**
* @author LauKa
* @contact a062431@vip.qq.com
* @date 2018/05/15
* @description 新系统换货表状态 换货状态:1、未处理;2、审核通过;3、用户发回退件;4、商家收到退件;5、商家发出换件;6、原件退还;7、不处理
*/
public enum MemberProductExchangeEnum {
Pending(1, "未处理"), AuditSucceess(2, "审核通过"), MemberDeliver(3, "用户发回退件"),
ShopDelivery(4, "商家收到退件"),ShopExchange(5,"商家发出换件"),ReturnOld(6,"原件退还"), Inattentive(7, "不予处理");
private int code; // 错误代码
private String msg; // 错误消息
public int getCode() {
return code;
}
public String getMsg() {
return msg;
}
MemberProductExchangeEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public static MemberProductExchangeEnum valueOf(int code) { // 手写的从int到enum的转换函数
List<MemberProductExchangeEnum> enums = EnumUtils.getEnumList(MemberProductExchangeEnum.class);
MemberProductExchangeEnum result = enums.stream()
.filter(p -> p.getCode() == code)
.findFirst()
.orElse(null);
return result;
}
public static MemberProductExchangeEnum resolve(String code) {
List<MemberProductExchangeEnum> enums = EnumUtils.getEnumList(MemberProductExchangeEnum.class);
MemberProductExchangeEnum result = enums.stream()
.filter(p -> StringUtils.equalsIgnoreCase(String.valueOf(p.getCode()), code))
.findFirst()
.orElse(null);
return result;
}
}
package com.sibu.orderHelper.integral.pineapple.enums;
import com.alibaba.druid.util.StringUtils;
import org.apache.commons.lang3.EnumUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author lauka
* @date 2018/03/30
* @description 菠萝派商城退款验证换货状态举类
*/
public enum PineappleExchangeEnum {
JH_01("JH_01", "买家已经申请退款等待卖家同意",Arrays.asList(MemberProductExchangeEnum.Pending.getCode())),
JH_02("JH_02", "卖家已经同意退款等待买家退货", Arrays.asList(MemberProductExchangeEnum.AuditSucceess.getCode())),
JH_03("JH_03", "买家已经退货等待卖家确认收货",Arrays.asList(MemberProductExchangeEnum.MemberDeliver.getCode())),
JH_04("JH_04", "卖家拒绝退款",Arrays.asList()),
JH_05("JH_05", "退款关闭",new ArrayList<>(MemberProductExchangeEnum.Inattentive.getCode())),
JH_06("JH_06", "退款成功",Arrays.asList()),
JH_07("JH_07", "没有退款",Arrays.asList(MemberProductExchangeEnum.ReturnOld.getCode(),MemberProductExchangeEnum.ShopExchange.getCode())),
JH_99("JH_99", "其他",new ArrayList<>(MemberProductExchangeEnum.ShopDelivery.getCode()));
private String code; // 错误代码
private String msg; // 错误消息
List<Integer> mallOrderStatus;
PineappleExchangeEnum(String code, String msg, List<Integer> mallOrderStatus) {
this.code = code;
this.msg = msg;
this.mallOrderStatus = mallOrderStatus;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static PineappleExchangeEnum resolve(String code) {
List<PineappleExchangeEnum> enums = EnumUtils.getEnumList(PineappleExchangeEnum.class);
PineappleExchangeEnum result = enums.stream()
.filter(p -> StringUtils.equalsIgnoreCase(p.code, code))
.findFirst()
.orElse(PineappleExchangeEnum.JH_99);
return result;
}
public static PineappleExchangeEnum resolveByPlatformRefundStatus(Integer platformOrderStatus) {
List<PineappleExchangeEnum> enums = EnumUtils.getEnumList(PineappleExchangeEnum.class);
PineappleExchangeEnum result = enums.stream()
.filter(p -> p.mallOrderStatus != null && p.mallOrderStatus.contains(platformOrderStatus))
.findFirst()
.orElse(PineappleExchangeEnum.JH_99);
return result;
}
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
@Data
@ToString
public class MemberProductBack implements Serializable{
private java.lang.Integer id;
private java.lang.Integer sellerId;
private java.lang.String sellerName;
private java.lang.Integer orderId;
private java.lang.String orderSn;
private java.lang.Integer orderProductId;
private java.lang.Integer productId;
private java.lang.String productName;
private java.lang.Integer memberId;
private java.lang.String memberName;
private java.lang.Integer provinceId;
private java.lang.Integer cityId;
private java.lang.Integer areaId;
private java.lang.String addressAll;
private java.lang.String addressInfo;
private java.lang.String zipCode;
private java.lang.String contactPhone;
private java.lang.String contactName;
private java.lang.Integer logisticsId;
private java.lang.String logisticsName;
private java.lang.String logisticsMark;
private java.lang.String logisticsNumber;
private java.lang.String question;
private java.lang.String image;
private java.lang.Integer stateReturn;
private java.lang.Integer stateMoney;
private java.lang.Integer number;
private java.math.BigDecimal backMoney;
private java.lang.Integer backIntegral;
private java.math.BigDecimal backIntegralMoney;
private java.lang.Integer backCouponUserId;
private java.util.Date backMoneyTime;
private java.lang.Integer optId;
private java.lang.String optName;
private java.lang.String remark;
private java.util.Date createTime;
private java.util.Date updateTime;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
@Data
@ToString
public class MemberProductExchange implements Serializable {
private java.lang.Integer id;
private java.lang.Integer sellerId;
private java.lang.String sellerName;
private java.lang.Integer orderId;
private java.lang.String orderSn;
private java.lang.Integer orderProductId;
private java.lang.Integer productId;
private java.lang.String productName;
private java.lang.Integer memberId;
private java.lang.String memberName;
private java.lang.Integer provinceId;
private java.lang.Integer cityId;
private java.lang.Integer areaId;
private java.lang.String addressAll;
private java.lang.String addressInfo;
private java.lang.String zipCode;
private java.lang.String changeName;
private java.lang.String phone;
private java.lang.Integer logisticsId;
private java.lang.String logisticsName;
private java.lang.String logisticsMark;
private java.lang.String logisticsNumber;
private java.lang.Integer provinceId2;
private java.lang.Integer cityId2;
private java.lang.Integer areaId2;
private java.lang.String addressAll2;
private java.lang.String addressInfo2;
private java.lang.String zipCode2;
private java.lang.String changeName2;
private java.lang.String phone2;
private java.lang.Integer logisticsId2;
private java.lang.String logisticsName2;
private java.lang.String logisticsMark2;
private java.lang.String logisticsNumber2;
private java.lang.Integer number;
private java.lang.String question;
private java.lang.String image;
private java.lang.String name;
private java.lang.Integer state;
private java.lang.Integer optId;
private java.lang.String optName;
private java.lang.String remark;
private java.util.Date createTime;
private java.util.Date updateTime;
}
package com.sibu.orderHelper.integral.pineapple.model;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
@Data
@ToString
public class SellerComplaint implements Serializable {
private java.lang.Integer id; //id
private java.lang.Integer userId; //投诉人ID
private java.lang.String userName; //投诉人账户
private java.lang.Integer orderId; //订单ID
private java.lang.Integer orderProductId; //网单ID
private java.lang.Integer productBackId; //退货管理id,如没有置为0
private java.lang.Integer productExchangeId; //换货管理id,如没有置为0
private java.lang.String content; //投诉内容
private java.lang.String image; //投诉图片
private java.util.Date complaintTime; //投诉时间
private java.lang.Integer sellerId; //投诉商家
private java.util.Date sellerComplaintTime; //商家申诉时间
private java.lang.String sellerCompContent; //商家申诉内容
private java.lang.String sellerCompImage; //商家申诉图片
private java.lang.Integer state; //状态:1、买家投诉待审核;2、买家投诉不通过;3、买家投诉通过;4、卖家申诉待审核;5、卖家申诉不通过;6、卖家申诉通过;
private java.lang.Integer optId; //平台处理人ID
private java.lang.String optContent; //平台处理结果
private java.lang.String userContent; //客户反馈意见
private java.util.Date createTime; //创建时间
private java.util.Date optTime; //处理时间
}