lbq
10 小时以前 2cb2fbb2663d975c3812def5c49c8b7495bfb6aa
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
package com.vincent.rsf.server.api.controller.pda;
 
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.vincent.rsf.framework.common.Cools;
import com.vincent.rsf.framework.common.R;
import com.vincent.rsf.server.common.domain.BaseParam;
import com.vincent.rsf.server.common.domain.PageParam;
import com.vincent.rsf.server.manager.entity.BasStation;
import com.vincent.rsf.server.manager.service.BasStationService;
import com.vincent.rsf.server.manager.service.TransferService;
import com.vincent.rsf.server.system.controller.BaseController;
import com.vincent.rsf.server.system.entity.DictData;
import com.vincent.rsf.server.system.service.DictDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
 
@Api(tags = "PDA获取信息接口")
@RequestMapping("/pda")
@RestController
public class SysInfoController extends BaseController {
 
    @Resource
    private DictDataService dictDataService;
    @Resource
    private BasStationService basStationService;
 
 
    @ApiOperation("容器类型")
//    @PreAuthorize("hasAuthority('manager:basStation:list')")
    @GetMapping("/info/palletType/list")
    public R getPalletType() {
 
        return R.ok().add(dictDataService.list(new LambdaQueryWrapper<>(DictData.class)
                .eq(DictData::getDictTypeId, 16).eq(DictData::getDeleted, 0)));
    }
 
//    @PreAuthorize("hasAuthority('manager:basStation:list')")
    @PostMapping("/basStation/page")
    public R getBasStation(@RequestBody Map<String, Object> map) {
        BaseParam baseParam = buildParam(map, BaseParam.class);
        PageParam<BasStation, BaseParam> pageParam = new PageParam<>(baseParam, BasStation.class);
        PageParam<BasStation, BaseParam> page = basStationService.page(pageParam, pageParam.buildWrapper(true));
        for (BasStation station : page.getRecords()) {
            if (!Cools.isEmpty(station.getCrossZoneArea())) {
                List<Long> longs1 = JSONObject.parseArray(station.getCrossZoneArea(), Long.class);
                station.setAreaIds(longs1);
            }
            if (!Cools.isEmpty(station.getContainerType())) {
                List<Long> longs1 = JSONObject.parseArray(station.getContainerType(), Long.class);
                station.setContainerTypes(longs1);
            }
 
        }
        return R.ok().add(page);
    }
 
}