| | |
| | | package com.mes.edgstoragecage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.wrapper.MPJAbstractLambdaWrapper; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | 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; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Service |
| | | public class EdgStorageCageDetailsServiceImpl extends ServiceImpl<EdgStorageCageDetailsMapper, EdgStorageCageDetails> implements EdgStorageCageDetailsService { |
| | | //获取全部数据 |
| | | public class EdgStorageCageDetailsServiceImpl extends MPJBaseServiceImpl<EdgStorageCageDetailsMapper, EdgStorageCageDetails> implements EdgStorageCageDetailsService { |
| | | |
| | | @Autowired |
| | | private HangzhouMesMapper hangzhouMesMapper; |
| | | UpPattenUsageMapper upPattenUsageMapper; |
| | | @Autowired |
| | | private EdgStorageCageDetailsMapper edgStorageCageDetailsMapper; |
| | | //识别 破损/拿走 |
| | | public boolean identWorn(String glassid,int ControlsId){ |
| | | List<EdgStorageCageDetails> edgStorageCageDetails=edgStorageCageDetailsMapper.selectList(new QueryWrapper<EdgStorageCageDetails>().eq("glassid",glassid)); |
| | | if(edgStorageCageDetails.size()==1){ |
| | | edgStorageCageDetailsMapper.update(edgStorageCageDetails.get(0),new QueryWrapper<EdgStorageCageDetails>().eq("glassid",glassid)); |
| | | OptimizeDetailMapper optimizeDetailMapper; |
| | | |
| | | /** |
| | | * 识别 拿走: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) { |
| | | 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= edgStorageCageDetailsMapper.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("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= edgStorageCageDetailsMapper.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)); |
| | | } |
| | | |
| | | ; |
| | | |
| | | |
| | | } |