|
@@ -6,11 +6,14 @@ import com.fdkankan.common.constant.ErrorCode;
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
import com.fdkankan.ucenter.common.constants.NacosProperty;
|
|
import com.fdkankan.ucenter.common.constants.NacosProperty;
|
|
import com.fdkankan.ucenter.entity.IncrementOrder;
|
|
import com.fdkankan.ucenter.entity.IncrementOrder;
|
|
|
|
+import com.fdkankan.ucenter.entity.IncrementType;
|
|
import com.fdkankan.ucenter.pay.factory.PayEntity;
|
|
import com.fdkankan.ucenter.pay.factory.PayEntity;
|
|
import com.fdkankan.ucenter.pay.factory.impl.PayOrderService;
|
|
import com.fdkankan.ucenter.pay.factory.impl.PayOrderService;
|
|
import com.fdkankan.ucenter.pay.paypal.PayPalDefaultConfig;
|
|
import com.fdkankan.ucenter.pay.paypal.PayPalDefaultConfig;
|
|
import com.fdkankan.ucenter.service.IIncrementOrderService;
|
|
import com.fdkankan.ucenter.service.IIncrementOrderService;
|
|
|
|
+import com.fdkankan.ucenter.service.IIncrementTypeService;
|
|
import com.fdkankan.ucenter.vo.request.PlaceOrderParam;
|
|
import com.fdkankan.ucenter.vo.request.PlaceOrderParam;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
@@ -24,6 +27,8 @@ public class PaypalIncrement implements PayEntity {
|
|
private IIncrementOrderService incrementOrderService;
|
|
private IIncrementOrderService incrementOrderService;
|
|
@Autowired
|
|
@Autowired
|
|
private PayPalDefaultConfig payPalDefaultConfig;
|
|
private PayPalDefaultConfig payPalDefaultConfig;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IIncrementTypeService incrementTypeService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -41,7 +46,14 @@ public class PaypalIncrement implements PayEntity {
|
|
if (incrementOrderEntity == null) {
|
|
if (incrementOrderEntity == null) {
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_8001);
|
|
}
|
|
}
|
|
- String subject = Constant.INCREMENT_SUBJECT + ":" + incrementOrderEntity.getCount() + "个/年";
|
|
|
|
|
|
+ String subject = null;
|
|
|
|
+ if(incrementOrderEntity.getIncrementType()!=null){
|
|
|
|
+ IncrementType incrementType = incrementTypeService.getById(incrementOrderEntity.getIncrementType());
|
|
|
|
+ String un = incrementType.getValidTimeType() == 0 ?"年":"月";
|
|
|
|
+ subject = incrementType.getName() + ":" + incrementOrderEntity.getCount() + "个/"+un ;
|
|
|
|
+ }else {
|
|
|
|
+ subject = Constant.INCREMENT_SUBJECT + ":" + incrementOrderEntity.getCount() + "个/年";
|
|
|
|
+ }
|
|
String orderSn = incrementOrderEntity.getOrderSn();
|
|
String orderSn = incrementOrderEntity.getOrderSn();
|
|
orderSn += "_increment";
|
|
orderSn += "_increment";
|
|
String body = subject;
|
|
String body = subject;
|