@AllArgsConstructor | @AllArgsConstructor | ||||
@Getter | @Getter | ||||
public enum PayChannelType { | public enum PayChannelType { | ||||
WEIXINPAY("微信支付"), | |||||
ALIPAY("支付宝支付"), | |||||
WEIXINPAY("微信支付",TradeType.class), | |||||
ALIPAY("支付宝支付",null), | |||||
; | ; | ||||
private String name; | |||||
private final String name; | |||||
private final Class<? extends Enum<?>> tradeType; | |||||
} | } |
@Column(name = "PRODUCT_AGREE_NO") | @Column(name = "PRODUCT_AGREE_NO") | ||||
private String productAgreeNo;//产品协议编号 | private String productAgreeNo;//产品协议编号 | ||||
@Column(name = "PRODUCT_TYPES") | @Column(name = "PRODUCT_TYPES") | ||||
private Integer productTypes;//产品类型 | |||||
private Integer productTypes;//产品类型 0:自营产品、1:非自营产品 | |||||
@Column(name = "PROMOTION_MODES") | @Column(name = "PROMOTION_MODES") | ||||
private Integer promotionModes;//推广模式(1--线上, 2---线下,3:线上和线下) | private Integer promotionModes;//推广模式(1--线上, 2---线下,3:线上和线下) | ||||
@Column(name = "EQUITY_ID") | @Column(name = "EQUITY_ID") | ||||
@Column(name = "RETURN_URL") | @Column(name = "RETURN_URL") | ||||
private String returnUrl;// 消息通知地址,渠道订单使用 | private String returnUrl;// 消息通知地址,渠道订单使用 | ||||
@Column(name = "PLATFORM_SOURCE") | @Column(name = "PLATFORM_SOURCE") | ||||
private String platformSource;// 电商平台 | |||||
private Integer platformSource;// 电商平台 | |||||
@Column(name = "WX_OPEN_ID") | @Column(name = "WX_OPEN_ID") | ||||
private String wxOpenedId;//渠道支付成功后保存微信openid | private String wxOpenedId;//渠道支付成功后保存微信openid | ||||
@Column(name = "H5_RETURN_QDURL") | @Column(name = "H5_RETURN_QDURL") |
private String spOpenid;// 用户服务商标识 +否 | private String spOpenid;// 用户服务商标识 +否 | ||||
private String subOpenid;//用户子商户标识 +否 | private String subOpenid;//用户子商户标识 +否 | ||||
public String getSuccessTime() { | |||||
if (successTime != null) { | |||||
return successTime.split("\\+")[0]; | |||||
}else return null; | |||||
} | |||||
} | } |
import cn.com.taiji.core.model.comm.protocol.AbstractSignTypeRequest; | import cn.com.taiji.core.model.comm.protocol.AbstractSignTypeRequest; | ||||
import cn.com.taiji.core.model.comm.protocol.constraint.EnumInteger; | import cn.com.taiji.core.model.comm.protocol.constraint.EnumInteger; | ||||
import cn.com.taiji.core.model.comm.protocol.constraint.EnumString; | import cn.com.taiji.core.model.comm.protocol.constraint.EnumString; | ||||
import cn.com.taiji.core.model.comm.protocol.constraint.IntegerConstant; | |||||
import cn.com.taiji.core.model.comm.protocol.constraint.StringConstant; | import cn.com.taiji.core.model.comm.protocol.constraint.StringConstant; | ||||
import cn.com.taiji.core.model.comm.protocol.valid.ErrorMsgBuilder; | import cn.com.taiji.core.model.comm.protocol.valid.ErrorMsgBuilder; | ||||
import lombok.Getter; | import lombok.Getter; | ||||
@NotBlank | @NotBlank | ||||
private String channelId;// 网点编号 | private String channelId;// 网点编号 | ||||
@NotNull | @NotNull | ||||
@StringConstant(values = "1,2") | |||||
@IntegerConstant(values = "1,2") | |||||
private Integer issueType;// 1:线上 2:线下 | private Integer issueType;// 1:线上 2:线下 | ||||
@NotNull | @NotNull | ||||
@EnumString(enumClazz = SourceType.class) | @EnumString(enumClazz = SourceType.class) | ||||
private String sourceType; | private String sourceType; | ||||
@StringConstant(values = "1,2,3,4,5") | |||||
private String platSource;//1-渠道APP 2-抖音 3-淘宝 4-京东 5-拼多多 | |||||
@IntegerConstant(values = "1,2,3,4,5") | |||||
private Integer platSource;//1-渠道APP 2-抖音 3-淘宝 4-京东 5-拼多多 | |||||
private String openId; | private String openId; | ||||
private String staffNum;// 业务员编号 | private String staffNum;// 业务员编号 | ||||
@NotBlank | @NotBlank | ||||
@EnumInteger(enumClazz = PlateColorType.class) | @EnumInteger(enumClazz = PlateColorType.class) | ||||
private Integer vehiclePlateColor;// 车牌颜色 | private Integer vehiclePlateColor;// 车牌颜色 | ||||
@NotNull | @NotNull | ||||
@StringConstant(values = "1,2") | |||||
@IntegerConstant(values = "1,2") | |||||
private Integer vanType;// // 客货类型,原来的type字段1-客车 2-货车 | private Integer vanType;// // 客货类型,原来的type字段1-客车 2-货车 | ||||
private Boolean whetherToMail = false;// 是否需要邮寄 | private Boolean whetherToMail = false;// 是否需要邮寄 | ||||
@NotNull | @NotNull |
if (product == null || promotion == null) { | if (product == null || promotion == null) { | ||||
throw newBusinessException("当前选择的产品不存在"); | throw newBusinessException("当前选择的产品不存在"); | ||||
} | } | ||||
String vehicleRegion = request.getVehiclePlate().substring(0, 2); | |||||
String vehicleRegion = request.getVehiclePlate().substring(0, 1); | |||||
throwBisExceptionOn(hasText(product.getVehiclePalce()) && !product.getVehiclePalce().contains(vehicleRegion), "超出当前产品的车籍范围"); | throwBisExceptionOn(hasText(product.getVehiclePalce()) && !product.getVehiclePalce().contains(vehicleRegion), "超出当前产品的车籍范围"); | ||||
throwBisExceptionOn(!EnableStatus.ENABLE.equals(product.getStatus()) || !EnableStatus.ENABLE.equals(promotion.getStatus()), "当前选择的产品未上架"); | throwBisExceptionOn(!EnableStatus.ENABLE.equals(product.getStatus()) || !EnableStatus.ENABLE.equals(promotion.getStatus()), "当前选择的产品未上架"); | ||||
throwBisExceptionOn(!product.getVanType().contains(request.getVanType().toString()), "当前选择的产品与车辆类型不符"); | throwBisExceptionOn(!product.getVanType().contains(request.getVanType().toString()), "当前选择的产品与车辆类型不符"); | ||||
orderPays.add(orderPay); | orderPays.add(orderPay); | ||||
} | } | ||||
if (isEmpty(orderPays)) | if (isEmpty(orderPays)) | ||||
orderPayRepo.saveAll(orderPays); | |||||
orderPayRepo.persistAll(orderPays); | |||||
} | } | ||||
private void checkVehiclePlate(String vehiclePlate, Integer vehiclePlateColor) throws ServiceHandleException { | private void checkVehiclePlate(String vehiclePlate, Integer vehiclePlateColor) throws ServiceHandleException { | ||||
} else {//其他包括渠道线上 | } else {//其他包括渠道线上 | ||||
order.setUserId(request.getOpenId()); | order.setUserId(request.getOpenId()); | ||||
} | } | ||||
order.setPlatformSource(request.getPlatSource()); | |||||
order.setNeedPay(product.getNeedPay()); | |||||
order.setProductId(request.getProductId()); | order.setProductId(request.getProductId()); | ||||
order.setProductName(product.getProductName()); | order.setProductName(product.getProductName()); | ||||
order.setProductTypes(product.getProductType()); | order.setProductTypes(product.getProductType()); |