StationService.java
2.83 KB
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
package com.huaheng.pc.config.station.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.huaheng.common.constant.QuantityConstant;
import com.huaheng.common.utils.Wrappers;
import com.huaheng.pc.config.container.domain.Container;
import com.huaheng.pc.config.container.service.ContainerService;
import com.huaheng.pc.config.containerType.domain.ContainerType;
import com.huaheng.pc.config.containerType.service.ContainerTypeService;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huaheng.pc.config.station.domain.Station;
import com.huaheng.pc.config.station.mapper.StationMapper;
import javax.annotation.Resource;
/**
* Created by Enzo Cotter on 2019/10/11.
*/
@Service("stationService")
public class StationService extends ServiceImpl<StationMapper, Station> {
@Resource
private ContainerService containerService;
@Resource
private ContainerTypeService containerTypeService;
public List<Station> selectlist(){
LambdaQueryWrapper<Station> lambdaQueryWrapper = Wrappers.lambdaQuery();
List<Station> list = this.list(lambdaQueryWrapper);
return list;
}
public Station getStaionByCode(String code,String warehouseCode){
Station station = this.getOne(
new LambdaQueryWrapper<Station>()
.eq(Station::getWarehouseCode, warehouseCode)
.eq(Station::getCode, code)
.last("limit 1"));
return station;
}
public List<Station> getStationByContainer(String area){
// int type = Integer.parseInt(types);
// Container container = containerService.getContainerByCode(containerCode);
// ContainerType containerType = containerTypeService.getContainerTypeByCode(container.getContainerType(), container.getWarehouseCode());
// Map<String, Object> map = new HashMap<>();
// if (container == null) {
// return null;
// }
// String area=containerType.getArea();
//
// if (type == QuantityConstant.STATION_PICK_AND_OUT) {
// queryWrapper.in(Station::getType,
// QuantityConstant.STATION_OUT, QuantityConstant.STATION_PICK);
// }
// if (type == QuantityConstant.STATION_OUT) {
// queryWrapper.in(Station::getType,
// QuantityConstant.STATION_OUT, QuantityConstant.STATION_PICK);
// } else {
// queryWrapper.eq(Station::getType, type);
// }
LambdaQueryWrapper<Station> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(Station::getArea, area);
List<Station> stationList = this.list(queryWrapper);
return stationList;
}
}