skyouc
2024-12-21 c635d78b479510ebe2556a420948effcd30a0731
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
package com.zy.asrs.wms.asrs.controller;
 
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.framework.common.R;
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wms.asrs.entity.*;
import com.zy.asrs.wms.asrs.entity.enums.LocStsType;
import com.zy.asrs.wms.asrs.entity.enums.OrderSettleType;
import com.zy.asrs.wms.asrs.entity.enums.TaskStsType;
import com.zy.asrs.wms.asrs.entity.param.GeneratePakInParam;
import com.zy.asrs.wms.asrs.entity.param.LocAdjustParam;
import com.zy.asrs.wms.asrs.entity.param.LocTransferParam;
import com.zy.asrs.wms.asrs.service.*;
import com.zy.asrs.wms.common.annotation.OperationLog;
import com.zy.asrs.wms.system.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.*;
 
@RestController
@RequestMapping("/api")
public class WorkController extends BaseController {
 
    @Autowired
    private WorkService workService;
    @Autowired
    private LocDetlService locDetlService;
    @Autowired
    private LocService locService;
    @Autowired
    private MatFieldService matFieldService;
    @Autowired
    private LocDetlFieldService locDetlFieldService;
 
    @OperationLog("生成入库任务")
    @PostMapping("/rpc/generatePakIn")
    public R generatePakIn(@RequestBody GeneratePakInParam param) {
        try {
            if (param.getTaskType() == 10) {
                workService.generateEmptyPakIn(param);//空托盘
            }else {
                workService.generatePakIn(param);//满托盘
            }
            return R.ok("添加成功");
        } catch (Exception e) {
            return R.error(e.getMessage());
        }
    }
 
    @OperationLog("库存调整")
    @PostMapping("/loc/adjust")
    @Transactional
    public R locAdjust(@RequestBody LocAdjustParam param) {
        try {
            workService.locAdjust(param);
            return R.ok();
        } catch (Exception e) {
            return R.error(e.getMessage());
        }
    }
 
    @OperationLog("库存移转")
    @PostMapping("/loc/transfer")
    @Transactional
    public R locTransfer(@RequestBody LocTransferParam param) {
        try {
            workService.locTransfer(param);
            return R.ok();
        } catch (Exception e) {
            return R.error(e.getMessage());
        }
    }
 
}