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
package com.zy.asrs.wms.asrs.service.impl;
 
import com.alibaba.fastjson.JSON;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.wms.asrs.entity.LocType;
import com.zy.asrs.wms.asrs.mapper.LocTypeBindMapper;
import com.zy.asrs.wms.asrs.entity.LocTypeBind;
import com.zy.asrs.wms.asrs.service.LocTypeBindService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
 
import java.util.Collections;
import java.util.List;
 
@Service("locTypeBindService")
public class LocTypeBindServiceImpl extends ServiceImpl<LocTypeBindMapper, LocTypeBind> implements LocTypeBindService {
 
    @Override
    public List<Long> getLocIdListByTypeId(Long typeId) {
        return this.baseMapper.getLocIdListByTypeId(typeId);
    }
 
    @Override
    public List<Long> getLocIdListByType(LocType locType) {
        List<Long> locIdList = this.getLocIdListByTypeId(locType.getId());
 
        if (!Cools.isEmpty(locType.getContain())) {
            List<Long> list = JSON.parseArray(locType.getContain(), Long.class);
            for (Long id : list) {
                List<Long> longs = this.getLocIdListByTypeId(id);
                if (!longs.isEmpty()) {
                    locIdList.addAll(longs);
                }
            }
        }
        return locIdList;
    }
}