jiazx0107@163.com
2023-05-17 620eab6cca2bc9ef9ea6d3067a0a5ba1deadbd1c
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
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
package com.ld.igds.inout.controller;
 
import com.bstek.bdf2.core.business.IUser;
import com.ld.igds.common.manager.CommonManager;
import com.ld.igds.constant.BizType;
import com.ld.igds.constant.Constant;
import com.ld.igds.constant.RespCodeEnum;
import com.ld.igds.data.Page;
import com.ld.igds.data.PageResponse;
import com.ld.igds.file.dto.FileData;
import com.ld.igds.inout.InoutConstant;
import com.ld.igds.inout.dto.InoutData;
import com.ld.igds.inout.dto.InoutParam;
import com.ld.igds.inout.dto.InoutRecordItemData;
import com.ld.igds.inout.dto.InoutRecordItemParam;
import com.ld.igds.inout.manager.InoutCommonManager;
import com.ld.igds.inout.manager.InoutManager2;
import com.ld.igds.io.dto.WeightDto;
import com.ld.igds.m.dto.NoticeParam;
import com.ld.igds.models.*;
import com.ld.igds.util.ContextUtil;
import com.ld.igds.util.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import java.net.URLDecoder;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
/**
 * 出入库管理入口2
 *
 * @author
 */
@Slf4j
@RestController
@RequestMapping("basic/inout")
public class InoutController2 {
 
    @Resource
    private CommonManager commonManager;
    @Resource
    private InoutManager2 inoutManager2;
    @Resource
    private InoutCommonManager inoutCommonManager;
 
    /**
     * 出入库流程中的实时数据页面,直接从缓存中获取
     *
     * @param deptId 当前人所在分库
     * @param type   出入库类型
     * @return
     */
    @RequestMapping("/inout-progress")
    public ModelAndView inoutProgress(@RequestParam(value = "deptId", required = false) String deptId,
                                      @RequestParam(value = "type", required = false) String type) {
 
        ModelAndView view = new ModelAndView();
        view.addObject("type", type);
 
        if (StringUtils.isEmpty(deptId)) {
            deptId = ContextUtil.subDeptId(null);
        }
        view.addObject("deptId", deptId);
 
        //流程字典表,用于存放路程阶段和名称关系
        view.addObject("mapProgress", DicTrigger.mapProgressName);
 
        //登录人所在分库下的仓库列表
        List<Depot> listDepot = commonManager.listDepot(true, deptId);
        Map<String, String> mapDept = new HashMap<>();
        if (null != listDepot) {
            for (Depot d : listDepot) {
                mapDept.put(d.getId(), d.getName());
            }
        }
        view.addObject("mapDept", mapDept);
 
        view.setViewName("admin/inout/inout-progress");
        return view;
    }
 
    /**
     * 出入库流程中的实时数据,直接从缓存中获取
     *
     * @param param 包含type和deptId两个参数
     * @return
     */
    @RequestMapping("/list-progress")
    public PageResponse<Map<String, List<InoutData>>> listProgress(@RequestBody InoutParam param) {
        IUser user = ContextUtil.getLoginUser();
        if (StringUtils.isEmpty(param.getDeptId())) {
            param.setDeptId(ContextUtil.subDeptId(user));
        }
        if (StringUtils.isEmpty(param.getCompanyId())) {
            param.setCompanyId(user.getCompanyId());
        }
 
        return inoutManager2.listProgress(param);
    }
 
    /**
     * 入库简易操作页面
     *
     * @param sort 表示使用的出入库设备配套号,不传递默认为1
     * @return
     */
    @RequestMapping("/in-easy")
    public ModelAndView inEasy(@RequestParam(value = "sort", required = false) String sort) {
        ModelAndView view = new ModelAndView();
 
        IUser user = ContextUtil.getLoginUser();
        view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
 
        view.addObject("bizType", BizType.INOUT_IN.getCode());
        view.addObject("type", InoutConstant.TYPE_IN);
        String deptId = ContextUtil.subDeptId(user);
        view.addObject("deptId", deptId);
 
        // 仓库列表做下拉框使用
        List<Depot> listDepot = commonManager.listInDepot();
        view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
 
        //入库流程
        String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(),
                ContextUtil.subDeptId(user), InoutConstant.TYPE_IN);
        view.addObject("inoutProgress", inoutProgress);
 
 
        // 粮食品种下拉框
        List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
                Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
        view.addObject("listFoodVariety", listFoodVariety);
 
        // 粮食等级下拉框
        List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
                Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
        view.addObject("listFoodLevel", listFoodLevel);
 
        // 当前流程标签
        view.addObject("progress", InoutConstant.PROGRESS_WEIGHT_TAG);
 
        // 获取出入库配置信息
        List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(
                user.getCompanyId(), deptId);
 
        // 获取地磅信息
        InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_30,
                InoutConstant.PROGRESS_WEIGHT_TAG, 1);
        view.addObject("weightDto", null == conf ? new WeightDto() : new WeightDto(conf));
 
        // 获取车牌识别信息
        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_10,
                InoutConstant.PROGRESS_WEIGHT_TAG, 1);
        view.addObject("lprDto", conf);
 
        // 抓拍摄像头1
        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
                InoutConstant.PROGRESS_WEIGHT_TAG, 1);
        view.addObject("snapDto1", conf);
 
        // 获取摄像头信息2
        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
                InoutConstant.PROGRESS_WEIGHT_TAG, 2);
        view.addObject("snapDto2", conf);
 
        //默认查询时间
        view.addObject("endTime",
                DateFormatUtils.format(new Date(), "yyyy-MM-dd"));
        view.addObject("startTime", DateFormatUtils.format(
                DateUtil.getNewByDay(null, -30), "yyyy-MM-dd"));
 
        view.setViewName("admin/inout/in-easy");
        return view;
    }
 
    /**
     * 出库简易操作页面
     *
     * @param sort 表示使用的出入库设备配套号,不传递默认为1
     * @return
     */
    @RequestMapping("/out-easy")
    public ModelAndView outEasy(@RequestParam(value = "sort", required = false) String sort) {
        ModelAndView view = new ModelAndView();
 
 
        IUser user = ContextUtil.getLoginUser();
        view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
 
        view.addObject("bizType", BizType.INOUT_IN.getCode());
        view.addObject("type", InoutConstant.TYPE_OUT);
        String deptId = ContextUtil.subDeptId(user);
        view.addObject("deptId", deptId);
 
        // 仓库列表做下拉框使用
        List<Depot> listDepot = commonManager.listOutDepot();
        view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
 
        //入库流程
        String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(),
                ContextUtil.subDeptId(user), InoutConstant.TYPE_IN);
        view.addObject("inoutProgress", inoutProgress);
 
 
        // 粮食品种下拉框
        List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
                Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
        view.addObject("listFoodVariety", listFoodVariety);
 
        // 粮食等级下拉框
        List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
                Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
        view.addObject("listFoodLevel", listFoodLevel);
 
        // 当前流程标签
        view.addObject("progress", InoutConstant.PROGRESS_WEIGHT_TAG);
 
        // 获取出入库配置信息
        List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(
                user.getCompanyId(), deptId);
 
        // 获取地磅信息
        InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_30,
                InoutConstant.PROGRESS_WEIGHT_TAG, 1);
        view.addObject("weightDto", null == conf ? new WeightDto() : new WeightDto(conf));
 
        // 获取车牌识别信息
        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_10,
                InoutConstant.PROGRESS_WEIGHT_TAG, 1);
        view.addObject("lprDto", conf);
 
        // 抓拍摄像头1
        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
                InoutConstant.PROGRESS_WEIGHT_TAG, 1);
        view.addObject("snapDto1", conf);
 
        // 获取摄像头信息2
        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
                InoutConstant.PROGRESS_WEIGHT_TAG, 2);
        view.addObject("snapDto2", conf);
 
        //默认查询时间
        view.addObject("endTime",
                DateFormatUtils.format(new Date(), "yyyy-MM-dd"));
        view.addObject("startTime", DateFormatUtils.format(
                DateUtil.getNewByDay(null, -30), "yyyy-MM-dd"));
 
        view.setViewName("admin/inout/out-easy");
        return view;
    }
 
    /**
     * 出入库简易操作-分页获取流程未完成的数据
     *
     * @param param
     * @return
     */
    @RequestMapping("/page-inout-data")
    public PageResponse<Page<InoutData>> pageInoutData(
            @RequestBody InoutParam param) {
        return inoutManager2.pageInoutData(param);
    }
 
    /**
     * 2022年11月15日 暂停使用
     * 入库的往来单位下拉框 -- 从入库通知单或往来单位表中查询
     *
     * @param param 查询关键字可以是ID也可能是名称
     * @return
 
     @RequestMapping("/list-in-customer") public PageResponse<List<InoutCustomer>> listInCustomer(@RequestBody InoutParam param) {
 
     return inoutManager2.listCustomerIn(param);
     }
     */
 
 
    /**
     * 入库通知单-获取没有完成的通知单列表
     *
     * @return
     */
    @RequestMapping("/list-notice—in")
    public PageResponse<List<InoutNoticeIn>> listNoticeIn(@RequestBody NoticeParam param) {
        return inoutManager2.listNoticeIn(param);
    }
 
    /**
     *
     * 2022年11月15日 暂停使用
     * 出库的往来单位下拉框 -- 从出库通知单或往来单位表中查询
     *
     * @param param
     * @return
     @RequestMapping("/list-out-customer") public PageResponse<List<InoutCustomer>> listOutCustomer(
     @RequestBody InoutParam param) {
 
     return inoutManager2.listCustomerOut(param);
     }
     */
 
    /**
     * 出库通知单-获取没有完成的通知单列表
     *
     * @return
     */
    @RequestMapping("/list-notice—out")
    public PageResponse<List<InoutNoticeOut>> listNoticeOut(@RequestBody NoticeParam param) {
        return inoutManager2.listNoticeOut(param);
    }
 
    /**
     * 船运登记页面 -- 入库
     *
     * @param sort 表示使用的出入库设备配套号,不传递默认为1
     * @return
     */
    @RequestMapping("/in-ship-register")
    public ModelAndView inShipRegister(
            @RequestParam(value = "sort", required = false) String sort) {
 
        ModelAndView view = new ModelAndView();
        IUser user = ContextUtil.getLoginUser();
        view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
 
        String deptId = ContextUtil.subDeptId(user);
        view.addObject("bizType", BizType.INOUT_IN.getCode());
        view.addObject("type", InoutConstant.TYPE_IN);
        view.addObject("deptId", deptId);
 
        // 仓库列表做下拉框使用
        List<Depot> listDepot = commonManager.listInDepot();
        view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
 
        // 粮食品种下拉框
        List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
                Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
        view.addObject("listFoodVariety", listFoodVariety);
 
        // 粮食等级下拉框
        List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
                Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
        view.addObject("listFoodLevel", listFoodLevel);
 
        view.addObject("checkUser", ContextUtil.getLoginUserCName());
 
        // 当前流程节点
        view.addObject("progress", InoutConstant.PROGRESS_REGISTER);
 
        view.setViewName("admin/inout/in-ship-register");
        return view;
    }
 
    /**
     * 船运称重页面 -- 入库
     *
     * @param sort 表示使用的出入库设备配套号,不传递默认为1
     * @return
     */
    @RequestMapping("/in-ship-weight")
    public ModelAndView inShipWeight(@RequestParam(value = "sort", required = false) String sort) {
 
        ModelAndView view = new ModelAndView();
        IUser user = ContextUtil.getLoginUser();
        view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
 
        String deptId = ContextUtil.subDeptId(user);
        view.addObject("bizType", BizType.INOUT_IN.getCode());
        view.addObject("type", InoutConstant.TYPE_IN);
        view.addObject("deptId", deptId);
 
        // 仓库列表做下拉框使用
        List<Depot> listDepot = commonManager.listInDepot();
        view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
 
        //入库流程
        String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(),
                ContextUtil.subDeptId(user), InoutConstant.TYPE_IN);
        view.addObject("inoutProgress", inoutProgress);
 
        //地磅是否可编辑
        String weightEditTag = inoutCommonManager.getWeightEditTag(user.getCompanyId(), ContextUtil.subDeptId(user));
        view.addObject("weightEditTag", weightEditTag);
 
        // 当前流程标签
        view.addObject("progress", InoutConstant.PROGRESS_WEIGHT_TAG);
        view.addObject("ship", "ship");
 
        // 粮食品种下拉框
        List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
                Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
        view.addObject("listFoodVariety", listFoodVariety);
 
        // 粮食等级下拉框
        List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
                Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
        view.addObject("listFoodLevel", listFoodLevel);
 
        // 获取出入库配置信息
        List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user
                .getCompanyId(), deptId);
 
        //获取所有的地磅列表用于页面用户选择
        List<WeightDto> listWeight = inoutCommonManager.getInoutWeightAll(listInoutConf, InoutConstant.CONF_TYPE_30);
        view.addObject("listWeight", listWeight);
 
        // 获取当前地磅信息
        WeightDto weightDto = inoutCommonManager.getInoutCurWeight(listWeight, sort);
        view.addObject("weightDto", weightDto);
 
        // 过程摄像头1
        InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
                InoutConstant.PROGRESS_WEIGHT_TAG, 1);
        view.addObject("snapDto1", conf);
 
        // 过程摄像头2
        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
                InoutConstant.PROGRESS_WEIGHT_TAG, 2);
        view.addObject("snapDto2", conf);
 
        // 过程摄像头3
        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
                InoutConstant.PROGRESS_WEIGHT_TAG, 3);
        view.addObject("snapDto3", conf);
 
        view.setViewName("admin/inout/in-ship-weight");
        return view;
    }
 
    /**
     * 船运登记页面 -- 出库
     *
     * @param sort 表示使用的出入库设备配套号,不传递默认为1
     * @return
     */
    @RequestMapping("/out-ship-register")
    public ModelAndView outShipRegister(
            @RequestParam(value = "sort", required = false) String sort) {
 
        ModelAndView view = new ModelAndView();
        IUser user = ContextUtil.getLoginUser();
        view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
 
        String deptId = ContextUtil.subDeptId(user);
        view.addObject("bizType", BizType.INOUT_OUT.getCode());
        view.addObject("type", InoutConstant.TYPE_OUT);
        view.addObject("deptId", deptId);
 
        // 仓库列表做下拉框使用
        List<Depot> listDepot = commonManager.listInDepot();
        view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
 
        // 粮食品种下拉框
        List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
                Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
        view.addObject("listFoodVariety", listFoodVariety);
 
        // 粮食等级下拉框
        List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
                Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
        view.addObject("listFoodLevel", listFoodLevel);
 
        // 当前流程节点
        view.addObject("progress", InoutConstant.PROGRESS_REGISTER);
 
        view.setViewName("admin/inout/out-ship-register");
        return view;
    }
 
    /**
     * 船运称重页面 -- 出库
     *
     * @param sort 表示使用的出入库设备配套号,不传递默认为1
     * @return
     */
    @RequestMapping("/out-ship-weight")
    public ModelAndView outShipWeight(@RequestParam(value = "sort", required = false) String sort) {
 
        ModelAndView view = new ModelAndView();
        IUser user = ContextUtil.getLoginUser();
        view.addObject(Constant.MODEL_KEY_LOGIN_USER, user);
 
        String deptId = ContextUtil.subDeptId(user);
        view.addObject("bizType", BizType.INOUT_OUT.getCode());
        view.addObject("type", InoutConstant.TYPE_OUT);
        view.addObject("deptId", deptId);
 
        // 仓库列表做下拉框使用
        List<Depot> listDepot = commonManager.listInDepot();
        view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot);
 
        //入库流程
        String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(),
                ContextUtil.subDeptId(user), InoutConstant.TYPE_IN);
        view.addObject("inoutProgress", inoutProgress);
 
        // 当前流程标签
        view.addObject("progress", InoutConstant.PROGRESS_WEIGHT_TAG);
        view.addObject("ship", "ship");
 
        // 粮食品种下拉框
        List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(
                Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId());
        view.addObject("listFoodVariety", listFoodVariety);
 
        //地磅是否可编辑
        String weightEditTag = inoutCommonManager.getWeightEditTag(user.getCompanyId(), ContextUtil.subDeptId(user));
        view.addObject("weightEditTag", weightEditTag);
 
        // 粮食等级下拉框
        List<DicTrigger> listFoodLevel = inoutCommonManager.getDicTrigger(
                Constant.TRIGGER_PARENT_FOOD_LEVEL, user.getCompanyId());
        view.addObject("listFoodLevel", listFoodLevel);
 
        // 获取出入库配置信息
        List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user
                .getCompanyId(), deptId);
 
        //获取所有的地磅列表用于页面用户选择
        List<WeightDto> listWeight = inoutCommonManager.getInoutWeightAll(listInoutConf, InoutConstant.CONF_TYPE_30);
        view.addObject("listWeight", listWeight);
 
        // 获取当前地磅信息
        WeightDto weightDto = inoutCommonManager.getInoutCurWeight(listWeight, sort);
        view.addObject("weightDto", weightDto);
 
        // 过程摄像头1
        InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
                InoutConstant.PROGRESS_WEIGHT_TAG, 1);
        view.addObject("snapDto1", conf);
 
        // 过程摄像头2
        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
                InoutConstant.PROGRESS_WEIGHT_TAG, 2);
        view.addObject("snapDto2", conf);
 
        // 过程摄像头3
        conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60,
                InoutConstant.PROGRESS_WEIGHT_TAG, 3);
        view.addObject("snapDto3", conf);
 
        view.setViewName("admin/inout/out-ship-weight");
        return view;
    }
 
    /**
     * 船运登记提交
     *
     * @param data
     * @return
     */
    @RequestMapping("/inout-ship-register")
    public PageResponse<InoutData> inoutShipRegister(@RequestBody InoutData data) {
        try {
            return inoutManager2.inoutShipRegister(data);
        } catch (Exception e) {
            log.error("后台异常:{}", e);
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "后台异常:" + e.getMessage());
        }
    }
 
 
    /**
     * 船运称重页面--列表查看运输车辆流程信息(分页获取船运信息子表信息-主从查询)
     *
     * @param param
     * @return
     */
    @RequestMapping("/list-inout-record-item")
    public PageResponse<List<InoutRecordItemData>> listInoutItem(@RequestBody InoutRecordItemParam param) {
 
        return inoutManager2.listInoutItem(param);
    }
 
    /**
     * 船运称重页面--查看运输车辆详细信息
     *
     * @param param
     * @return
     */
    @RequestMapping("/get-inout-record-item")
    public PageResponse<InoutRecordItemData> getInoutItem(@RequestBody InoutRecordItemParam param) {
 
        return inoutManager2.getInoutItemByCarNum(param);
    }
 
    /**
     * 船运车辆绑定时,验证车辆是否在流程中
     *
     * @param param
     * @return
     */
    @RequestMapping("/check-car-num")
    public PageResponse<InoutRecordItemData> checkCarNum(@RequestBody InoutRecordItemParam param) {
 
        return inoutManager2.checkCarNum(param);
    }
 
    /**
     * 船运称重页面 - 车辆登记及称重提交
     *
     * @param data
     * @return
     */
    @RequestMapping("/inout-ship-next-step")
    public PageResponse<String> inoutItemNextStep(@RequestBody InoutRecordItemData data) {
        try {
            return inoutManager2.inoutItemNextStep(data);
        } catch (Exception e) {
            log.error("后台异常:{}", e);
            return new PageResponse<String>(RespCodeEnum.CODE_1111.getCode(),
                    "后台异常:" + e.getMessage(), null);
        }
    }
 
    /**
     * 获取流程未结束的船运流水信息 -- 用于船运称重页面的车辆登记使用
     *
     * @param param
     * @return
     */
    @RequestMapping("/un-ship-inout-record")
    public PageResponse<List<InoutRecordItemData>> unShipInoutRecord(@RequestBody InoutRecordItemParam param) {
 
        return inoutManager2.unShipInoutRecord(param);
    }
 
    /**
     * 获取船运车辆信息
     *
     * @param param
     * @return
     */
    @RequestMapping("/list-Ship-Car")
    public PageResponse<List<InoutCarConf>> listShipCar(@RequestBody InoutRecordItemParam param) {
 
        return inoutManager2.listShipCar(param.getCompanyId(), param.getDeptId());
    }
 
    /**
     * 获取船运流水信息 -- 默认获取一个月的
     *
     * @param param
     * @return
     */
    @RequestMapping("/ship-inout-record")
    public PageResponse<List<InoutRecordItemData>> getShipInoutRecord(@RequestBody InoutRecordItemParam param) {
 
        return inoutManager2.getShipInoutRecord(param);
    }
 
    /**
     * 结束船运信息流程,统计相关重量信息
     *
     * @param data
     * @return
     */
    @RequestMapping("/ship-to-complete")
    public PageResponse<InoutRecordItemData> shipComplete(@RequestBody InoutRecordItemData data) {
 
        try {
            return inoutManager2.shipComplete(data);
        } catch (Exception e) {
            log.error("后台异常:{}", e);
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "后台异常:" + e.getMessage(), data);
        }
    }
 
    /**
     * 结束船运信息流程,统计相关重量信息
     *
     * @param data
     * @return
     */
    @RequestMapping("/del-ship-item")
    public PageResponse<String> delShipItem(@RequestBody InoutRecordItemData data) {
 
        try {
            return inoutManager2.delShipItem(data);
        } catch (Exception e) {
            log.error("后台异常:{}", e);
            return new PageResponse<>(RespCodeEnum.CODE_1111.getCode(),
                    "后台异常:" + e.getMessage());
        }
    }
 
    /**
     * 出入库详单页面的可视化追踪页面
     *
     * @return
     */
    @RequestMapping("/inout-img")
    public ModelAndView inoutImg(@RequestParam(value = "id", required = true) String id,
                                 @RequestParam(value = "plateNum", required = false) String plateNum,
                                 @RequestParam(value = "user", required = false) String userName) {
 
        ModelAndView view = new ModelAndView();
        try {
            view.addObject("id", id);
 
            if (StringUtils.isNotEmpty(plateNum)) {
                view.addObject("plateNum", URLDecoder.decode(plateNum, "UtF-8"));
            }
            if (StringUtils.isNotEmpty(userName)) {
                view.addObject("userName", URLDecoder.decode(userName, "UtF-8"));
            }
 
            view.setViewName("admin/inout/inout-img");
        } catch (Exception e) {
            log.error("后台异常:{}", e);
        }
        return view;
    }
 
    /**
     * 根据参数获取出入库的图片,文件流展示
     *
     * @param param
     * @return
     */
    @RequestMapping("/cut-img-list")
    public PageResponse<List<FileData>> cutImgList(@RequestBody InoutParam param) {
        return inoutManager2.cutImgList(param);
    }
}