自动化立体仓库 - WMS系统
#
LSH
2023-02-13 30155d34eade43e1713ee1022a9af4d4744acda1
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
package com.zy.asrs.controller;
 
import com.core.annotations.ManagerAuth;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.common.R;
import com.zy.asrs.entity.ManLocDetl;
import com.zy.asrs.service.ManLocDetlService;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.Map;
 
@RestController
public class ManLocDetlController extends BaseController {
 
    @Autowired
    private ManLocDetlService manLocDetlService;
 
    @RequestMapping(value = "/manLocDetl/list/auth")
    @ManagerAuth
    public R list(@RequestParam(defaultValue = "1")Integer curr,
                  @RequestParam(defaultValue = "10")Integer limit,
                  @RequestParam(required = false)String orderByField,
                  @RequestParam(required = false)String orderByType,
                  @RequestParam Map<String, Object> param){
        Long hostId = getHostId();
        System.out.println(hostId);
        if (hostId != null) {
            param.put("host_id", hostId);
        }
        Object nodeId = param.get("node_id");
        if (Cools.isEmpty(nodeId)) {
            nodeId = getOriginNode().getId();
            param.put("node_id", String.valueOf(nodeId));
        }
        Object tagId = param.get("tag_id");
        if (Cools.isEmpty(tagId)) {
            tagId = getOriginTag().getId();
            param.put("tag_id", String.valueOf(tagId));
        }
        if (!Cools.isEmpty(param.get("update_time"))){
            String val = String.valueOf(param.get("update_time"));
            if (val.contains(RANGE_TIME_LINK)) {
                String[] dates = val.split(RANGE_TIME_LINK);
                param.put("startTime", DateUtils.convert(dates[0]));
                param.put("endTime", DateUtils.convert(dates[1]));
                param.remove("update_time");
            }
        }
        System.out.println(param);
        return R.ok(manLocDetlService.getPage(toPage(curr, limit, param, ManLocDetl.class)));
    }
}