liujie
2023-04-06 30cb1d32796a1b482d44bd424fdfe28c26b87be9
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
package com.stylefeng.guns.modular.system.controller;
 
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.crypto.SecureUtil;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.stylefeng.guns.core.base.controller.BaseController;
import com.stylefeng.guns.core.util.DateUtil;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.system.model.TDriver;
import com.stylefeng.guns.modular.system.model.TDriverListVo;
import com.stylefeng.guns.modular.system.service.ITDriverService;
import com.stylefeng.guns.modular.system.utils.UserInfoUtil;
import com.stylefeng.guns.modular.system.utils.WoUtil;
import com.stylefeng.guns.modular.system.utils.tips.ErrorTip;
import com.stylefeng.guns.modular.system.utils.tips.SuccessTip;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.time.DateUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
 
import javax.servlet.http.HttpServletRequest;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
 
/**
 * 控制器
 *
 * @author fengshuonan
 * @Date 2022-12-30 17:04:55
 */
@Controller
@Api(tags = "司机")
@RequestMapping("/api/driver")
public class DriverController extends BaseController {
 
    @Autowired
    private ITDriverService driverService;
 
 
 
    @ApiOperation(value = "卡车公司-司机列表", notes = "卡车公司-司机列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
            @ApiImplicitParam(name = "time", value = "2000-01-01 - 2000-11-11", required = false, dataType = "String"),
            @ApiImplicitParam(name = "name", value = "name", required = false, dataType = "String"),
            @ApiImplicitParam(name = "pageNumber", value = "pageNumber", required = true, dataType = "int"),
            @ApiImplicitParam(name = "pageSize", value = "pageSize", required = true, dataType = "int"),
    })
    @GetMapping(value = "/driverList")
    @ResponseBody
    public Object driverList(String time, String name, int pageNumber, int pageSize) {
        String sTime = null;
        String eTime = null;
        EntityWrapper<TDriver> wrapper = new EntityWrapper<>();
        Page<TDriver> tDriverPage = new Page<>(pageNumber, pageSize);
        wrapper.eq("remove", 0);
        if (ToolUtil.isNotEmpty(name)) {
            wrapper.like("driver_name", name).or().like("account", name);
        }
        if (ToolUtil.isNotEmpty(time)) {
            sTime = time.split(" - ")[0] + " 00:00:01";
            eTime = time.split(" - ")[1] + " 23:59:59";
            wrapper.between("create_time", sTime, eTime);
        }
        Page<TDriver> tDrivers = driverService.selectPage(tDriverPage, wrapper);
        ArrayList<TDriverListVo> tDriverListVos = new ArrayList<>();
        tDrivers.getRecords().stream().forEach(e -> {
            TDriverListVo tDriverListVo = new TDriverListVo();
            BeanUtil.copyProperties(e, tDriverListVo);
            tDriverListVos.add(tDriverListVo);
        });
 
        Page<TDriverListVo> objectPage = new Page<>();
        objectPage.setRecords(tDriverListVos);
        BeanUtil.copyProperties(tDrivers, objectPage);
        return new SuccessTip(objectPage);
    }
 
 
    @ApiOperation(value = "卡车公司-添加司机", notes = "卡车公司-添加司机")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
    })
    @PostMapping(value = "/driverAdd")
    @ResponseBody
    public Object driverAdd(@RequestBody TDriver driver) {
        try {
            driver.setCompanyId(UserInfoUtil.getId());
            driver.setCreateTime(new Date());
            driverService.insert(driver);
            return new SuccessTip();
        } catch (Exception e) {
            e.printStackTrace();
            return new ErrorTip(500, "Error");
        }
    }
 
    @ApiOperation(value = "卡车公司-删除司机", notes = "卡车公司-删除司机")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
            @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "int"),
    })
    @GetMapping(value = "/driverDelete")
    @ResponseBody
    public Object driverDelete(int id) {
        try {
            TDriver tDriver = driverService.selectById(id);
            tDriver.setRemove(1);
            driverService.updateById(tDriver);
            return new SuccessTip();
        } catch (Exception e) {
            e.printStackTrace();
            return new ErrorTip(500, "Error");
        }
    }
 
 
    @ApiOperation(value = "卡车公司-获取司机详情", notes = "卡车公司-获取司机详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
            @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "int"),
    })
    @GetMapping(value = "/driverDetail")
    @ResponseBody
    public Object driverDetail(int id) {
        try {
            TDriver tDriver = driverService.selectById(id);
            return new SuccessTip(tDriver);
        } catch (Exception e) {
            e.printStackTrace();
            return new ErrorTip(500, "Error");
        }
    }
 
 
    @ApiOperation(value = "卡车公司-编辑司机", notes = "卡车公司-编辑司机")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
    })
    @PostMapping(value = "/driverUpdate")
    @ResponseBody
    public Object driverUpdate(@RequestBody TDriver driver) {
        try {
            driverService.updateById(driver);
            return new SuccessTip();
        } catch (Exception e) {
            e.printStackTrace();
            return new ErrorTip(500, "Error");
        }
    }
 
    /**
     * 导入操作
     *
     * @param request
     * @return
     */
    @ApiOperation(value = "卡车公司-司机导入", notes = "卡车公司-司机导入")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
    })
    @RequestMapping(value = "/exportCar", method = RequestMethod.POST)
    @ResponseBody
    public Object exportCar(HttpServletRequest request, MultipartFile file) {
        try {
            Workbook book = WoUtil.ImportFile(file);
            Sheet sh = book.getSheetAt(0);   //获取到第一个表
            for (int i = 1; i <= sh.getLastRowNum(); i++) {
                Row row = sh.getRow(i);
 
                Cell cell0 = row.getCell(0);
                String zero = null;//司机名称
                if (ToolUtil.isNotEmpty(cell0)) {
                    cell0.setCellType(Cell.CELL_TYPE_STRING);
                    zero = String.valueOf(cell0.getStringCellValue()).trim();
                }
 
                Cell cell1 = row.getCell(1);
                String one = null;//Contact Number
 
                if (ToolUtil.isNotEmpty(cell1)) {
                    cell1.setCellType(Cell.CELL_TYPE_STRING);
                    one = String.valueOf(cell1.getStringCellValue()).trim();
                }
 
                Cell cell2 = row.getCell(2);
                String two = null;//Driver Number
                if (ToolUtil.isNotEmpty(cell2)) {
                    two = String.valueOf(cell2.getStringCellValue()).trim();
                }
 
                Cell cell3 = row.getCell(3);
                String three = null;//Date of Birth
                if (ToolUtil.isNotEmpty(cell3)) {
                    three = String.valueOf(cell3.getStringCellValue()).trim();
                }
 
                Cell cell4 = row.getCell(4);
                String four = null;//Address
                if (ToolUtil.isNotEmpty(cell4)) {
                    four = String.valueOf(cell4.getStringCellValue()).trim();
                }
 
                Cell cell5 = row.getCell(5);
                String five = null;//Driver Type
                if (ToolUtil.isNotEmpty(cell5)) {
                    five = String.valueOf(cell5.getStringCellValue()).trim();
                }
 
                Cell cell6 = row.getCell(6);
                String six = null;//Status
                if (ToolUtil.isNotEmpty(cell6)) {
                    six = String.valueOf(cell6.getStringCellValue()).trim();
                }
 
                Cell cell7 = row.getCell(7);
                String seven = null;//StatusRemark
                if (ToolUtil.isNotEmpty(cell7)) {
                    seven = String.valueOf(cell7.getStringCellValue()).trim();
                }
 
                Cell cell8 = row.getCell(8);
                if(cell8!=null){
                    cell8.setCellType(Cell.CELL_TYPE_STRING);
                }
                String eight = null;//Commercial Driiver Since Year
                if (ToolUtil.isNotEmpty(cell8)) {
                    eight = String.valueOf(cell8.getStringCellValue()).trim();
                }
 
                Cell cell9 = row.getCell(9);
                if(cell9!=null){
                    cell9.setCellType(Cell.CELL_TYPE_STRING);
                }
                String nine = null;//License Type
                if (ToolUtil.isNotEmpty(cell9)) {
                    nine = String.valueOf(cell9.getStringCellValue()).trim();
                }
 
                Cell cell10 = row.getCell(10);
                if(cell10!=null){
                    cell10.setCellType(Cell.CELL_TYPE_STRING);
                }
 
                String ten = null;//CDL Number
                if (ToolUtil.isNotEmpty(cell10)) {
                    ten = String.valueOf(cell10.getStringCellValue()).trim();
                }
 
                Cell cell11 = row.getCell(11);
                if(cell11!=null){
                    cell11.setCellType(Cell.CELL_TYPE_STRING);
                }
                String eleven = null;//Driving School
                if (ToolUtil.isNotEmpty(cell11)) {
                    eleven = String.valueOf(cell11.getStringCellValue()).trim();
                }
 
                Cell cell12 = row.getCell(12);
                if(cell12!=null){
                    cell12.setCellType(Cell.CELL_TYPE_STRING);
                }
                String twelve = null;//Type of Experience
                if (ToolUtil.isNotEmpty(cell12)) {
                    twelve = String.valueOf(cell12.getStringCellValue()).trim();
                }
 
                Cell cell13 = row.getCell(13);
                if(cell13!=null){
                    cell13.setCellType(Cell.CELL_TYPE_STRING);
                }
                String thirteen = null;//License Endorsements
                if (ToolUtil.isNotEmpty(cell13)) {
                    thirteen = String.valueOf(cell13.getStringCellValue()).trim();
                }
 
                Cell cell14 = row.getCell(14);
                if(cell14!=null){
                    cell14.setCellType(Cell.CELL_TYPE_STRING);
                }
                String fourteen = null;//Application Date
                if (ToolUtil.isNotEmpty(cell14)) {
                    fourteen = String.valueOf(cell14.getStringCellValue()).trim();
                }
 
                Cell cell15 = row.getCell(15);
                if(cell15!=null){
                    cell15.setCellType(Cell.CELL_TYPE_STRING);
                }
                String fifteen = null;//Termination Date
                if (ToolUtil.isNotEmpty(cell15)) {
                    fifteen = String.valueOf(cell15.getStringCellValue()).trim();
                }
 
                Cell cell16 = row.getCell(16);
                if(cell16!=null){
                    cell16.setCellType(Cell.CELL_TYPE_STRING);
                }
                String sixteen = null;//Bonus Eligibility Date
                if (ToolUtil.isNotEmpty(cell16)) {
                    sixteen = String.valueOf(cell16.getStringCellValue()).trim();
                }
 
                Cell cell17 = row.getCell(17);
                if(cell17!=null){
                    cell17.setCellType(Cell.CELL_TYPE_STRING);
                }
                String seventeen = null;//Hire Date
                if (ToolUtil.isNotEmpty(cell17)) {
                    seventeen = String.valueOf(cell17.getStringCellValue()).trim();
                }
                Cell cell18 = row.getCell(18);
                if(cell18!=null){
                    cell18.setCellType(Cell.CELL_TYPE_STRING);
                }
                String eighteen = null;//Rehirable
                if (ToolUtil.isNotEmpty(cell18)) {
                    eighteen = String.valueOf(cell18.getStringCellValue()).trim();
                }
                Cell cell19 = row.getCell(19);
                if(cell19!=null){
                    cell19.setCellType(Cell.CELL_TYPE_STRING);
                }
                String nineteen = null;//License Endorsements One
                if (ToolUtil.isNotEmpty(cell19)) {
                    nineteen = String.valueOf(cell19.getStringCellValue()).trim();
                }
                Cell cell20 = row.getCell(20);
                if(cell20!=null){
                    cell20.setCellType(Cell.CELL_TYPE_STRING);
                }
                String twenty = null;//Insurance Co
                if (ToolUtil.isNotEmpty(cell20)) {
                    twenty = String.valueOf(cell20.getStringCellValue()).trim();
                }
                Cell cell21 = row.getCell(21);
                if(cell21!=null){
                    cell21.setCellType(Cell.CELL_TYPE_STRING);
                }
                String twentyOne = null;//Id Number
                if (ToolUtil.isNotEmpty(cell21)) {
                    twentyOne = String.valueOf(cell21.getStringCellValue()).trim();
                }
                Cell cell22 = row.getCell(22);
                if(cell22!=null){
                    cell22.setCellType(Cell.CELL_TYPE_STRING);
                }
                String twentyTwo = null;//Group Number
                if (ToolUtil.isNotEmpty(cell22)) {
                    twentyTwo = String.valueOf(cell22.getStringCellValue()).trim();
                }
                Cell cell23 = row.getCell(23);
                if(cell23!=null){
                    cell23.setCellType(Cell.CELL_TYPE_STRING);
                }
                String twentyThree = null;//License Expiration Date
                if (ToolUtil.isNotEmpty(cell23)) {
                    twentyThree = String.valueOf(cell23.getStringCellValue()).trim();
                }
                Cell cell24 = row.getCell(24);
                if(cell24!=null){
                    cell24.setCellType(Cell.CELL_TYPE_STRING);
                }
                String twentyFour = null;//Hazmat Endorsement Expiration Date
                if (ToolUtil.isNotEmpty(cell24)) {
                    twentyFour = String.valueOf(cell24.getStringCellValue()).trim();
                }
                Cell cell25 = row.getCell(25);
                if(cell25!=null){
                    cell25.setCellType(Cell.CELL_TYPE_STRING);
                }
                String twentyFive = null;//Insurance Expiration Date
                if (ToolUtil.isNotEmpty(cell25)) {
                    twentyFive = String.valueOf(cell25.getStringCellValue()).trim();
                }
                Cell cell26 = row.getCell(26);
                if(cell26!=null){
                    cell26.setCellType(Cell.CELL_TYPE_STRING);
                }
                String twentySix = null;//Last Drug Test Date
                if (ToolUtil.isNotEmpty(cell26)) {
                    twentySix = String.valueOf(cell26.getStringCellValue()).trim();
                }
                Cell cell27 = row.getCell(27);
                if(cell27!=null){
                    cell27.setCellType(Cell.CELL_TYPE_STRING);
                }
                String twentySeven = null;//TWIC Card Expiration Date
                if (ToolUtil.isNotEmpty(cell27)) {
                    twentySeven = String.valueOf(cell27.getStringCellValue()).trim();
                }
                Cell cell28 = row.getCell(28);
                if(cell28!=null){
                    cell28.setCellType(Cell.CELL_TYPE_STRING);
                }
                String twentyEight = null;//DOT Medical Card Expiration Date
                if (ToolUtil.isNotEmpty(cell28)) {
                    twentyEight = String.valueOf(cell28.getStringCellValue()).trim();
                }
                Cell cell29 = row.getCell(29);
                if(cell29!=null){
                    cell29.setCellType(Cell.CELL_TYPE_STRING);
                }
                String twentyNine = null;//Late Road Test Date
                if (ToolUtil.isNotEmpty(cell29)) {
                    twentyNine = String.valueOf(cell29.getStringCellValue()).trim();
                }
                Cell cell30 = row.getCell(30);
                if(cell30!=null){
                    cell30.setCellType(Cell.CELL_TYPE_STRING);
                }
                String thirty = null;//Last Alcogol Test Date
                if (ToolUtil.isNotEmpty(cell30)) {
                    thirty = String.valueOf(cell30.getStringCellValue()).trim();
                }
                Cell cell31 = row.getCell(31);
                if(cell31!=null){
                    cell31.setCellType(Cell.CELL_TYPE_STRING);
                }
                String thirtyOne = null;//Account
                if (ToolUtil.isNotEmpty(cell31)) {
                    thirtyOne = String.valueOf(cell31.getStringCellValue()).trim();
                }
                Cell cell32 = row.getCell(32);
                if(cell32!=null){
                    cell32.setCellType(Cell.CELL_TYPE_STRING);
                }
                String thirtyTwo = null;//Password
                if (ToolUtil.isNotEmpty(cell32)) {
                    thirtyTwo = String.valueOf(cell32.getStringCellValue()).trim();
                }
 
 
                if (ToolUtil.isEmpty(thirtyOne) || ToolUtil.isEmpty(zero) || ToolUtil.isEmpty(one)
                        || ToolUtil.isEmpty(thirtyTwo)) {
                    return new ErrorTip(500, "[Driver name、Contact number、Account、Password] can not be blank");
                }
 
 
                TDriver tDriver = new TDriver();
                tDriver.setCreateTime(new Date());
                tDriver.setRemove(0);
                tDriver.setDriverName(zero);
                tDriver.setContactNumber(one);
                tDriver.setDriverNumber(two);
                if (three != null) {
                    tDriver.setDateOfBrith(DateUtil.parseDate(three));
                }
                tDriver.setAddress(four);
                if (five != null) {
                    tDriver.setDriverType(Integer.valueOf(five));
                }
                if (six != null) {
                    tDriver.setStatus(Integer.valueOf(six));
                }
                tDriver.setStatusRemark(seven);
                tDriver.setSinceYear(eight);
                tDriver.setLicenseType(nine);
                tDriver.setCdlNumber(ten);
                tDriver.setDrivingSchool(eleven);
                tDriver.setTypeOfExperience(twelve);
                tDriver.setLicenseEndorsements(thirteen);
 
                if (fourteen != null) {
                    tDriver.setApplicationDate(DateUtil.parseDate(fourteen));
                }
                if (fifteen != null) {
                    tDriver.setTerminationDate(DateUtil.parseDate(fifteen));
                }
                if (sixteen != null) {
                    tDriver.setBonusEligibilityDate(DateUtil.parseDate(sixteen));
                }
                if (seventeen != null) {
                    tDriver.setHireDate(DateUtil.parseDate(seventeen));
                }
                tDriver.setRehirable(eighteen);
                tDriver.setLicenseEndorsementsOne(nineteen);
                tDriver.setInsuranceCo(twenty);
                tDriver.setIdNumber(twentyOne);
                tDriver.setGroupNumber(thirtyTwo);
                if (twentyThree != null) {
                    tDriver.setLicenseExpirationDate(DateUtil.parseDate(twentyThree));
                }
                if (twentyFour != null) {
                    tDriver.setHazmatExpriationDate(DateUtil.parseDate(twentyFour));
                }
                if (twentyFive != null) {
                    tDriver.setInsuranceExpirationDate(DateUtil.parseDate(twentyFive));
                }
                if (twentySix != null) {
                    tDriver.setLastDrugTestDate(DateUtil.parseDate(twentySix));
                }
                if (twentySeven != null) {
                    tDriver.setTwicCardExpirationDate(DateUtil.parseDate(twentySeven));
                }
                if (twentyEight != null) {
                    tDriver.setDotCardExpirationDate(DateUtil.parseDate(twentyEight));
                }
                if (twentyNine != null) {
                    tDriver.setLastRoadTestDate(DateUtil.parseDate(twentyNine));
                }
                if (thirty != null) {
                    tDriver.setLastAlcoholTestDate(DateUtil.parseDate(thirty));
                }
                tDriver.setAccount(thirtyOne);
                tDriver.setPassword(SecureUtil.md5(thirtyTwo));
                List<TDriver> tDrivers = driverService.selectList(new EntityWrapper<TDriver>().eq("account", thirtyOne));
                if(tDrivers.size()==0){
                    driverService.insert(tDriver);
                }
            }
            return new SuccessTip();
        } catch (Exception e) {
            e.printStackTrace();
            return new ErrorTip(500,"Error");
        }
    }
 
    /**
     * 转换日期
     *
     * @return
     */
    public static String importByExcelForDate(String value) {//value就是它的天数
        String currentCellValue = "";
        if (value != null && !value.equals("")) {
            Calendar calendar = new GregorianCalendar(1900, 0, -1);
            Date d = calendar.getTime();
            Date dd = DateUtils.addDays(d, Integer.valueOf(value));
            DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
            currentCellValue = formater.format(dd);
        }
        return currentCellValue;
    }
 
}