package cn.stylefeng.guns.modular.business.dto;
|
|
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.json.JSONUtil;
|
import cn.stylefeng.guns.modular.business.dto.request.CustomerUpdateRequest;
|
import cn.stylefeng.guns.modular.business.entity.CounsellingOrder;
|
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModelProperty;
|
import lombok.Data;
|
|
import java.math.BigDecimal;
|
import java.util.Date;
|
|
@Data
|
@ApiModel("咨询订单-响应参数")
|
public class CounsellingOrderResponseDTO extends CounsellingOrder {
|
|
@ApiModelProperty("咨询师名称")
|
private String counsellingName;
|
|
@ApiModelProperty("用户姓名")
|
private String userName;
|
|
@ApiModelProperty("陪护教练名称")
|
private String companionUserName;
|
|
@ApiModelProperty("咨询顾问名称")
|
private String consultantUserName;
|
|
@ApiModelProperty("展示状态用于后台系统展示:0待支付,1已完成,3服务中,9取消,10退款,11-已支付")
|
private Integer showState;
|
|
@ApiModelProperty("现状用户信息")
|
private CustomerUpdateRequest customerUpdateRequest;
|
|
@ApiModelProperty(value = "咨询师类型 1-首席咨询师,2-明星咨询师")
|
@ChineseDescription("咨询师类型 1-首席咨询师,2-明星咨询师")
|
private Integer counsellingType;
|
|
public CustomerUpdateRequest getCustomerUpdateRequest() {
|
if (StrUtil.isNotBlank(this.getUserInfoJson())){
|
return JSONUtil.toBean(this.getUserInfoJson(), CustomerUpdateRequest.class);
|
}
|
return customerUpdateRequest;
|
}
|
|
public Integer getShowState() {
|
Integer statusFlag = getStatusFlag();
|
//判断订单状态
|
if (statusFlag != null && getOrderType() != null){
|
if (statusFlag.intValue() == 0){
|
return 0;
|
} else if (statusFlag.intValue() == 1) {
|
Date nowDate = new Date();
|
//判断订单类型
|
if (getOrderType().intValue() ==1 ){
|
if (getFirstAppointmentDate() == null){
|
return 3;
|
}else{
|
String Date = DateUtil.formatDate(getFirstAppointmentDate()) + " " + getFirstAppointmentTimes().split("-")[1]+":00";
|
if (nowDate.getTime() > DateUtil.parseDateTime(Date).getTime()){
|
return 1;
|
}else{
|
return 11;
|
}
|
|
}
|
} else {
|
if (nowDate.getTime() > getEffectiveEndTime().getTime()){
|
return 1;
|
}else{
|
return 3;
|
}
|
}
|
|
} else if (statusFlag.intValue() == 2) {
|
//订单已完成
|
return 1;
|
}else {
|
return getStatusFlag();
|
}
|
}
|
return showState;
|
}
|
|
@ApiModelProperty("最近预约时间")
|
private String lastTime;
|
|
@ApiModelProperty("咨询师封面图url")
|
private String coverImageUrl;
|
|
@ApiModelProperty("首次咨询预约状态 1-未预约首次咨询,2-已预约首次咨询,等待咨询,3-已完成首次预约咨询")
|
private Integer isFirstAppointment;
|
|
@ApiModelProperty("上架状态 1-上架,2-下架")
|
private Integer listingStatus;
|
}
|