|
|
@ -15,11 +15,13 @@ import com.hfkj.entity.BsOrderRefundExample; |
|
|
|
import com.hfkj.mer.BsMerPayConfigService; |
|
|
|
import com.hfkj.mer.BsMerPayConfigService; |
|
|
|
import com.hfkj.model.order.OrderChildModel; |
|
|
|
import com.hfkj.model.order.OrderChildModel; |
|
|
|
import com.hfkj.model.order.OrderModel; |
|
|
|
import com.hfkj.model.order.OrderModel; |
|
|
|
|
|
|
|
import com.hfkj.service.hlt.HuiLianTongUnionCardService; |
|
|
|
import com.hfkj.service.order.BsOrderChildService; |
|
|
|
import com.hfkj.service.order.BsOrderChildService; |
|
|
|
import com.hfkj.service.order.BsOrderRefundService; |
|
|
|
import com.hfkj.service.order.BsOrderRefundService; |
|
|
|
import com.hfkj.service.order.BsOrderService; |
|
|
|
import com.hfkj.service.order.BsOrderService; |
|
|
|
import com.hfkj.service.order.OrderRefundSuccessService; |
|
|
|
import com.hfkj.service.order.OrderRefundSuccessService; |
|
|
|
import com.hfkj.service.pay.HuiPayService; |
|
|
|
import com.hfkj.service.pay.HuiPayService; |
|
|
|
|
|
|
|
import com.hfkj.service.pay.huift.TradeService; |
|
|
|
import com.hfkj.service.user.UserIntegralService; |
|
|
|
import com.hfkj.service.user.UserIntegralService; |
|
|
|
import com.hfkj.sysenum.UserIntegralRecordOpUserTypeEnum; |
|
|
|
import com.hfkj.sysenum.UserIntegralRecordOpUserTypeEnum; |
|
|
|
import com.hfkj.sysenum.UserIntegralRecordSourceTypeEnum; |
|
|
|
import com.hfkj.sysenum.UserIntegralRecordSourceTypeEnum; |
|
|
@ -35,10 +37,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.*; |
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @className: BsOrderRefundServiceImpl |
|
|
|
* @className: BsOrderRefundServiceImpl |
|
|
@ -59,6 +58,8 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private BsMerPayConfigService merPayConfigService; |
|
|
|
private BsMerPayConfigService merPayConfigService; |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
|
|
|
|
private TradeService huiftTradeService; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private OrderRefundSuccessService orderRefundSuccessService; |
|
|
|
private OrderRefundSuccessService orderRefundSuccessService; |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void editData(BsOrderRefund data) { |
|
|
|
public void editData(BsOrderRefund data) { |
|
|
@ -92,11 +93,25 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService { |
|
|
|
editData(orderRefund); |
|
|
|
editData(orderRefund); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}/* else if (OrderPayChannelEnum.type2.getCode() == orderRefund.getRefundPayChannel()) { |
|
|
|
} else if (OrderPayChannelEnum.type3.getCode() == orderRefund.getRefundPayChannel()) { |
|
|
|
// TODO 暂无该支付方式
|
|
|
|
// 商户退款
|
|
|
|
|
|
|
|
JSONObject refundObj = huiftTradeService.thirdPayRefund(orderRefund.getRefundOrderNo(), orderRefund.getRefundPrice(), orderRefund.getOrderNo()); |
|
|
|
} else if (OrderPayChannelEnum.type3.getCode() ==orderRefund.getRefundPayChannel()) { |
|
|
|
orderRefund.setRefundSerialNo(refundObj.getString("refundTraceNo")); |
|
|
|
// TODO 暂无该支付方式
|
|
|
|
orderRefund.setRefundPayChannelOrderNo(refundObj.getString("refundOrderNo")); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} /*else if (OrderPayChannelEnum.type4.getCode() == orderRefund.getRefundPayChannel()) { |
|
|
|
|
|
|
|
// 商户退款
|
|
|
|
|
|
|
|
JSONObject refundObj = HuiLianTongUnionCardService.refund(orderRefund.getRefundOrderNo(), orderRefund.getOrderNo()); |
|
|
|
|
|
|
|
if (!refundObj.getString("respCode").equals("0000")) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refundObj.getString("respMessage")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
JSONObject consumptionResult = HuiLianTongUnionCardService.resolveResponse(refundObj.getString("data")); |
|
|
|
|
|
|
|
if (!(consumptionResult.getBoolean("success") || Objects.equals(consumptionResult.getString("message"), "原交易已撤销,不可再次操作"))) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!"+consumptionResult.getString("message")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
orderRefund.setRefundSerialNo(consumptionResult.getString("orderId")); |
|
|
|
|
|
|
|
return true; |
|
|
|
}*/ else { |
|
|
|
}*/ else { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!该支付方式暂不支持退款"); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!该支付方式暂不支持退款"); |
|
|
|
} |
|
|
|
} |
|
|
@ -250,6 +265,10 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService { |
|
|
|
BsOrderRefundExample example = new BsOrderRefundExample(); |
|
|
|
BsOrderRefundExample example = new BsOrderRefundExample(); |
|
|
|
BsOrderRefundExample.Criteria criteria = example.createCriteria(); |
|
|
|
BsOrderRefundExample.Criteria criteria = example.createCriteria(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (MapUtils.getLong(param, "merId") != null) { |
|
|
|
|
|
|
|
criteria.andMerIdEqualTo(MapUtils.getLong(param, "merId")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(MapUtils.getString(param, "userPhone"))) { |
|
|
|
if (StringUtils.isNotBlank(MapUtils.getString(param, "userPhone"))) { |
|
|
|
criteria.andUserPhoneEqualTo(MapUtils.getString(param, "userPhone")); |
|
|
|
criteria.andUserPhoneEqualTo(MapUtils.getString(param, "userPhone")); |
|
|
|
} |
|
|
|
} |
|
|
|