| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- package com.ydtech.modules.equity.model.request;
- import com.alibaba.fastjson.JSON;
- import com.fasterxml.jackson.annotation.JsonProperty;
- import com.ydtech.modules.admin.model.SysUser;
- import com.ydtech.modules.equity.model.InsAreaCompanyEquity;
- import com.ydtech.modules.equity.model.response.LocalEquityPackageAssociation;
- import com.ydtech.modules.equity.model.response.LocalEquityPackagePage;
- import com.ydtech.utils.StringUtils;
- import io.swagger.annotations.ApiModelProperty;
- import lombok.Data;
- import org.springframework.beans.BeanUtils;
- import java.math.BigDecimal;
- import java.util.ArrayList;
- import java.util.Date;
- import java.util.List;
- /**
- * @version
- * @author: hxl
- * @Date: 2025/4/30 14:41
- * @Description: 三方下单实体
- */
- @Data
- public class ThreeUserOrderVo extends BaseRequest {
- @ApiModelProperty(value = "子订单id")
- @JsonProperty("orderId")
- private String orderId;
- @ApiModelProperty(value = "代客下单用户id")
- @JsonProperty("orderUserId")
- private String orderUserId;
- @ApiModelProperty(value = "代客下单用户名称")
- @JsonProperty("orderUserName")
- private String orderUserName;
- @ApiModelProperty(value = "代客下单类型 1.渠道 2.代理人 3.电销")
- @JsonProperty("orderUserType")
- private Integer orderUserType;
- @ApiModelProperty(value = "代客下单手机号")
- @JsonProperty("orderUserPhone")
- private String orderUserPhone;
- @ApiModelProperty(value = "代客下单身份证号")
- @JsonProperty("orderUserIdcard")
- private String orderUserIdcard;
- @ApiModelProperty(value = "三方用户id")
- @JsonProperty("threeUserId")
- private String threeUserId;
- @ApiModelProperty(value = "投保人姓名")
- @JsonProperty("applyName")
- private String applyName;
- @ApiModelProperty(value = "投保人身份证号")
- @JsonProperty("applyIdcard")
- private String applyIdcard;
- @ApiModelProperty(value = "投保人电话")
- @JsonProperty("applyIdcard")
- private String applyPhone;
- @ApiModelProperty(value = "被保人姓名")
- @JsonProperty("insureName")
- private String insureName;
- @ApiModelProperty(value = "被保人身份证号")
- @JsonProperty("insureIdcard")
- private String insureIdcard;
- @ApiModelProperty(value = "被保人电话")
- @JsonProperty("insurePhone")
- private String insurePhone;
- @ApiModelProperty(value = "车主姓名")
- @JsonProperty("ownerName")
- private String ownerName;
- @ApiModelProperty(value = "车主身份证号")
- @JsonProperty("ownerIdcard")
- private String ownerIdcard;
- @ApiModelProperty(value = "车主电话")
- @JsonProperty("ownerPhone")
- private String ownerPhone;
- @ApiModelProperty(value = "返佣金额")
- @JsonProperty("orderMoney")
- private BigDecimal orderMoney;
- @ApiModelProperty(value = "剩余金额(抵扣积分)")
- @JsonProperty("surplusMoney")
- private BigDecimal surplusMoney;
- // 新增 字段
- @ApiModelProperty(value = "人员类型(1.代理人 2. 投保人 3.被保人 4.车主)")
- @JsonProperty("type")
- private Integer type;
- @ApiModelProperty(value = "权益卷列表")
- @JsonProperty("rightsInfoVoList")
- private List<ThreeRightsInfoVo> rightsInfoVoList;
- public ThreeUserOrderVo(String companyId, InsAreaCompanyEquity equity, String appkey, SysUser user) {
- this.orderId = companyId;
- this.threeUserId = appkey;
- if(equity.getReceiveType().equals(0)){
- this.applyName = equity.getReceiveName();
- this.applyPhone = equity.getReceivePhone();
- this.applyIdcard = equity.getReceiveIdentify();
- this.type = 2;
- }else if(equity.getReceiveType().equals(1)){
- this.insureName = equity.getReceiveName();
- this.insurePhone = equity.getReceivePhone();
- this.insureIdcard = equity.getReceiveIdentify();
- this.type = 3;
- }else if(equity.getReceiveType().equals(2)){
- this.ownerName = equity.getReceiveName();
- this.ownerPhone = equity.getReceivePhone();
- this.ownerIdcard = equity.getReceiveIdentify();
- this.type = 4;
- }
- this.orderMoney = equity.getOrderMoney();
- this.surplusMoney = equity.getPoint();
- this.rightsInfoVoList = ThreeRightsInfoVo.coverList(equity.getEquityInfo());
- if(StringUtils.isBlank(user.getDeptType())){
- this.orderUserType = 0;
- }else{
- this.orderUserType = Integer.parseInt(user.getDeptType());
- }
- this.orderUserId = user.getId();
- this.orderUserName = user.getName();
- this.orderUserPhone = user.getMobile();
- this.orderUserIdcard = user.getIdentity();
- }
- @Data
- public static class ThreeRightsInfoVo {
- @ApiModelProperty(value = "权益卷Id")
- @JsonProperty("rightsInfoId")
- private String rightsInfoId;
- @ApiModelProperty(value = "权益卷套餐Id")
- @JsonProperty("courseId")
- private String courseId;
- @ApiModelProperty(value = "权益卷个数")
- @JsonProperty("number")
- private Integer number;
- @ApiModelProperty(value = "类型(1.兑换券 2.折扣卷 3.抵现劵)")
- @JsonProperty("type")
- private String type;
- @ApiModelProperty(value = "权益名称")
- @JsonProperty("rightsName")
- private String rightsName;
- @ApiModelProperty(value = "分类")
- @JsonProperty("classify")
- private String classify;
- @ApiModelProperty(value = "折扣值")
- @JsonProperty("rebate")
- private String rebate;
- @ApiModelProperty(value = "抵现金额")
- @JsonProperty("amount")
- private java.math.BigDecimal amount;
- @ApiModelProperty(value = "权益图片")
- @JsonProperty("rightsPicture")
- private String rightsPicture;
- @ApiModelProperty(value = "市场售价")
- @JsonProperty("marketPrice")
- private BigDecimal marketPrice;
- @ApiModelProperty(value = "协议价")
- @JsonProperty("contractRate")
- private BigDecimal contractRate;
- @ApiModelProperty(value = "三方结算价格")
- @JsonProperty("settlePrice")
- private BigDecimal settlePrice;
- @ApiModelProperty(value = "使用有限期类型(1.用户领取后生效2.三方用户赠送时间起3.固定时间段4.长期可用)")
- @JsonProperty("useCondition")
- private String useCondition;
- @ApiModelProperty(value = "天数")
- @JsonProperty("dayNum")
- private Integer dayNum;
- @ApiModelProperty(value = "开始时间")
- @JsonProperty("startTime")
- private Date startTime;
- @ApiModelProperty(value = "结束时间")
- @JsonProperty("endTime")
- private Date endTime;
- public static List<ThreeRightsInfoVo> coverList(String equityInfo) {
- List<ThreeRightsInfoVo> infoVoList = new ArrayList<>();
- LocalEquityPackagePage packagevo = JSON.parseObject(equityInfo, LocalEquityPackagePage.class);
- List<LocalEquityPackageAssociation> localEquityPackageAssociationList = packagevo.getLocalEquityPackageAssociationList();
- for (LocalEquityPackageAssociation localEquityPackageAssociation : localEquityPackageAssociationList) {
- ThreeRightsInfoVo threeRightsInfoVo = new ThreeRightsInfoVo();
- BeanUtils.copyProperties(localEquityPackageAssociation,threeRightsInfoVo);
- threeRightsInfoVo.setRightsInfoId(localEquityPackageAssociation.getRightsId());
- threeRightsInfoVo.setCourseId(localEquityPackageAssociation.getRightsPackageId());
- infoVoList.add(threeRightsInfoVo);
- }
- return infoVoList;
- }
- }
- }
|