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 implements LocTypeBindService { @Override public List getLocIdListByTypeId(Long typeId) { return this.baseMapper.getLocIdListByTypeId(typeId); } @Override public List getLocIdListByType(LocType locType) { List locIdList = this.getLocIdListByTypeId(locType.getId()); if (!Cools.isEmpty(locType.getContain())) { List list = JSON.parseArray(locType.getContain(), Long.class); for (Long id : list) { List longs = this.getLocIdListByTypeId(id); if (!longs.isEmpty()) { locIdList.addAll(longs); } } } return locIdList; } }