#
whycq
2022-09-12 964c095a69cc70115b6c5c185c0682aeb68da5ab
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
package zy.cloud.wms.common.entity;
 
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.core.common.SpringUtils;
import com.core.exception.CoolException;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotations.TableField;
import java.text.SimpleDateFormat;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.annotations.ApiModelProperty;
import java.text.SimpleDateFormat;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
import java.text.SimpleDateFormat;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty;
 
import com.baomidou.mybatisplus.annotations.TableName;
import zy.cloud.wms.manager.entity.Cstmr;
import zy.cloud.wms.manager.entity.ProjectType;
import zy.cloud.wms.manager.service.CstmrService;
import zy.cloud.wms.manager.service.ProjectTypeService;
import zy.cloud.wms.system.entity.User;
import zy.cloud.wms.system.service.UserService;
 
import java.io.Serializable;
@Data
@TableName("man_sale_project")
public class SaleProject implements Serializable {
 
    private static final long serialVersionUID = 1L;
 
    /**
     * 唯一ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value= "唯一ID")
    private Long id;
 
    @ApiModelProperty(value= "")
    @TableField("update_by")
    private Long updateBy;
 
    @ApiModelProperty(value= "")
    @TableField("update_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
 
    @ApiModelProperty(value= "")
    @TableField("create_by")
    private Long createBy;
 
    @ApiModelProperty(value= "")
    @TableField("create_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;
 
    /**
     * 状态,暂未启用
     */
    @ApiModelProperty(value= "状态,暂未启用")
    private Integer status;
 
    /**
     * 业务员
     */
    @ApiModelProperty(value= "业务员")
    private Long saleman;
 
    /**
     * 客户名称
     */
    @ApiModelProperty(value= "客户名称")
    @TableField("cust_id")
    private Long custId;
 
    /**
     * 项目地址
     */
    @ApiModelProperty(value= "项目地址")
    @TableField("project_addr")
    private String projectAddr;
 
    /**
     * 项目类型
     */
    @ApiModelProperty(value= "项目类型")
    @TableField("project_type")
    private Integer projectType;
 
 
    @TableField("warehouse_size")
    private String warehouseSize;
 
    /**
     * 货物尺寸
     */
    @ApiModelProperty(value= "货物尺寸")
    @TableField("goods_size")
    private String goodsSize;
 
    /**
     * 货物重量
     */
    @ApiModelProperty(value= "货物重量")
    @TableField("goods_weight")
    private String goodsWeight;
 
    /**
     * 厂房情况 1: 新建  2: 旧改  
     */
    @ApiModelProperty(value= "厂房情况 1: 新建  2: 旧改  ")
    @TableField("warehouse_status")
    private Integer warehouseStatus;
 
    /**
     * 规划方案
     */
    @ApiModelProperty(value= "规划方案")
    @TableField("project_scheme")
    private String projectScheme;
 
    /**
     * 报价阶段
     */
    @ApiModelProperty(value= "报价阶段")
    private String offer;
 
    @TableField("bid")
    private String bid;
 
    /**
     * 堆垛机数量
     */
    @ApiModelProperty(value= "堆垛机数量")
    @TableField("crn_num")
    private Integer crnNum;
 
    @TableField("shelf_height")
    private String shelfHeight;
 
    /**
     * 货位数
     */
    @ApiModelProperty(value= "货位数")
    @TableField("storage_num")
    private String storageNum;
 
    /**
     * 项目金额
     */
    @ApiModelProperty(value= "项目金额")
    @TableField("project_fee")
    private String projectFee;
 
    /**
     * 成功率
     */
    @ApiModelProperty(value= "成功率")
    @TableField("success_percentage")
    private String successPercentage;
 
    /**
     * 最近一次联系日期
     */
    @ApiModelProperty(value= "最近一次联系日期")
    @TableField("last_contact")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date lastContact;
 
    /**
     * 备注
     */
    @ApiModelProperty(value= "备注")
    private String memo;
 
    public SaleProject() {}
 
    public SaleProject(Long updateBy,Date updateTime,Long createBy,Date createTime,Integer status,Long saleman,Long custId,String projectAddr,Integer projectType,String goodsSize,String goodsWeight,Integer warehouseStatus,String projectScheme,String offer,Integer crnNum,String storageNum,String projectFee,String successPercentage,Date lastContact,String memo) {
        this.updateBy = updateBy;
        this.updateTime = updateTime;
        this.createBy = createBy;
        this.createTime = createTime;
        this.status = status;
        this.saleman = saleman;
        this.custId = custId;
        this.projectAddr = projectAddr;
        this.projectType = projectType;
        this.goodsSize = goodsSize;
        this.goodsWeight = goodsWeight;
        this.warehouseStatus = warehouseStatus;
        this.projectScheme = projectScheme;
        this.offer = offer;
        this.crnNum = crnNum;
        this.storageNum = storageNum;
        this.projectFee = projectFee;
        this.successPercentage = successPercentage;
        this.lastContact = lastContact;
        this.memo = memo;
    }
 
//    SaleProject saleProject = new SaleProject(
//            null,    // 
//            null,    // 
//            null,    // 
//            null,    // 
//            null,    // 状态,暂未启用
//            null,    // 业务员
//            null,    // 客户名称
//            null,    // 项目地址
//            null,    // 项目类型
//            null,    // 货物尺寸
//            null,    // 货物重量
//            null,    // 厂房情况
//            null,    // 规划方案
//            null,    // 报价阶段
//            null,    // 堆垛机数量
//            null,    // 货位数
//            null,    // 项目金额
//            null,    // 成功率
//            null,    // 最近一次联系日期
//            null    // 备注
//    );
 
    public Long getId() {
        return id;
    }
 
    public void setId(Long id) {
        this.id = id;
    }
 
    public Long getUpdateBy() {
        return updateBy;
    }
 
    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }
 
    public Date getUpdateTime() {
        return updateTime;
    }
 
    public String getUpdateTime$(){
        if (Cools.isEmpty(this.updateTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
    }
 
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
 
    public Long getCreateBy() {
        return createBy;
    }
 
    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }
 
    public Date getCreateTime() {
        return createTime;
    }
 
    public String getCreateTime$(){
        if (Cools.isEmpty(this.createTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
    }
 
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
 
    public Integer getStatus() {
        return status;
    }
 
    public void setStatus(Integer status) {
        this.status = status;
    }
 
    public Long getSaleman() {
        return saleman;
    }
 
    public void setSaleman(Long saleman) {
        this.saleman = saleman;
    }
 
    public Long getCustId() {
        return custId;
    }
 
    public void setCustId(Long custId) {
        this.custId = custId;
    }
 
    public String getProjectAddr() {
        return projectAddr;
    }
 
    public void setProjectAddr(String projectAddr) {
        this.projectAddr = projectAddr;
    }
 
    public Integer getProjectType() {
        return projectType;
    }
 
    public void setProjectType(Integer projectType) {
        this.projectType = projectType;
    }
 
    public String getGoodsSize() {
        return goodsSize;
    }
 
    public void setGoodsSize(String goodsSize) {
        this.goodsSize = goodsSize;
    }
 
    public String getGoodsWeight() {
        return goodsWeight;
    }
 
    public void setGoodsWeight(String goodsWeight) {
        this.goodsWeight = goodsWeight;
    }
 
    public Integer getWarehouseStatus() {
        return warehouseStatus;
    }
 
    public String getWarehouseStatus$(){
        if (null == this.warehouseStatus){ return null; }
        switch (this.warehouseStatus){
            case 1:
                return "新建";
            case 2:
                return "旧改";
            default:
                return String.valueOf(this.warehouseStatus);
        }
    }
 
    public void setWarehouseStatus(Integer warehouseStatus) {
        this.warehouseStatus = warehouseStatus;
    }
 
    public String getProjectScheme() {
        return projectScheme;
    }
 
    public void setProjectScheme(String projectScheme) {
        this.projectScheme = projectScheme;
    }
 
    public String getOffer() {
        return offer;
    }
 
    public void setOffer(String offer) {
        this.offer = offer;
    }
 
    public Integer getCrnNum() {
        return crnNum;
    }
 
    public void setCrnNum(Integer crnNum) {
        this.crnNum = crnNum;
    }
 
    public String getStorageNum() {
        return storageNum;
    }
 
    public void setStorageNum(String storageNum) {
        this.storageNum = storageNum;
    }
 
    public String getProjectFee() {
        return projectFee;
    }
 
    public void setProjectFee(String projectFee) {
        this.projectFee = projectFee;
    }
 
    public String getSuccessPercentage() {
        return successPercentage;
    }
 
    public void setSuccessPercentage(String successPercentage) {
        this.successPercentage = successPercentage;
    }
 
    public Date getLastContact() {
        return lastContact;
    }
 
    public String getLastContact$(){
        if (Cools.isEmpty(this.lastContact)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd").format(this.lastContact);
    }
 
    public void setLastContact(Date lastContact) {
        this.lastContact = lastContact;
    }
 
    public String getMemo() {
        return memo;
    }
 
    public void setMemo(String memo) {
        this.memo = memo;
    }
 
    /**
     * 获取业务员
     * @return
     */
    public String getSaleman$(){
        UserService bean = SpringUtils.getBean(UserService.class);
        User user = bean.selectOne(new EntityWrapper<User>()
                .eq("id", this.getSaleman()));
        if (!Cools.isEmpty(user)) {
 
            return user.getUsername();
        }
        return "";
    }
 
    /**
     * 获取客户名
     * @return
     */
    public String getCustId$(){
        CstmrService bean = SpringUtils.getBean(CstmrService.class);
        Cstmr id1 = bean.selectOne(new EntityWrapper<Cstmr>()
                .eq("id", this.getCustId()));
        if (!Cools.isEmpty(id1)) {
 
            return id1.getName();
        }
        return "";
    }
 
    /**
     * 获取项目地址
     * @return
     */
    public String getprojectAddr$(){
        CstmrService bean = SpringUtils.getBean(CstmrService.class);
        Cstmr id1 = bean.selectOne(new EntityWrapper<Cstmr>()
                .eq("id", this.getCustId()));
        if (!Cools.isEmpty(id1)) {
 
            return id1.getAddr();
        }
        return "";
    }
 
    /**
     *  获取项目类型
     */
 
    public String getProjectType$(){
        ProjectTypeService bean = SpringUtils.getBean(ProjectTypeService.class);
        ProjectType id1 = bean.selectOne(new EntityWrapper<ProjectType>()
                .eq("id", this.projectType));
        if (!Cools.isEmpty(id1)) {
            return id1.getTypeName();
        }
        return "";
    }
 
    /**
     * 给货物重量添加KG
     * @return
     */
    public String getGoodsWeight$(){
        return this.goodsWeight + "KG";
    }
 
    /**
     * 转换为√和×
     * @return
     */
    public String getProjectScheme$(){
        if (Cools.isEmpty(this.projectScheme)) {
            return "×";
        }
        if (this.projectScheme.equals("1")){
            return "√";
        }else {
            return "×";
        }
    }
    public String getOffer$(){
        if (Cools.isEmpty(this.offer)) {
            return "×";
        }
        if (this.offer.equals("1")){
            return "√";
        }else {
            return "×";
        }
    }
    public String getBid$(){
        if (Cools.isEmpty(this.bid)) {
            return "×";
        }
        if (this.bid.equals("1")){
            return "√";
        }else {
            return "×";
        }
    }
 
    public String getSuccessPercentage$(){
        return this.successPercentage + "%";
    }
}