| | |
| | | package com.mes.downstorage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | |
| | | |
| | |
| | | |
| | | import com.mes.downstorage.mapper.DownStorageCageMapper; |
| | | import com.mes.downstorage.service.DownStorageCageDetailsService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | @Slf4j |
| | | @Service |
| | | public class DownStorageCageDetailsServiceImpl extends ServiceImpl<DownStorageCageDetailsMapper, DownStorageCageDetails> implements DownStorageCageDetailsService { |
| | | |
| | | @Autowired |
| | | @Autowired(required=false) |
| | | private DownStorageCageMapper downStorageCageMapper; |
| | | @Autowired |
| | | private DownStorageCageDetailsMapper downStorageCageDetailsMapper; |
| | | |
| | | @Override |
| | | public void addDownStorageCageDetails(DownStorageCageDetails details) { |
| | | this.save(details); |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> getCacheOut(int start, int end) { |
| | | log.info("根据传入的工位查询符合按照顺序和大小出片的小片"); |
| | | return downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCage>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .leftJoin("down_workstation dw on escd.flow_card_id = dw.flow_card_id") |
| | | .leftJoin("glass_info gi on dw.flow_card_id = gi.flowcard_id and gi.flowcard_id=escd.flow_card_id ") |
| | | .isNotNull("escd.slot") |
| | | .between("dw.workstation_id", start, end) |
| | | .orderByDesc("escd.width") |
| | | .orderByDesc("escd.height") |
| | | ); |
| | | } |
| | | |
| | | |
| | | // @Override |
| | | // public List<DownStorageCageDetails> getCacheOut(int start, int end) { |
| | | // log.info("根据传入的工位查询符合按照顺序和大小出片的小片"); |
| | | // return downStorageCageMapper.selectJoinList( |
| | | // DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCage>() |
| | | // .select("escd.*") |
| | | // .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | // .leftJoin("down_workstation dw on escd.flow_card_id = dw.flow_card_id") |
| | | // .leftJoin("glass_info gi on dw.flow_card_id = gi.flowcard_id and gi.flowcard_id=escd.flow_card_id ") |
| | | // .isNotNull("escd.slot") |
| | | // .between("dw.workstation_id", start, end) |
| | | // .orderByDesc("escd.width") |
| | | // .orderByDesc("escd.height") |
| | | // ); |
| | | // } |
| | | |
| | | |
| | | // @Override |
| | | // public List<DownStorageCageDetails> selectCacheEmpty2(){ |
| | | // return downStorageCageMapper.selectJoinList( |
| | | // DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCage>() |
| | | // .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | // .leftJoin("down_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | // .isNull("escd.slot") |
| | | // ); |
| | | // } |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> selectCacheEmpty2(){ |
| | | return downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCage>() |
| | | .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | .leftJoin("down_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | .isNull("escd.slot") |
| | | public List<Map<String, Object>> getCacheInfo() { |
| | | log.info("查询笼子内信息"); |
| | | return downStorageCageDetailsMapper.selectJoinMaps(JoinWrappers.lambda(DownStorageCageDetails.class) // 使用 JoinWrappers.lambda 创建联合查询 |
| | | .selectAll(DownStorageCageDetails.class) // 选择所有字段 |
| | | .eq(DownStorageCage::getSlot, DownStorageCageDetails::getSlot) // 设置关联条件 |
| | | .orderByAsc(DownStorageCage::getSlot) // 按 slot 字段升序排序 |
| | | ); |
| | | } |
| | | |
| | | // |
| | | // @Override |
| | | // public List<Map> getCacheInfo() { |
| | | // log.info(" 查询笼子内信息"); |
| | | // return downStorageCageMapper.selectJoinList( |
| | | // Map.class, new MPJQueryWrapper<DownStorageCage>() |
| | | // .select("escd.*") |
| | | // .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | // .orderByAsc("t.slot") |
| | | // ); |
| | | // |
| | | // } |
| | | |
| | | @Override |
| | | public List<Map> getCacheInfo() { |
| | | log.info(" 查询笼子内信息"); |
| | | return downStorageCageMapper.selectJoinList( |
| | | Map.class, new MPJQueryWrapper<DownStorageCage>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .orderByAsc("t.slot") |
| | | ); |
| | | |
| | | } |
| | | // @Override |
| | | // public List<DownStorageCageDetails> getCacheLeisure() { |
| | | // log.info(" 查询笼子内空闲"); |
| | | // List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( |
| | | // DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCage>() |
| | | // .select("escd.*") |
| | | // .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | // .isNull("escd.slot") |
| | | // |
| | | // .orderByAsc("escd.slot") |
| | | // ); |
| | | // return list; |
| | | // } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> getCacheLeisure() { |
| | | log.info(" 查询笼子内空闲"); |
| | | List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCage>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNull("escd.slot") |
| | | |
| | | .orderByAsc("escd.slot") |
| | | ); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<DownStorageCageDetails> getIsExistIntoCacheByflowcardid(String flowcardid, double width) { |
| | | log.info(" 查询可进此片玻璃的栅格号 找到空格"); |
| | | |
| | | return downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCage>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNull("escd.slot") |
| | | .apply("t.remain_width - " + width + " > 0") |
| | | .orderByAsc("escd.sequence") |
| | | ); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | // @Override |
| | | // public List<DownStorageCageDetails> getIsExistIntoCacheByflowcardid(String flowcardid, double width) { |
| | | // log.info(" 查询可进此片玻璃的栅格号 找到空格"); |
| | | // |
| | | // return downStorageCageMapper.selectJoinList( |
| | | // DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCage>() |
| | | // .select("escd.*") |
| | | // .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | // .isNull("escd.slot") |
| | | // .apply("t.remain_width - " + width + " > 0") |
| | | // .orderByAsc("escd.sequence") |
| | | // ); |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // } |
| | | |
| | | |
| | | |