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

Commit 61f8b718 authored by anjiabin's avatar anjiabin
parents 81f81c46 0ef1f56e
package com.liquidnet.service.adam.common;
import lombok.Data;
@Data
public class EmailEntity {
//发件人
private String fromPerson;
//收件人
private String toPerson;
// 收件人邮箱
private String targetMail;
//主题
private String subject;
//正文
private String content;
}
package com.liquidnet.service.adam.util;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.temporal.ChronoUnit;
import java.util.Date;
public class DateUtil {
/**
* 前端显示转换的时间戳
*
* @param now LocalDate
* LocalDateTime
*/
public static String getVoTimestamp(Object now) {
return getVoTimestamp(now, ZoneOffset.UTC);
}
public static String getVoTimestamp(Object now, ZoneOffset offset) {
if (now == null) {
return null;
}
if (offset == null) {
offset = ZoneOffset.UTC;
}
long l = 0;
if (now instanceof LocalDate) {
l = ((LocalDate) now).atStartOfDay(offset).toInstant().getEpochSecond();
} else if (now instanceof LocalDateTime) {
l = ((LocalDateTime) now).toEpochSecond(offset);
}
return String.valueOf(l);
}
/**
* 获取当天剩余秒数
*
* @param currentDate 当前时间
*/
public static Integer getRemainSecondsOneDay(Date currentDate) {
LocalDateTime midnight = LocalDateTime.ofInstant(currentDate.toInstant(),
ZoneId.systemDefault()).plusDays(1).withHour(0).withMinute(0)
.withSecond(0).withNano(0);
LocalDateTime currentDateTime = LocalDateTime.ofInstant(currentDate.toInstant(),
ZoneId.systemDefault());
long seconds = ChronoUnit.SECONDS.between(currentDateTime, midnight);
return (int) seconds;
}
}
package com.liquidnet.service.adam.util;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;
/**
* 枚举工具类
*
* @author LiChen
* @date 2020/9/17 2:47 下午
*/
public class PageUtil {
public static Page transferFromPageInfo(PageInfo pageInfo) {
Page page = new Page();
page.setRecords(pageInfo.getList());
page.setTotal(pageInfo.getTotal());
page.setSize(pageInfo.getPageSize());
page.setCurrent(pageInfo.getPageNum());
return page;
}
}
package com.liquidnet.service.kylin.dto.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* <p>
* 退款申请参数
* </p>
*
* @author jiangxiulong
* @since 2021-06-02 11:19 上午
*/
@Data
public class RefundApplyParam implements Serializable {
private String orderTicketsId;
private String orderRefundBatchesId;
private String reason;
private double RefundPriceExpress;
private List<String> ticketEntityIds;
private List<String> ids;
private Integer status;
private String reject;
private String refuse;
}
...@@ -2,27 +2,21 @@ package com.liquidnet.client.admin.web.controller.zhengzai.kylin; ...@@ -2,27 +2,21 @@ package com.liquidnet.client.admin.web.controller.zhengzai.kylin;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.liquidnet.client.admin.common.core.controller.BaseController; 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.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinOrderRefundsServiceImpl; import com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinOrderRefundsServiceImpl;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.constant.KylinTableStatusConst; import com.liquidnet.service.kylin.constant.KylinTableStatusConst;
import com.liquidnet.service.kylin.dao.OrderRefundDao; import com.liquidnet.service.kylin.dao.OrderRefundDao;
import com.liquidnet.service.kylin.dto.param.RefundApplyParam;
import com.liquidnet.service.kylin.dto.param.RefundCallbackParam; import com.liquidnet.service.kylin.dto.param.RefundCallbackParam;
import com.liquidnet.service.kylin.dto.param.RefundSearchParam; import com.liquidnet.service.kylin.dto.param.RefundSearchParam;
import com.liquidnet.service.kylin.dto.vo.KylinOrderRefundsVo; import com.liquidnet.service.kylin.dto.vo.KylinOrderRefundsVo;
import com.liquidnet.service.kylin.dto.vo.partner.KylinPerformanceMisVo;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/** /**
* <p> * <p>
* 后台单订单退款 服务实现类 * 后台单订单退款 服务实现类
...@@ -48,7 +42,6 @@ public class KylinOrderRefundAdminController extends BaseController { ...@@ -48,7 +42,6 @@ public class KylinOrderRefundAdminController extends BaseController {
} }
@GetMapping("callback") @GetMapping("callback")
@ApiOperation("退款回调")
public String refundCallback(@RequestBody RefundCallbackParam refundCallbackParam) { public String refundCallback(@RequestBody RefundCallbackParam refundCallbackParam) {
String result = kylinOrderRefundsServiceImpl.refundCallback(refundCallbackParam); String result = kylinOrderRefundsServiceImpl.refundCallback(refundCallbackParam);
return result; return result;
...@@ -71,149 +64,117 @@ public class KylinOrderRefundAdminController extends BaseController { ...@@ -71,149 +64,117 @@ public class KylinOrderRefundAdminController extends BaseController {
return getDataTable(result.getList()); return getDataTable(result.getList());
} }
@RequiresPermissions("kylin:refund:apply")
@PostMapping("apply") @PostMapping("apply")
@ApiOperation("申请退款") @ResponseBody
@ApiImplicitParams({ public AjaxResult refundApply(RefundApplyParam refundApplyParam) {
@ApiImplicitParam(type = "body", dataType = "String", name = "orderTicketsId", value = "订单id", required = true),
@ApiImplicitParam(type = "body", dataType = "String", name = "orderRefundBatchesId", value = "批量id"),
@ApiImplicitParam(type = "body", dataType = "String", name = "refundData", value = "退款数据"),
@ApiImplicitParam(type = "body", dataType = "String", name = "reason", value = "备注", required = true)
})
public ResponseDto<Object> refundApply(
@RequestBody String orderTicketsId,
@RequestBody String orderRefundBatchesId,
@RequestBody String refundData,
@RequestBody String reason
) {
try { try {
Boolean res = kylinOrderRefundsServiceImpl.refundApply(orderTicketsId, reason, orderRefundBatchesId, refundData); Boolean res = kylinOrderRefundsServiceImpl.refundApply(refundApplyParam);
if (res) { if (res) {
return ResponseDto.success(); return success();
} else { } else {
return ResponseDto.failure("申请退款失败"); return error("申请退款失败");
} }
} catch (Exception e) { } catch (Exception e) {
return ResponseDto.failure(e.getMessage()); return error(e.getMessage());
} }
} }
@RequiresPermissions("kylin:refund:cancel")
@PostMapping("cancel") @PostMapping("cancel")
@ApiOperation("取消退款") @ResponseBody
@ApiImplicitParams({ public AjaxResult refundCancel(RefundApplyParam refundApplyParam) {
@ApiImplicitParam(type = "body", dataType = "Lsit", name = "orderRefundsIdList", value = "退款id 支持批量", required = true)
})
public ResponseDto<Object> refundApply(
@RequestBody List orderRefundsIdList
) {
try { try {
Boolean res = kylinOrderRefundsServiceImpl.refundCancel(orderRefundsIdList); Boolean res = kylinOrderRefundsServiceImpl.refundCancel(refundApplyParam);
if (res) { if (res) {
return ResponseDto.success(); return success();
} else { } else {
return ResponseDto.failure("取消退款失败"); return error("取消退款失败");
} }
} catch (Exception e) { } catch (Exception e) {
return ResponseDto.failure(e.getMessage()); return error(e.getMessage());
} }
} }
@RequiresPermissions("kylin:refund:reapply")
@PostMapping("reapply") @PostMapping("reapply")
@ApiOperation("再次提交审核") @ResponseBody
@ApiImplicitParams({ public AjaxResult refundReapply(RefundApplyParam refundApplyParam) {
@ApiImplicitParam(type = "body", dataType = "Lsit", name = "orderRefundsIdList", value = "退款id 支持批量", required = true)
})
public ResponseDto<Object> refundReapply(
@RequestBody List orderRefundsIdList
) {
try { try {
Boolean res = kylinOrderRefundsServiceImpl.refundReapply(orderRefundsIdList); Boolean res = kylinOrderRefundsServiceImpl.refundReapply(refundApplyParam);
if (res) { if (res) {
return ResponseDto.success(); return success();
} else { } else {
return ResponseDto.failure("再次申请退款失败"); // 不是重新发起退款,而是重新发起退款审核
return error("再次发起退款审核失败");
} }
} catch (Exception e) { } catch (Exception e) {
return ResponseDto.failure(e.getMessage()); return error(e.getMessage());
} }
} }
// 一审
@RequiresPermissions("kylin:refund:review")
@PostMapping("review") @PostMapping("review")
@ApiOperation("一审运营 审核/驳回") @ResponseBody
@ApiImplicitParams({ public AjaxResult refundReview(RefundApplyParam refundApplyParam) {
@ApiImplicitParam(type = "body", dataType = "Lsit", name = "orderRefundsIdList", value = "退款id 支持批量", required = true),
@ApiImplicitParam(type = "body", dataType = "Integer", name = "status", value = "批量id", required = true),
@ApiImplicitParam(type = "body", dataType = "String", name = "reject", value = "备注", required = true)
})
public ResponseDto<Object> refundReview(
@RequestBody List orderRefundsIdList,
@RequestBody Integer status,
@RequestBody String reject
) {
try { try {
Boolean res = false; Boolean res = false;
Integer status = refundApplyParam.getStatus();
if (status == KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED) { // 通过 if (status == KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED) { // 通过
res = kylinOrderRefundsServiceImpl.refundApproved(orderRefundsIdList, reject); res = kylinOrderRefundsServiceImpl.refundApproved(refundApplyParam);
} }
if (status == KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT) { // 驳回 if (status == KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT) { // 驳回
res = kylinOrderRefundsServiceImpl.refundReject(orderRefundsIdList, reject); res = kylinOrderRefundsServiceImpl.refundReject(refundApplyParam);
} }
if (res) { if (res) {
return ResponseDto.success(); return success();
} else { } else {
return ResponseDto.failure("审核退款失败"); return error("审核退款失败");
} }
} catch (Exception e) { } catch (Exception e) {
return ResponseDto.failure(e.getMessage()); return error(e.getMessage());
} }
} }
// 二审
@RequiresPermissions("kylin:refund:execute")
@PostMapping("execute") @PostMapping("execute")
@ApiOperation("二审财务 审核(执行退款)/驳回") @ResponseBody
@ApiImplicitParams({ public AjaxResult refundExecute(RefundApplyParam refundApplyParam) {
@ApiImplicitParam(type = "body", dataType = "Lsit", name = "orderRefundsIdList", value = "退款id 支持批量", required = true),
@ApiImplicitParam(type = "body", dataType = "Integer", name = "status", value = "批量id", required = true),
@ApiImplicitParam(type = "body", dataType = "String", name = "refuse", value = "备注", required = true)
})
public ResponseDto<Object> refundExecute(
@RequestBody List orderRefundsIdList,
@RequestBody Integer status,
@RequestBody String refuse
) {
try { try {
Boolean res = false; Boolean res = false;
Integer status = refundApplyParam.getStatus();
if (status == KylinTableStatusConst.ORDER_REFUND_STATUS_UNFILLED) { // 通过 if (status == KylinTableStatusConst.ORDER_REFUND_STATUS_UNFILLED) { // 通过
res = kylinOrderRefundsServiceImpl.refundUnfilled(orderRefundsIdList, refuse); res = kylinOrderRefundsServiceImpl.refundUnfilled(refundApplyParam);
} }
if (status == KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE) { // 驳回 if (status == KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE) { // 驳回
res = kylinOrderRefundsServiceImpl.refundRefuse(orderRefundsIdList, refuse); res = kylinOrderRefundsServiceImpl.refundRefuse(refundApplyParam);
} }
if (res) { if (res) {
return ResponseDto.success(); return success();
} else { } else {
return ResponseDto.failure("审核退款失败"); return error("审核退款失败");
} }
} catch (Exception e) { } catch (Exception e) {
return ResponseDto.failure(e.getMessage()); return error(e.getMessage());
} }
} }
// @PostMapping("refundCompleted") // 主动完成退款
// @ApiOperation("主动关闭订单,完成退款") @RequiresPermissions("kylin:refund:completed")
@ApiImplicitParams({ @PostMapping("completed")
@ApiImplicitParam(type = "body", dataType = "Integer", name = "orderRefundsId", value = "退款id", required = true) @ResponseBody
}) public AjaxResult refundCompleted(RefundApplyParam refundApplyParam) {
public ResponseDto<Object> refundCompleted(
@RequestBody Integer orderRefundsId
) {
try { try {
Boolean res = kylinOrderRefundsServiceImpl.refundCompleted(orderRefundsId); Boolean res = kylinOrderRefundsServiceImpl.refundCompleted(refundApplyParam);
if (res) { if (res) {
return ResponseDto.success(); return success();
} else { } else {
return ResponseDto.failure("关闭订单失败"); return error("关闭订单失败");
} }
} catch (Exception e) { } catch (Exception e) {
return ResponseDto.failure(e.getMessage()); return error(e.getMessage());
} }
} }
......
...@@ -1008,11 +1008,13 @@ var table = { ...@@ -1008,11 +1008,13 @@ var table = {
return url; return url;
}, },
// 删除信息 // 删除信息
remove: function(id, message) { remove: function(id, message, url) {
table.set(); table.set();
message = message ?? "确定删除该条" + table.options.modalName + "信息吗?"; message = message ?? "确定删除该条" + table.options.modalName + "信息吗?";
$.modal.confirm(message, function() { $.modal.confirm(message, function() {
var url = $.common.isEmpty(id) ? table.options.removeUrl : table.options.removeUrl.replace("{id}", id); if (!url) {
url = $.common.isEmpty(id) ? table.options.urls : table.options.urls.replace("{id}", id);
}
if(table.options.type == table_type.bootstrapTreeTable) { if(table.options.type == table_type.bootstrapTreeTable) {
$.operate.get(url); $.operate.get(url);
} else { } else {
...@@ -1022,7 +1024,7 @@ var table = { ...@@ -1022,7 +1024,7 @@ var table = {
}); });
}, },
// 批量删除信息 // 批量删除信息
removeAll: function(message) { removeAll: function(message, url) {
table.set(); table.set();
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
message = message ?? "确认要删除选中的" + rows.length + "条数据吗?"; message = message ?? "确认要删除选中的" + rows.length + "条数据吗?";
...@@ -1031,7 +1033,9 @@ var table = { ...@@ -1031,7 +1033,9 @@ var table = {
return; return;
} }
$.modal.confirm(message, function() { $.modal.confirm(message, function() {
var url = table.options.removeUrl; if (!url) {
url = table.options.removeUrl;
}
var data = { "ids": rows.join() }; var data = { "ids": rows.join() };
$.operate.submit(url, "post", "json", data); $.operate.submit(url, "post", "json", data);
}); });
......
...@@ -7,17 +7,12 @@ ...@@ -7,17 +7,12 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m-t" id="signupForm"> <form class="form-horizontal m-t" id="signupForm">
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">tetete</label> <label class="col-sm-2 control-label">退款单id</label>
<div class="form-control-static" th:text="${KylinOrderRefundsVo.orderRefundsId}"> <div class="form-control-static" th:text="${KylinOrderRefundsVo.orderRefundsId}">
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<script th:inline="javascript">
$(function() {
});
</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -42,39 +42,78 @@ ...@@ -42,39 +42,78 @@
</div> </div>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="kylin:performances:add"> <a class="btn btn-success multiple disabled" onclick="review()" shiro:hasPermission="kylin:refund:review">
<i class="fa fa-plus"></i> 批量一审 批量一审
</a> </a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="kylin:performances:edit"> <a class="btn btn-primary multiple disabled" onclick="execute()" shiro:hasPermission="kylin:refund:execute">
<i class="fa fa-edit"></i> 批量二审 批量二审
</a> </a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="kylin:performances:remove"> <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll('确定取消选中的退款申请吗?', '/cancel')" shiro:hasPermission="kylin:refund:cancel">
<i class="fa fa-remove"></i> 批量取消 批量取消
</a> </a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="kylin:performances:export"> <a class="btn btn-warning multiple disabled" onclick="$.operate.removeAll('确定重新提交选中的退款审核吗?', '/reapply')" shiro:hasPermission="kylin:refund:reapply">
<i class="fa fa-download"></i> 批量重新提交 批量重新提交
</a> </a>
</div> </div>
<div class="col-sm-12 select-table table-bordered"> <div class="col-sm-12 select-table table-bordered">
<table id="bootstrap-table"></table> <table id="bootstrap-table"></table>
</div> </div>
<form id="appTest">
<div class="select-list">
<ul>
<li>
<input type="text" name="orderTicketsId" th:value="71619365224734720"/>
<input type="text" name="orderRefundBatchesId" th:value="222"/>
<input type="text" name="RefundPriceExpress" th:value="0"/>
<input type="text" name="reason" th:value="备注"/>
</li>
<li>
<div class="form-group">
<div class="col-sm-8">
<label class="check-box">
<input checked name="ticketEntityIds" type="checkbox" value="69485706304757740">展开/折叠
</label>
<label class="check-box">
<input checked name="ticketEntityIds" type="checkbox" value="69485706304757739">全选/全不选
</label>
</div>
</div>
</li>
</ul>
</div>
</form>
</div> </div>
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<script th:inline="javascript"> <script th:inline="javascript">
var detailFlag = [[${@permission.hasPermi('kylin:performances:detail')}]]; var detailFlag = [[${@permission.hasPermi('kylin:refund:detail')}]];
var reviewFlag = [[${@permission.hasPermi('kylin:refund:review')}]];
var executeFlag = [[${@permission.hasPermi('kylin:refund:execute')}]];
var cancelFlag = [[${@permission.hasPermi('kylin:refund:cancel')}]];
var reapplyFlag = [[${@permission.hasPermi('kylin:refund:reapply')}]];
var detailFlag = [[${@permission.hasPermi('kylin:performances:detail')}]];
var detailFlag = [[${@permission.hasPermi('kylin:performances:detail')}]];
var detailFlag = [[${@permission.hasPermi('kylin:performances:detail')}]];
var detailFlag = [[${@permission.hasPermi('kylin:performances:detail')}]];
var prefix = ctx + "kylin/refund"; var prefix = ctx + "kylin/refund";
function apply() {
var data = $('#appTest').serializeArray();
$.operate.save(prefix + "/apply", data);
}
function review() {
alert(1)
}
function execute() {
alert(2)
}
$(function() { $(function() {
var options = { var options = {
url: prefix + "/list", url: prefix + "/list",
detailUrl: prefix + "/details/{id}", detailUrl: prefix + "/details/{id}",
modalName: "退款详情", cancelUrl: prefix + "/cancel",
reapplyUrl: prefix + "/reapply",
columns: [{ columns: [{
checkbox: true checkbox: true
}, },
...@@ -103,17 +142,22 @@ ...@@ -103,17 +142,22 @@
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.orderRefundsId + '\')"><i class="fa fa-edit"></i>查看</a> '); actions.push('<a class="btn btn-info btn-xs' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.orderRefundsId + '\')"></i>查看</a> ');
actions.push('<a class="btn btn-success btn-xs ' + reviewFlag + '" href="javascript:void(0)" onclick="review(\'' + row.orderRefundsId + '\')"></i>一审</a> ');
actions.push('<a class="btn btn-primary btn-xs ' + executeFlag + '" href="javascript:void(0)" onclick="execute(\'' + row.orderRefundsId + '\')"></i>二审</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderRefundsId + '\', \'确定取消退款申请吗?\', table.options.cancelUrl)"></i>取消</a> ');
actions.push('<a class="btn btn-warning btn-xs ' + reapplyFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderRefundsId + '\', \'确定重新提交退款审核吗?\', table.options.reapplyUrl)"></i>重新提交</a> ');
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="apply()"></i>提交申请</a> ');
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.orderRefundsId + '\')"><i class="fa fa-edit"></i>一审</a> ');
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.orderRefundsId + '\')"><i class="fa fa-edit"></i>二审</a> ');
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.orderRefundsId + '\')"><i class="fa fa-edit"></i>取消</a> ');
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.orderRefundsId + '\')"><i class="fa fa-edit"></i>重新提交</a> ');
return actions.join(''); return actions.join('');
} }
}] }]
}; };
$.table.init(options); $.table.init(options);
}); });
</script> </script>
</body> </body>
......
...@@ -5,20 +5,29 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; ...@@ -5,20 +5,29 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.liquidnet.client.admin.common.utils.ShiroUtils;
import com.liquidnet.client.admin.zhengzai.kylin.utils.DataUtils;
import com.liquidnet.commons.lang.util.BeanUtil; import com.liquidnet.commons.lang.util.BeanUtil;
import com.liquidnet.service.kylin.constant.KylinTableStatusConst; import com.liquidnet.service.kylin.constant.KylinTableStatusConst;
import com.liquidnet.service.kylin.dao.OrderRefundDao; import com.liquidnet.service.kylin.dao.OrderRefundDao;
import com.liquidnet.service.kylin.dto.param.RefundApplyParam;
import com.liquidnet.service.kylin.dto.param.RefundCallbackParam; import com.liquidnet.service.kylin.dto.param.RefundCallbackParam;
import com.liquidnet.service.kylin.dto.param.RefundSearchParam; import com.liquidnet.service.kylin.dto.param.RefundSearchParam;
import com.liquidnet.service.kylin.dto.vo.KylinOrderRefundsVo; import com.liquidnet.service.kylin.dto.vo.KylinOrderRefundsVo;
import com.liquidnet.service.kylin.entity.KylinOrderRefunds; import com.liquidnet.service.kylin.entity.KylinOrderRefunds;
import com.liquidnet.service.kylin.entity.KylinOrderTicketEntities;
import com.liquidnet.service.kylin.entity.KylinOrderTicketStatus;
import com.liquidnet.service.kylin.entity.KylinOrderTickets; import com.liquidnet.service.kylin.entity.KylinOrderTickets;
import com.liquidnet.service.kylin.mapper.KylinOrderRefundsMapper; import com.liquidnet.service.kylin.mapper.KylinOrderRefundsMapper;
import com.liquidnet.service.kylin.mapper.KylinOrderTicketEntitiesMapper;
import com.liquidnet.service.kylin.mapper.KylinOrderTicketStatusMapper;
import com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper; import com.liquidnet.service.kylin.mapper.KylinOrderTicketsMapper;
import com.liquidnet.service.kylin.service.IKylinOrderRefundsService; import com.liquidnet.service.kylin.service.IKylinOrderRefundsService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpException;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
...@@ -43,16 +52,93 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -43,16 +52,93 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
@Autowired @Autowired
private KylinOrderRefundsMapper kylinOrderRefundsMapper; private KylinOrderRefundsMapper kylinOrderRefundsMapper;
public Boolean refundApply(String orderTicketsId, String reason, String orderRefundBatchesId, String refundData) throws Exception { @Autowired
int count = 0; private KylinOrderTicketStatusMapper kylinOrderTicketStatusMapper;
@Autowired
private KylinOrderTicketEntitiesMapper kylinOrderTicketEntitiesMapper;
@Autowired
MongoTemplate mongoTemplate;
@Autowired
private DataUtils dataUtils;
public Boolean refundApply(RefundApplyParam refundApplyParam) throws Exception {
/*int count = 0;
count = kylinOrderTicketsMapper.selectCount( count = kylinOrderTicketsMapper.selectCount(
new UpdateWrapper<KylinOrderTickets>().eq("order_tickets_id", orderTicketsId).eq("coupon_type2", "full") new UpdateWrapper<KylinOrderTickets>().eq("order_tickets_id", refundApplyParam.getOrderTicketsId()).eq("coupon_type", "no")
); );
if (count > 0) { if (count > 0) {
throw new Exception("使用满减券 暂不能退款"); throw new Exception("使用满减券 暂不能退款");
}*/
String orderTicketsId = refundApplyParam.getOrderTicketsId();
List<String> ticketEntityIds = refundApplyParam.getTicketEntityIds();
double RefundPriceExpress = refundApplyParam.getRefundPriceExpress();
KylinOrderTickets orderInfo = kylinOrderTicketsMapper.selectOne(
new QueryWrapper<KylinOrderTickets>().eq("order_tickets_id", orderTicketsId)
);
KylinOrderTicketStatus orderStatus = kylinOrderTicketStatusMapper.selectOne(
new QueryWrapper<KylinOrderTicketStatus>().eq("order_id", orderTicketsId)
);
int thisOrderStatus = orderStatus.getStatus();
int thisPayStatus = orderStatus.getPayStatus();
double priceExpress = orderInfo.getPriceExpress().doubleValue();
// todo 转增是否能退
// 订单状态需已付款
if (thisOrderStatus != KylinTableStatusConst.ORDER_STATUS1) {
throw new HttpException("订单状态信息有误");
}
// 订单支付状态需为已支付
if (thisPayStatus != KylinTableStatusConst.ORDER_PAY_STATUS1) {
throw new HttpException("订单支付信息有误");
}
// 传的快递费不能大于实际的快递费
if (RefundPriceExpress > priceExpress) {
throw new HttpException("快递费不能大于实际的快递费");
}
// 该订单正在退款或已有退款
QueryWrapper<KylinOrderRefunds> refundingCountQuery = new QueryWrapper<KylinOrderRefunds>()
.eq("order_tickets_id", orderTicketsId)
.ne("status", KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL);
for (String v : ticketEntityIds) {
refundingCountQuery.like("order_ticket_entities_ids", v);
} }
int refundingCount = kylinOrderRefundsMapper.selectCount(refundingCountQuery);
if (refundingCount > 0) {
throw new HttpException("该订单正在退款或已有退款");
}
// 该订单的入场人未付款/正在退款/已退款
// TODO: 2021/5/27 出票未出票不知是否要处理
/*QueryWrapper<KylinOrderTicketEntities> notPayCountQuery = new QueryWrapper<KylinOrderTicketEntities>()
.in("order_ticket_entities_id", ticketEntityIds)
.in("is_payment", new Integer[]{
KylinTableStatusConst.ENTITIES_IS_PAYMENT0,
KylinTableStatusConst.ENTITIES_IS_PAYMENT2,
KylinTableStatusConst.ENTITIES_IS_PAYMENT3});
int notPayCount = kylinOrderTicketEntitiesMapper.selectCount(notPayCountQuery);*/
boolean res = kylinRefundsStatusServiceImpl.orderTicketRefunding(orderTicketsId, refundData, reason, orderRefundBatchesId); // 选择退款的入场人是否正确
// TODO: 2021/5/27 出票未出票不知是否要处理
QueryWrapper<KylinOrderTicketEntities> choiceCountQuery = new QueryWrapper<KylinOrderTicketEntities>()
.eq("order_id", orderTicketsId)
.eq("is_payment", KylinTableStatusConst.ENTITIES_IS_PAYMENT1)
.in("order_ticket_entities_id", ticketEntityIds);
int choiceCount = kylinOrderTicketEntitiesMapper.selectCount(choiceCountQuery);
int ticketEntityCount = ticketEntityIds.size();
if (choiceCount < 0 || choiceCount != ticketEntityCount) {
throw new HttpException("入场人订单有误或不存在");
}
boolean res = kylinRefundsStatusServiceImpl.orderTicketRefunding(
refundApplyParam, orderInfo, orderTicketsId,
RefundPriceExpress, priceExpress,
ticketEntityCount, ticketEntityIds
);
if (res) { if (res) {
return true; return true;
} else { } else {
...@@ -60,7 +146,8 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -60,7 +146,8 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
} }
} }
public Boolean refundCancel(List orderRefundsIdList) throws Exception { public Boolean refundCancel(RefundApplyParam refundApplyParam) throws Exception {
List<String> orderRefundsIdList = refundApplyParam.getIds();
Integer[] orderRefundStatus = {KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY, KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE}; Integer[] orderRefundStatus = {KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY, KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE};
List<KylinOrderRefunds> refundList = kylinOrderRefundsMapper.selectList( List<KylinOrderRefunds> refundList = kylinOrderRefundsMapper.selectList(
new QueryWrapper<KylinOrderRefunds>() new QueryWrapper<KylinOrderRefunds>()
...@@ -80,7 +167,8 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -80,7 +167,8 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
} }
} }
public Boolean refundReapply(List orderRefundsIdList) throws Exception { public Boolean refundReapply(RefundApplyParam refundApplyParam) throws Exception {
List<String> orderRefundsIdList = refundApplyParam.getIds();
Integer[] orderRefundStatus = {KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE}; Integer[] orderRefundStatus = {KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE};
List<KylinOrderRefunds> refundList = kylinOrderRefundsMapper.selectList( List<KylinOrderRefunds> refundList = kylinOrderRefundsMapper.selectList(
new QueryWrapper<KylinOrderRefunds>() new QueryWrapper<KylinOrderRefunds>()
...@@ -89,7 +177,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -89,7 +177,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
.in("status", orderRefundStatus) .in("status", orderRefundStatus)
); );
if (orderRefundsIdList.size() != refundList.size()) { if (orderRefundsIdList.size() != refundList.size()) {
throw new Exception("订单需已驳回、已回绝"); throw new Exception("订单需一审驳回或二审驳回");
} }
boolean res = kylinRefundsStatusServiceImpl.orderTicketRefundReapply(refundList); boolean res = kylinRefundsStatusServiceImpl.orderTicketRefundReapply(refundList);
...@@ -100,7 +188,9 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -100,7 +188,9 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
} }
} }
public Boolean refundApproved(List orderRefundsIdList, String reject) throws Exception { public Boolean refundApproved(RefundApplyParam refundApplyParam) throws Exception {
List<String> orderRefundsIdList = refundApplyParam.getIds();
String reject = refundApplyParam.getReject();
Integer[] orderRefundStatus = {KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY, KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE}; Integer[] orderRefundStatus = {KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY, KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE};
List<KylinOrderRefunds> refundList = kylinOrderRefundsMapper.selectList( List<KylinOrderRefunds> refundList = kylinOrderRefundsMapper.selectList(
new QueryWrapper<KylinOrderRefunds>() new QueryWrapper<KylinOrderRefunds>()
...@@ -120,7 +210,9 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -120,7 +210,9 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
} }
} }
public Boolean refundReject(List orderRefundsIdList, String reject) throws Exception { public Boolean refundReject(RefundApplyParam refundApplyParam) throws Exception {
List<String> orderRefundsIdList = refundApplyParam.getIds();
String reject = refundApplyParam.getReject();
Integer[] orderRefundStatus = {KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY, KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE}; Integer[] orderRefundStatus = {KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY, KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED, KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE};
List<KylinOrderRefunds> refundList = kylinOrderRefundsMapper.selectList( List<KylinOrderRefunds> refundList = kylinOrderRefundsMapper.selectList(
new QueryWrapper<KylinOrderRefunds>() new QueryWrapper<KylinOrderRefunds>()
...@@ -140,7 +232,9 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -140,7 +232,9 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
} }
} }
public Boolean refundUnfilled(List orderRefundsIdList, String refuse) throws Exception { public Boolean refundUnfilled(RefundApplyParam refundApplyParam) throws Exception {
List<String> orderRefundsIdList = refundApplyParam.getIds();
String refuse = refundApplyParam.getRefuse();
Integer[] orderRefundStatus = {KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED, KylinTableStatusConst.ORDER_REFUND_STATUS_ERROR}; Integer[] orderRefundStatus = {KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED, KylinTableStatusConst.ORDER_REFUND_STATUS_ERROR};
List<KylinOrderRefunds> refundList = kylinOrderRefundsMapper.selectList( List<KylinOrderRefunds> refundList = kylinOrderRefundsMapper.selectList(
new QueryWrapper<KylinOrderRefunds>() new QueryWrapper<KylinOrderRefunds>()
...@@ -160,7 +254,9 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -160,7 +254,9 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
} }
} }
public Boolean refundRefuse(List orderRefundsIdList, String refuse) throws Exception { public Boolean refundRefuse(RefundApplyParam refundApplyParam) throws Exception {
List<String> orderRefundsIdList = refundApplyParam.getIds();
String refuse = refundApplyParam.getRefuse();
Integer[] orderRefundStatus = {KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED, KylinTableStatusConst.ORDER_REFUND_STATUS_ERROR}; Integer[] orderRefundStatus = {KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED, KylinTableStatusConst.ORDER_REFUND_STATUS_ERROR};
List<KylinOrderRefunds> refundList = kylinOrderRefundsMapper.selectList( List<KylinOrderRefunds> refundList = kylinOrderRefundsMapper.selectList(
new QueryWrapper<KylinOrderRefunds>() new QueryWrapper<KylinOrderRefunds>()
...@@ -180,7 +276,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM ...@@ -180,7 +276,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
} }
} }
public Boolean refundCompleted(Integer orderRefundsId) { public Boolean refundCompleted(RefundApplyParam refundApplyParam) {
return false; return false;
} }
......
...@@ -4,12 +4,14 @@ import com.alibaba.fastjson.JSON; ...@@ -4,12 +4,14 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.liquidnet.client.admin.common.utils.ShiroUtils;
import com.liquidnet.client.admin.common.utils.StringUtils; import com.liquidnet.client.admin.common.utils.StringUtils;
import com.liquidnet.client.admin.zhengzai.kylin.utils.DataUtils; import com.liquidnet.client.admin.zhengzai.kylin.utils.DataUtils;
import com.liquidnet.commons.lang.util.HttpUtil; import com.liquidnet.commons.lang.util.HttpUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.kylin.constant.KylinTableStatusConst; import com.liquidnet.service.kylin.constant.KylinTableStatusConst;
import com.liquidnet.service.kylin.dto.param.RefundApplyParam;
import com.liquidnet.service.kylin.dto.param.RefundCallbackParam; import com.liquidnet.service.kylin.dto.param.RefundCallbackParam;
import com.liquidnet.service.kylin.dto.vo.KylinOrderTicketEntitiesVo; import com.liquidnet.service.kylin.dto.vo.KylinOrderTicketEntitiesVo;
import com.liquidnet.service.kylin.dto.vo.KylinOrderTicketVo; import com.liquidnet.service.kylin.dto.vo.KylinOrderTicketVo;
...@@ -69,73 +71,17 @@ public class KylinRefundsStatusServiceImpl { ...@@ -69,73 +71,17 @@ public class KylinRefundsStatusServiceImpl {
@Autowired @Autowired
private DataUtils dataUtils; private DataUtils dataUtils;
public Boolean orderTicketRefunding(String orderTicketsId, String refundData, String reason, String orderRefundBatchesId) throws HttpException { public Boolean orderTicketRefunding(
RefundApplyParam refundApplyParam, KylinOrderTickets orderInfo, String orderTicketsId,
double RefundPriceExpress, double priceExpress,
int ticketEntityCount, List<String> ticketEntityIds
) throws HttpException {
// 处理数据 // 处理数据
String authId = "434"; String authId = ShiroUtils.getUserId().toString();
String authName = "sss"; String authName = ShiroUtils.getLoginName();
JsonNode refundDataJson = JsonUtils.fromJson(refundData, JsonNode.class); String reason = refundApplyParam.getReason();
JsonNode ticketEntityIds = refundDataJson.get("ticketEntityIds"); String orderRefundBatchesId = refundApplyParam.getOrderRefundBatchesId();
double RefundpriceExpress = refundDataJson.get("RefundpriceExpress").doubleValue();
KylinOrderTickets orderInfo = kylinOrderTicketsMapper.selectOne(
new UpdateWrapper<KylinOrderTickets>().eq("order_tickets_id", orderTicketsId)
);
KylinOrderTicketStatus orderStatus = kylinOrderTicketStatusMapper.selectOne(
new UpdateWrapper<KylinOrderTicketStatus>().eq("order_id", orderTicketsId)
);
int thisOrderStatus = orderStatus.getStatus();
int thisPayStatus = orderStatus.getPayStatus();
double priceExpress = orderInfo.getPriceExpress().doubleValue();
double priceActual = orderInfo.getPriceActual().doubleValue(); double priceActual = orderInfo.getPriceActual().doubleValue();
// todo 转增是否能退
// 订单状态需已付款
if (thisOrderStatus != KylinTableStatusConst.ORDER_STATUS1) {
throw new HttpException("订单状态信息有误");
}
// 订单支付状态需为已支付
if (thisPayStatus != KylinTableStatusConst.ORDER_PAY_STATUS1) {
throw new HttpException("订单支付信息有误");
}
// 传的快递费不能大于实际的快递费
if (RefundpriceExpress > priceExpress) {
throw new HttpException("快递费不能大于实际的快递费");
}
// 该订单正在退款或已有退款
QueryWrapper<KylinOrderRefunds> refundingCountQuery = new QueryWrapper<KylinOrderRefunds>()
.eq("order_tickets_id", orderTicketsId)
.ne("status", KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL);
for (JsonNode v : ticketEntityIds) {
refundingCountQuery.like("order_ticket_entities_ids", v);
}
int refundingCount = kylinOrderRefundsMapper.selectCount(refundingCountQuery);
if (refundingCount > 0) {
throw new HttpException("该订单正在退款或已有退款");
}
// 该订单的入场人未付款/正在退款/已退款
// TODO: 2021/5/27 出票未出票不知是否要处理
QueryWrapper<KylinOrderTicketEntities> notPayCountQuery = new QueryWrapper<KylinOrderTicketEntities>()
.in("order_ticket_entities_id", ticketEntityIds)
.in("is_payment", new Integer[]{
KylinTableStatusConst.ENTITIES_IS_PAYMENT0,
KylinTableStatusConst.ENTITIES_IS_PAYMENT2,
KylinTableStatusConst.ENTITIES_IS_PAYMENT3});
int notPayCount = kylinOrderTicketEntitiesMapper.selectCount(notPayCountQuery);
// 选择退款的入场人是否正确
// TODO: 2021/5/27 出票未出票不知是否要处理
QueryWrapper<KylinOrderTicketEntities> choiceCountQuery = new QueryWrapper<KylinOrderTicketEntities>()
.eq("order_id", orderTicketsId)
.eq("is_payment", KylinTableStatusConst.ENTITIES_IS_PAYMENT1)
.in("order_ticket_entities_id", ticketEntityIds);
int choiceCount = kylinOrderTicketEntitiesMapper.selectCount(choiceCountQuery);
int ticketEntityCount = ticketEntityIds.size();
if (choiceCount < 0 || choiceCount != ticketEntityCount) {
throw new HttpException("入场人订单有误或不存在");
}
// 本次退款总金额 // 本次退款总金额
// 总入场人数量 排出未付款的 用来计算单入场人的价格 // 总入场人数量 排出未付款的 用来计算单入场人的价格
int allEntitiesCount = kylinOrderTicketEntitiesMapper.selectCount( int allEntitiesCount = kylinOrderTicketEntitiesMapper.selectCount(
...@@ -143,7 +89,7 @@ public class KylinRefundsStatusServiceImpl { ...@@ -143,7 +89,7 @@ public class KylinRefundsStatusServiceImpl {
.eq("order_id", orderTicketsId) .eq("order_id", orderTicketsId)
.ne("is_payment", KylinTableStatusConst.ENTITIES_IS_PAYMENT0) .ne("is_payment", KylinTableStatusConst.ENTITIES_IS_PAYMENT0)
); );
double refundTotalPrice = RefundpriceExpress + ((priceActual - priceExpress) / allEntitiesCount * ticketEntityCount); double refundTotalPrice = RefundPriceExpress + ((priceActual - priceExpress) / allEntitiesCount * ticketEntityCount);
// 更新数据 // 更新数据
// 订单状态表 // 订单状态表
...@@ -151,7 +97,7 @@ public class KylinRefundsStatusServiceImpl { ...@@ -151,7 +97,7 @@ public class KylinRefundsStatusServiceImpl {
// TODO: 2021/5/27 事物 and 部分退款 // TODO: 2021/5/27 事物 and 部分退款
orderStatusTable.setStatus(KylinTableStatusConst.ORDER_STATUS3); orderStatusTable.setStatus(KylinTableStatusConst.ORDER_STATUS3);
kylinOrderTicketStatusMapper.update(orderStatusTable, new UpdateWrapper<KylinOrderTicketStatus>() kylinOrderTicketStatusMapper.update(orderStatusTable, new UpdateWrapper<KylinOrderTicketStatus>()
.eq("order_ticket_status_id", orderTicketsId)); .eq("order_id", orderTicketsId));
KylinOrderTicketVo kylinOrderTicketVo = new KylinOrderTicketVo(); KylinOrderTicketVo kylinOrderTicketVo = new KylinOrderTicketVo();
kylinOrderTicketVo.setStatus(KylinTableStatusConst.ORDER_STATUS3); kylinOrderTicketVo.setStatus(KylinTableStatusConst.ORDER_STATUS3);
...@@ -165,7 +111,7 @@ public class KylinRefundsStatusServiceImpl { ...@@ -165,7 +111,7 @@ public class KylinRefundsStatusServiceImpl {
// 入场人 // 入场人
for (JsonNode v : ticketEntityIds) { for (String v : ticketEntityIds) {
KylinOrderTicketEntities entitiesTable = new KylinOrderTicketEntities(); KylinOrderTicketEntities entitiesTable = new KylinOrderTicketEntities();
// TODO: 2021/5/27 事物 and 部分退款 // TODO: 2021/5/27 事物 and 部分退款
entitiesTable.setIsPayment(KylinTableStatusConst.ENTITIES_IS_PAYMENT2); entitiesTable.setIsPayment(KylinTableStatusConst.ENTITIES_IS_PAYMENT2);
...@@ -181,7 +127,7 @@ public class KylinRefundsStatusServiceImpl { ...@@ -181,7 +127,7 @@ public class KylinRefundsStatusServiceImpl {
new FindOneAndUpdateOptions().returnDocument(ReturnDocument.AFTER) new FindOneAndUpdateOptions().returnDocument(ReturnDocument.AFTER)
); );
dataUtils.delOrderTicketEntitiesRedis(v.toString()); dataUtils.delOrderTicketEntitiesRedis(v);
} }
// 退款明细 // 退款明细
...@@ -198,7 +144,7 @@ public class KylinRefundsStatusServiceImpl { ...@@ -198,7 +144,7 @@ public class KylinRefundsStatusServiceImpl {
String orderRefundCode = orderInfo.getOrderCode(); String orderRefundCode = orderInfo.getOrderCode();
String codeNum = StringUtils.leftPad(String.valueOf(refundCount), 3, "0"); String codeNum = StringUtils.leftPad(String.valueOf(refundCount), 3, "0");
kylinOrderRefunds.setOrderRefundCode(orderRefundCode + codeNum); kylinOrderRefunds.setOrderRefundCode(orderRefundCode.concat(codeNum));
kylinOrderRefunds.setPrice(BigDecimal.valueOf(refundTotalPrice)); kylinOrderRefunds.setPrice(BigDecimal.valueOf(refundTotalPrice));
kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY); kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY);
kylinOrderRefunds.setType(0); kylinOrderRefunds.setType(0);
...@@ -207,23 +153,24 @@ public class KylinRefundsStatusServiceImpl { ...@@ -207,23 +153,24 @@ public class KylinRefundsStatusServiceImpl {
kylinOrderRefunds.setApplicantAt(LocalDateTime.now()); kylinOrderRefunds.setApplicantAt(LocalDateTime.now());
kylinOrderRefunds.setReason(reason); kylinOrderRefunds.setReason(reason);
// TODO: 2021/5/27 判断tyoe // TODO: 2021/5/27 判断tyoe
if (RefundpriceExpress > 0) { if (RefundPriceExpress > 0) {
kylinOrderRefunds.setRefundType("all"); kylinOrderRefunds.setRefundType("all");
} else { } else {
kylinOrderRefunds.setRefundType("ticket"); kylinOrderRefunds.setRefundType("ticket");
} }
kylinOrderRefunds.setOrderTicketEntitiesIds(ticketEntityIds.toString()); kylinOrderRefunds.setOrderTicketEntitiesIds(StringUtils.join(ticketEntityIds, ','));
kylinOrderRefunds.setCreatedAt(LocalDateTime.now()); kylinOrderRefunds.setCreatedAt(LocalDateTime.now());
int rows = kylinOrderRefundsMapper.insert(kylinOrderRefunds);
return true; return true;
} }
public boolean orderTicketRefundCancel(List<KylinOrderRefunds> refundList) { public boolean orderTicketRefundCancel(List<KylinOrderRefunds> refundList) {
for (KylinOrderRefunds v : refundList) { for (KylinOrderRefunds refundInfo : refundList) {
String orderTicketEntitiesIds = v.getOrderTicketEntitiesIds(); String orderTicketEntitiesIds = refundInfo.getOrderTicketEntitiesIds();
String[] orderTicketEntitiesIdsArr = orderTicketEntitiesIds.split(","); String[] orderTicketEntitiesIdsArr = orderTicketEntitiesIds.split(",");
String orderTicketsId = v.getOrderTicketsId(); String orderTicketsId = refundInfo.getOrderTicketsId();
String orderRefundsId = v.getOrderRefundsId(); String orderRefundsId = refundInfo.getOrderRefundsId();
// 更新数据 // 更新数据
// 订单状态表 // 订单状态表
...@@ -231,7 +178,7 @@ public class KylinRefundsStatusServiceImpl { ...@@ -231,7 +178,7 @@ public class KylinRefundsStatusServiceImpl {
// TODO: 2021/5/27 事物 and 部分退款 // TODO: 2021/5/27 事物 and 部分退款
orderStatusTable.setStatus(KylinTableStatusConst.ORDER_STATUS1); orderStatusTable.setStatus(KylinTableStatusConst.ORDER_STATUS1);
kylinOrderTicketStatusMapper.update(orderStatusTable, new UpdateWrapper<KylinOrderTicketStatus>() kylinOrderTicketStatusMapper.update(orderStatusTable, new UpdateWrapper<KylinOrderTicketStatus>()
.eq("order_ticket_status_id", orderTicketsId)); .eq("order_id", orderTicketsId));
KylinOrderTicketVo kylinOrderTicketVo = new KylinOrderTicketVo(); KylinOrderTicketVo kylinOrderTicketVo = new KylinOrderTicketVo();
kylinOrderTicketVo.setStatus(KylinTableStatusConst.ORDER_STATUS1); kylinOrderTicketVo.setStatus(KylinTableStatusConst.ORDER_STATUS1);
...@@ -247,7 +194,6 @@ public class KylinRefundsStatusServiceImpl { ...@@ -247,7 +194,6 @@ public class KylinRefundsStatusServiceImpl {
// 入场人 // 入场人
for (String entitiesId : orderTicketEntitiesIdsArr) { for (String entitiesId : orderTicketEntitiesIdsArr) {
KylinOrderTicketEntities entitiesTable = new KylinOrderTicketEntities(); KylinOrderTicketEntities entitiesTable = new KylinOrderTicketEntities();
// TODO: 2021/5/27 事物 and 部分退款
entitiesTable.setIsPayment(KylinTableStatusConst.ENTITIES_IS_PAYMENT1); entitiesTable.setIsPayment(KylinTableStatusConst.ENTITIES_IS_PAYMENT1);
kylinOrderTicketEntitiesMapper.update(entitiesTable, new UpdateWrapper<KylinOrderTicketEntities>() kylinOrderTicketEntitiesMapper.update(entitiesTable, new UpdateWrapper<KylinOrderTicketEntities>()
.eq("order_ticket_entities_id", entitiesId) .eq("order_ticket_entities_id", entitiesId)
...@@ -269,6 +215,7 @@ public class KylinRefundsStatusServiceImpl { ...@@ -269,6 +215,7 @@ public class KylinRefundsStatusServiceImpl {
// 退款细节取消 // 退款细节取消
KylinOrderRefunds kylinOrderRefunds = new KylinOrderRefunds(); KylinOrderRefunds kylinOrderRefunds = new KylinOrderRefunds();
kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL); kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_CANCEL);
kylinOrderRefunds.setUpdatedAt(LocalDateTime.now());
kylinOrderRefundsMapper.update(kylinOrderRefunds, new UpdateWrapper<KylinOrderRefunds>() kylinOrderRefundsMapper.update(kylinOrderRefunds, new UpdateWrapper<KylinOrderRefunds>()
.eq("order_refunds_id", orderRefundsId)); .eq("order_refunds_id", orderRefundsId));
...@@ -277,8 +224,8 @@ public class KylinRefundsStatusServiceImpl { ...@@ -277,8 +224,8 @@ public class KylinRefundsStatusServiceImpl {
} }
public boolean orderTicketRefundReapply(List<KylinOrderRefunds> refundList) { public boolean orderTicketRefundReapply(List<KylinOrderRefunds> refundList) {
String authId = "434"; String authId = ShiroUtils.getUserId().toString();
String authName = "sss"; String authName = ShiroUtils.getLoginName();
KylinOrderRefunds kylinOrderRefunds = new KylinOrderRefunds(); KylinOrderRefunds kylinOrderRefunds = new KylinOrderRefunds();
kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY); kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_APPLY);
...@@ -297,8 +244,8 @@ public class KylinRefundsStatusServiceImpl { ...@@ -297,8 +244,8 @@ public class KylinRefundsStatusServiceImpl {
} }
public boolean orderTicketRefundApproved(List<KylinOrderRefunds> refundList, String reject) { public boolean orderTicketRefundApproved(List<KylinOrderRefunds> refundList, String reject) {
String authId = "434"; String authId = ShiroUtils.getUserId().toString();
String authName = "sss"; String authName = ShiroUtils.getLoginName();
KylinOrderRefunds kylinOrderRefunds = new KylinOrderRefunds(); KylinOrderRefunds kylinOrderRefunds = new KylinOrderRefunds();
kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED); kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED);
...@@ -318,8 +265,8 @@ public class KylinRefundsStatusServiceImpl { ...@@ -318,8 +265,8 @@ public class KylinRefundsStatusServiceImpl {
} }
public boolean orderTicketRefundReject(List<KylinOrderRefunds> refundList, String reject) { public boolean orderTicketRefundReject(List<KylinOrderRefunds> refundList, String reject) {
String authId = "434"; String authId = ShiroUtils.getUserId().toString();
String authName = "sss"; String authName = ShiroUtils.getLoginName();
KylinOrderRefunds kylinOrderRefunds = new KylinOrderRefunds(); KylinOrderRefunds kylinOrderRefunds = new KylinOrderRefunds();
kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT); kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT);
...@@ -339,8 +286,8 @@ public class KylinRefundsStatusServiceImpl { ...@@ -339,8 +286,8 @@ public class KylinRefundsStatusServiceImpl {
} }
public boolean orderTicketRefundRefuse(List<KylinOrderRefunds> refundList, String refuse) { public boolean orderTicketRefundRefuse(List<KylinOrderRefunds> refundList, String refuse) {
String authId = "434"; String authId = ShiroUtils.getUserId().toString();
String authName = "sss"; String authName = ShiroUtils.getLoginName();
KylinOrderRefunds kylinOrderRefunds = new KylinOrderRefunds(); KylinOrderRefunds kylinOrderRefunds = new KylinOrderRefunds();
kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE); kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE);
...@@ -360,8 +307,8 @@ public class KylinRefundsStatusServiceImpl { ...@@ -360,8 +307,8 @@ public class KylinRefundsStatusServiceImpl {
} }
public boolean orderTicketRefundUnfilled(List<KylinOrderRefunds> refundList, String refuse) throws Exception { public boolean orderTicketRefundUnfilled(List<KylinOrderRefunds> refundList, String refuse) throws Exception {
String authId = "434"; String authId = ShiroUtils.getUserId().toString();
String authName = "sss"; String authName = ShiroUtils.getLoginName();
KylinOrderRefunds kylinOrderRefunds = new KylinOrderRefunds(); KylinOrderRefunds kylinOrderRefunds = new KylinOrderRefunds();
kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_UNFILLED); kylinOrderRefunds.setStatus(KylinTableStatusConst.ORDER_REFUND_STATUS_UNFILLED);
...@@ -384,7 +331,7 @@ public class KylinRefundsStatusServiceImpl { ...@@ -384,7 +331,7 @@ public class KylinRefundsStatusServiceImpl {
MultiValueMap<String, String> headers = new LinkedMultiValueMap(); MultiValueMap<String, String> headers = new LinkedMultiValueMap();
headers.add("token", token); headers.add("token", token);
for (KylinOrderRefunds refund: refundList) { for (KylinOrderRefunds refund : refundList) {
KylinOrderTickets oderInfo = kylinOrderTicketsMapper.selectOne( KylinOrderTickets oderInfo = kylinOrderTicketsMapper.selectOne(
new QueryWrapper<KylinOrderTickets>() new QueryWrapper<KylinOrderTickets>()
.eq("order_tickets_id", refund.getOrderTicketsId()) .eq("order_tickets_id", refund.getOrderTicketsId())
......
...@@ -20,6 +20,7 @@ liquidnet: ...@@ -20,6 +20,7 @@ liquidnet:
url-pay: url-pay:
pay: "http://testpay.zhengzai.tv/" pay: "http://testpay.zhengzai.tv/"
check: "http://testpay.zhengzai.tv/order/verify" check: "http://testpay.zhengzai.tv/order/verify"
localUrl: "https://zuul.zhengzai.tv/kylin/order/syncOrder"
#以下为spring各环境个性配置 #以下为spring各环境个性配置
spring: spring:
......
...@@ -20,6 +20,7 @@ liquidnet: ...@@ -20,6 +20,7 @@ liquidnet:
url-pay: url-pay:
pay: "http://testpay.zhengzai.tv/" pay: "http://testpay.zhengzai.tv/"
check: "http://testpay.zhengzai.tv/order/verify" check: "http://testpay.zhengzai.tv/order/verify"
localUrl: "https://zuul.zhengzai.tv/kylin/order/syncOrder"
#以下为spring各环境个性配置 #以下为spring各环境个性配置
spring: spring:
......
...@@ -59,6 +59,9 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -59,6 +59,9 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
private String payUrl; private String payUrl;
@Value("${liquidnet.url-pay.check}") @Value("${liquidnet.url-pay.check}")
private String checkUrl; private String checkUrl;
@Value("${liquidnet.url-pay.localUrl}")
private String synUrl;
@Autowired @Autowired
private DataUtils dataUtils; private DataUtils dataUtils;
@Autowired @Autowired
...@@ -454,7 +457,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -454,7 +457,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
httpData.add("detail", performanceData.getTitle() + "-" + ticketData.getTitle() + "-" + ticketData.getUseStart()); httpData.add("detail", performanceData.getTitle() + "-" + ticketData.getTitle() + "-" + ticketData.getUseStart());
httpData.add("order_code", orderTickets.getOrderCode()); httpData.add("order_code", orderTickets.getOrderCode());
httpData.add("client_ip", "127.0.0.1"); httpData.add("client_ip", "127.0.0.1");
httpData.add("notify_url", "http://www.baidu.com"); httpData.add("notify_url", synUrl);
httpData.add("create_date", orderTickets.getCreatedAt().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); httpData.add("create_date", orderTickets.getCreatedAt().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
httpData.add("expire_time", orderTickets.getPayCountdownMinute().toString()); httpData.add("expire_time", orderTickets.getPayCountdownMinute().toString());
...@@ -531,7 +534,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -531,7 +534,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
httpData.add("detail", entitiesData.getPerformanceTitle() + "-" + entitiesData.getTicketTitle() + "-" + entitiesData.getUseStart()); httpData.add("detail", entitiesData.getPerformanceTitle() + "-" + entitiesData.getTicketTitle() + "-" + entitiesData.getUseStart());
httpData.add("order_code", orderTicketData.getOrderCode()); httpData.add("order_code", orderTicketData.getOrderCode());
httpData.add("client_ip", "127.0.0.1"); httpData.add("client_ip", "127.0.0.1");
httpData.add("notify_url", "http://www.baidu.com"); httpData.add("notify_url", synUrl);
httpData.add("create_date", orderTicketData.getCreatedAt()); httpData.add("create_date", orderTicketData.getCreatedAt());
httpData.add("expire_time", orderTicketData.getPayCountdownMinute().toString()); httpData.add("expire_time", orderTicketData.getPayCountdownMinute().toString());
......
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