申请退款,取消退款优化
This commit is contained in:
parent
ce309e5feb
commit
80731e0ae8
@ -136,6 +136,7 @@ public class XhpcRefundAuditController extends BaseController {
|
|||||||
String refundOrderId = StringUtils.valueOf(refundOrder.get("refundOrderId"));
|
String refundOrderId = StringUtils.valueOf(refundOrder.get("refundOrderId"));
|
||||||
XhpcRefundOrder xhpcRefundOrder = new XhpcRefundOrder();
|
XhpcRefundOrder xhpcRefundOrder = new XhpcRefundOrder();
|
||||||
xhpcRefundOrder.setRefundOrderId(Long.parseLong(refundOrderId));
|
xhpcRefundOrder.setRefundOrderId(Long.parseLong(refundOrderId));
|
||||||
|
xhpcRefundOrder.setExamineStatus(1);
|
||||||
xhpcRefundOrder.setStatus(StatusConstants.REFUND_ORDER_STATUS_CANCEL);
|
xhpcRefundOrder.setStatus(StatusConstants.REFUND_ORDER_STATUS_CANCEL);
|
||||||
int updateStatus = iXhpcRefundOrderService.updateStatus(xhpcRefundOrder);
|
int updateStatus = iXhpcRefundOrderService.updateStatus(xhpcRefundOrder);
|
||||||
if (updateStatus == 0) {
|
if (updateStatus == 0) {
|
||||||
|
|||||||
@ -54,6 +54,18 @@ public class XhpcRefundOrderController extends BaseController {
|
|||||||
if (StringUtils.isEmpty(type)) {
|
if (StringUtils.isEmpty(type)) {
|
||||||
return AjaxResult.error(HttpStatus.NOT_NULL, "退款渠道不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "退款渠道不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//是否有实时数据
|
||||||
|
int i =iXhpcRefundOrderService.countXhpcRealTimeOrder(Long.valueOf(userId));
|
||||||
|
if (i > 0) {
|
||||||
|
return AjaxResult.error(1103, "车辆正在充电,不能退款");
|
||||||
|
}
|
||||||
|
// 是否有异常订单
|
||||||
|
int j =iXhpcRefundOrderService.countXhpcChargeOrder(Long.valueOf(userId));
|
||||||
|
if (j > 0) {
|
||||||
|
return AjaxResult.error(1103, "你有异常订单未解决,请拨打客服电话进行解决");
|
||||||
|
}
|
||||||
|
|
||||||
//生成退款订单
|
//生成退款订单
|
||||||
String orderOutNumber = StringUtils.numFormat(Long.parseLong(userId), Integer.parseInt(type), StatusConstants.FLOWING_WATER_REFUND_TYPE);
|
String orderOutNumber = StringUtils.numFormat(Long.parseLong(userId), Integer.parseInt(type), StatusConstants.FLOWING_WATER_REFUND_TYPE);
|
||||||
String remark = StringUtils.valueOf(map.get("remark"));
|
String remark = StringUtils.valueOf(map.get("remark"));
|
||||||
|
|||||||
@ -81,4 +81,14 @@ public interface XhpcRefundOrderMapper {
|
|||||||
*/
|
*/
|
||||||
public Map<String, Object> getNotRefundOrder(@Param("userId") Long userId);
|
public Map<String, Object> getNotRefundOrder(@Param("userId") Long userId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断用户是否在充电中
|
||||||
|
*/
|
||||||
|
int countXhpcRealTimeOrder(@Param("userId")Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断用户是否有异常订单未处理
|
||||||
|
*/
|
||||||
|
int countXhpcChargeOrder(@Param("userId")Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.xhpc.payment.service;
|
|||||||
|
|
||||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||||
import com.xhpc.payment.domain.XhpcRefundOrder;
|
import com.xhpc.payment.domain.XhpcRefundOrder;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -67,4 +68,17 @@ public interface IXhpcRefundOrderService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateStatus(XhpcRefundOrder xhpcRefundOrder);
|
public int updateStatus(XhpcRefundOrder xhpcRefundOrder);
|
||||||
|
|
||||||
|
|
||||||
|
//是否有正在充电的订单
|
||||||
|
/**
|
||||||
|
* 判断用户是否在充电中
|
||||||
|
*/
|
||||||
|
int countXhpcRealTimeOrder(Long userId);
|
||||||
|
//是否有异常订单
|
||||||
|
/**
|
||||||
|
* 判断用户是否有异常订单未处理
|
||||||
|
*/
|
||||||
|
int countXhpcChargeOrder(Long userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -132,4 +132,15 @@ public class XhpcRefundOrderServiceImpl implements IXhpcRefundOrderService {
|
|||||||
public int updateStatus(XhpcRefundOrder xhpcRefundOrder) {
|
public int updateStatus(XhpcRefundOrder xhpcRefundOrder) {
|
||||||
return xhpcRefundOrderMapper.updateStatus(xhpcRefundOrder);
|
return xhpcRefundOrderMapper.updateStatus(xhpcRefundOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int countXhpcRealTimeOrder(Long userId) {
|
||||||
|
return xhpcRefundOrderMapper.countXhpcRealTimeOrder(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int countXhpcChargeOrder(Long userId) {
|
||||||
|
return xhpcRefundOrderMapper.countXhpcChargeOrder(userId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -142,6 +142,7 @@
|
|||||||
UPDATE xhpc_refund_order
|
UPDATE xhpc_refund_order
|
||||||
<set>
|
<set>
|
||||||
<if test="null != status">status = #{status},</if>
|
<if test="null != status">status = #{status},</if>
|
||||||
|
<if test="null != examineStatus">examine_status = #{examineStatus},</if>
|
||||||
</set>
|
</set>
|
||||||
WHERE refund_order_id = #{refundOrderId} and examine_status = 0
|
WHERE refund_order_id = #{refundOrderId} and examine_status = 0
|
||||||
</update>
|
</update>
|
||||||
@ -221,4 +222,13 @@
|
|||||||
</if>
|
</if>
|
||||||
ORDER BY xro.create_time DESC LIMIT 1
|
ORDER BY xro.create_time DESC LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="countXhpcRealTimeOrder" resultType="int">
|
||||||
|
select charge_order_id as chargeOrderId from xhpc_charge_order where user_id =#{userId} and status=0 and del_flag =0 limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="countXhpcChargeOrder" resultType="int">
|
||||||
|
select count(charge_order_id) from xhpc_charge_order where user_id =#{userId} and status =2 and del_flag =0
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
x
Reference in New Issue
Block a user