From cff0c053baeb229a6c7a7794c061c179111e0b7f Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 31 八月 2023 10:46:12 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/zycrm' into zycrm

---
 src/main/java/com/zy/crm/manager/entity/BusinessTrip.java |  673 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 673 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/zy/crm/manager/entity/BusinessTrip.java b/src/main/java/com/zy/crm/manager/entity/BusinessTrip.java
new file mode 100644
index 0000000..5ff25c8
--- /dev/null
+++ b/src/main/java/com/zy/crm/manager/entity/BusinessTrip.java
@@ -0,0 +1,673 @@
+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")
+public class BusinessTrip 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;
+
+    /**
+     * 鍚岃浜篒D
+     */
+    @ApiModelProperty(value= "鍚岃浜篒D")
+    @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;
+
+    /**
+     * 鍒涘缓鏃堕棿
+     */
+    @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: 姝e父  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;
+
+    public BusinessTrip() {}
+
+    public BusinessTrip(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) {
+        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;
+    }
+
+//    BusinessTrip businessTrip = new BusinessTrip(
+//            null,    // 鍑哄樊浜嬬敱[闈炵┖]
+//            null,    // 浜ら�氬伐鍏穂闈炵┖]
+//            null,    // 鍗曠▼寰�杩擺闈炵┖]
+//            null,    // 鍑哄彂鐪�
+//            null,    // 鍑哄彂甯�
+//            null,    // 鍑哄彂鍘�
+//            null,    // 鍑哄彂闀�
+//            null,    // 鍑哄彂鍦癧闈炵┖]
+//            null,    // 鐩殑鐪�
+//            null,    // 鐩殑甯�
+//            null,    // 鐩殑鍘�
+//            null,    // 鐩殑闀�
+//            null,    // 鐩殑鍦癧闈炵┖]
+//            null,    // 鍑哄彂鏃ユ湡[闈炵┖]
+//            null,    // 缁撴潫鏃ユ湡[闈炵┖]
+//            null,    // 鍑哄樊鏃堕暱
+//            null,    // 鍑哄樊澶╂暟
+//            null,    // 鍑哄樊澶囨敞
+//            null,    // 鍑鸿浜恒�佸悓琛屼汉[闈炵┖]
+//            null,    // 鍚岃浜篒D
+//            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$();
+    }
+
+}

--
Gitblit v1.9.1