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

Commit e6a8a020 authored by jiangxiulong's avatar jiangxiulong

refund

parent 9ebe8e2a
......@@ -7,6 +7,7 @@ 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.enums.BusinessType;
import com.liquidnet.client.admin.common.utils.ShiroUtils;
import com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinOrderRefundsServiceImpl;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ResponseDto;
......@@ -91,7 +92,9 @@ public class KylinOrderRefundAdminController extends BaseController {
@ResponseBody
public AjaxResult refundApply(RefundApplyParam refundApplyParam) {
try {
ResponseDto res = kylinOrderRefundsServiceImpl.refundApply(refundApplyParam);
String authId = ShiroUtils.getUserId().toString();
String authName = ShiroUtils.getLoginName();
ResponseDto res = kylinOrderRefundsServiceImpl.refundApply(refundApplyParam, authId, authName);
if (res.isSuccess()) {
return success();
} else {
......@@ -109,7 +112,9 @@ public class KylinOrderRefundAdminController extends BaseController {
public AjaxResult refundCancel(RefundApplyParam refundApplyParam) {
try {
refundApplyParam.setType("cancel");
ResponseDto res = kylinOrderRefundsServiceImpl.refundCheckStatus(refundApplyParam);
String authId = ShiroUtils.getUserId().toString();
String authName = ShiroUtils.getLoginName();
ResponseDto res = kylinOrderRefundsServiceImpl.refundCheckStatus(refundApplyParam, authId, authName);
if (res.isSuccess()) {
return success();
} else {
......@@ -127,7 +132,9 @@ public class KylinOrderRefundAdminController extends BaseController {
public AjaxResult refundReapply(RefundApplyParam refundApplyParam) {
try {
refundApplyParam.setType("reapply");
ResponseDto res = kylinOrderRefundsServiceImpl.refundCheckStatus(refundApplyParam);
String authId = ShiroUtils.getUserId().toString();
String authName = ShiroUtils.getLoginName();
ResponseDto res = kylinOrderRefundsServiceImpl.refundCheckStatus(refundApplyParam, authId, authName);
if (res.isSuccess()) {
return success();
} else {
......@@ -147,13 +154,15 @@ public class KylinOrderRefundAdminController extends BaseController {
try {
ResponseDto res = null;
Integer status = refundApplyParam.getStatus();
String authId = ShiroUtils.getUserId().toString();
String authName = ShiroUtils.getLoginName();
if (status == KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED) { // 通过
refundApplyParam.setType("approved");
res = kylinOrderRefundsServiceImpl.refundCheckStatus(refundApplyParam);
res = kylinOrderRefundsServiceImpl.refundCheckStatus(refundApplyParam, authId, authName);
}
if (status == KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT) { // 驳回
refundApplyParam.setType("reject");
res = kylinOrderRefundsServiceImpl.refundCheckStatus(refundApplyParam);
res = kylinOrderRefundsServiceImpl.refundCheckStatus(refundApplyParam, authId, authName);
}
if (res.isSuccess()) {
return success();
......@@ -174,13 +183,15 @@ public class KylinOrderRefundAdminController extends BaseController {
try {
ResponseDto res = null;
Integer status = refundApplyParam.getStatus();
String authId = ShiroUtils.getUserId().toString();
String authName = ShiroUtils.getLoginName();
if (status == KylinTableStatusConst.ORDER_REFUND_STATUS_UNFILLED) { // 通过
refundApplyParam.setType("unfilled");
res = kylinOrderRefundsServiceImpl.refundCheckStatus(refundApplyParam);
res = kylinOrderRefundsServiceImpl.refundCheckStatus(refundApplyParam, authId, authName);
}
if (status == KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE) { // 驳回
refundApplyParam.setType("refuse");
res = kylinOrderRefundsServiceImpl.refundCheckStatus(refundApplyParam);
res = kylinOrderRefundsServiceImpl.refundCheckStatus(refundApplyParam, authId, authName);
}
if (res.isSuccess()) {
return success();
......
......@@ -89,7 +89,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
@Autowired
private MongoConverter mongoConverter;
public ResponseDto refundApply(RefundApplyParam refundApplyParam) {
public ResponseDto refundApply(RefundApplyParam refundApplyParam, String authId, String authName) {
String orderTicketsId = refundApplyParam.getOrderTicketsId();
List<String> ticketEntityIds = refundApplyParam.getTicketEntityIds();
List<BigDecimal> entitiesPrice = refundApplyParam.getEntitiesPrice();
......@@ -201,6 +201,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
refundApplyParam, orderInfo, orderTicketsId,
RefundPriceExpress,
ticketEntityIds, realRefundPriceList
, authId, authName
);
HashMap<String, Object> map = new HashMap<>();
......@@ -226,7 +227,7 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
);
}*/
public ResponseDto refundCheckStatus(RefundApplyParam refundApplyParam) {
public ResponseDto refundCheckStatus(RefundApplyParam refundApplyParam, String authId, String authName) {
String type = refundApplyParam.getType();
List<String> orderRefundsIdList = refundApplyParam.getIds();
if (orderRefundsIdList.size() <= 0) {
......@@ -279,23 +280,21 @@ public class KylinOrderRefundsServiceImpl extends ServiceImpl<KylinOrderRefundsM
res = kylinRefundsStatusServiceImpl.orderTicketRefundCancel(refundList, true);
break;
case "reapply":
res = kylinRefundsStatusServiceImpl.orderRefundChangeStatus(refundList, type, "", "");
res = kylinRefundsStatusServiceImpl.orderRefundChangeStatus(refundList, type, "", "", authId, authName);
break;
case "approved":
res = kylinRefundsStatusServiceImpl.orderRefundChangeStatus(refundList, type, reject, "");
res = kylinRefundsStatusServiceImpl.orderRefundChangeStatus(refundList, type, reject, "", authId, authName);
break;
case "reject":
boolean cancelRes = kylinRefundsStatusServiceImpl.orderTicketRefundCancel(refundList, false);
res = kylinRefundsStatusServiceImpl.orderRefundChangeStatus(refundList, type, reject, "");
res = kylinRefundsStatusServiceImpl.orderRefundChangeStatus(refundList, type, reject, "", authId, authName);
break;
case "unfilled":
String authId = ShiroUtils.getUserId().toString();
String authName = ShiroUtils.getLoginName();
kylinRefundsStatusServiceImpl.orderTicketRefundUnfilled(refundList, refuse, authId, authName);
res = true;
break;
case "refuse":
res = kylinRefundsStatusServiceImpl.orderRefundChangeStatus(refundList, type, "", refuse);
res = kylinRefundsStatusServiceImpl.orderRefundChangeStatus(refundList, type, "", refuse, authId, authName);
break;
}
if (res) {
......
......@@ -50,7 +50,7 @@ public class KylinRefundExecuteServiceImpl {
private KylinOrderRefundsServiceImpl kylinOrderRefundsServiceImpl;
@Async
public void refundBatchApply(String targetId, String refundBatchId, String reason) {
public void refundBatchApply(String targetId, String refundBatchId, String reason, String authId, String authName) {
RefundApplyParam refundApplyParam = new RefundApplyParam();
int count;
int limitNum = 10;
......@@ -74,7 +74,7 @@ public class KylinRefundExecuteServiceImpl {
refundApplyParam.setRefundPriceExpress(order.getPriceExpress());
}
try {
ResponseDto res = kylinOrderRefundsServiceImpl.refundApply(refundApplyParam);
ResponseDto res = kylinOrderRefundsServiceImpl.refundApply(refundApplyParam, authId, authName);
} catch (Exception e) {
}
......@@ -95,7 +95,7 @@ public class KylinRefundExecuteServiceImpl {
}
@Async
public void refundBatchStatus(RefundBatchApplyParam refundBatchApplyParam, String type) {
public void refundBatchStatus(RefundBatchApplyParam refundBatchApplyParam, String type, String authId, String authName) {
String refundBatchId = refundBatchApplyParam.getRefundBatchId();
Integer status = refundBatchApplyParam.getRefundStatus();
// 处理查询订单状态
......@@ -150,7 +150,7 @@ public class KylinRefundExecuteServiceImpl {
refundApplyParam.setReject(refundBatchApplyParam.getReject());
}
try {
ResponseDto res = kylinOrderRefundsServiceImpl.refundCheckStatus(refundApplyParam);
ResponseDto res = kylinOrderRefundsServiceImpl.refundCheckStatus(refundApplyParam, authId, authName);
} catch (Exception e) {
}
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.liquidnet.client.admin.common.utils.ShiroUtils;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.BeanUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
......@@ -111,7 +112,9 @@ public class KylinRefundPerformancesAdminServiceImpl {
int resNum = kylinOrderRefundBatchesMapper.insert(createData);
if (resNum > 0) {
// 开始执行批量提交审核 分批处理退款申请
kylinRefundExecuteServiceImpl.refundBatchApply(targetId, refundBatchId, refundBatchApplyParam.getReason());
String authId = ShiroUtils.getUserId().toString();
String authName = ShiroUtils.getLoginName();
kylinRefundExecuteServiceImpl.refundBatchApply(targetId, refundBatchId, refundBatchApplyParam.getReason(), authId, authName);
return ResponseDto.success();
} else {
return ResponseDto.failure("操作失败");
......@@ -176,7 +179,9 @@ public class KylinRefundPerformancesAdminServiceImpl {
if (null != orderUpdateStatus) {
refundBatchApplyParam.setRefundStatus(orderUpdateStatus);
}
kylinRefundExecuteServiceImpl.refundBatchStatus(refundBatchApplyParam, type);
String authId = ShiroUtils.getUserId().toString();
String authName = ShiroUtils.getLoginName();
kylinRefundExecuteServiceImpl.refundBatchStatus(refundBatchApplyParam, type, authId, authName);
} catch (Exception e) {
return ResponseDto.failure("操作失败");
}
......
......@@ -95,13 +95,12 @@ public class KylinRefundsStatusServiceImpl {
RefundApplyParam refundApplyParam, KylinOrderTickets orderInfo, String orderTicketsId,
BigDecimal RefundPriceExpress,
List<String> ticketEntityIds, List<BigDecimal> entitiesPrice
, String authId, String authName
) {
if (CollectionUtil.isEmpty(ticketEntityIds)) {
return false;
}
// 基础数据
String authId = ShiroUtils.getUserId().toString();
String authName = ShiroUtils.getLoginName();
String reason = refundApplyParam.getReason();
String orderRefundBatchesId = refundApplyParam.getOrderRefundBatchesId();
// 本次退款票总金额
......@@ -334,9 +333,7 @@ public class KylinRefundsStatusServiceImpl {
return true;
}
public boolean orderRefundChangeStatus(List<KylinOrderRefunds> refundList, String type, String reject, String refuse) {
String authId = ShiroUtils.getUserId().toString();
String authName = ShiroUtils.getLoginName();
public boolean orderRefundChangeStatus(List<KylinOrderRefunds> refundList, String type, String reject, String refuse, String authId, String authName) {
KylinOrderRefunds kylinOrderRefunds = new KylinOrderRefunds();
switch (type) {
case "reapply":
......
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