luxiaotao1123
2021-11-17 85d878b12d6988ca2275d60e7da0ec31814f8fc8
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
package zy.cloud.wms.pda.controller;
 
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.annotations.ManagerAuth;
import com.core.common.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import zy.cloud.wms.common.web.BaseController;
import zy.cloud.wms.manager.entity.Comb;
import zy.cloud.wms.manager.entity.Node;
import zy.cloud.wms.manager.service.CombService;
import zy.cloud.wms.manager.service.NodeService;
import zy.cloud.wms.pda.entity.CombParam;
import zy.cloud.wms.pda.service.MobileService;
 
import java.util.List;
 
/**
 * 移动端接口控制器
 * Created by vincent on 2020/6/10
 */
@RestController
@RequestMapping("mobile")
public class MobileController extends BaseController {
 
    @Autowired
    private MobileService mobileService;
    @Autowired
    private CombService combService;
    @Autowired
    private NodeService nodeService;
 
    /**
     * 组托
     */
    @RequestMapping("/comb/auth")
    @ManagerAuth(memo = "组托")
    public R comb(@RequestBody CombParam combParam){
        mobileService.comb(combParam, getUserId(), getHostId());
        return R.ok();
    }
 
    /**
     *  根据库位号查找库存明细
     */
    @PostMapping("/inStock/auth")
    @ManagerAuth
    public R getLocDetl(@RequestParam String zpallet){
        List<Comb> combs = combService.selectList(new EntityWrapper<Comb>().eq("zpallet", zpallet).eq("io_status", 1));
        return R.ok().add(combs);
    }
 
    /**
     *  查找货位
     */
    @PostMapping("/inStock/node/auth")
    @ManagerAuth
    public R getNode(@RequestParam String node){
        Node one = nodeService.selectOne(new EntityWrapper<Node>().eq("uuid", node).eq("status", 1));
        return R.ok().add(one);
    }
 
 
//    /**
//     *  根据库位号查找库存明细
//     */
//    @RequestMapping("/locDetl")
//    @ManagerAuth
//    public R getLocDetl(@RequestParam(required = false)String locNo,
//                        @RequestParam(required = false)String matNo){
//        if (!Cools.isEmpty(locNo)) {
//            LocMast locMast = locMastService.selectById(locNo);
//            if (null == locMast || !"F".equals(locMast.getLocSts())) {
//                return R.parse(BaseRes.EMPTY);
//            }
//            List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
//                    .eq("loc_no", locNo).orderBy("appe_time", false));
//            List<MobileLocDetlVo> res = new ArrayList<>();
//            locDetls.forEach(locDetl -> {
//                MobileLocDetlVo vo = new MobileLocDetlVo();
//                vo.setLocNo(locDetl.getLocNo());
//                vo.setMatnr(locDetl.getMatnr());
//                vo.setMaktx(locDetl.getMaktx());
//                vo.setCount(locDetl.getAnfme());
//                res.add(vo);
//            });
//            return R.ok().add(res);
//        }
//        if (!Cools.isEmpty(matNo)) {
//            List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>()
//                    .eq("matnr", matNo).orderBy("appe_time", false));
//            List<MobileLocDetlVo> res = new ArrayList<>();
//            locDetls.forEach(locDetl -> {
//                MobileLocDetlVo vo = new MobileLocDetlVo();
//                vo.setLocNo(locDetl.getLocNo());
//                vo.setMatnr(locDetl.getMatnr());
//                vo.setMaktx(locDetl.getMaktx());
//                vo.setCount(locDetl.getAnfme());
//                res.add(vo);
//            });
//            return R.ok().add(res);
//        }
//        return R.parse(BaseRes.PARAM);
//    }
//
//    /**
//     * 根据通知单查询明细
//     */
//    @RequestMapping("/bill/query/auth")
//    @ManagerAuth(memo = "根据通知单查询明细")
//    public R billQuery(@RequestParam String billNo){
//        List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("supplier", billNo).isNull("zpallet"));
//        List<CombBillQueryVo> vos = new ArrayList<>();
//        if (!Cools.isEmpty(waitPakins)) {
//            for (WaitPakin waitPakin : waitPakins) {
//                CombBillQueryVo vo = new CombBillQueryVo();
//                vo.setMatNo(waitPakin.getMatnr());
//                vo.setMatName(waitPakin.getMaktx());
//                vo.setCount(waitPakin.getAnfme());
//                vos.add(vo);
//            }
//        }
//        return R.ok().add(vos);
//    }
 
 
}