| | |
| | | package com.mes.edgstoragecage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.wrapper.interfaces.LambdaJoin; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.taskcache.mapper.HangzhouMesMapper; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.mapper.OptimizeDetailMapper; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | UpPattenUsageMapper upPattenUsageMapper; |
| | | @Autowired |
| | | OptimizeDetailMapper optimizeDetailMapper; |
| | | |
| | | //识别 破损/拿走 |
| | | public boolean identWorn(String glassid, int ControlsId) { |
| | | List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new QueryWrapper<EdgStorageCageDetails>().eq("glassid", glassid)); |
| | | /** |
| | | * 识别 拿走:200/破损:201 |
| | | * @param glassId |
| | | * @param ControlsId |
| | | * @return |
| | | */ |
| | | public boolean identWorn(String glassId, int ControlsId) { |
| | | List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new QueryWrapper<EdgStorageCageDetails>().eq("glass_id", glassId)); |
| | | if (edgStorageCageDetails.size() == 1) { |
| | | baseMapper.update(edgStorageCageDetails.get(0), new QueryWrapper<EdgStorageCageDetails>().eq("glassid", glassid)); |
| | | EdgStorageCageDetails item=edgStorageCageDetails.get(0); |
| | | item.setState(ControlsId); |
| | | baseMapper.update(edgStorageCageDetails.get(0), new QueryWrapper<EdgStorageCageDetails>().eq("glass_id", glassId)); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | //获取 切割当前版图 |
| | | /** |
| | | * 获取 切割当前版图 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map> selectCutTerritory() { |
| | | List<Map> list = upPattenUsageMapper.selectJoinList( |
| | | Map.class, new MPJQueryWrapper<UpPattenUsage>().selectAll(UpPattenUsage.class) |
| | | .select("escd.glass_id", "escd.flow_card_id", "escd.width", "escd.height") |
| | | .select("gi.x_coordinate","gi.y_coordinate","gi.tempering_feed_sequence") |
| | | .leftJoin("glass_info gi on t.layout_sequence=gi.pattern_sequence and t.engineering_id=gi.engineer_id") |
| | | .leftJoin("edg_storage_cage_details escd on gi.id=escd.glass_id") |
| | | .eq("t.state", 1) |
| | | .orderByAsc("t.layout_sequence") |
| | | ); |
| | | return list; |
| | | public List<OptimizeDetail> selectCutTerritory() { |
| | | List<UpPattenUsage> upPattenUsage=upPattenUsageMapper.selectList(new QueryWrapper<UpPattenUsage>() |
| | | .eq("state", 1)); |
| | | if(!upPattenUsage.isEmpty()){ |
| | | UpPattenUsage upPattenUsage1=upPattenUsage.get(0); |
| | | return optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>() |
| | | .eq("project_no", upPattenUsage1.getEngineeringId()) |
| | | .eq("stock_id",upPattenUsage1.getLayoutSequence()) |
| | | ); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | //获取 工程下的当前版图 |
| | | /** |
| | | * 获取 工程下的当前版图 |
| | | * @param current |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map> selectCurrentCutTerritory(String current) { |
| | | List<Map> list = baseMapper.selectJoinList( |
| | | Map.class, new MPJQueryWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class) |
| | | .select("escd.glass_id", "escd.flow_card_id", "escd.width", "escd.height") |
| | | .leftJoin("glass_info gi on t.layout_sequence=gi.pattern_sequence and t.engineering_id=gi.engineer_id") |
| | | .leftJoin("edg_storage_cage_details escd on gi.id=escd.glass_id") |
| | | .eq("t.engineering_id", current) |
| | | .orderByAsc("t.layout_sequence") |
| | | ); |
| | | return list; |
| | | public List<OptimizeDetail> selectCurrentCutTerritory(String current) { |
| | | return optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>().eq("project_no", current)); |
| | | } |
| | | |
| | | ; |