From 4a93670e28238f0e5f19b1f0a5f20080cea55414 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期一, 28 八月 2023 16:32:25 +0800
Subject: [PATCH] #出差审批完善

---
 src/main/java/com/zy/crm/manager/entity/BusinessTrip.java |   65 +++++++++++++++++++++++++++++---
 1 files changed, 59 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..3e7f25a 100644
--- a/src/main/java/com/zy/crm/manager/entity/BusinessTrip.java
+++ b/src/main/java/com/zy/crm/manager/entity/BusinessTrip.java
@@ -7,8 +7,12 @@
 import com.core.common.Cools;
 import com.core.common.SpringUtils;
 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;
@@ -142,7 +146,7 @@
      */
     @ApiModelProperty(value= "鍑哄樊鏃堕暱")
     @TableField("business_duration")
-    private Long businessDuration;
+    private Double businessDuration;
 
     /**
      * 鍑哄樊澶╂暟
@@ -280,7 +284,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 +386,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 +477,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 +490,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