package com.zy.crm.manager.entity;
|
|
import com.baomidou.mybatisplus.annotations.TableField;
|
import com.baomidou.mybatisplus.annotations.TableId;
|
import com.baomidou.mybatisplus.annotations.TableName;
|
import com.baomidou.mybatisplus.enums.IdType;
|
import com.core.common.Cools;
|
import com.core.common.SpringUtils;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.zy.crm.manager.utils.TimeCalculatorUtils;
|
import com.zy.crm.system.entity.Dept;
|
import com.zy.crm.system.entity.Dic;
|
import com.zy.crm.system.entity.User;
|
import com.zy.crm.system.service.DeptService;
|
import com.zy.crm.system.service.DicService;
|
import com.zy.crm.system.service.UserService;
|
import io.swagger.annotations.ApiModelProperty;
|
import lombok.Data;
|
import org.springframework.format.annotation.DateTimeFormat;
|
|
import java.io.Serializable;
|
import java.text.SimpleDateFormat;
|
import java.util.Date;
|
|
@Data
|
@TableName("man_business_trip_other")
|
public class BusinessTripOther implements Serializable {
|
|
private static final long serialVersionUID = 1L;
|
|
/**
|
* ID
|
*/
|
@ApiModelProperty(value= "ID")
|
@TableId(value = "id", type = IdType.AUTO)
|
private Long id;
|
|
/**
|
* 出差事由
|
*/
|
@ApiModelProperty(value= "出差事由")
|
@TableField("business_trip_reasons")
|
private String businessTripReasons;
|
|
/**
|
* 交通工具
|
*/
|
@ApiModelProperty(value= "交通工具")
|
@TableField("business_transportation")
|
private Integer businessTransportation;
|
|
/**
|
* 单程往返
|
*/
|
@ApiModelProperty(value= "单程往返")
|
@TableField("business_return")
|
private Integer businessReturn;
|
|
/**
|
* 出发省
|
*/
|
@ApiModelProperty(value= "出发省")
|
@TableField("business_start_province")
|
private String businessStartProvince;
|
|
/**
|
* 出发市
|
*/
|
@ApiModelProperty(value= "出发市")
|
@TableField("business_start_city")
|
private String businessStartCity;
|
|
/**
|
* 出发县
|
*/
|
@ApiModelProperty(value= "出发县")
|
@TableField("business_start_district")
|
private String businessStartDistrict;
|
|
/**
|
* 出发镇
|
*/
|
@ApiModelProperty(value= "出发镇")
|
@TableField("business_start_town")
|
private String businessStartTown;
|
|
/**
|
* 出发地
|
*/
|
@ApiModelProperty(value= "出发地")
|
@TableField("business_start_addr")
|
private String businessStartAddr;
|
|
/**
|
* 目的省
|
*/
|
@ApiModelProperty(value= "目的省")
|
@TableField("business_end_province")
|
private String businessEndProvince;
|
|
/**
|
* 目的市
|
*/
|
@ApiModelProperty(value= "目的市")
|
@TableField("business_end_city")
|
private String businessEndCity;
|
|
/**
|
* 目的县
|
*/
|
@ApiModelProperty(value= "目的县")
|
@TableField("business_end_district")
|
private String businessEndDistrict;
|
|
/**
|
* 目的镇
|
*/
|
@ApiModelProperty(value= "目的镇")
|
@TableField("business_end_town")
|
private String businessEndTown;
|
|
/**
|
* 目的地
|
*/
|
@ApiModelProperty(value= "目的地")
|
@TableField("business_end_addr")
|
private String businessEndAddr;
|
|
/**
|
* 出发日期
|
*/
|
@ApiModelProperty(value= "出发日期")
|
@TableField("business_start_time")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
private Date businessStartTime;
|
|
/**
|
* 结束日期
|
*/
|
@ApiModelProperty(value= "结束日期")
|
@TableField("business_end_time")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
private Date businessEndTime;
|
|
/**
|
* 出差时长
|
*/
|
@ApiModelProperty(value= "出差时长")
|
@TableField("business_duration")
|
private Double businessDuration;
|
|
/**
|
* 出差天数
|
*/
|
@ApiModelProperty(value= "出差天数")
|
@TableField("business_trip_days")
|
private Integer businessTripDays;
|
|
/**
|
* 出差备注
|
*/
|
@ApiModelProperty(value= "出差备注")
|
@TableField("business_notes")
|
private String businessNotes;
|
|
/**
|
* 出行人、同行人
|
*/
|
@ApiModelProperty(value= "出行人、同行人")
|
@TableField("business_peers")
|
private String businessPeers;
|
|
/**
|
* 同行人ID
|
*/
|
@ApiModelProperty(value= "同行人ID")
|
@TableField("business_peers_id")
|
private Long businessPeersId;
|
|
/**
|
* 自驾私家车车牌号
|
*/
|
@ApiModelProperty(value= "自驾私家车车牌号")
|
@TableField("car_number")
|
private String carNumber;
|
|
/**
|
* 自驾私家车行程明细及公里数
|
*/
|
@ApiModelProperty(value= "自驾私家车行程明细及公里数")
|
private String kilometers;
|
|
/**
|
* 创建人
|
*/
|
@ApiModelProperty(value= "创建人")
|
@TableField("user_id")
|
private Long userId;
|
|
/**
|
* 所属部门
|
*/
|
@ApiModelProperty(value= "所属部门")
|
@TableField("dept_id")
|
private Long deptId;
|
|
/**
|
* hostId
|
*/
|
@ApiModelProperty(value= "hostId")
|
@TableField("host_id")
|
private Long hostId;
|
|
/**
|
* 跟踪项目ID
|
*/
|
@ApiModelProperty(value= "跟踪项目ID")
|
@TableField("order_id")
|
private Long orderId;
|
|
/**
|
* 创建时间
|
*/
|
@ApiModelProperty(value= "创建时间")
|
@TableField("create_time")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
private Date createTime;
|
|
/**
|
* 更新时间
|
*/
|
@ApiModelProperty(value= "更新时间")
|
@TableField("update_time")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
private Date updateTime;
|
|
/**
|
* 更新人员ID
|
*/
|
@ApiModelProperty(value= "更新人员ID")
|
@TableField("update_id")
|
private Long updateId;
|
|
@ApiModelProperty(value= "")
|
private String form;
|
|
/**
|
* 进度
|
*/
|
@ApiModelProperty(value= "进度")
|
private Integer settle;
|
|
/**
|
* 流程进度
|
*/
|
@ApiModelProperty(value= "流程进度")
|
@TableField("settle_msg")
|
private String settleMsg;
|
|
/**
|
* 状态 1: 正常 0: 禁用
|
*/
|
@ApiModelProperty(value= "状态 1: 已完成 0: 未完成 ")
|
private Integer status;
|
|
/**
|
* 类型
|
*/
|
@ApiModelProperty(value= "类型")
|
@TableField("business_trip_type")
|
private Integer businessTripType;
|
|
/**
|
* 类型
|
*/
|
@ApiModelProperty(value= "开始时辰")
|
@TableField("business_start_time_day")
|
private Integer businessStartTimeDay;
|
|
/**
|
* 类型
|
*/
|
@ApiModelProperty(value= "结束时辰")
|
@TableField("business_end_time_day")
|
private Integer businessEndTimeDay;
|
|
@TableField(exist = false)
|
private String pcdStart;
|
|
@TableField(exist = false)
|
private String pcdEnd;
|
|
/**
|
* 出差时长
|
*/
|
@ApiModelProperty(value= "金额")
|
@TableField("amount_of_money")
|
private Double amountOfMoney;
|
|
public BusinessTripOther() {}
|
|
public BusinessTripOther(String businessTripReasons, Integer businessTransportation, Integer businessReturn, String businessStartProvince, String businessStartCity, String businessStartDistrict, String businessStartTown, String businessStartAddr, String businessEndProvince, String businessEndCity, String businessEndDistrict, String businessEndTown, String businessEndAddr, Date businessStartTime, Date businessEndTime, Double businessDuration, Integer businessTripDays, String businessNotes, String businessPeers, Long businessPeersId, String carNumber, String kilometers, Long userId, Long deptId, Long hostId, Date createTime, Date updateTime, Long updateId, String form, Integer settle, String settleMsg, Integer status, Integer businessTripType, Integer businessStartTimeDay, Integer businessEndTimeDay,Double amountOfMoney) {
|
this.businessTripReasons = businessTripReasons;
|
this.businessTransportation = businessTransportation;
|
this.businessReturn = businessReturn;
|
this.businessStartProvince = businessStartProvince;
|
this.businessStartCity = businessStartCity;
|
this.businessStartDistrict = businessStartDistrict;
|
this.businessStartTown = businessStartTown;
|
this.businessStartAddr = businessStartAddr;
|
this.businessEndProvince = businessEndProvince;
|
this.businessEndCity = businessEndCity;
|
this.businessEndDistrict = businessEndDistrict;
|
this.businessEndTown = businessEndTown;
|
this.businessEndAddr = businessEndAddr;
|
this.businessStartTime = businessStartTime;
|
this.businessEndTime = businessEndTime;
|
this.businessDuration = businessDuration;
|
this.businessTripDays = businessTripDays;
|
this.businessNotes = businessNotes;
|
this.businessPeers = businessPeers;
|
this.businessPeersId = businessPeersId;
|
this.carNumber = carNumber;
|
this.kilometers = kilometers;
|
this.userId = userId;
|
this.deptId = deptId;
|
this.hostId = hostId;
|
this.createTime = createTime;
|
this.updateTime = updateTime;
|
this.updateId = updateId;
|
this.form = form;
|
this.settle = settle;
|
this.settleMsg = settleMsg;
|
this.status = status;
|
this.businessTripType = businessTripType;
|
this.businessStartTimeDay = businessStartTimeDay;
|
this.businessEndTimeDay = businessEndTimeDay;
|
this.amountOfMoney = amountOfMoney;
|
}
|
|
// BusinessTrip businessTrip = new BusinessTrip(
|
// null, // 出差事由[非空]
|
// null, // 交通工具[非空]
|
// null, // 单程往返[非空]
|
// null, // 出发省
|
// null, // 出发市
|
// null, // 出发县
|
// null, // 出发镇
|
// null, // 出发地[非空]
|
// null, // 目的省
|
// null, // 目的市
|
// null, // 目的县
|
// null, // 目的镇
|
// null, // 目的地[非空]
|
// null, // 出发日期[非空]
|
// null, // 结束日期[非空]
|
// null, // 出差时长
|
// null, // 出差天数
|
// null, // 出差备注
|
// null, // 出行人、同行人[非空]
|
// null, // 同行人ID
|
// null, // 自驾私家车车牌号[非空]
|
// null, // 自驾私家车行程明细及公里数[非空]
|
// null, // 创建人
|
// null, // 所属部门
|
// null, // hostId
|
// null, // 创建时间
|
// null, // 更新时间
|
// null, // 更新人员ID
|
// null, //
|
// null, // 进度
|
// null, // 流程进度
|
// null, // 状态
|
// null // 类型
|
// );
|
|
public String getBusinessStartTime$(){
|
if (Cools.isEmpty(this.businessStartTime)){
|
return "";
|
}
|
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.businessStartTime);
|
}
|
|
public String getBusinessEndTime$(){
|
if (Cools.isEmpty(this.businessEndTime)){
|
return "";
|
}
|
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.businessEndTime);
|
}
|
|
public String getCreateTime$(){
|
if (Cools.isEmpty(this.createTime)){
|
return "";
|
}
|
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
|
}
|
|
public String getUpdateTime$(){
|
if (Cools.isEmpty(this.updateTime)){
|
return "";
|
}
|
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
|
}
|
|
public String getUpdateId$(){
|
UserService service = SpringUtils.getBean(UserService.class);
|
User user = service.selectById(this.updateId);
|
if (!Cools.isEmpty(user)){
|
return String.valueOf(user.getNickname());
|
}
|
return null;
|
}
|
|
public String getUserId$(){
|
UserService service = SpringUtils.getBean(UserService.class);
|
User user = service.selectById(this.userId);
|
if (!Cools.isEmpty(user)){
|
return String.valueOf(user.getNickname());
|
}
|
return null;
|
}
|
|
public String getDeptId$(){
|
DeptService service = SpringUtils.getBean(DeptService.class);
|
Dept dept = service.selectById(this.deptId);
|
if (!Cools.isEmpty(dept)){
|
return String.valueOf(dept.getName());
|
}
|
return null;
|
}
|
|
public String getSettle$(){
|
if (null == this.settle){ return null; }
|
switch (this.settle){
|
case 1:
|
return "等待批准";
|
case 2:
|
return "申请通过";
|
default:
|
return String.valueOf(this.settle);
|
}
|
}
|
|
|
|
public String getStatus$(){
|
if (null == this.status){ return null; }
|
switch (this.status){
|
case 1:
|
return "已完成";
|
case 0:
|
return "未完成";
|
default:
|
return String.valueOf(this.status);
|
}
|
}
|
|
public String getBusinessTransportation$(){
|
if (null == this.businessTransportation){ return null; }
|
switch (this.businessTransportation){
|
case 1:
|
return "飞机";
|
case 2:
|
return "高铁";
|
case 3:
|
return "火车";
|
case 4:
|
return "汽车";
|
case 5:
|
return "摩托";
|
case 6:
|
return "电车";
|
default:
|
// return String.valueOf(this.status);
|
return "其它";
|
}
|
}
|
|
public String getBusinessReturn$(){
|
if (null == this.businessTransportation){ return null; }
|
switch (this.businessTransportation){
|
case 1:
|
return "单程";
|
case 2:
|
return "往返";
|
default:
|
// return String.valueOf(this.status);
|
return "其它";
|
}
|
}
|
|
public String getBusinessStartTimeDay$(){
|
if (null == this.businessStartTimeDay){ return null; }
|
switch (this.businessStartTimeDay){
|
case 1:
|
return TimeCalculatorUtils.timeYestMonthDay(this.businessStartTime)+ "上午";
|
case 2:
|
return TimeCalculatorUtils.timeYestMonthDay(this.businessStartTime)+ "下午";
|
default:
|
// return String.valueOf(this.status);
|
return "未知";
|
}
|
}
|
|
public String getBusinessEndTimeDay$(){
|
if (null == this.businessEndTimeDay){ return null; }
|
switch (this.businessTransportation){
|
case 1:
|
return TimeCalculatorUtils.timeYestMonthDay(this.businessEndTime)+ "上午";
|
case 2:
|
return TimeCalculatorUtils.timeYestMonthDay(this.businessEndTime)+ "下午";
|
default:
|
// return String.valueOf(this.status);
|
return "未知";
|
}
|
}
|
|
public String getBusinessDuration$(){
|
if (null == this.businessDuration) return null;
|
return this.businessDuration+"\t天";
|
}
|
|
public String getBusinessTripDays$(){
|
if (null == this.businessTripDays) return null;
|
return this.businessTripDays+"\t天";
|
}
|
|
public String getPcdStart() {
|
StringBuilder sb = new StringBuilder();
|
if (!Cools.isEmpty(businessStartProvince)) {
|
sb.append(businessStartProvince).append(",");
|
}
|
if (!Cools.isEmpty(businessStartCity)) {
|
sb.append(businessStartCity).append(",");
|
}
|
if (!Cools.isEmpty(businessStartDistrict)) {
|
sb.append(businessStartDistrict).append(",");
|
}
|
String s = sb.toString();
|
if (s.endsWith(",")) {
|
s = s.substring(0, s.length() - 1);
|
}
|
return s;
|
}
|
|
public String getPcdStart$() {
|
StringBuilder sb = new StringBuilder();
|
DicService service = SpringUtils.getBean(DicService.class);
|
if (!Cools.isEmpty(businessStartProvince)) {
|
Dic provinceDic = service.selectById(businessStartProvince);
|
if (!Cools.isEmpty(provinceDic)) {
|
sb.append(provinceDic.getName()).append(",");
|
}
|
}
|
if (!Cools.isEmpty(businessStartCity)) {
|
Dic cityDic = service.selectById(businessStartCity);
|
if (!Cools.isEmpty(cityDic)) {
|
sb.append(cityDic.getName()).append(",");
|
}
|
}
|
if (!Cools.isEmpty(businessStartDistrict)) {
|
Dic districtDic = service.selectById(businessStartDistrict);
|
if (!Cools.isEmpty(districtDic)) {
|
sb.append(districtDic.getName()).append(",");
|
}
|
}
|
String s = sb.toString();
|
if (s.endsWith(",")) {
|
s = s.substring(0, s.length() - 1);
|
}
|
return s;
|
}
|
|
public void setPcdStart(String pcdStart) {
|
this.pcdStart = pcdStart;
|
if (!Cools.isEmpty(pcdStart)) {
|
String[] split = this.pcdStart.split(",");
|
for (int i = 0;i< split.length; i++) {
|
switch (i) {
|
case 0:
|
this.businessStartProvince = split[0];
|
break;
|
case 1:
|
this.businessStartCity = split[1];
|
break;
|
case 2:
|
this.businessStartDistrict = split[2];
|
break;
|
default:
|
break;
|
}
|
}
|
} else {
|
this.businessStartProvince = "";
|
this.businessStartCity = "";
|
this.businessStartDistrict = "";
|
}
|
}
|
|
public String getPcdEnd() {
|
StringBuilder sb = new StringBuilder();
|
if (!Cools.isEmpty(businessEndProvince)) {
|
sb.append(businessEndProvince).append(",");
|
}
|
if (!Cools.isEmpty(businessEndCity)) {
|
sb.append(businessEndCity).append(",");
|
}
|
if (!Cools.isEmpty(businessEndDistrict)) {
|
sb.append(businessEndDistrict).append(",");
|
}
|
String s = sb.toString();
|
if (s.endsWith(",")) {
|
s = s.substring(0, s.length() - 1);
|
}
|
return s;
|
}
|
|
public String getPcdEnd$() {
|
StringBuilder sb = new StringBuilder();
|
DicService service = SpringUtils.getBean(DicService.class);
|
if (!Cools.isEmpty(businessEndProvince)) {
|
Dic provinceDic = service.selectById(businessEndProvince);
|
if (!Cools.isEmpty(provinceDic)) {
|
sb.append(provinceDic.getName()).append(",");
|
}
|
}
|
if (!Cools.isEmpty(businessEndCity)) {
|
Dic cityDic = service.selectById(businessEndCity);
|
if (!Cools.isEmpty(cityDic)) {
|
sb.append(cityDic.getName()).append(",");
|
}
|
}
|
if (!Cools.isEmpty(businessEndDistrict)) {
|
Dic districtDic = service.selectById(businessEndDistrict);
|
if (!Cools.isEmpty(districtDic)) {
|
sb.append(districtDic.getName()).append(",");
|
}
|
}
|
String s = sb.toString();
|
if (s.endsWith(",")) {
|
s = s.substring(0, s.length() - 1);
|
}
|
return s;
|
}
|
|
public void setPcdEnd(String pcdEnd) {
|
this.pcdEnd = pcdEnd;
|
if (!Cools.isEmpty(pcdEnd)) {
|
String[] split = this.pcdEnd.split(",");
|
for (int i = 0;i< split.length; i++) {
|
switch (i) {
|
case 0:
|
this.businessEndProvince = split[0];
|
break;
|
case 1:
|
this.businessEndCity = split[1];
|
break;
|
case 2:
|
this.businessEndDistrict = split[2];
|
break;
|
default:
|
break;
|
}
|
}
|
} else {
|
this.businessEndProvince = "";
|
this.businessEndCity = "";
|
this.businessEndDistrict = "";
|
}
|
}
|
|
public String getBusinessStartAddr$(){
|
if (!Cools.isEmpty(businessStartAddr)){
|
return getPcdStart$()+"--"+businessStartAddr;
|
}
|
return getPcdStart$();
|
}
|
|
public String getBusinessEndAddr$(){
|
if (!Cools.isEmpty(businessEndAddr)){
|
return getPcdEnd$()+"--"+businessEndAddr;
|
}
|
return getPcdStart$();
|
}
|
|
public String getAmountOfMoney$(){
|
if (null == this.amountOfMoney) return "0\t元";
|
return this.amountOfMoney+"\t元";
|
}
|
|
}
|