中扬CRM客户关系管理系统
LSH
2023-10-07 c6e9227208dc46f2f46f046fea0b21bea398a16c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
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元";
    }
 
}