记得上下班打卡 | git大法好,push需谨慎

Commit 11fd30ee authored by anjiabin's avatar anjiabin
parents 0fd2ac32 c0d225f4
...@@ -18,17 +18,10 @@ import java.util.*; ...@@ -18,17 +18,10 @@ import java.util.*;
* @version 1.0 2015年10月16日 13:32:00 * @version 1.0 2015年10月16日 13:32:00
*/ */
public abstract class DateUtil { public abstract class DateUtil {
/**
* 定义常量
**/
public static final String DATE_JFP_STR = "yyyyMM";
public static final String DATE_FULL_STR = "yyyy-MM-dd HH:mm:ss"; public static final String DATE_FULL_STR = "yyyy-MM-dd HH:mm:ss";
public static final String DATE_SMALL_STR = "yyyy-MM-dd"; public static final String DATE_SMALL_STR = "yyyy-MM-dd";
public static final String DATE_KEY_STR = "yyyyMMddHHmmss";
/** /**
* 日期格式化器 * 日期格式化器
*/ */
...@@ -37,6 +30,7 @@ public abstract class DateUtil { ...@@ -37,6 +30,7 @@ public abstract class DateUtil {
MM_dd("MM-dd"), MM_dd("MM-dd"),
yyyyMMdd("yyyyMMdd"), yyyyMMdd("yyyyMMdd"),
yyyy_MM_dd("yyyy-MM-dd"), yyyy_MM_dd("yyyy-MM-dd"),
yyyy_MM_dd2("yyyy/MM/dd"),
yyyyMMddHH("yyyy-MM-dd HH"), yyyyMMddHH("yyyy-MM-dd HH"),
yyyyMMddHHmm("yyyy-MM-dd HH:mm"), yyyyMMddHHmm("yyyy-MM-dd HH:mm"),
yyyyMMddHHmmss("yyyy-MM-dd HH:mm:ss"), yyyyMMddHHmmss("yyyy-MM-dd HH:mm:ss"),
......
...@@ -7,7 +7,7 @@ import lombok.Data; ...@@ -7,7 +7,7 @@ import lombok.Data;
@ApiModel(value = "AdamEntersParam", description = "添加/编辑入场人入参") @ApiModel(value = "AdamEntersParam", description = "添加/编辑入场人入参")
@Data @Data
public class AdamEntersParam implements java.io.Serializable { public class AdamEntersParam implements java.io.Serializable {
private static final long serialVersionUID = 5940725094369061032L; private static final long serialVersionUID = 8628253022063935727L;
@ApiModelProperty(position = 10, required = false, value = "入场人ID,编辑时必传[50]") @ApiModelProperty(position = 10, required = false, value = "入场人ID,编辑时必传[50]")
private String entersId; private String entersId;
@ApiModelProperty(position = 11, required = true, value = "入场人名称[50]", example = "Swagger") @ApiModelProperty(position = 11, required = true, value = "入场人名称[50]", example = "Swagger")
......
...@@ -5,40 +5,18 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,40 +5,18 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 会员价格
*/
@ApiModel(value = "AdamMemberCodeParam", description = "添加编辑会员兑换码") @ApiModel(value = "AdamMemberCodeParam", description = "添加编辑会员兑换码")
@Data @Data
public class AdamMemberCodeParam implements Serializable { public class AdamMemberCodeParam implements Serializable {
private static final long serialVersionUID = -7273522103593077617L;
private static final long serialVersionUID = 5940725094369061032L;
/**
* 会员类型ID
*/
@ApiModelProperty(position = 1, required = false, value = "会员类型ID") @ApiModelProperty(position = 1, required = false, value = "会员类型ID")
private String memberId; private String memberId;
/**
* 会员价格ID
*/
@ApiModelProperty(position = 2, required = false, value = "会员价格ID") @ApiModelProperty(position = 2, required = false, value = "会员价格ID")
private String memberPriceId; private String memberPriceId;
@ApiModelProperty(position = 3, required = true, value = "类型:0-用户购买兑换码,1-后台生成兑换码", example = "0")
/**
* 类型 0-用户购买兑换码 1-后台生成兑换码
*/
@ApiModelProperty(position = 3, required = true, value = "类型 0-用户购买兑换码 1-后台生成兑换码", example = "0")
private Integer type; private Integer type;
@ApiModelProperty(position = 4, required = false, value = "用户ID", example = "1")
/**
* 购买会员码的用户id
*/
@ApiModelProperty(position = 4, required = false, value = "登录用户token,应该从token里拿", example = "0")
private String buyUid; private String buyUid;
} }
...@@ -10,17 +10,18 @@ import java.time.LocalDateTime; ...@@ -10,17 +10,18 @@ import java.time.LocalDateTime;
@ApiModel(value = "AdamMemberOrderCodeParam", description = "使用兑换码") @ApiModel(value = "AdamMemberOrderCodeParam", description = "使用兑换码")
@Data @Data
public class AdamMemberOrderCodeParam implements Serializable { public class AdamMemberOrderCodeParam implements Serializable {
private static final long serialVersionUID = 5940725094369061032L; private static final long serialVersionUID = 1298109732452201034L;
@ApiModelProperty(position = 10, required = true, value = "类型:2-会员码,3-礼包码", example = "2")
@ApiModelProperty(position = 0, required = true, value = "类型2-会员码 3-礼包码", example = "2") private Integer type;
private int type; @ApiModelProperty(position = 11, required = true, value = "兑换码", example = "0")
@ApiModelProperty(position = 1, required = true, example = "0")
private String memberCode; private String memberCode;
@ApiModelProperty(position = 2, required = true, example = "0") @ApiModelProperty(position = 12, required = true, value = "生日", example = "0")
private LocalDateTime birthday; private LocalDateTime birthday;
@ApiModelProperty(position = 13, required = false, value = "姓名")
private String name;
@ApiModelProperty(position = 14, required = false, value = "身份证件号")
private String idCard;
private String ip; private String ip;
private String source; private String source;
private String version; private String version;
} }
...@@ -9,11 +9,7 @@ import java.util.List; ...@@ -9,11 +9,7 @@ import java.util.List;
@ApiModel(value = "AdamMemberParam", description = "添加会员参数") @ApiModel(value = "AdamMemberParam", description = "添加会员参数")
@Data @Data
public class AdamMemberParam implements Serializable { public class AdamMemberParam implements Serializable {
private static final long serialVersionUID = 5940725094369061032L; private static final long serialVersionUID = -7411934614249221021L;
/**
* 会员卡id
*/
@ApiModelProperty(position = 0, required = false, value = "会员ID[50]", example = "62960077673504768") @ApiModelProperty(position = 0, required = false, value = "会员ID[50]", example = "62960077673504768")
private String memberId; private String memberId;
......
...@@ -20,9 +20,7 @@ import java.time.LocalDateTime; ...@@ -20,9 +20,7 @@ import java.time.LocalDateTime;
@ApiModel(value = "AdamMemberPriceParam", description = "添加编辑会员价格") @ApiModel(value = "AdamMemberPriceParam", description = "添加编辑会员价格")
@Data @Data
public class AdamMemberPriceParam implements Serializable { public class AdamMemberPriceParam implements Serializable {
private static final long serialVersionUID = -6432796310264973696L;
private static final long serialVersionUID = 5940725094369061032L;
@ApiModelProperty(position = 0, required = false, value = "价格id") @ApiModelProperty(position = 0, required = false, value = "价格id")
private Integer mid; private Integer mid;
......
...@@ -4,12 +4,12 @@ import io.swagger.annotations.ApiModel; ...@@ -4,12 +4,12 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
@ApiModel(value = "AdamUserMemberParam", description = "会员用户信息") @ApiModel(value = "AdamUserMemberParam", description = "会员用户信息")
@Data @Data
public class AdamUserMemberParam { public class AdamUserMemberParam implements Serializable {
private static final long serialVersionUID = 3317939633062845439L;
private static final long serialVersionUID = 5940725094369061032L;
@ApiModelProperty(position = 0, required = true, value = "用户id", example = "0") @ApiModelProperty(position = 0, required = true, value = "用户id", example = "0")
private String uid; private String uid;
@ApiModelProperty(position = 1, required = true, value = "会员类型id", example = "0") @ApiModelProperty(position = 1, required = true, value = "会员类型id", example = "0")
......
...@@ -88,6 +88,15 @@ public class AdamMemberOrderController { ...@@ -88,6 +88,15 @@ public class AdamMemberOrderController {
param.setIp("127.0.0.1"); param.setIp("127.0.0.1");
param.setSource("Android"); param.setSource("Android");
param.setVersion("5.5.5"); param.setVersion("5.5.5");
AdamRealInfoVo realInfoVo = adamRealNameService.queryByUid(CurrentUtil.getCurrentUid());
if (null == realInfoVo) {
if (StringUtils.isBlank(param.getName()) || StringUtils.isBlank(param.getIdCard())) {
return ResponseDto.failure(ErrorMapping.get("10101"));
}
adamUserService.identity(CurrentUtil.getCurrentUid(), param.getName(), param.getIdCard());
}
boolean result = adamMemberOrderService.useMemberCode(param); boolean result = adamMemberOrderService.useMemberCode(param);
if (!result) { if (!result) {
return ResponseDto.failure("兑换失败"); return ResponseDto.failure("兑换失败");
......
package com.liquidnet.service.kylin.constant;
/**
* <p>
* Kylin表状态常量定义
* </p>
*
* @author jiangxiulong
* @since 2021-05-25 6:38 下午
*/
public class KylinTableStatusConst {
// 批量退款
public static final Integer STATUS_APPLY = 1; // 1申请退款
public static final Integer STATUS_CANCEL = 2; // 2取消退款
public static final Integer STATUS_OPERATE_REJECT = 3; // 3运营驳回审核
public static final Integer STATUS_OPERATE_ADOPT = 4; // 4运营通过审核
public static final Integer STATUS_FINANCE_REJECT = 5; // 5财务驳回审核
public static final Integer STATUS_FINANCE_ADOPT = 6; // 6财务通过审核
public static final Integer STATUS_TARGET_TYPE = 1; // 演出
// 退款
public static final Integer ORDER_REFUND_STATUS_APPLY = 0; // 客服(待审核),用户(正在退款)
public static final Integer ORDER_REFUND_STATUS_APPROVED = 1; // 客服(已通过),用户(正在退款)
public static final Integer ORDER_REFUND_STATUS_CANCEL = 2; // 客服(已取消),用户(取消退款,恢复正常订单)
public static final Integer ORDER_REFUND_STATUS_REFUNDING = 3; // 客服(正在退款),用户(正在退款)
public static final Integer ORDER_REFUND_STATUS_REFUNDED = 4; // 客服(退款成功),用户(完成退款,部分退款为正常订单,全额退款为退款订单)
public static final Integer ORDER_REFUND_STATUS_REJECT = 5; // 客服(被审核员驳回),用户(正在退款)
public static final Integer ORDER_REFUND_STATUS_ERROR = 6; // 客服(退款失败),用户(正在退款)
public static final Integer ORDER_REFUND_STATUS_UNFILLED = 7; // 客服(等待退款),用户(正在退款)
public static final Integer ORDER_REFUND_STATUS_REFUSE = 8; // 客服(被执行员拒绝),用户(正在退款)
public static final Integer ORDER_REFUND_TYPE_APPLY = 0; // 人工申请类型的退款,可以取消退款,退款完成需返还库存
public static final Integer ORDER_REFUND_TYPE_AUTO = 1; // 自动申请类型的退款,无法取消退款,退款完成不返还库存
}
package com.liquidnet.service.kylin.dto.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@ApiModel(value = "KylinStationCheckDataParam", description = "上载验票入参")
@Data
public class KylinStationCheckOrderParam implements Serializable {
private static final long serialVersionUID = 2312115659117282564L;
@ApiModelProperty(position = 10, value = "演出ID[64]")
private String performanceId;
@ApiModelProperty(position = 11, value = "订单号")
private String orderCode;
@ApiModelProperty(position = 12, value = "二维码地址")
private String qrCode;
@ApiModelProperty(position = 13, value = "付款张数")
private Integer number;
@ApiModelProperty(position = 14, value = "退款张数")
private Integer refundNumber;
@ApiModelProperty(position = 16, value = "订单状态:0-待付款,1-已付款,2-已关闭,3-正在退款,4-已退款,5-待关闭,6-部分退款")
private Integer status;
@ApiModelProperty(position = 17, value = "支付状态:0-未支付,1-已支付,2-支付失败")
private Integer payStatus;
@ApiModelProperty(position = 18, value = "是否学生票[1-是,2-否]")
private Integer isStudent;
@ApiModelProperty(position = 19, value = "购买者是否是会员[0-否,1-是]")
private Integer isMember;
@ApiModelProperty(position = 30, value = "*验票张数")
private Integer checkedNumber;
@ApiModelProperty(position = 31, value = "*是否已同步[0-否,1-是]")
private Integer synced;
}
...@@ -3,44 +3,75 @@ package com.liquidnet.service.kylin.dto.vo; ...@@ -3,44 +3,75 @@ package com.liquidnet.service.kylin.dto.vo;
import com.liquidnet.service.kylin.entity.KylinOrderTicketRelations; import com.liquidnet.service.kylin.entity.KylinOrderTicketRelations;
import com.liquidnet.service.kylin.entity.KylinOrderTicketStatus; import com.liquidnet.service.kylin.entity.KylinOrderTicketStatus;
import com.liquidnet.service.kylin.entity.KylinOrderTickets; import com.liquidnet.service.kylin.entity.KylinOrderTickets;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
@ApiModel(value = "KylinOrderTicketVo", description = "订单数据")
@Data @Data
public class KylinOrderTicketVo implements Serializable { public class KylinOrderTicketVo implements Serializable {
private static final long serialVersionUID = 5325511589667456213L; private static final long serialVersionUID = 5325511589667456213L;
@ApiModelProperty(position = 10, value = "ID")
private String orderTicketsId; private String orderTicketsId;
@ApiModelProperty(position = 11, value = "用户ID[64]")
private String userId; private String userId;
@ApiModelProperty(position = 12, value = "用户昵称")
private String userName; private String userName;
@ApiModelProperty(position = 13, value = "用户手机号")
private String userMobile; private String userMobile;
@ApiModelProperty(position = 14, value = "演出名称")
private String performanceTitle; private String performanceTitle;
@ApiModelProperty(position = 15, value = "订单号")
private String orderCode; private String orderCode;
@ApiModelProperty(position = 16, value = "支付单号")
private String payCode; private String payCode;
@ApiModelProperty(position = 17, value = "二维码地址")
private String qrCode; private String qrCode;
@ApiModelProperty(position = 18, value = "下单方式")
private String orderType; private String orderType;
@ApiModelProperty(position = 19, value = "下单版本")
private String orderVersion; private String orderVersion;
@ApiModelProperty(position = 20, value = "数量")
private Integer number; private Integer number;
@ApiModelProperty(position = 21, value = "单价")
private BigDecimal price; private BigDecimal price;
@ApiModelProperty(position = 22, value = "会员单价")
private BigDecimal priceMember; private BigDecimal priceMember;
@ApiModelProperty(position = 23, value = "应付价格")
private BigDecimal priceTotal; private BigDecimal priceTotal;
@ApiModelProperty(position = 24, value = "优惠价格")
private BigDecimal priceVoucher; private BigDecimal priceVoucher;
@ApiModelProperty(position = 25, value = "实付价格")
private BigDecimal priceActual; private BigDecimal priceActual;
@ApiModelProperty(position = 26, value = "快递价格")
private BigDecimal priceExpress; private BigDecimal priceExpress;
@ApiModelProperty(position = 27, value = "退款价格")
private BigDecimal priceRefund; private BigDecimal priceRefund;
@ApiModelProperty(position = 28, value = "退款张数")
private Integer refundNumber; private Integer refundNumber;
@ApiModelProperty(position = 29, value = "选择支付方式")
private String payType; private String payType;
@ApiModelProperty(position = 30, value = "实际支付方式")
private String paymentType; private String paymentType;
@ApiModelProperty(position = 31, value = "支付时间")
private String timePay; private String timePay;
@ApiModelProperty(position = 32, value = "收货人")
private String expressContacts; private String expressContacts;
@ApiModelProperty(position = 33, value = "收货地址")
private String expressAddress; private String expressAddress;
@ApiModelProperty(position = 34, value = "收货人联系方式")
private String expressPhone; private String expressPhone;
@ApiModelProperty(position = 35, value = "券使用类别")
private String couponType; private String couponType;
@ApiModelProperty(position = 36, value = "取票方式 电子票electronic快递票express")
private String getTicketType; private String getTicketType;
@ApiModelProperty(position = 37, value = "直播用取票观演码,隔开")
private String getTicketDescribe; private String getTicketDescribe;
@ApiModelProperty(position = 38, value = "订单过期时间(分钟)")
private Integer payCountdownMinute; private Integer payCountdownMinute;
private Integer expressType; private Integer expressType;
......
package com.liquidnet.service.kylin.dto.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@ApiModel(value = "KylinStationCheckOrderVo", description = "下载验票-订单响应参数")
@Data
public class KylinStationCheckOrderVo implements Serializable {
private static final long serialVersionUID = 7450966265904643147L;
@ApiModelProperty(position = 10, value = "演出ID[64]")
private String performanceId;
@ApiModelProperty(position = 11, value = "订单号")
private String orderCode;
@ApiModelProperty(position = 12, value = "二维码地址")
private String qrCode;
@ApiModelProperty(position = 13, value = "用户昵称")
private String userName;
@ApiModelProperty(position = 14, value = "用户手机号")
private String userMobile;
@ApiModelProperty(position = 16, value = "付款张数")
private Integer number;
@ApiModelProperty(position = 17, value = "退款张数")
private Integer refundNumber;
@ApiModelProperty(position = 18, value = "订单状态:0-待付款,1-已付款,2-已关闭,3-正在退款,4-已退款,5-待关闭,6-部分退款")
private Integer status;
@ApiModelProperty(position = 19, value = "支付状态:0-未支付,1-已支付,2-支付失败")
private Integer payStatus;
@ApiModelProperty(position = 20, value = "是否学生票[1-是,2-否]")
private Integer isStudent;
@ApiModelProperty(position = 21, value = "购买者是否是会员[0-否,1-是]")
private Integer isMember;
@ApiModelProperty(position = 30, value = "*验票张数")
private Integer checkedNumber;
@ApiModelProperty(position = 31, value = "*是否已同步[0-否,1-是]")
private Integer synced;
private static final KylinStationCheckOrderVo obj = new KylinStationCheckOrderVo();
public static KylinStationCheckOrderVo getNew() {
try {
return (KylinStationCheckOrderVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new KylinStationCheckOrderVo();
}
}
}
package com.liquidnet.service.kylin.dto.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@ApiModel(value = "KylinStationPerformanceVo", description = "演出列表响应参数")
@Data
public class KylinStationPerformanceVo implements Serializable, Cloneable {
private static final long serialVersionUID = -4994363974994478286L;
@ApiModelProperty(position = 10, value = "演出ID[64]")
private String performanceId;
@ApiModelProperty(position = 11, value = "类型[101-音乐节,102小型演出(livehouse演出),103巡演]")
private Integer type;
@ApiModelProperty(position = 12, value = "演出标题[255]")
private String title;
@ApiModelProperty(position = 13, value = "开始时间[yyyy/MM/dd]")
private String timeStart;
@ApiModelProperty(position = 14, value = "结束时间[yyyy/MM/dd]")
private String timeEnd;
@ApiModelProperty(position = 15, value = "票种列表信息")
private List<KylinStationTicketVo> ticketVoList;
private static final KylinStationPerformanceVo obj = new KylinStationPerformanceVo();
public static KylinStationPerformanceVo getNew() {
try {
return (KylinStationPerformanceVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new KylinStationPerformanceVo();
}
}
}
package com.liquidnet.service.kylin.dto.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@ApiModel(value = "KylinStationTicketVo", description = "票种统计信息")
@Data
public class KylinStationTicketVo implements Serializable, Cloneable {
private static final long serialVersionUID = 1303234075649915021L;
@ApiModelProperty(position = 10, value = "票种ID[64]")
private String ticketsId;
@ApiModelProperty(position = 11, value = "类型[1-单日票,2-通票]")
private String type;
@ApiModelProperty(position = 12, value = "名称[32]")
private String title;
@ApiModelProperty(position = 13, value = "单价(8,2)")
private BigDecimal price;
@ApiModelProperty(position = 14, value = "适用开始时间")
private String useStart;
@ApiModelProperty(position = 15, value = "适用结束时间")
private String useEnd;
@ApiModelProperty(position = 16, value = "票房")
private BigDecimal priceSum;
@ApiModelProperty(position = 17, value = "票量[9]")
private Integer number;
@ApiModelProperty(position = 18, value = "已验票量[9]")
private Integer checkedNum;
@ApiModelProperty(position = 19, value = "余量[9]")
private Integer remainderNum;
}
package com.liquidnet.service.kylin.service;
import com.liquidnet.service.kylin.entity.KylinRefundBatches;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 批量退款表 服务类
* </p>
*
* @author liquidnet
* @since 2021-05-25
*/
public interface IKylinRefundBatchesService extends IService<KylinRefundBatches> {
}
package com.liquidnet.service.kylin.service;
import com.liquidnet.service.kylin.entity.KylinRefunds;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 退款表 服务类
* </p>
*
* @author liquidnet
* @since 2021-05-26
*/
public interface IKylinRefundsService extends IService<KylinRefunds> {
}
package com.liquidnet.service.kylin.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 批量退款表
* </p>
*
* @author liquidnet
* @since 2021-05-25
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class KylinRefundBatches implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Integer mid;
/**
* refund_batch_id
*/
private String refundBatchId;
/**
* 目标id target_type=1为演出id
*/
private String targetId;
/**
* 目标名称 target_type=1为演出名称
*/
private String targetTitle;
/**
* 目标类型 1演出
*/
private Integer targetType;
/**
* 批量退款状态 1申请退款 2取消退款 3运营驳回审核 4运营通过审核 5财务驳回审核 6财务通过审核
*/
private Integer status;
/**
* 批量退款总金额
*/
private BigDecimal totalPrice;
/**
* 实际批量退款总金额
*/
private BigDecimal realTotalPrice;
/**
* 批量退款总数量
*/
private Integer totalNum;
/**
* 实际批量退款总数量
*/
private Integer realTotalNum;
/**
* 申请时支付宝需退款总金额
*/
private BigDecimal totalRefundAlipay;
/**
* 申请时微信需退款总金额
*/
private BigDecimal totalRefundWepay;
/**
* 快递费总金额支付宝
*/
private BigDecimal totalPriceExpressAlipay;
/**
* 快递费总金额微信
*/
private BigDecimal totalPriceExpressWepay;
/**
* 批量退款原因
*/
private String reason;
/**
* 批量退款备注
*/
private String remark;
/**
* 驳回原因
*/
private String reject;
/**
* 回绝原因
*/
private String refuse;
/**
* 批量申请人id
*/
private Integer applicantId;
/**
* 批量申请人名称
*/
private String applicantName;
/**
* 批量申请时间
*/
private LocalDateTime applicantAt;
/**
* 批量审核人id
*/
private Integer auditorId;
/**
* 批量审核人名称
*/
private String auditorName;
/**
* 批量审核时间
*/
private LocalDateTime auditorAt;
/**
* 批量执行人id
*/
private Integer executorId;
/**
* 批量执行人名称
*/
private String executorName;
/**
* 批量执行时间
*/
private LocalDateTime executorAt;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}
package com.liquidnet.service.kylin.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 退款表
* </p>
*
* @author liquidnet
* @since 2021-05-26
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class KylinRefunds implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Integer mid;
/**
* refunds_id
*/
private String refundsId;
/**
* 商户id
*/
private String merchantId;
/**
* 退款状态: 0请求退款 2取消退款 1审核通过 5驳回退款 7等待退款 3正在退款 4完成退款 6退款失败
*/
private Integer status;
/**
* 退款差异: 0申请退款返还库存 1自动退款无法取消退款不返还库存
*/
private Integer type;
/**
* 订单id
*/
private String orderId;
/**
* 订单类型 order_product 商品订单 , order_ticket 票务订单
*/
private String orderType;
/**
* 订单中心订单号,这里方便查询
*/
private String orderCode;
/**
* 退款内容,演出title,商品title,这里方便查询
*/
private String orderTitle;
/**
* 退款手机号,这里方便查询
*/
private String orderMobile;
/**
* 支付中心支付单号,用于申请退款
*/
private String payCode;
/**
* 退款编号
*/
private String orderRefundCode;
/**
* 退款总金额
*/
private BigDecimal price;
/**
* 退款原因
*/
private String reason;
/**
* 退款备注
*/
private String remark;
/**
* 驳回原因
*/
private String reject;
/**
* 回绝原因
*/
private String refuse;
/**
* 退款中心退款编号
*/
private String refundCode;
/**
* 退款类型
*/
private String refundType;
/**
* 成功退款时间
*/
private LocalDateTime refundAt;
/**
* 第三方退款编号
*/
private String refundId;
/**
* 退款失败原因
*/
private String refundError;
/**
* 申请人id
*/
private Integer applicantId;
/**
* 申请人名称
*/
private String applicantName;
/**
* 申请时间
*/
private LocalDateTime applicantAt;
/**
* 审核人id
*/
private Integer auditorId;
/**
* 审核人名称
*/
private String auditorName;
/**
* 审核时间
*/
private LocalDateTime auditorAt;
/**
* 执行人id
*/
private Integer executorId;
/**
* 执行人名称
*/
private String executorName;
/**
* 执行时间
*/
private LocalDateTime executorAt;
/**
* 批量退款id
*/
private Integer batchId;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
/**
* 支付类型
*/
private String paymentType;
}
...@@ -3,14 +3,25 @@ package com.liquidnet.service.kylin.mapper; ...@@ -3,14 +3,25 @@ package com.liquidnet.service.kylin.mapper;
import com.liquidnet.service.kylin.entity.KylinOrderTickets; import com.liquidnet.service.kylin.entity.KylinOrderTickets;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.HashMap;
import java.util.List;
/** /**
* <p> * <p>
* 订单 Mapper 接口 * 订单 Mapper 接口
* </p> * </p>
* *
* @author liquidnet * @author jiangxiulong
* @since 2021-05-20 * @since 2021-05-25 14:00 下午
*/ */
public interface KylinOrderTicketsMapper extends BaseMapper<KylinOrderTickets> { public interface KylinOrderTicketsMapper extends BaseMapper<KylinOrderTickets> {
// 查询演出订单能退款的总金额和总订单数量
HashMap<String, Object> getPriceNum(String targetId);
// 查询微信、支付宝对应的订单金额、快递费金额
Double getTotalPrice(String targetId, String selectFields, String[] paymentType);
// 获取订单和购票信息
List getOrderEntities(String targetId, int mid, int limitNum);
} }
package com.liquidnet.service.kylin.mapper;
import com.liquidnet.service.kylin.entity.KylinRefundBatches;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 批量退款表 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-05-25
*/
public interface KylinRefundBatchesMapper extends BaseMapper<KylinRefundBatches> {
}
package com.liquidnet.service.kylin.mapper;
import com.liquidnet.service.kylin.entity.KylinRefunds;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/**
* <p>
* 退款表 Mapper 接口
* </p>
*
* @author liquidnet
* @since 2021-05-26
*/
public interface KylinRefundsMapper extends BaseMapper<KylinRefunds> {
List<KylinRefunds> getRefundList(Integer whereType, String refundBatchId, Integer[] whereStatus, int mid, int limitNum);
}
...@@ -2,4 +2,46 @@ ...@@ -2,4 +2,46 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper"> <mapper namespace="com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper">
<select id="getPriceNum" resultType="java.util.HashMap">
SELECT SUM('o.price_actual') as total_price, SUM('o.number') as total_num
FROM kylin_order_tickets AS o
JOIN kylin_order_ticket_relations AS r ON r.order_id = o.order_tickets_id
JOIN kylin_order_ticket_status AS s ON s.order_id = o.order_tickets_id
<where>
r.performance_id=#{targetId}
AND s.status=1
AND s.pay_status=1
AND o.coupon_type='no'
</where>
</select>
<select id="getTotalPrice" resultType="java.lang.Double">
SELECT SUM(${selectFields})
FROM kylin_order_tickets AS o
JOIN kylin_order_ticket_relations AS r ON r.order_id = o.order_tickets_id
JOIN kylin_order_ticket_status AS s ON s.order_id = o.order_tickets_id
<where>
r.performance_id=#{targetId}
AND s.status=1
AND s.pay_status=1
AND o.coupon_type='no'
AND o.payment_type IN
<foreach collection="paymentType" item="payment_type" index="index" open="(" close=")" separator=",">
#{payment_type}
</foreach>
</where>
</select>
<select id="getOrderEntities" resultType="java.util.List">
SELECT o.mid, order_tickets_id, number, price_actual, performance_title
FROM kylin_order_tickets AS o
JOIN kylin_order_ticket_relations AS r ON r.order_id = o.order_tickets_id
JOIN kylin_order_ticket_status AS s ON s.order_id = o.order_tickets_id
<where>
r.performance_id=#{targetId}
AND s.status=1
AND s.pay_status=1
AND o.coupon_type='no'
AND o.mid>#{mid}
</where>
LIMIT #{limitNum}
</select>
</mapper> </mapper>
<?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.liquidnet.service.kylin.mapper.KylinRefundBatchesMapper">
</mapper>
<?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.liquidnet.service.kylin.mapper.KylinRefundsMapper">
<select id="getRefundList" resultType="com.liquidnet.service.kylin.entity.KylinRefunds">
SELECT refunds_id
FROM kylin_refunds
<where>
r.performance_id=#{targetId}
AND type=#{whereType}
AND batch_id=#{refundBatchId}
AND o.mid>#{mid}
AND status IN
<foreach collection="whereStatus" item="status" index="index" open="(" close=")" separator=",">
#{status}
</foreach>
</where>
LIMIT #{limitNum}
</select>
</mapper>
...@@ -644,3 +644,89 @@ insert into `kylin_buy_notice` (`buy_notice_id`, `img_url`, `message`, `status`, ...@@ -644,3 +644,89 @@ insert into `kylin_buy_notice` (`buy_notice_id`, `img_url`, `message`, `status`,
values ('12', 'http://img-zhengzai-tv.oss-cn-hangzhou.aliyuncs.com/partner/2019/01/21/5c456d9482fb9.png', values ('12', 'http://img-zhengzai-tv.oss-cn-hangzhou.aliyuncs.com/partner/2019/01/21/5c456d9482fb9.png',
'电子票购票人须持本人身份证原件和订单二维码验票入场。请不要将身份证信息和订单二维码提供给他人,因此导致的损失,主办方/平台方不承担任何责任。', '1', '0', '2019-01-29 13:51:42', '电子票购票人须持本人身份证原件和订单二维码验票入场。请不要将身份证信息和订单二维码提供给他人,因此导致的损失,主办方/平台方不承担任何责任。', '1', '0', '2019-01-29 13:51:42',
'2019-01-29 13:51:42', '凭身份证原件兑票'); '2019-01-29 13:51:42', '凭身份证原件兑票');
# 批量退款表
drop TABLE if exists `kylin_refund_batches`;
CREATE TABLE `kylin_refund_batches`
(
`mid` int unsigned NOT NULL AUTO_INCREMENT,
`refund_batch_id` varchar(255) NOT NULL DEFAULT '' COMMENT 'refund_batch_id',
`target_id` varchar(255) NOT NULL DEFAULT '' COMMENT '目标id target_type=1为演出id',
`target_title` varchar(255) NOT NULL DEFAULT '' COMMENT '目标名称 target_type=1为演出名称',
`target_type` tinyint NOT NULL DEFAULT '1' COMMENT '目标类型 1演出',
`status` tinyint NOT NULL DEFAULT '1' COMMENT '批量退款状态 1申请退款 2取消退款 3运营驳回审核 4运营通过审核 5财务驳回审核 6财务通过审核',
`total_price` decimal(11, 2) NOT NULL DEFAULT '0.00' COMMENT '批量退款总金额',
`real_total_price` decimal(11, 2) NOT NULL DEFAULT '0.00' COMMENT '实际批量退款总金额',
`total_num` int NOT NULL DEFAULT '0' COMMENT '批量退款总数量',
`real_total_num` int NOT NULL DEFAULT '0' COMMENT '实际批量退款总数量',
`total_refund_alipay` decimal(11, 2) NOT NULL DEFAULT '0.00' COMMENT '申请时支付宝需退款总金额',
`total_refund_wepay` decimal(11, 2) NOT NULL DEFAULT '0.00' COMMENT '申请时微信需退款总金额',
`total_price_express_alipay` decimal(11, 2) NOT NULL DEFAULT '0.00' COMMENT '快递费总金额支付宝',
`total_price_express_wepay` decimal(11, 2) NOT NULL DEFAULT '0.00' COMMENT '快递费总金额微信',
`reason` varchar(200) NOT NULL DEFAULT '' COMMENT '批量退款原因',
`remark` varchar(200) NOT NULL DEFAULT '' COMMENT '批量退款备注',
`reject` varchar(200) NOT NULL DEFAULT '' COMMENT '驳回原因',
`refuse` varchar(200) NOT NULL DEFAULT '' COMMENT '回绝原因',
`applicant_id` int NOT NULL DEFAULT '0' COMMENT '批量申请人id',
`applicant_name` varchar(100) NOT NULL DEFAULT '' COMMENT '批量申请人名称',
`applicant_at` timestamp NULL DEFAULT NULL COMMENT '批量申请时间',
`auditor_id` int NOT NULL DEFAULT '0' COMMENT '批量审核人id',
`auditor_name` varchar(100) NOT NULL DEFAULT '' COMMENT '批量审核人名称',
`auditor_at` timestamp NULL DEFAULT NULL COMMENT '批量审核时间',
`executor_id` int NOT NULL DEFAULT '0' COMMENT '批量执行人id',
`executor_name` varchar(100) NOT NULL DEFAULT '' COMMENT '批量执行人名称',
`executor_at` timestamp NULL DEFAULT NULL COMMENT '批量执行时间',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
KEY `kylin_refund_batch_id_index` (`refund_batch_id`),
PRIMARY KEY (`mid`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT '批量退款表';
# 退款表
drop TABLE if exists `kylin_refunds`;
CREATE TABLE `kylin_refunds`
(
`mid` int unsigned NOT NULL AUTO_INCREMENT,
`refunds_id` varchar(255) NOT NULL DEFAULT '' COMMENT 'refunds_id',
`merchant_id` varchar(255) NOT NULL DEFAULT '' COMMENT '商户id',
`status` tinyint NOT NULL DEFAULT '0' COMMENT '退款状态: 0请求退款 2取消退款 1审核通过 5驳回退款 7等待退款 3正在退款 4完成退款 6退款失败',
`type` tinyint NOT NULL DEFAULT '0' COMMENT '退款差异: 0申请退款返还库存 1自动退款无法取消退款不返还库存',
`order_id` varchar(255) NOT NULL DEFAULT '' COMMENT '订单id',
`order_type` varchar(50) NOT NULL DEFAULT '' COMMENT '订单类型 order_product 商品订单 , order_ticket 票务订单',
`order_code` varchar(50) NOT NULL COMMENT '订单中心订单号,这里方便查询',
`order_title` varchar(200) NOT NULL DEFAULT '' COMMENT '退款内容,演出title,商品title,这里方便查询',
`order_mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '退款手机号,这里方便查询',
`pay_code` varchar(50) NOT NULL COMMENT '支付中心支付单号,用于申请退款',
`order_refund_code` varchar(50) NOT NULL COMMENT '退款编号',
`price` decimal(10, 2) NOT NULL DEFAULT '0.00' COMMENT '退款总金额',
`reason` varchar(200) NOT NULL DEFAULT '' COMMENT '退款原因',
`remark` varchar(200) NOT NULL DEFAULT '' COMMENT '退款备注',
`reject` varchar(200) NOT NULL DEFAULT '' COMMENT '驳回原因',
`refuse` varchar(200) NOT NULL DEFAULT '' COMMENT '回绝原因',
`refund_code` varchar(50) DEFAULT NULL COMMENT '退款中心退款编号',
`refund_type` varchar(20) DEFAULT NULL COMMENT '退款类型',
`refund_at` timestamp NULL DEFAULT NULL COMMENT '成功退款时间',
`refund_id` varchar(50) DEFAULT NULL COMMENT '第三方退款编号',
`refund_error` varchar(100) DEFAULT NULL COMMENT '退款失败原因',
`applicant_id` int NOT NULL DEFAULT '0' COMMENT '申请人id',
`applicant_name` varchar(100) NOT NULL DEFAULT '' COMMENT '申请人名称',
`applicant_at` timestamp NULL DEFAULT NULL COMMENT '申请时间',
`auditor_id` int NOT NULL DEFAULT '0' COMMENT '审核人id',
`auditor_name` varchar(100) NOT NULL DEFAULT '' COMMENT '审核人名称',
`auditor_at` timestamp NULL DEFAULT NULL COMMENT '审核时间',
`executor_id` int NOT NULL DEFAULT '0' COMMENT '执行人id',
`executor_name` varchar(100) NOT NULL DEFAULT '' COMMENT '执行人名称',
`executor_at` timestamp NULL DEFAULT NULL COMMENT '执行时间',
`batch_id` varchar(255) NOT NULL DEFAULT '' COMMENT '批量退款id',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`payment_type` varchar(20) NOT NULL DEFAULT '' COMMENT '支付类型',
PRIMARY KEY (`mid`),
UNIQUE KEY `kylin_refunds_order_refund_code_unique` (`order_refund_code`),
KEY `kylin_refunds_id_index` (`refunds_id`),
KEY `kylin_refunds_order_id_index` (`order_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT ='退款表'
\ No newline at end of file
package com.liquidnet.service.kylin.controller;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dto.param.KylinStationCheckOrderParam;
import com.liquidnet.service.kylin.dto.vo.KylinStationCheckOrderVo;
import com.liquidnet.service.kylin.dto.vo.KylinStationPerformanceVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import java.util.Collections;
import java.util.List;
@Api(tags = "验票")
@Slf4j
@RestController
@RequestMapping("station")
public class KylinStationController {
@ApiOperation(value = "手机号密码登录")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", dataType = "String", name = "mobile", value = "手机号"),
@ApiImplicitParam(type = "form", dataType = "String", name = "passwd", value = "密码"),
})
@PostMapping("login")
public ResponseDto<String> login(@RequestParam String mobile, @RequestParam String passwd) {
log.info("mobile:{},passwd:{}", mobile, passwd);
return ResponseDto.success("token........");
}
@ApiOperation(value = "手机号验证码登录")
@ApiImplicitParams({
@ApiImplicitParam(type = "body", required = true, dataType = "String", name = "mobile", value = "手机号"),
@ApiImplicitParam(type = "body", required = true, dataType = "String", name = "code", value = "验证码"),
})
@PostMapping("login/sms")
public ResponseDto<String> loginBySms(@RequestParam String mobile, @RequestParam String code) {
log.info("mobile:{},code:{}", mobile, code);
return ResponseDto.success("token.........");
}
/* ------------------------------------------------------------------ */
@ApiOperation(value = "演出列表")
@ApiImplicitParams({
@ApiImplicitParam(type = "body", required = true, dataType = "String", name = "mod", value = "模块[recent-近期的,down-已下载,over-历史]", allowableValues = "recent,down,over"),
})
@GetMapping("performances/{mod}")
public ResponseDto<KylinStationPerformanceVo> performances(@PathVariable String mod) {
log.info("mod:{}", mod);
return ResponseDto.success(KylinStationPerformanceVo.getNew());
}
@ApiOperation(value = "下载验票数据")
@ApiImplicitParams({
@ApiImplicitParam(type = "body", required = true, dataType = "String", name = "type", value = "类型[101-音乐节,102小型演出(livehouse演出),103巡演]", allowableValues = "101,102,103"),
@ApiImplicitParam(type = "body", required = true, dataType = "String", name = "performanceId", value = "演出ID[64]"),
})
@GetMapping("download/{type}/{performanceId}")
public ResponseDto<List<KylinStationCheckOrderVo>> downloadTicketData(@PathVariable String type, @PathVariable String performanceId) {
log.info("type:{},performanceId:{}", type, performanceId);
return ResponseDto.success(Collections.singletonList(KylinStationCheckOrderVo.getNew()));
}
@ApiOperation(value = "上载验票数据")
@PostMapping("upload")
public ResponseDto<Boolean> uploadTicketData(@RequestBody List<KylinStationCheckOrderParam> checkDataParams) {
log.info("checkDataParams:{}", JsonUtils.toJson(checkDataParams));
return ResponseDto.success(true);
}
/* ------------------------------------------------------------------ */
private String loginProcess() {
return null;
}
}
package com.liquidnet.service.kylin.controller.admin;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dto.param.BannersParam;
import com.liquidnet.service.kylin.service.impl.admin.KylinRefundPerformancesAdminServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 后台单订单退款 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-05-25 10:58 上午
*/
@Api(tags = "后端-单订单退款")
@RestController
@RequestMapping("admin/refund")
public class KylinRefundAdminController {
@Autowired
private KylinRefundPerformancesAdminServiceImpl kylinRefundPerformancesAdminServiceImpl;
@PostMapping("")
@ApiOperation("创建banner")
public ResponseDto<Object> create(@RequestBody @Validated BannersParam bannersParam) {
return ResponseDto.success();
/*Boolean res = kylinRefundAdminServiceImpl.create(bannersParam);
if (res) {
return ResponseDto.success();
} else {
return ResponseDto.failure("添加banner失败");
}*/
}
}
package com.liquidnet.service.kylin.controller.admin;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.service.impl.admin.KylinRefundPerformancesAdminServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
/**
* <p>
* 后台按演出批量退款 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-05-25 11:07 上午
*/
@Api(tags = "后端-批量退款")
@RestController
@RequestMapping("admin/refundBatch")
public class KylinRefundBatchAdminController {
@Autowired
private KylinRefundPerformancesAdminServiceImpl kylinRefundPerformancesAdminServiceImpl;
@PostMapping("apply")
@ApiOperation("申请演出退款")
@ApiImplicitParams({
@ApiImplicitParam(type = "body", dataType = "String", name = "targetId", value = "ID targetType=1为演出id", required = true),
@ApiImplicitParam(type = "body", dataType = "Integer", name = "targetType", value = "类型 1演出", required = true),
@ApiImplicitParam(type = "body", dataType = "String", name = "reason", value = "申请备注", required = true),
})
public ResponseDto<Object> refundBatchApply(
@RequestBody String targetId,
@RequestBody Integer targetType,
@RequestBody String reason
) {
Integer authId = 1;
String authName = "jxl";
String token = "22adsd34tt";
HashMap<String, Object> otherParam = new HashMap();
otherParam.put("token", token);
otherParam.put("reason", reason);
try {
if (1 == targetType) {
Boolean res = kylinRefundPerformancesAdminServiceImpl.refundBatchApply(targetId, targetType, authId, authName, otherParam);
if (res) {
return ResponseDto.success();
} else {
return ResponseDto.failure("申请演出退款失败");
}
} else {
return ResponseDto.failure("参数错误");
}
} catch (Exception e) {
return ResponseDto.failure(e.getMessage());
}
}
@PostMapping("reapply")
@ApiOperation("再次提交审核")
@ApiImplicitParams({
@ApiImplicitParam(type = "body", dataType = "String", name = "refundBatchId", value = "refundBatchId 批量id", required = true),
@ApiImplicitParam(type = "body", dataType = "String", name = "remark", value = "再次提交备注", required = true),
})
public ResponseDto<Object> refundBatchApply(
@RequestBody String refundBatchId,
@RequestBody String remark
) throws Exception {
String token = "22adsd34tt";
HashMap<String, Object> otherParam = new HashMap();
otherParam.put("token", token);
otherParam.put("type", "reapply");
Boolean res = kylinRefundPerformancesAdminServiceImpl.refundBatchReapply(refundBatchId, remark, otherParam);
if (res) {
return ResponseDto.success();
} else {
return ResponseDto.failure("提交审核失败");
}
}
@PostMapping("cancel")
@ApiOperation("取消退款")
@ApiImplicitParams({
@ApiImplicitParam(type = "body", dataType = "String", name = "refundBatchId", value = "refundBatchId 批量id", required = true)
})
public ResponseDto<Object> refundBatchCancel(
@RequestBody String refundBatchId
) throws Exception {
String token = "22adsd34tt";
HashMap<String, Object> otherParam = new HashMap();
otherParam.put("token", token);
otherParam.put("type", "cancel");
Boolean res = kylinRefundPerformancesAdminServiceImpl.refundBatchCancel(refundBatchId, otherParam);
if (res) {
return ResponseDto.success();
} else {
return ResponseDto.failure("取消退款失败");
}
}
@PostMapping("review")
@ApiOperation("审核/驳回")
@ApiImplicitParams({
@ApiImplicitParam(type = "body", dataType = "String", name = "refundBatchId", value = "refundBatchId 批量id", required = true),
@ApiImplicitParam(type = "body", dataType = "Integer", name = "status", value = "状态 3运营驳回审核 4运营通过审核", required = true),
@ApiImplicitParam(type = "body", dataType = "String", name = "reject", value = "备注", required = true)
})
public ResponseDto<Object> refundBatchReview(
@RequestBody String refundBatchId,
@RequestBody Integer status,
@RequestBody String reject
) throws Exception {
String token = "22adsd34tt";
HashMap<String, Object> otherParam = new HashMap();
otherParam.put("token", token);
otherParam.put("type", "review");
otherParam.put("status", status);
otherParam.put("reject", reject);
Boolean res = kylinRefundPerformancesAdminServiceImpl.refundBatchReview(refundBatchId, otherParam);
if (res) {
return ResponseDto.success();
} else {
return ResponseDto.failure("审核失败");
}
}
@PostMapping("execute")
@ApiOperation("执行退款/拒绝退款")
@ApiImplicitParams({
@ApiImplicitParam(type = "body", dataType = "String", name = "refundBatchId", value = "refundBatchId 批量id", required = true),
@ApiImplicitParam(type = "body", dataType = "Integer", name = "status", value = "状态 5财务驳回审核 6财务通过审核", required = true),
@ApiImplicitParam(type = "body", dataType = "String", name = "refuse", value = "备注", required = true)
})
public ResponseDto<Object> refundBatchExecute(
@RequestBody String refundBatchId,
@RequestBody Integer status,
@RequestBody String refuse
) throws Exception {
String token = "22adsd34tt";
HashMap<String, Object> otherParam = new HashMap();
otherParam.put("token", token);
otherParam.put("type", "execute");
otherParam.put("status", status);
otherParam.put("refuse", refuse);
Boolean res = kylinRefundPerformancesAdminServiceImpl.refundBatchExecute(refundBatchId, otherParam);
if (res) {
return ResponseDto.success();
} else {
return ResponseDto.failure("审核失败");
}
}
}
package com.liquidnet.service.kylin.controller.admin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 退款表 前端控制器
* </p>
*
* @author liquidnet
* @since 2021-05-26
*/
@RestController
@RequestMapping("/kylin-refunds")
public class KylinRefundsController {
}
package com.liquidnet.service.kylin.service.impl;
import com.liquidnet.service.kylin.service.IKylinStationService;
import org.springframework.stereotype.Service;
@Service
public class KylinStationServiceImpl implements IKylinStationService {
}
package com.liquidnet.service.kylin.service.impl.admin;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.service.kylin.constant.KylinTableStatusConst;
import com.liquidnet.service.kylin.entity.*;
import com.liquidnet.service.kylin.mapper.KylinOrderTicketEntitiesMapper;
import com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper;
import com.liquidnet.service.kylin.mapper.KylinRefundBatchesMapper;
import com.liquidnet.service.kylin.mapper.KylinRefundsMapper;
import com.liquidnet.service.kylin.service.IKylinRefundBatchesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 后台退款 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-05-25 19:50 下午
*/
@Service
public class KylinRefundExecuteServiceImpl extends ServiceImpl<KylinRefundBatchesMapper, KylinRefundBatches> implements IKylinRefundBatchesService {
@Autowired
private KylinOrderTicketsMapper kylinOrderTicketsMapper;
@Autowired
private KylinRefundsMapper kylinRefundsMapper;
@Autowired
private KylinOrderTicketEntitiesMapper kylinOrderTicketEntitiesMapper;
@Autowired
RedisUtil redisUtil;
@Autowired
private KylinRefundHttpSubmitServiceImpl kylinRefundHttpSubmitServiceImpl;
@Async
public void refundBatchApply(String targetId, String refundBatchId, HashMap<String, Object> otherParam) throws Exception {
int count;
int limitNum = 100;
int mid = 0;
do {
List<KylinOrderTickets> orderList = kylinOrderTicketsMapper.getOrderEntities(targetId, mid, limitNum);
for (KylinOrderTickets v : orderList) {
List<KylinOrderTicketEntities> entitiesList = kylinOrderTicketEntitiesMapper.selectList(
new UpdateWrapper<KylinOrderTicketEntities>().eq("order_id", v.getOrderTicketsId())
.eq("is_payment", "yes")
);
// 请求php接口
kylinRefundHttpSubmitServiceImpl.httpApply(v, entitiesList, otherParam, refundBatchId);
}
count = orderList.size();
KylinOrderTickets lastInfo = orderList.get(count - 1);
mid = lastInfo.getMid();
} while (count >= limitNum);
}
@Async
public void refundBatchStatus(String refundBatchId, HashMap<String, Object> otherParam) throws Exception {
// 处理查询订单状态
Integer[] whereStatus = {};
Integer whereType = KylinTableStatusConst.ORDER_REFUND_TYPE_APPLY;
switch ((String) otherParam.get("type")) {
case "reapply":
whereStatus = new Integer[]{KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE};
break;
case "cancel":
whereStatus = new Integer[]{KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY, KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE};
break;
case "review":
if (otherParam.get("status") == KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED) { // 通过申请
whereStatus = new Integer[]{KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY, KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE};
}
if (otherParam.get("status") == KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT) { // 驳回申请
whereStatus = new Integer[]{KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY, KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE};
}
break;
case "execute":
if (otherParam.get("status") == KylinTableStatusConst.ORDER_REFUND_STATUS_UNFILLED) { // 执行退款
whereStatus = new Integer[]{KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE, KylinTableStatusConst.ORDER_REFUND_STATUS_ERROR};
}
if (otherParam.get("status") == KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE) { // 拒绝退款
whereStatus = new Integer[]{KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED, KylinTableStatusConst.ORDER_REFUND_STATUS_ERROR};
}
break;
default:
throw new Exception("type异常,无法操作");
}
int count;
int limitNum = 1;
int mid = 0;
do {
List<KylinRefunds> refundList = kylinRefundsMapper.getRefundList(whereType, refundBatchId, whereStatus, mid, limitNum);
List<String> refundIds = null;
if (!refundList.isEmpty()) {
for (KylinRefunds v : refundList) {
String refundId = v.getRefundId();
refundIds.add(refundId);
}
// 请求php接口
kylinRefundHttpSubmitServiceImpl.httpStatus(refundIds, otherParam);
}
count = refundList.size();
KylinRefunds lastInfo = refundList.get(count - 1);
mid = lastInfo.getMid();
} while (count >= limitNum);
}
}
package com.liquidnet.service.kylin.service.impl.admin;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.databind.JsonNode;
import com.liquidnet.commons.lang.util.HttpUtil;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.kylin.entity.KylinOrderTicketEntities;
import com.liquidnet.service.kylin.entity.KylinOrderTickets;
import com.liquidnet.service.kylin.entity.KylinRefundBatches;
import com.liquidnet.service.kylin.mapper.KylinRefundBatchesMapper;
import com.liquidnet.service.kylin.service.IKylinRefundBatchesService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 后台退款 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-05-26 13:00 下午
*/
@Service
public class KylinRefundHttpSubmitServiceImpl extends ServiceImpl<KylinRefundBatchesMapper, KylinRefundBatches> implements IKylinRefundBatchesService {
@Async
public void httpApply(KylinOrderTickets orderInfo, List<KylinOrderTicketEntities> entitiesList, HashMap<String, Object> otherParam, String refundBatchId) throws Exception {
String postUrl = "apply";
// 构造退款数据
List<String> ticketEntityIds = null;
if (!entitiesList.isEmpty()) {
for (KylinOrderTicketEntities v : entitiesList) {
String orderTicketsId = v.getOrderTicketEntitiesId();
ticketEntityIds.add(orderTicketsId);
}
}
HashMap<String, Object> refundData = new HashMap();
refundData.put("ticket_entity_ids", ticketEntityIds);
refundData.put("matter_items", new ArrayList()); //搭售不处理
if (ticketEntityIds.isEmpty()) {
throw new Exception("查询详情出错");
}
// 发起退款申请
MultiValueMap<String, String> headers = new LinkedMultiValueMap();
headers.add("Authorization", otherParam.get("token").toString());
MultiValueMap<String, String> formParams = new LinkedMultiValueMap();
formParams.add("order_type", "order_ticket");
formParams.add("order_id", orderInfo.getOrderTicketsId());
formParams.add("batch_id", refundBatchId);
formParams.add("reason", otherParam.get("reason").toString());
formParams.add("refund_data", JsonUtils.toJson(refundData));
/*HashMap<String, Object> postParams = new HashMap();
postParams.put("headers", headers);
postParams.put("form_params", formParams);*/
// 请求提审接口参数
String postResult = HttpUtil.post(postUrl, formParams, headers);
JsonNode postResultNew = JsonUtils.fromJson(postResult, JsonNode.class);
// 请求提审接口结果
if (postResultNew.get("message").toString() != "OK") {
throw new Exception("申请退款出错");
}
}
@Async
public void httpStatus(List<String> refundIds, HashMap<String, Object> otherParam) throws Exception {
String postUrl = "reapply";
// 发起退款申请
MultiValueMap<String, String> headers = new LinkedMultiValueMap();
headers.add("Authorization", otherParam.get("token").toString());
MultiValueMap<String, String> formParams = new LinkedMultiValueMap();
formParams.put("ids", refundIds);
String reject = otherParam.get("reject").toString();
if (reject.isEmpty()) reject = "";
String refuse = otherParam.get("refuse").toString();
if (refuse.isEmpty()) refuse = "";
String status = (String) otherParam.get("status");
if (status.isEmpty()) status = "0";
formParams.add("reject", reject);
formParams.add("status", status);
formParams.add("refuse", refuse);
// 请求提审接口参数
String postResult = HttpUtil.post(postUrl, formParams, headers);
JsonNode postResultNew = JsonUtils.fromJson(postResult, JsonNode.class);
// 请求提审接口结果
if (postResultNew.get("message").toString() != "OK") {
throw new Exception("操作出错");
}
}
}
package com.liquidnet.service.kylin.service.impl.admin;
import com.liquidnet.service.kylin.entity.KylinRefunds;
import com.liquidnet.service.kylin.mapper.KylinRefundsMapper;
import com.liquidnet.service.kylin.service.IKylinRefundsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 退款表 服务实现类
* </p>
*
* @author liquidnet
* @since 2021-05-26
*/
@Service
public class KylinRefundsServiceImpl extends ServiceImpl<KylinRefundsMapper, KylinRefunds> implements IKylinRefundsService {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment