|
|
|
@ -19,6 +19,9 @@ import com.hfkj.service.order.BsOrderChildService; |
|
|
|
|
import com.hfkj.service.order.BsOrderRefundService; |
|
|
|
|
import com.hfkj.service.order.BsOrderService; |
|
|
|
|
import com.hfkj.service.pay.HuiPayService; |
|
|
|
|
import com.hfkj.service.user.UserIntegralService; |
|
|
|
|
import com.hfkj.sysenum.UserIntegralRecordOpUserTypeEnum; |
|
|
|
|
import com.hfkj.sysenum.UserIntegralRecordSourceTypeEnum; |
|
|
|
|
import com.hfkj.sysenum.mer.PayPlatformEnum; |
|
|
|
|
import com.hfkj.sysenum.order.*; |
|
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
@ -32,6 +35,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
@ -50,6 +54,8 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService { |
|
|
|
|
@Resource |
|
|
|
|
private BsOrderChildService orderChildService; |
|
|
|
|
@Resource |
|
|
|
|
private UserIntegralService userIntegralService; |
|
|
|
|
@Resource |
|
|
|
|
private BsMerPayConfigService merPayConfigService; |
|
|
|
|
@Override |
|
|
|
|
public void editData(BsOrderRefund data) { |
|
|
|
@ -174,10 +180,28 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService { |
|
|
|
|
orderRefund.setRefundPrice(unitPrice.multiply(new BigDecimal(productCount.toString()))); |
|
|
|
|
orderRefund.setRefundIntegral(unitPriceIntegral.multiply(new BigDecimal("100")).longValue()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (orderRefund.getRefundIntegral() > 0L) { |
|
|
|
|
Map<String,Object> opUser = new HashMap<>(); |
|
|
|
|
opUser.put("opUserType", orderRefund.getOpUserType()); |
|
|
|
|
opUser.put("opUserId", orderRefund.getUserId()); |
|
|
|
|
opUser.put("opUserPhone", orderRefund.getUserPhone()); |
|
|
|
|
|
|
|
|
|
Map<String,Object> source = new HashMap<>(); |
|
|
|
|
source.put("sourceType", UserIntegralRecordSourceTypeEnum.type2.getCode()); |
|
|
|
|
source.put("sourceId", orderChild.getId()); |
|
|
|
|
source.put("sourceOrderNo", orderChild.getChildOrderNo()); |
|
|
|
|
source.put("sourceContent", "商品订单退款退回积分"); |
|
|
|
|
|
|
|
|
|
// 退款积分
|
|
|
|
|
userIntegralService.entry(orderRefund.getUserId(),orderRefund.getRefundIntegral(), opUser, source); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
orderRefund.setRefundRemark(remark); |
|
|
|
|
orderRefund.setRefundStatus(OrderRefundStatusEnum.status1.getCode()); |
|
|
|
|
orderRefund.setAccountMerchantNo(orderChild.getSettleAccount()); |
|
|
|
|
orderRefund.setAccountMerchantNo(orderChild.getSettleAccountKey()); |
|
|
|
|
orderRefund.setAccountMerchantKey(orderChild.getSettleAccountKey()); |
|
|
|
|
editData(orderRefund); |
|
|
|
|
|
|
|
|
|
// 资金退款
|
|
|
|
|