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

Commit 8af7c317 authored by jiangxiulong's avatar jiangxiulong

完善列表 详情 提交

parent 93f51ec4
package com.liquidnet.service.kylin.dto.vo;
import com.liquidnet.service.kylin.dto.vo.partner.KylinPerformanceMisVo;
import io.swagger.annotations.ApiModel;
import com.liquidnet.service.kylin.dao.PerformanceOrderStatisticalDao;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* <p>
* refund batches返回给前端的数据字段
* </p>
*
* @author jiangxiulong
* @since 2021-05-31 11:19 上午
*/
@Data
@ApiModel
public class KylinOrderRefundBatchesPerformanceVo implements Serializable {
private KylinPerformanceMisVo kylinPerformanceMisVo;
private List<PerformanceOrderStatisticalDao> performanceOrderStatisticalDao;
}
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
......@@ -29,6 +30,10 @@ public class KylinOrderRefundBatchesVo implements Serializable {
@ApiModelProperty(value = "状态")
private Integer status;
private Integer totalNum;
private BigDecimal totalAlipay;
private BigDecimal totalWepay;
@ApiModelProperty(value = "添加时间")
private LocalDateTime createdAt;
......
......@@ -4,18 +4,24 @@ import com.github.pagehelper.PageInfo;
import com.liquidnet.client.admin.common.core.controller.BaseController;
import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinPerformancesAdminServiceImpl;
import com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinRefundPerformancesAdminServiceImpl;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dao.OrderRefundBatchDao;
import com.liquidnet.service.kylin.dao.PerformanceOrderStatisticalDao;
import com.liquidnet.service.kylin.dto.param.RefundBatchApplyParam;
import com.liquidnet.service.kylin.dto.param.RefundBatchSearchParam;
import com.liquidnet.service.kylin.dto.vo.KylinOrderRefundBatchesPerformanceVo;
import com.liquidnet.service.kylin.dto.vo.KylinOrderRefundBatchesVo;
import com.liquidnet.service.kylin.dto.vo.partner.KylinPerformanceMisVo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 后台按演出批量退款 服务实现类
......@@ -34,6 +40,9 @@ public class KylinOrderRefundBatchAdminController extends BaseController {
@Autowired
private KylinRefundPerformancesAdminServiceImpl kylinRefundPerformancesAdminServiceImpl;
@Autowired
private KylinPerformancesAdminServiceImpl kylinPerformancesService;
@RequiresPermissions("kylin:refundBatch:view")
@GetMapping()
public String operlog()
......@@ -65,8 +74,16 @@ public class KylinOrderRefundBatchAdminController extends BaseController {
@PostMapping("applyPerformance")
@ResponseBody
public String applyPerformance(RefundBatchSearchParam refundBatchSearchParam) {
return "error";
public KylinOrderRefundBatchesPerformanceVo applyPerformance(RefundBatchApplyParam refundBatchApplyParam) {
String performancesId = refundBatchApplyParam.getTargetId();
//获取演出详情
KylinPerformanceMisVo performanceMisVo = kylinPerformancesService.performanceDetails(performancesId);
List<PerformanceOrderStatisticalDao> result = kylinPerformancesService.getPerformanceOrderStatisticalList(performancesId);
KylinOrderRefundBatchesPerformanceVo kylinOrderRefundBatchesPerformanceVo = new KylinOrderRefundBatchesPerformanceVo();
kylinOrderRefundBatchesPerformanceVo.setKylinPerformanceMisVo(performanceMisVo);
kylinOrderRefundBatchesPerformanceVo.setPerformanceOrderStatisticalDao(result);
return kylinOrderRefundBatchesPerformanceVo;
}
@RequiresPermissions("kylin:refundBatch:apply")
......@@ -81,6 +98,7 @@ public class KylinOrderRefundBatchAdminController extends BaseController {
return error("申请退款失败");
}
} catch (Exception e) {
e.printStackTrace();
return error(e.getMessage());
}
}
......
......@@ -91,7 +91,6 @@
var data = $('#form-post-add').serializeArray();
data.push({"ticketEntityIds":rows.join()});
data.push({"name":"ticketEntityIds","value":rows});
console.log(111)
$.operate.save(prefix + "/apply", data);
}
}
......
......@@ -9,13 +9,13 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">演出id:</label>
<div class="col-sm-8">
<input th:value="67689474263547904" class="form-control" type="text" name="targetId" id="targetId" required>
<input class="form-control" type="text" name="targetId" id="targetId" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">演出名称:</label>
<div class="col-sm-8">
<input th:value="0" class="form-control" type="text" name="title">
<input class="form-control" type="text" name="title">
</div>
</div>
<div class="form-group">
......@@ -27,9 +27,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<label class="col-sm-3 control-label layui-required is-required">备注:</label>
<div class="col-sm-8">
<textarea name="reason" class="form-control"></textarea>
<textarea name="reason" maxlength="500" class="form-control layui-required" rows="3"></textarea>
</div>
</div>
</form>
......@@ -48,16 +48,28 @@
type: "post",
dataType: "json",
data: {
"performancesId" : function() {
"targetId" : function() {
return $.common.trim($("#targetId").val());
}
},
beforeSend: function () {
$.modal.loading("正在查询订单,请稍后...");
$.modal.loading("正在查询演出,请稍后...");
},
success: function(result) {
var options = {
data: result.orderTicketEntitiesVo,
pagination: false,
columns: [{
checkbox: true
},
{
field: 'orderTicketEntitiesId',
title: '票种数据'
},
]
};
$.table.init(options);
$.modal.closeLoading();
console.log(result)
}
};
$.ajax(config)
......@@ -68,8 +80,15 @@
});
function submitHandler() {
var reason = $('#form-post-add').find("[name='reason']").val();
var targetId = $('#form-post-add').find("[name='targetId']").val();
if (!targetId || !reason) {
layer.msg("请完善数据");
return false;
}
if ($.validate.form()) {
$.operate.save(prefix + "/apply", $('#form-post-add').serialize());
var data = $('#form-post-add').serializeArray();
$.operate.save(prefix + "/apply", data);
}
}
</script>
......
......@@ -7,12 +7,32 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m-t" id="signupForm">
<div class="form-group">
<label class="col-sm-2 control-label">批量退款id:</label>
<label class="col-sm-2 control-label">演出退款id:</label>
<div class="form-control-static" th:text="${KylinOrderRefundsBatchVo.refundBatchId}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">批量提交时间:</label>
<label class="col-sm-2 control-label">演出id:</label>
<div class="form-control-static" th:text="${KylinOrderRefundsBatchVo.targetId}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">应退款总票数:</label>
<div class="form-control-static" th:text="${KylinOrderRefundsBatchVo.totalNum}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">应退款支付宝总金额:</label>
<div class="form-control-static" th:text="${KylinOrderRefundsBatchVo.totalAlipay}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">应退款微信总金额:</label>
<div class="form-control-static" th:text="${KylinOrderRefundsBatchVo.totalWepay}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">提交时间:</label>
<div class="form-control-static" th:text="${KylinOrderRefundsBatchVo.createdAt}">
</div>
</div>
......
......@@ -160,14 +160,18 @@
field: 'refundBatchId',
title: '退款id'
},
{
field: 'status',
title: '状态'
},
{
field: 'targetId',
title: '演出id'
},
{
field: 'performancesInfo.title',
title: '演出名称'
},
{
field: 'statusName',
title: '状态'
},
{
field: 'createdAt',
title: '申请时间'
......
......@@ -10,16 +10,20 @@ import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.constant.KylinTableStatusConst;
import com.liquidnet.service.kylin.dao.OrderRefundBatchDao;
import com.liquidnet.service.kylin.dao.OrderRefundDao;
import com.liquidnet.service.kylin.dto.param.RefundBatchApplyParam;
import com.liquidnet.service.kylin.dto.param.RefundBatchSearchParam;
import com.liquidnet.service.kylin.dto.vo.KylinOrderRefundBatchesVo;
import com.liquidnet.service.kylin.entity.KylinOrderRefundBatches;
import com.liquidnet.service.kylin.entity.KylinPerformances;
import com.liquidnet.service.kylin.mapper.KylinOrderRefundBatchesMapper;
import com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper;
import com.liquidnet.service.kylin.mapper.KylinPerformancesMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
......@@ -43,6 +47,9 @@ public class KylinRefundPerformancesAdminServiceImpl {
@Autowired
private KylinOrderRefundBatchesMapper kylinOrderRefundBatchesMapper;
@Autowired
private KylinPerformancesMapper kylinPerformancesMapper;
@Autowired
private KylinRefundExecuteServiceImpl kylinRefundExecuteServiceImpl;
......@@ -52,15 +59,15 @@ public class KylinRefundPerformancesAdminServiceImpl {
public Boolean refundBatchApply(RefundBatchApplyParam refundBatchApplyParam) throws Exception {
String targetId = refundBatchApplyParam.getTargetId();
HashMap<String, Object> priceNum = kylinOrderTicketsMapper.getPriceNum(targetId);
Integer totalNum = 0;
if (null != priceNum) {
double totalPrice = Double.parseDouble(priceNum.get("total_price").toString());
Integer totalNum = Integer.parseInt(priceNum.get("total_num").toString());
totalNum = Integer.parseInt(priceNum.get("total_num").toString());
if (totalPrice <= 0 || totalNum <= 0) throw new Exception("当前演出暂无需要退款的订单,请确认后重试!");
} else {
throw new Exception("当前演出暂无需要退款的订单,请确认后重试!");
}
// 汇总退款
/*String[] paymentTypeAlipayArray = {"APPALIPAY", "WAPALIPAY", "alipay"};
double totalRefundAlipay = kylinOrderTicketsMapper.getTotalPrice(targetId, "price_actual", paymentTypeAlipayArray);
......@@ -69,6 +76,11 @@ public class KylinRefundPerformancesAdminServiceImpl {
double totalPriceExpressAlipay = kylinOrderTicketsMapper.getTotalPrice(targetId, "price_express", paymentTypeAlipayArray);
double totalPriceExpressWepay = kylinOrderTicketsMapper.getTotalPrice(targetId, "price_express", paymentTypeWepayArray);*/
String[] paymentTypeAlipayArray = {"APPALIPAY", "WAPALIPAY", "alipay"};
Double totalAlipay = kylinOrderTicketsMapper.getTotalPrice(targetId, "price_actual", paymentTypeAlipayArray);
String[] paymentTypeWepayArray = {"APPWEPAY", "APPLETWEPAY", "WAPWEPAY", "JSWEPAY", "wepay"};
Double totalWepay = kylinOrderTicketsMapper.getTotalPrice(targetId, "price_actual", paymentTypeWepayArray);
KylinOrderRefundBatches refundBatchesInfo = kylinOrderRefundBatchesMapper.selectOne(
new QueryWrapper<KylinOrderRefundBatches>().eq("target_id", targetId).orderByDesc("refund_batch_id")
);
......@@ -82,8 +94,15 @@ public class KylinRefundPerformancesAdminServiceImpl {
KylinOrderRefundBatches createData = new KylinOrderRefundBatches();
createData.setRefundBatchId(refundBatchId);
createData.setTargetId(targetId);
createData.setCreatedAt(LocalDateTime.now());
createData.setStatus(KylinTableStatusConst.STATUS_APPLY);
createData.setTotalNum(totalNum);
if (null != totalAlipay) {
createData.setTotalAlipay(BigDecimal.valueOf(totalAlipay));
}
if (null != totalWepay) {
createData.setTotalWepay(BigDecimal.valueOf(totalWepay));
}
createData.setCreatedAt(LocalDateTime.now());
int resNum = kylinOrderRefundBatchesMapper.insert(createData);
if (resNum > 0) {
......@@ -168,6 +187,7 @@ public class KylinRefundPerformancesAdminServiceImpl {
new UpdateWrapper<KylinOrderRefundBatches>()
.eq("refund_batch_id", orderRefundId)
);
KylinOrderRefundBatchesVo kylinOrderRefundBatchesVo = new KylinOrderRefundBatchesVo();
BeanUtils.copyProperties(data, kylinOrderRefundBatchesVo);
......@@ -179,6 +199,14 @@ public class KylinRefundPerformancesAdminServiceImpl {
try {
PageHelper.startPage(refundBatchSearchParam.getPageNum(), refundBatchSearchParam.getPageSize());
List<OrderRefundBatchDao> voList = kylinOrderRefundBatchesMapper.misRefundBatchList(BeanUtil.convertBeanToMap(refundBatchSearchParam));
for (OrderRefundBatchDao item : voList) {
KylinPerformances info = kylinPerformancesMapper.selectOne(
new UpdateWrapper<KylinPerformances>()
.eq("performances_id", item.getTargetId())
);
item.setPerformancesInfo(info);
item.setStatusName(item.getStatus());
}
pageInfoTmp = new PageInfo(voList);
} catch (Exception e) {
return null;
......
package com.liquidnet.service.kylin.dao;
import com.liquidnet.service.kylin.entity.KylinPerformances;
import lombok.Data;
import java.io.Serializable;
......@@ -13,10 +14,41 @@ public class OrderRefundBatchDao implements Serializable {
private String targetId;
private Integer status;
private String statusName;
private LocalDateTime executorAt;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
private KylinPerformances performancesInfo;
public void setStatusName(Integer status){
this.status=status;
switch (status){
case 1:
this.statusName="申请退款";
break;
case 2:
this.statusName="取消退款";
break;
case 3:
this.statusName="运营驳回审核";
break;
case 4:
this.statusName="运营通过审核";
break;
case 5:
this.statusName="财务驳回审核";
break;
case 6:
this.statusName="财务通过审核";
break;
default:
this.statusName="其他";
break;
}
}
}
......@@ -2,6 +2,8 @@ package com.liquidnet.service.kylin.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
......@@ -39,6 +41,10 @@ public class KylinOrderRefundBatches implements Serializable {
*/
private Integer status;
private Integer totalNum;
private BigDecimal totalAlipay;
private BigDecimal totalWepay;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
......
......@@ -22,7 +22,7 @@ public interface KylinOrderTicketsMapper extends BaseMapper<KylinOrderTickets> {
HashMap<String, Object> getPriceNum(String targetId);
// 查询微信、支付宝对应的订单金额、快递费金额
Double getTotalPrice(String targetId, String selectFields, String[] paymentType);
Double getTotalPrice(@Param("targetId") String targetId, @Param("selectFields") String selectFields, @Param("paymentType") String[] paymentType);
// 获取订单和购票信息
List<KylinOrderTickets> getOrderList(@Param("targetId") String targetId, @Param("mid") int mid, @Param("limitNum") int limitNum);
......
......@@ -38,19 +38,19 @@
</where>
LIMIT 1
</select>
<select id="getTotalPrice" resultType="java.lang.Double">
<select id="getTotalPrice" parameterType="java.lang.String" 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}
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}
'${payment_type}'
</foreach>
</where>
</select>
......
create
database if not exists ln_scene character set utf8mb4 collate utf8mb4_unicode_ci;
database if not exists ln_scene character set utf8mb4 collate utf8mb4_unicode_ci;
-- >>------------------------------------------------------------------------------------
use
ln_scene;
ln_scene;
SET NAMES utf8mb4;
-- 轮播图
......@@ -592,7 +592,11 @@ CREATE TABLE `express_batches`
KEY `express_batches_number_index` (`number`),
KEY `express_batches_order_code_index` (`order_code`),
KEY `express_batches_order_type_index` (`order_type`)
) ENGINE=InnoDB AUTO_INCREMENT=34781 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;
) ENGINE = InnoDB
AUTO_INCREMENT = 34781
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci
ROW_FORMAT = DYNAMIC;
drop TABLE if exists `express_logs`;
CREATE TABLE `express_logs`
(
......@@ -607,7 +611,11 @@ CREATE TABLE `express_logs`
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=487 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;
) ENGINE = InnoDB
AUTO_INCREMENT = 487
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci
ROW_FORMAT = DYNAMIC;
drop TABLE if exists `express_timelines`;
CREATE TABLE `express_timelines`
(
......@@ -619,7 +627,11 @@ CREATE TABLE `express_timelines`
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2039805 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='快递时间线表';
) ENGINE = InnoDB
AUTO_INCREMENT = 2039805
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci
ROW_FORMAT = DYNAMIC COMMENT ='快递时间线表';
drop TABLE if exists `expresses`;
CREATE TABLE `expresses`
(
......@@ -639,7 +651,11 @@ CREATE TABLE `expresses`
KEY `expresses_order_code_index` (`order_code`),
KEY `expresses_order_id_index` (`order_id`),
KEY `expresses_order_type_index` (`order_type`)
) ENGINE=InnoDB AUTO_INCREMENT=56762 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='快递表';
) ENGINE = InnoDB
AUTO_INCREMENT = 56762
DEFAULT CHARSET = utf8
COLLATE = utf8_unicode_ci
ROW_FORMAT = DYNAMIC COMMENT ='快递表';
insert into `kylin_buy_notice` (`buy_notice_id`, `img_url`, `message`, `status`, `sort`, `created_at`,
......@@ -706,10 +722,9 @@ CREATE TABLE `kylin_order_refund_batches`
`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',
`status` tinyint NOT NULL DEFAULT '1' COMMENT '批量退款状态 1申请退款 2取消退款 3运营驳回审核 4运营通过审核 5财务驳回审核 6财务通过审核',
`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 '快递费总金额微信',
`total_num` int NOT NULL DEFAULT '0' COMMENT '申请时退票总数',
`total_alipay` decimal(11, 2) NOT NULL DEFAULT '0.00' COMMENT '申请时支付宝需退款总金额 包含快递费',
`total_wepay` decimal(11, 2) NOT NULL DEFAULT '0.00' COMMENT '申请时微信需退款总金额 包含快递费',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
KEY `kylin_order_refund_batch_id_index` (`refund_batch_id`),
......@@ -746,7 +761,7 @@ CREATE TABLE `kylin_order_refunds`
`executor_name` varchar(100) NOT NULL DEFAULT '' COMMENT '执行人名称',
`executor_at` timestamp NULL DEFAULT NULL COMMENT '执行时间',
`refuse` varchar(200) NOT NULL DEFAULT '' COMMENT '回绝原因',
`refund_type` enum('ticket','express','all') NOT NULL DEFAULT 'ticket' COMMENT '票务/快递费/票和快递费',
`refund_type` enum ('ticket','express','all') NOT NULL DEFAULT 'ticket' COMMENT '票务/快递费/票和快递费',
`order_ticket_entities_ids` text COMMENT '订单入场人/搭售款式表 id 多个 ,分割',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
......@@ -755,4 +770,6 @@ CREATE TABLE `kylin_order_refunds`
KEY `kylin_order_refunds_order_tickets_id_index` (`order_tickets_id`),
KEY `kylin_order_refunds_refund_type_index` (`refund_type`),
KEY `kylin_order_refunds_order_refunds_id_index` (`order_refunds_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='订单退款表'
\ No newline at end of file
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT ='订单退款表'
\ No newline at end of file
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