From 34f99d106551b51bf2af3bbd40c64624a3af25eb Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期六, 09 九月 2023 09:43:57 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/crm/manager/entity/BusinessTrip.java |   68 +++++++++++++++++++++++++++++++---
 1 files changed, 62 insertions(+), 6 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
index 6ff5444..5ff25c8 100644
--- a/src/main/java/com/zy/crm/manager/entity/BusinessTrip.java
+++ b/src/main/java/com/zy/crm/manager/entity/BusinessTrip.java
@@ -6,9 +6,14 @@
 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;
@@ -127,6 +132,7 @@
     @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;
 
     /**
@@ -135,6 +141,7 @@
     @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;
 
     /**
@@ -142,7 +149,7 @@
      */
     @ApiModelProperty(value= "鍑哄樊鏃堕暱")
     @TableField("business_duration")
-    private Long businessDuration;
+    private Double businessDuration;
 
     /**
      * 鍑哄樊澶╂暟
@@ -280,7 +287,7 @@
 
     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, Long 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) {
+    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;
@@ -382,6 +389,47 @@
         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){
@@ -432,9 +480,9 @@
         if (null == this.businessStartTimeDay){ return null; }
         switch (this.businessStartTimeDay){
             case 1:
-                return TimeCalculatorUtils.getYestMonthDay(this.businessStartTime)+ "涓婂崍";
+                return TimeCalculatorUtils.timeYestMonthDay(this.businessStartTime)+ "涓婂崍";
             case 2:
-                return TimeCalculatorUtils.getYestMonthDay(this.businessStartTime)+ "涓嬪崍";
+                return TimeCalculatorUtils.timeYestMonthDay(this.businessStartTime)+ "涓嬪崍";
             default:
 //                return String.valueOf(this.status);
                 return "鏈煡";
@@ -445,16 +493,24 @@
         if (null == this.businessEndTimeDay){ return null; }
         switch (this.businessTransportation){
             case 1:
-                return TimeCalculatorUtils.getYestMonthDay(this.businessEndTime)+ "涓婂崍";
+                return TimeCalculatorUtils.timeYestMonthDay(this.businessEndTime)+ "涓婂崍";
             case 2:
-                return TimeCalculatorUtils.getYestMonthDay(this.businessEndTime)+ "涓嬪崍";
+                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();

--
Gitblit v1.9.1