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

Commit 5ee545ff authored by jiangxiulong's avatar jiangxiulong

票种增加票的数据

parent c40678d1
......@@ -32,4 +32,19 @@ public class KylinTableStatusConst {
public static final Integer ORDER_REFUND_TYPE_APPLY = 0; // 人工申请类型的退款,可以取消退款,退款完成需返还库存
public static final Integer ORDER_REFUND_TYPE_AUTO = 1; // 自动申请类型的退款,无法取消退款,退款完成不返还库存
// 订单状态
public static final Integer STATUS_UNPAID = 0; // 待付款
public static final Integer STATUS_PAID = 1; // 已付款
public static final Integer STATUS_CLOSE = 2; // 已关闭
public static final Integer STATUS_DELETE = -1; // 关闭后用户主动删除
public static final Integer STATUS_REFUND = 3; // 正在退款
public static final Integer STATUS_REFUNDED = 4; // 已退款
public static final Integer STATUS_WAIT_CLOSE = 5; // 待关闭
// 订单转赠状态
public static final Integer TRANSFER_STATUS_NONE = 0; // 无
public static final Integer TRANSFER_STATUS_ACCEPT = 1; // 接受
public static final Integer TRANSFER_STATUS_GRANT = 2; // 赠予
}
......@@ -735,13 +735,13 @@ CREATE TABLE `kylin_refund_batches`
`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_id` varchar(255) NOT NULL DEFAULT '' 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_id` varchar(255) NOT NULL DEFAULT '' 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_id` varchar(255) NOT NULL DEFAULT '' COMMENT '批量执行人id',
`executor_name` varchar(100) NOT NULL DEFAULT '' COMMENT '批量执行人名称',
`executor_at` timestamp NULL DEFAULT NULL COMMENT '批量执行时间',
`created_at` timestamp NULL DEFAULT NULL,
......@@ -778,13 +778,13 @@ CREATE TABLE `kylin_refunds`
`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_id` varchar(255) NOT NULL DEFAULT '' 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_id` varchar(255) NOT NULL DEFAULT '' 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_id` varchar(255) NOT NULL DEFAULT '' 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',
......@@ -797,4 +797,45 @@ CREATE TABLE `kylin_refunds`
KEY `kylin_refunds_order_id_index` (`order_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT ='退款表'
\ No newline at end of file
COLLATE = utf8mb4_unicode_ci COMMENT ='退款表';
# 订单退款表
drop TABLE if exists `kylin_order_refunds`;
CREATE TABLE `kylin_order_refunds`
(
`mid` int unsigned NOT NULL AUTO_INCREMENT,
`order_refunds_id` varchar(255) NOT NULL DEFAULT '' COMMENT 'order_refunds_id',
`performance_id` varchar(255) NOT NULL DEFAULT '' COMMENT '演出 id',
`merchant_id` varchar(255) NOT NULL DEFAULT '' COMMENT '商户id',
`order_id` varchar(255) NOT NULL DEFAULT '' COMMENT '票务订单id',
`matter_id` varchar(255) NOT NULL DEFAULT '' COMMENT '商品订单id',
`admin_id` varchar(255) NOT NULL DEFAULT '' COMMENT '管理员id',
`admin_name` varchar(100) NOT NULL DEFAULT '' COMMENT '管理员名称',
`reason` varchar(200) NOT NULL DEFAULT '' COMMENT '退款原因',
`batch` int NOT NULL DEFAULT '1' COMMENT '批次从1开始',
`order_type` varchar(50) NOT NULL DEFAULT '' COMMENT '下单方式',
`pay_type` enum ('wepay','alipay','no') NOT NULL DEFAULT 'no' COMMENT '选择支付方式',
`payment_type` varchar(50) NOT NULL DEFAULT '' COMMENT '实际支付方式',
`refund_table` enum ('order_ticket_entities','matter_items') NOT NULL DEFAULT 'order_ticket_entities' COMMENT '订单入场人/搭售款式表',
`refund_type` enum ('ticket','product','express') NOT NULL DEFAULT 'ticket' COMMENT '票务/商品/快递费',
`refund_table_id` varchar(255) NOT NULL DEFAULT '' COMMENT '订单入场人/搭售款式表 id',
`refund_type_parent_id` varchar(255) NOT NULL DEFAULT '' COMMENT '演出/商品 id',
`refund_type_id` varchar(255) NOT NULL DEFAULT '' COMMENT '票种/款式 id',
`refund_status` int unsigned NOT NULL DEFAULT '0' COMMENT '2关闭或者取消退款3正在退款,4已退款',
`refund_number` int NOT NULL DEFAULT '0' COMMENT '数量',
`refund_price` decimal(10, 2) NOT NULL DEFAULT '0.00' COMMENT '退款金额 快递费有可能为负,意思是补差价',
`coupon_type` enum ('exchange','voucher','no') NOT NULL DEFAULT 'no' COMMENT '使用了兑换券/优惠券/无使用',
`coupon_id` varchar(255) NOT NULL DEFAULT '' COMMENT '优惠券id',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`refund_remark` varchar(200) NOT NULL DEFAULT '' COMMENT '退款备注',
`refund_code` varchar(100) NOT NULL DEFAULT '' COMMENT '退款单号',
`refund_id` varchar(255) NOT NULL DEFAULT '' COMMENT '退款表refunds的id',
PRIMARY KEY (`mid`),
KEY `kylin_order_refunds_order_id_index` (`order_id`),
KEY `kylin_order_refunds_refund_type_index` (`refund_type`),
KEY `kylin_order_refunds_refund_status_index` (`refund_status`),
KEY `kylin_order_refunds_id_index` (`order_refunds_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT ='订单退款表';
\ No newline at end of file
......@@ -171,11 +171,11 @@ public class KylinPerformancesController {
@ApiImplicitParam(type = "path", dataType = "String", name = "performancesId", value = "演出id", required = true),
@ApiImplicitParam(type = "query", dataType = "Integer", name = "isAgent", value = "是否分销 1是 0不是 空/不传/0")
})
public ResponseDto<List<KylinTicketTimesVo>> ticketTimesPartner(
public ResponseDto<HashMap<String, Object>> ticketTimesPartner(
@PathVariable("performancesId") String performancesId,
@RequestParam(defaultValue = "0") Integer isAgent
) {
List<KylinTicketTimesVo> result = kylinPerformancesService.ticketTimesPartner(performancesId, isAgent);
HashMap<String, Object> result = kylinPerformancesService.ticketTimesPartner(performancesId, isAgent);
if (result.size() > 0) {
return ResponseDto.success(result);
} else {
......
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 com.liquidnet.service.kylin.service.impl.admin.KylinRefundsServiceImpl;
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.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -28,18 +28,32 @@ import org.springframework.web.bind.annotation.RestController;
public class KylinRefundAdminController {
@Autowired
private KylinRefundPerformancesAdminServiceImpl kylinRefundPerformancesAdminServiceImpl;
private KylinRefundsServiceImpl kylinRefundsServiceImpl;
@PostMapping("")
@ApiOperation("创建banner")
public ResponseDto<Object> create(@RequestBody @Validated BannersParam bannersParam) {
return ResponseDto.success();
/*Boolean res = kylinRefundAdminServiceImpl.create(bannersParam);
@PostMapping("apply")
@ApiOperation("申请退款")
@ApiImplicitParams({
@ApiImplicitParam(type = "body", dataType = "String", name = "orderTicketsId", value = "订单id", required = true),
@ApiImplicitParam(type = "body", dataType = "String", name = "orderType", value = "订单order_ticket 商品order_product", required = true),
@ApiImplicitParam(type = "body", dataType = "String", name = "reason", value = "备注", required = true),
@ApiImplicitParam(type = "body", dataType = "String", name = "remark", value = "备注"),
@ApiImplicitParam(type = "body", dataType = "Integer", name = "batch_id", value = "批量id"),
@ApiImplicitParam(type = "body", dataType = "String", name = "refundData", value = "退款数据")
})
public ResponseDto<Object> refundApply(
@RequestBody String orderTicketsId,
@RequestBody String orderType,
@RequestBody String reason,
@RequestBody String remark,
@RequestBody Integer batch_id,
@RequestBody String refundData
) throws Exception {
Boolean res = kylinRefundsServiceImpl.refundApply(orderTicketsId, orderType, reason, remark, batch_id, refundData);
if (res) {
return ResponseDto.success();
} else {
return ResponseDto.failure("添加banner失败");
}*/
return ResponseDto.failure("申请退款失败");
}
}
}
......@@ -213,7 +213,7 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
public KylinPerformanceVo detail(String performancesId, double latitudeFrom, double longitudeFrom) {
KylinPerformanceVo performancesInfo = (KylinPerformanceVo) redisUtil.hget(KylinRedisConst.PERFORMANCES, performancesId);
KylinPerformanceVo performancesInfo = (KylinPerformanceVo) redisUtil.get(KylinRedisConst.PERFORMANCES.concat(performancesId));
String roadShowId = "";
if (null == performancesInfo) {
performancesInfo = mongoTemplate.findOne(
......@@ -226,7 +226,7 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
} else {
roadShowId = performancesInfo.getRoadShowId();
redisUtil.hset(KylinRedisConst.PERFORMANCES, performancesId, performancesInfo);
redisUtil.set(KylinRedisConst.PERFORMANCES.concat(performancesId), performancesInfo);
}
} else {
roadShowId = performancesInfo.getRoadShowId();
......@@ -274,7 +274,7 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
return performancesInfo;
}
public List<KylinTicketTimesVo> ticketTimesPartner(String performancesId, Integer isAgent) {
public HashMap<String, Object> ticketTimesPartner(String performancesId, Integer isAgent) {
List<KylinTicketTimesVo> ticketTimesList = mongoTemplate.find(
Query.query(Criteria.where("performanceId").is(performancesId)),
KylinTicketTimesVo.class,
......@@ -329,7 +329,17 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
partner.setTicketList(ticketList);
}
return ticketTimesList;
KylinPerformanceVo performancesInfo = (KylinPerformanceVo) redisUtil.get(KylinRedisConst.PERFORMANCES.concat(performancesId));
HashMap<String, Object> info = new HashMap();
info.put("city_name", performancesInfo.getCityName());
info.put("field_name", performancesInfo.getFieldName());
info.put("title", performancesInfo.getTitle());
HashMap result = new HashMap();
result.put("performancesInfo", info);
result.put("ticketTimesList", ticketTimesList);
return result;
}
public List<KylinPerformanceVo> performanceList(String... performancesIds) {
......
package com.liquidnet.service.kylin.service.impl.admin;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.kylin.entity.KylinOrderTickets;
import com.liquidnet.service.kylin.entity.KylinRefundBatches;
import com.liquidnet.service.kylin.entity.KylinRefunds;
import com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper;
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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
......@@ -17,4 +24,32 @@ import org.springframework.stereotype.Service;
@Service
public class KylinRefundsServiceImpl extends ServiceImpl<KylinRefundsMapper, KylinRefunds> implements IKylinRefundsService {
@Autowired
private KylinOrderTicketsMapper kylinOrderTicketsMapper;
@Autowired
private KylinRefundsStatusServiceImpl kylinRefundsStatusServiceImpl;
public Boolean refundApply(String orderTicketsId, String orderType, String reason, String remark, Integer batch_id, String refundData) throws Exception {
int count = 0;
if(orderType == "order_ticket"){
count = kylinOrderTicketsMapper.selectCount(
new UpdateWrapper<KylinOrderTickets>().eq("order_tickets_id", orderTicketsId).eq("coupon_type2", "full")
);
}
if(count > 0){
throw new Exception("使用满减券 暂不能退款");
}
if (orderType == "order_ticket") { // 票务退款
JsonNode refundDataJson = JsonUtils.fromJson(refundData, JsonNode.class);
JsonNode ticketEntityIds = refundDataJson.get("ticketEntityIds");
int authId = 0;
String authName = "sss";
kylinRefundsStatusServiceImpl.orderTicketRefunding(authId, authName, orderTicketsId, ticketEntityIds, reason, remark, batch_id);
}
return true;
}
}
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