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

Commit 88f7224c authored by jiangxiulong's avatar jiangxiulong

批量整合

parent 0b7d35b2
......@@ -31,4 +31,6 @@ public class RefundBatchApplyParam implements Serializable {
private String refuse;
private String type;
}
......@@ -5,6 +5,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.zhengzai.kylin.service.impl.KylinRefundPerformancesAdminServiceImpl;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dao.OrderRefundBatchDao;
import com.liquidnet.service.kylin.dto.param.RefundBatchApplyParam;
import com.liquidnet.service.kylin.dto.param.RefundBatchSearchParam;
......@@ -90,13 +91,13 @@ public class KylinOrderRefundBatchAdminController extends BaseController {
public AjaxResult refundBatchReApply(RefundBatchApplyParam refundBatchApplyParam) {
String ids = refundBatchApplyParam.getIds();
refundBatchApplyParam.setRefundBatchId(ids);
refundBatchApplyParam.setType("reapply");
try {
Boolean res = kylinRefundPerformancesAdminServiceImpl.refundBatchReapply(refundBatchApplyParam);
if (res) {
ResponseDto res = kylinRefundPerformancesAdminServiceImpl.refundBatchCheckStatus(refundBatchApplyParam);
if (res.isSuccess()) {
return success();
} else {
// 不是重新发起退款,而是重新发起退款审核
return error("再次发起退款审核失败");
return error(res.getMessage());
}
} catch (Exception e) {
return error(e.getMessage());
......@@ -109,12 +110,13 @@ public class KylinOrderRefundBatchAdminController extends BaseController {
public AjaxResult refundBatchCancel(RefundBatchApplyParam refundBatchApplyParam) {
String ids = refundBatchApplyParam.getIds();
refundBatchApplyParam.setRefundBatchId(ids);
refundBatchApplyParam.setType("cancel");
try {
Boolean res = kylinRefundPerformancesAdminServiceImpl.refundBatchCancel(refundBatchApplyParam);
if (res) {
ResponseDto res = kylinRefundPerformancesAdminServiceImpl.refundBatchCheckStatus(refundBatchApplyParam);
if (res.isSuccess()) {
return success();
} else {
return error("取消退款失败");
return error(res.getMessage());
}
} catch (Exception e) {
return error(e.getMessage());
......@@ -125,12 +127,13 @@ public class KylinOrderRefundBatchAdminController extends BaseController {
@PostMapping("review")
@ResponseBody
public AjaxResult refundBatchReview(RefundBatchApplyParam refundBatchApplyParam) {
refundBatchApplyParam.setType("review");
try {
Boolean res = kylinRefundPerformancesAdminServiceImpl.refundBatchReview(refundBatchApplyParam);
if (res) {
ResponseDto res = kylinRefundPerformancesAdminServiceImpl.refundBatchCheckStatus(refundBatchApplyParam);
if (res.isSuccess()) {
return success();
} else {
return error("审核退款失败");
return error(res.getMessage());
}
} catch (Exception e) {
return error(e.getMessage());
......@@ -141,12 +144,13 @@ public class KylinOrderRefundBatchAdminController extends BaseController {
@PostMapping("execute")
@ResponseBody
public AjaxResult refundBatchExecute(RefundBatchApplyParam refundBatchApplyParam) {
refundBatchApplyParam.setType("execute");
try {
Boolean res = kylinRefundPerformancesAdminServiceImpl.refundBatchExecute(refundBatchApplyParam);
if (res) {
ResponseDto res = kylinRefundPerformancesAdminServiceImpl.refundBatchCheckStatus(refundBatchApplyParam);
if (res.isSuccess()) {
return success();
} else {
return error("审核退款失败");
return error(res.getMessage());
}
} catch (Exception e) {
e.printStackTrace();
......
......@@ -7,6 +7,7 @@ import com.github.pagehelper.PageInfo;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.BeanUtil;
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.dto.param.RefundBatchApplyParam;
......@@ -97,102 +98,68 @@ public class KylinRefundPerformancesAdminServiceImpl {
}
}
public Boolean refundBatchReapply(RefundBatchApplyParam refundBatchApplyParam) throws Exception {
String refundBatchId = refundBatchApplyParam.getRefundBatchId();
Integer[] paymentTypeAlipayArray = {KylinTableStatusConst.STATUS_OPERATE_REJECT, KylinTableStatusConst.STATUS_FINANCE_REJECT};
KylinOrderRefundBatches refundBatchesInfo = kylinOrderRefundBatchesMapper.selectOne(
new UpdateWrapper<KylinOrderRefundBatches>().eq("refund_batch_id", refundBatchId).in("status", paymentTypeAlipayArray)
);
if (null != refundBatchesInfo) {
// 开始执行批量提交审核 分批处理退款申请
kylinRefundExecuteServiceImpl.refundBatchStatus(refundBatchApplyParam, "reapply");
KylinOrderRefundBatches params = new KylinOrderRefundBatches();
params.setStatus(KylinTableStatusConst.STATUS_APPLY);
kylinOrderRefundBatchesMapper.update(params, new UpdateWrapper<KylinOrderRefundBatches>().eq("refund_batch_id", refundBatchId));
return true;
} else {
throw new Exception("当前状态下不允许此操作");
}
}
public Boolean refundBatchCancel(RefundBatchApplyParam refundBatchApplyParam) throws Exception {
String refundBatchId = refundBatchApplyParam.getRefundBatchId();
Integer[] paymentTypeAlipayArray = {KylinTableStatusConst.STATUS_APPLY, KylinTableStatusConst.STATUS_OPERATE_REJECT, KylinTableStatusConst.STATUS_FINANCE_REJECT};
KylinOrderRefundBatches refundBatchesInfo = kylinOrderRefundBatchesMapper.selectOne(
new UpdateWrapper<KylinOrderRefundBatches>().eq("refund_batch_id", refundBatchId).in("status", paymentTypeAlipayArray)
);
if (null != refundBatchesInfo) {
// 开始执行批量提交审核 分批处理退款申请
kylinRefundExecuteServiceImpl.refundBatchStatus(refundBatchApplyParam, "cancel");
KylinOrderRefundBatches params = new KylinOrderRefundBatches();
params.setStatus(KylinTableStatusConst.STATUS_CANCEL);
kylinOrderRefundBatchesMapper.update(params, new UpdateWrapper<KylinOrderRefundBatches>().eq("refund_batch_id", refundBatchId));
return true;
} else {
throw new Exception("当前状态下不允许此操作");
}
}
public Boolean refundBatchReview(RefundBatchApplyParam refundBatchApplyParam) throws Exception {
String refundBatchId = refundBatchApplyParam.getRefundBatchId();
Integer batchStatus = refundBatchApplyParam.getStatus();
Integer updateStatus = 0;
if (KylinTableStatusConst.STATUS_OPERATE_REJECT == batchStatus) {// 驳回
updateStatus = KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT;
} else if (KylinTableStatusConst.STATUS_OPERATE_ADOPT == batchStatus) {// 通过
updateStatus = KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED;
}
Integer[] paymentTypeAlipayArray = {KylinTableStatusConst.STATUS_APPLY};
KylinOrderRefundBatches refundBatchesInfo = kylinOrderRefundBatchesMapper.selectOne(
new UpdateWrapper<KylinOrderRefundBatches>().eq("refund_batch_id", refundBatchId).in("status", paymentTypeAlipayArray)
);
if (null != refundBatchesInfo) {
// 开始执行批量提交审核 分批处理退款申请
refundBatchApplyParam.setRefundStatus(updateStatus);
kylinRefundExecuteServiceImpl.refundBatchStatus(refundBatchApplyParam, "review");
KylinOrderRefundBatches params = new KylinOrderRefundBatches();
params.setStatus(batchStatus);
kylinOrderRefundBatchesMapper.update(
params,
new UpdateWrapper<KylinOrderRefundBatches>().eq("refund_batch_id", refundBatchId)
);
return true;
} else {
throw new Exception("当前状态下不允许此操作");
}
}
public Boolean refundBatchExecute(RefundBatchApplyParam refundBatchApplyParam) throws Exception {
public ResponseDto refundBatchCheckStatus(RefundBatchApplyParam refundBatchApplyParam) {
String refundBatchId = refundBatchApplyParam.getRefundBatchId();
String type = refundBatchApplyParam.getType();
Integer batchStatus = refundBatchApplyParam.getStatus();
Integer updateStatus = 0;
if (KylinTableStatusConst.STATUS_FINANCE_REJECT == batchStatus) {// 驳回
updateStatus = KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE;
} else if (KylinTableStatusConst.STATUS_FINANCE_ADOPT == batchStatus) {// 通过
updateStatus = KylinTableStatusConst.ORDER_REFUND_STATUS_UNFILLED;
Integer[] paymentTypeAlipayArray = null;
Integer batchUpdateStatus = 0;
Integer orderUpdateStatus = 0;
switch (type) {
case "reapply":
paymentTypeAlipayArray = new Integer[]{KylinTableStatusConst.STATUS_OPERATE_REJECT, KylinTableStatusConst.STATUS_FINANCE_REJECT};
batchUpdateStatus = KylinTableStatusConst.STATUS_APPLY;
break;
case "cancel":
paymentTypeAlipayArray = new Integer[]{KylinTableStatusConst.STATUS_APPLY, KylinTableStatusConst.STATUS_OPERATE_REJECT, KylinTableStatusConst.STATUS_FINANCE_REJECT};
batchUpdateStatus = KylinTableStatusConst.STATUS_CANCEL;
break;
case "review":
batchUpdateStatus = batchStatus;
if (batchStatus == KylinTableStatusConst.STATUS_OPERATE_ADOPT) { // 通过申请
paymentTypeAlipayArray = new Integer[]{KylinTableStatusConst.STATUS_APPLY};
orderUpdateStatus = KylinTableStatusConst.ORDER_REFUND_STATUS_APPROVED;
}
if (batchStatus == KylinTableStatusConst.STATUS_OPERATE_REJECT) { // 驳回申请
paymentTypeAlipayArray = new Integer[]{KylinTableStatusConst.STATUS_APPLY};
orderUpdateStatus = KylinTableStatusConst.ORDER_REFUND_STATUS_REJECT;
}
break;
case "execute":
batchUpdateStatus = batchStatus;
if (batchStatus == KylinTableStatusConst.STATUS_FINANCE_ADOPT) { // 执行退款
paymentTypeAlipayArray = new Integer[]{KylinTableStatusConst.STATUS_OPERATE_ADOPT, KylinTableStatusConst.STATUS_FINANCE_REJECT};
orderUpdateStatus = KylinTableStatusConst.ORDER_REFUND_STATUS_UNFILLED;
}
if (batchStatus == KylinTableStatusConst.STATUS_FINANCE_REJECT) { // 拒绝退款
paymentTypeAlipayArray = new Integer[]{KylinTableStatusConst.STATUS_OPERATE_ADOPT, KylinTableStatusConst.STATUS_FINANCE_REJECT};
orderUpdateStatus = KylinTableStatusConst.ORDER_REFUND_STATUS_REFUSE;
}
break;
default:
return ResponseDto.failure("type异常,无法操作");
}
Integer[] paymentTypeAlipayArray = {KylinTableStatusConst.STATUS_OPERATE_ADOPT, KylinTableStatusConst.STATUS_FINANCE_REJECT};
KylinOrderRefundBatches refundBatchesInfo = kylinOrderRefundBatchesMapper.selectOne(
new UpdateWrapper<KylinOrderRefundBatches>().eq("refund_batch_id", refundBatchId).in("status", paymentTypeAlipayArray)
);
if (null != refundBatchesInfo) {
// 开始执行批量提交审核 分批处理退款申请
refundBatchApplyParam.setRefundStatus(updateStatus);
kylinRefundExecuteServiceImpl.refundBatchStatus(refundBatchApplyParam, "execute");
try {
if (null != orderUpdateStatus) {
refundBatchApplyParam.setRefundStatus(orderUpdateStatus);
}
kylinRefundExecuteServiceImpl.refundBatchStatus(refundBatchApplyParam, type);
} catch (Exception e) {
return ResponseDto.failure("操作失败");
}
KylinOrderRefundBatches params = new KylinOrderRefundBatches();
params.setStatus(batchStatus);
params.setStatus(batchUpdateStatus);
kylinOrderRefundBatchesMapper.update(params, new UpdateWrapper<KylinOrderRefundBatches>().eq("refund_batch_id", refundBatchId));
return true;
return ResponseDto.success();
} else {
throw new Exception("当前状态下不允许此操作");
return ResponseDto.failure("当前状态下不允许此操作");
}
}
......
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