| | |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | import com.mes.edgstoragecage.service.*; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | // Boolean[] values1 = { false, true, true, true, false, false, true, false, |
| | | // false, true ,true }; |
| | | // List<Boolean> getplcvlues = new ArrayList<>(Arrays.asList(values1)); |
| | | List<Boolean> getplcvlues = S7object.getinstance().plccontrol.ReadBits(plcBitObject.getPlcAddressBegin(), plcBitObject.getPlcAddressLength()); |
| | | plcBitObject.setPlcBitList(getplcvlues); |
| | | // List<Boolean> getplcvlues = S7object.getinstance().plccontrol.ReadBits(plcBitObject.getPlcAddressBegin(), plcBitObject.getPlcAddressLength()); |
| | | // plcBitObject.setPlcBitList(getplcvlues); |
| | | } |
| | | |
| | | |
| | | public static void readAndUpdateWordValues(PlcParameterObject plcParameterObject) { |
| | | |
| | | // byte[] getplcvlues = {0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02, 0x03, 0x04,0x01, 0x02}; |
| | | byte[] getplcvlues = S7object.getinstance().plccontrol.ReadByte(plcParameterObject.getPlcAddressBegin(), plcParameterObject.getPlcAddressLength()); |
| | | plcParameterObject.setPlcParameterList(getplcvlues); |
| | | // byte[] getplcvlues = S7object.getinstance().plccontrol.ReadByte(plcParameterObject.getPlcAddressBegin(), plcParameterObject.getPlcAddressLength()); |
| | | // plcParameterObject.setPlcParameterList(getplcvlues); |
| | | } |
| | | |
| | | |
| | |
| | | package com.mes.edgstoragecage.controller; |
| | | |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.edgstoragecage.service.impl.EdgStorageCageServiceImpl; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.service.impl.TaskCacheServiceImpl; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.awt.image.ImageProducer; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RequestMapping("/edgStorageCage") |
| | | public class EdgStorageCageController { |
| | | |
| | | //todo: 实例代码 待删除 |
| | | @ApiOperation("测试") |
| | | @GetMapping("/index") |
| | | public String index() { |
| | | return "hello world"; |
| | | @Autowired |
| | | private EdgStorageCageServiceImpl edgStorageCageServiceImpl; |
| | | |
| | | |
| | | //查询磨边缓存理片笼内详情 |
| | | @PostMapping("/selectEdgStorageCage") |
| | | @ResponseBody |
| | | public Result selectEdgStorageCage () { |
| | | List<Map> list=edgStorageCageServiceImpl.selectEdgStorageCages(); |
| | | return Result.build(200,"成功",list); |
| | | } |
| | | //添加磨边缓存理片笼信息 功能:笼内绑定玻璃 |
| | | @PostMapping("/insertEdgStorageCage") |
| | | @ResponseBody |
| | | public Result insertEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) { |
| | | boolean isSucess=edgStorageCageServiceImpl.updateEdgStorageCage(edgStorageCage); |
| | | return Result.build(200,"添加成功",1); |
| | | } |
| | | //修改磨边缓存理片笼信息 功能:对笼内栅格进行【启用/禁用】/ 【更换】笼内栅格玻璃信息 |
| | | @PostMapping("/updateEdgStorageCage") |
| | | @ResponseBody |
| | | public Result updateEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) { |
| | | boolean isSucess=edgStorageCageServiceImpl.updateEdgStorageCage(edgStorageCage); |
| | | return Result.build(200,"更换成功",1); |
| | | } |
| | | |
| | | //删除磨边缓存理片笼信息 功能:对笼内栅格玻璃进行【清除】 |
| | | @PostMapping("/deleteEdgStorageCage") |
| | | @ResponseBody |
| | | public Result deleteEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) { |
| | | boolean isSucess=edgStorageCageServiceImpl.updateEdgStorageCage(edgStorageCage); |
| | | return Result.build(200,"删除成功",1); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.mes.edgstoragecage.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | |
| | | /** |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | public interface EdgStorageCageMapper extends BaseMapper<EdgStorageCage> { |
| | | public interface EdgStorageCageMapper extends MPJBaseMapper<EdgStorageCage> { |
| | | |
| | | } |
| | |
| | | * @since 2024-04-07 |
| | | */ |
| | | public interface EdgStorageCageDetailsService extends IService<EdgStorageCageDetails> { |
| | | //获取全部 磨边前缓存笼信息 |
| | | public List<Map> getEdgStorageInfos(); |
| | | //修改 笼内数据 |
| | | public List<Map> setEdgStorageInfos(); |
| | | |
| | | //识别 破损/拿走 |
| | | public boolean identWorn(String glassid,int ControlsId); |
| | | //获取 切割当前版图 |
| | | public List<Map> selectCutTerritory(); |
| | | //获取 工程下的当前版图 |
| | | public List<Map> selectCurrentCutTerritory(String current); |
| | | |
| | | |
| | | } |
| | |
| | | public interface EdgStorageCageService extends IService<EdgStorageCage> { |
| | | |
| | | //查询笼内空格 |
| | | List<EdgStorageCage> selectCacheEmpty(); |
| | | List<Map> selectCacheEmpty(); |
| | | |
| | | //查询笼内出片顺序详情 |
| | | List<EdgStorageCage> selectCacheOut(); |
| | | List<Map> selectCacheOut(); |
| | | |
| | | //查询笼内详情 |
| | | List<Map> selectCacheInfos(); |
| | | |
| | | //添加理片笼信息 传入glassid |
| | | boolean insertCacheInfo(String glassid); |
| | | List<Map> selectEdgStorageCages(); |
| | | |
| | | //修改理片笼内信息 |
| | | boolean updateCacheInfo(String cacheId); |
| | | |
| | | //删除理片笼内信息 |
| | | boolean deleteCacheInfo(String cacheId); |
| | | boolean updateEdgStorageCage(EdgStorageCage edgStorageCage); |
| | | } |
| | |
| | | package com.mes.edgstoragecage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.wrapper.MPJAbstractLambdaWrapper; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | |
| | | private HangzhouMesMapper hangzhouMesMapper; |
| | | @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)); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | //获取 切割当前版图 |
| | | @Override |
| | | public List<Map> getEdgStorageInfos(){ |
| | | List<Map> map=edgStorageCageDetailsMapper.selectJoinList( |
| | | Map.class,new MPJQueryWrapper<EdgStorageCage>().selectAll(EdgStorageCage.class) |
| | | .select("a.c","a.d") |
| | | .leftJoin("ab a on t.id=a.id") |
| | | .le("a.id","1") |
| | | 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 map; |
| | | }; |
| | | |
| | | return list; |
| | | } |
| | | //获取 工程下的当前版图 |
| | | @Override |
| | | public List<Map> setEdgStorageInfos(){ |
| | | return hangzhouMesMapper.selectCachInfo(); |
| | | 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; |
| | | }; |
| | | |
| | | |
| | |
| | | package com.mes.edgstoragecage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | |
| | | EdgStorageCageDetailsMapper edgStorageCageDetailsMapper; |
| | | |
| | | @Override |
| | | //查询笼内空格 EdgStorageCage as esc left join EdgStorageCageDetails as escd esc.device_id=escd.device_id |
| | | public List<EdgStorageCage> selectCacheEmpty(){ |
| | | List<EdgStorageCage> listEdgStorageCage= edgStorageCageMapper.selectList(null); |
| | | ; |
| | | List<EdgStorageCageDetails> orderList = listEdgStorageCage.stream() |
| | | .flatMap(user -> edgStorageCageDetailsMapper.selectList( |
| | | new QueryWrapper<EdgStorageCageDetails>().eq("user_id", user.getId())).stream() |
| | | ) |
| | | .collect(Collectors.toList()); |
| | | |
| | | return listEdgStorageCage; |
| | | //查询笼内空格 |
| | | public List<Map> selectCacheEmpty(){ |
| | | List<Map> map=edgStorageCageMapper.selectJoinList( |
| | | Map.class,new MPJQueryWrapper<EdgStorageCage>().selectAll(EdgStorageCage.class) |
| | | .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | .isNull("escd.slot") |
| | | ); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | //查询笼内出片任务 |
| | | public List<EdgStorageCage> selectCacheOut(){ |
| | | List<EdgStorageCage> list= new ArrayList<EdgStorageCage>(); |
| | | //查询笼内出片任务 按钢化版图号+版图内序号 |
| | | public List<Map> selectCacheOut(){ |
| | | List<Map> list= edgStorageCageMapper.selectJoinList( |
| | | Map.class,new MPJQueryWrapper<EdgStorageCage>().selectAll(EdgStorageCage.class) |
| | | .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .orderByAsc("escd.tempering_layout_id","escd.tempering_feed_sequence") |
| | | ); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | //理片缓存详情 |
| | | public List<Map> selectCacheInfos(){ |
| | | List<Map> mapList=new ArrayList<>(); |
| | | return mapList; |
| | | public List<Map> selectEdgStorageCages(){ |
| | | List<Map> map=edgStorageCageMapper.selectJoinList( |
| | | Map.class,new MPJQueryWrapper<EdgStorageCage>().selectAll(EdgStorageCage.class) |
| | | .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | ); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | //添加理片笼信息 传入glassid |
| | | public boolean insertCacheInfo(String glassid){ |
| | | return false; |
| | | //修改理片笼内信息 功能:对笼内栅格玻璃 【添加/删除/更换】 |
| | | public boolean updateEdgStorageCage(EdgStorageCage edgStorageCage){ |
| | | edgStorageCageMapper.updateById(edgStorageCage); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | //修改理片笼内信息 |
| | | public boolean updateCacheInfo(String cacheId){ |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | //删除理片笼内信息 |
| | | public boolean deleteCacheInfo(String cacheId){ |
| | | return false; |
| | | } |
| | | } |
| | |
| | | package com.mes.glassinfo.controller; |
| | | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.utils.Result; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.mes.glassinfo.service.impl.GlassInfoServiceImpl; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RequestMapping("/glassInfo") |
| | | public class GlassInfoController { |
| | | |
| | | @Autowired |
| | | private GlassInfoServiceImpl GlassInfoServiceImpl; |
| | | |
| | | @PostMapping("/selectId") // 查询切割版图信息-根据 工程号 |
| | | @ResponseBody |
| | | public Result selectId(String ProcessId) { |
| | | List<GlassInfo> list = GlassInfoServiceImpl.selectId(ProcessId); |
| | | return Result.build(200,"成功",list); |
| | | } |
| | | |
| | | @PostMapping("/selectAll") // 查询切割版图信息-根据 工程号 |
| | | @ResponseBody |
| | | public Result selectAll() { |
| | | List<GlassInfo> list = GlassInfoServiceImpl.selectAll(); |
| | | return Result.build(200,"成功",list); |
| | | } |
| | | |
| | | @PostMapping("/selectFlowCardId") // 查询切割版图信息-根据 工程号 |
| | | @ResponseBody |
| | | public Result selectFlowCardId(String flowCardId) { |
| | | List<GlassInfo> list = GlassInfoServiceImpl.selectFlowCardId(flowCardId); |
| | | return Result.build(200,"成功",list); |
| | | } |
| | | } |
| | | |
| | |
| | | /** |
| | | * 流程卡 |
| | | */ |
| | | private String flowcardId; |
| | | private String flowCardId; |
| | | |
| | | /** |
| | | * 流程卡玻璃类型 |
| | |
| | | |
| | | public List<GlassInfo> selectAll(); |
| | | public List<GlassInfo> selectId(String glassId); |
| | | public List<GlassInfo> selectFlowcardId(String flowcard_id); |
| | | public List<GlassInfo> selectFlowCardId(String flowCardId); |
| | | } |
| | |
| | | //根据ID 获取小片数据 |
| | | @Override |
| | | public List<GlassInfo> selectId(String glassId){ |
| | | QueryWrapper<GlassInfo> queryWrapper = new QueryWrapper<GlassInfo>(); |
| | | queryWrapper.eq("id",glassId); |
| | | return glassInfoMapper.selectList(queryWrapper); |
| | | return glassInfoMapper.selectList(new QueryWrapper<GlassInfo>().eq("id",glassId)); |
| | | }; |
| | | |
| | | //获取全部小片数据 |
| | |
| | | |
| | | //根据工程 获取小片数据 |
| | | @Override |
| | | public List<GlassInfo> selectFlowcardId(String flowcardId){ |
| | | QueryWrapper<GlassInfo> queryWrapper = new QueryWrapper<GlassInfo>(); |
| | | queryWrapper.eq("flowcardId",flowcardId); |
| | | return glassInfoMapper.selectList(queryWrapper); |
| | | public List<GlassInfo> selectFlowCardId(String flowCardId){ |
| | | return glassInfoMapper.selectList(new QueryWrapper<GlassInfo>().eq("flowCardId",flowCardId)); |
| | | }; |
| | | } |
| | |
| | | package com.mes.taskcache.controller; |
| | | |
| | | import com.mes.edgstoragecage.service.impl.EdgStorageCageDetailsServiceImpl; |
| | | import com.mes.edgstoragecage.service.impl.EdgStorageCageServiceImpl; |
| | | import com.mes.taskcache.service.HangzhoumesService; |
| | | import com.mes.taskcache.service.PpService; |
| | | import com.mes.utils.Result; |
| | |
| | | public class TaskCacheController { |
| | | |
| | | @Autowired |
| | | private PpService ppService; |
| | | private EdgStorageCageServiceImpl edgStorageCageServiceImpl; |
| | | |
| | | @Autowired |
| | | private EdgStorageCageDetailsServiceImpl edgStorageCageDetailsServiceImpl; |
| | | |
| | | @Autowired |
| | | private HangzhoumesService hangzhoumesService; |
| | | |
| | | // @GetMapping("/SelectTerritoryInfo") // 查询钢化版图信息-根据 工程号 |
| | | // @ResponseBody |
| | | // public Result SelectTerritoryInfo(@RequestParam(name = "ProcessId", required = false) String ProcessId) { |
| | | // List<Tempered> h = ppService.selectTemperedTerritory(ProcessId); |
| | | // return Result.seccess(h); |
| | | // } |
| | | |
| | | @GetMapping("/CutTerritory") // 查询切割版图信息-根据 工程号 |
| | | @PostMapping("/cutTerritory") // 查询切割版图信息-根据 工程号 |
| | | @ResponseBody |
| | | public Result CutTerritory(String ProcessId) { |
| | | List<Map> h = ppService.selectCutTerritory(ProcessId); |
| | | public Result cutTerritory(String current) { |
| | | List<Map> h = edgStorageCageDetailsServiceImpl.selectCurrentCutTerritory(current); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | |
| | | @GetMapping("/CurrentCutTerritory") // 识别显示 当前版图 |
| | | @PostMapping("/currentCutTerritory") // 识别显示 当前版图 |
| | | @ResponseBody |
| | | public Result CurrentCutTerritory() { |
| | | List<Map> h = ppService.selectCutTerritory(); |
| | | System.out.println(h); |
| | | public Result currentCutTerritory() { |
| | | List<Map> h = edgStorageCageDetailsServiceImpl.selectCutTerritory(); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | |
| | | @GetMapping("/SelectCutTerritory") // 识别显示 特定版图 |
| | | @PostMapping("/selectCutTerritory") // 识别显示 特定版图 |
| | | @ResponseBody |
| | | public Result SelectCutTerritory(String TerritoryId) { |
| | | List<Map> h = ppService.selectCutTerritory(TerritoryId); |
| | | public Result selectCutTerritory(String TerritoryId) { |
| | | List<Map> h = edgStorageCageDetailsServiceImpl.selectCutTerritory(); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | |
| | | @GetMapping("/IdentControls") // 识别操作: 破损/拿走 参数(ID,功能[0:破损,1:拿走]) |
| | | @PostMapping("/identControls") // 识别操作: 破损/拿走 参数(ID,功能[0:破损,1:拿走]) |
| | | @ResponseBody |
| | | public Result Ident(@RequestParam(name = "IdentId", required = false) String ProcessId,@RequestParam(name = "ControlsId", required = false) String ControlsId) { |
| | | List<Map> h = ppService.selectCutTerritory("P24032508"); |
| | | return Result.build(200,"成功",h); |
| | | public Result identControls(@RequestParam(name = "identId", required = false) String identId,@RequestParam(name = "controlsId", required = false) int controlsId) { |
| | | |
| | | boolean issucess = edgStorageCageDetailsServiceImpl.identWorn(identId,controlsId); |
| | | return Result.build(200,"成功",issucess); |
| | | } |
| | | |
| | | @GetMapping("/SelectCageInfo") // 查询笼内信息 |
| | | @PostMapping("/selectCageInfo") // 查询笼内信息 |
| | | @ResponseBody |
| | | public Result SelectCageInfo(String ProcessId) { |
| | | public Result selectCageInfo(String ProcessId) { |
| | | List<Map> h = hangzhoumesService.SelectCageInfo(); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | |
| | | @GetMapping("/SelectEdgTask") //磨边任务 |
| | | @PostMapping("/selectEdgTask") //磨边任务 |
| | | @ResponseBody |
| | | public Result SelectEdgTask(String ProcessId) { |
| | | public Result selectEdgTask(String ProcessId) { |
| | | List<Map> EdgTasks = hangzhoumesService.SelectEdgInfo("1"); |
| | | return Result.build(200,"成功",EdgTasks); |
| | | } |
| | |
| | | |
| | | import com.mes.common.PLCAutoMes; |
| | | import com.mes.common.PlcParameterObject; |
| | | import com.mes.common.S7object; |
| | | //import com.mes.common.S7object; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.taskcache.mapper.HangzhouMesMapper; |
| | |
| | | // } |
| | | // } |
| | | // } |
| | | //理片 进 |
| | | public boolean processInto(String Number){ |
| | | //查询消息队列里的玻璃 |
| | | GlassInfo GlassInfo=hangzhouMesMapper.selectGlassId(Number); |
| | | PlcParameterObject plcmes= PLCAutoMes.PlcMesObject; |
| | | if(GlassInfo!=null){//存在此玻璃编号 |
| | | //同钢化版图内的栅格号 |
| | | List<EdgStorageCageDetails> list=hangzhouMesMapper.selectIsExistIntoCache(GlassInfo.getTemperingLayoutId(),GlassInfo.getTemperingFeedSequence(),GlassInfo.getWidth()); |
| | | //空栅格号 |
| | | if (list.size()==0) { |
| | | list=hangzhouMesMapper.selectCacheLeisure(); |
| | | } |
| | | //小于此玻璃钢化版图序号的栅格号 |
| | | if(list.size()==0){ |
| | | list=hangzhouMesMapper.selectIsExistIntoCache(GlassInfo.getTemperingLayoutId(),GlassInfo.getWidth()); |
| | | } |
| | | if(list.size()>0){ |
| | | //存在空格 |
| | | //1.生成任务: 起始位置0 结束位置this.slot 任务类型 1 (进片任务) |
| | | //2.回复 1进片 |
| | | EdgStorageCageDetails item=list.get(0); |
| | | hangzhouMesMapper.insertCacheTask(GlassInfo.getId()+"","0",item.getSlot()+"","1"); |
| | | S7object.getinstance().plccontrol.WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1); |
| | | return true; |
| | | } |
| | | |
| | | }else{ |
| | | // ID编号不存在 不处理/回复PLC 进行报警提示 |
| | | } |
| | | //返回结果 |
| | | return false; |
| | | } |
| | | // //理片 进 |
| | | // public boolean processInto(String Number){ |
| | | // //查询消息队列里的玻璃 |
| | | // GlassInfo GlassInfo=hangzhouMesMapper.selectGlassId(Number); |
| | | // PlcParameterObject plcmes= PLCAutoMes.PlcMesObject; |
| | | // if(GlassInfo!=null){//存在此玻璃编号 |
| | | // //同钢化版图内的栅格号 |
| | | // List<EdgStorageCageDetails> list=hangzhouMesMapper.selectIsExistIntoCache(GlassInfo.getTemperingLayoutId(),GlassInfo.getTemperingFeedSequence(),GlassInfo.getWidth()); |
| | | // //空栅格号 |
| | | // if (list.size()==0) { |
| | | // list=hangzhouMesMapper.selectCacheLeisure(); |
| | | // } |
| | | // //小于此玻璃钢化版图序号的栅格号 |
| | | // if(list.size()==0){ |
| | | // list=hangzhouMesMapper.selectIsExistIntoCache(GlassInfo.getTemperingLayoutId(),GlassInfo.getWidth()); |
| | | // } |
| | | // if(list.size()>0){ |
| | | // //存在空格 |
| | | // //1.生成任务: 起始位置0 结束位置this.slot 任务类型 1 (进片任务) |
| | | // //2.回复 1进片 |
| | | // EdgStorageCageDetails item=list.get(0); |
| | | // hangzhouMesMapper.insertCacheTask(GlassInfo.getId()+"","0",item.getSlot()+"","1"); |
| | | // S7object.getinstance().plccontrol.WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1); |
| | | // return true; |
| | | // } |
| | | // |
| | | // }else{ |
| | | // // ID编号不存在 不处理/回复PLC 进行报警提示 |
| | | // } |
| | | // //返回结果 |
| | | // return false; |
| | | // } |
| | | // //理片 出 |
| | | // public boolean processOut(){ |
| | | // //查询任务 |
| | |
| | | public interface TaskCacheService extends IService<TaskCache> { |
| | | |
| | | //添加理片笼任务 |
| | | public boolean insertTaskCache(); |
| | | boolean insertTaskCache(TaskCache taskCache); |
| | | |
| | | //查询磨边任务 |
| | | public List<TaskCache> selectEdgInfo(String line); |
| | | List<TaskCache> selectEdgInfo(String line); |
| | | |
| | | //查询理片任务 |
| | | public List<TaskCache> selectCacheInfo(); |
| | | List<TaskCache> selectCacheInfo(); |
| | | |
| | | //查询全部任务 |
| | | public List<TaskCache> selectAll(); |
| | | List<TaskCache> selectAll(); |
| | | |
| | | //查询进片任务 |
| | | public List<TaskCache> selectInputTaskCache(); |
| | | List<TaskCache> selectInputTaskCache(); |
| | | |
| | | //查询出片任务 |
| | | public List<TaskCache> selectOutTaskCache(); |
| | | List<TaskCache> selectOutTaskCache(); |
| | | |
| | | //查询 A09 或 A10 最新的一片 出片任务 |
| | | public boolean selectLastOutCacheInfo(); |
| | | List<TaskCache> selectLastOutCacheInfo(String line); |
| | | } |
| | |
| | | package com.mes.taskcache.service.impl; |
| | | |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.mapper.TaskCacheMapper; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | @Service |
| | | public class TaskCacheServiceImpl extends ServiceImpl<TaskCacheMapper, TaskCache> implements TaskCacheService { |
| | | |
| | | //添加理片笼任务 |
| | | @Override |
| | | public boolean insertTaskCache(){ |
| | | return false; |
| | | public boolean insertTaskCache(TaskCache taskCache){ |
| | | return this.save(taskCache); |
| | | } |
| | | |
| | | //查询磨边任务 |
| | | @Override |
| | | public List<TaskCache> selectEdgInfo(String line) { |
| | | return null; |
| | | public List<TaskCache> selectEdgInfo(String line){ |
| | | |
| | | } |
| | | |
| | | //查询理片任务 |
| | | @Override |
| | | public List<TaskCache> selectCacheInfo(){ |
| | | return null; |
| | | |
| | | } |
| | | |
| | | //查询全部任务 |
| | | @Override |
| | | public List<TaskCache> selectAll() { |
| | | return null; |
| | | public List<TaskCache> selectAll(){ |
| | | |
| | | } |
| | | |
| | | //查询进片任务 |
| | | @Override |
| | | public List<TaskCache> selectInputTaskCache(){ |
| | | return null; |
| | | |
| | | } |
| | | |
| | | //查询出片任务 |
| | | @Override |
| | | public List<TaskCache> selectOutTaskCache(){ |
| | | return null; |
| | | |
| | | } |
| | | |
| | | //查询 A09 或 A10 最新的一片 出片任务 |
| | | @Override |
| | | public boolean selectLastOutCacheInfo(){ |
| | | return false; |
| | | public List<TaskCache> selectLastOutCacheInfo(String line){ |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.uppattenusage.controller; |
| | | |
| | | import com.mes.edgstoragecage.service.impl.EdgStorageCageDetailsServiceImpl; |
| | | import com.mes.edgstoragecage.service.impl.EdgStorageCageServiceImpl; |
| | | import com.mes.taskcache.service.HangzhoumesService; |
| | | import com.mes.utils.Result; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/taskCache") |
| | | public class uppattenusageController { |
| | | |
| | | @Autowired |
| | | private EdgStorageCageServiceImpl edgStorageCageServiceImpl; |
| | | |
| | | @Autowired |
| | | private EdgStorageCageDetailsServiceImpl edgStorageCageDetailsServiceImpl; |
| | | |
| | | @Autowired |
| | | private HangzhoumesService hangzhoumesService; |
| | | |
| | | |
| | | @PostMapping("/selectEdgTask") //磨边任务 |
| | | @ResponseBody |
| | | public Result selectEdgTask(String ProcessId) { |
| | | List<Map> EdgTasks = hangzhoumesService.SelectEdgInfo("1"); |
| | | return Result.build(200,"成功",EdgTasks); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.uppattenusage.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | @Data //lombok 简写java代码 实体类的get与set |
| | | @TableName("`up_patten_usage`") |
| | | public class UpPattenUsage { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id;//原片使用情况表id |
| | | private Integer engineeringid;//工程号 |
| | | private Integer filmsid;//膜系id |
| | | private Double width;//宽 |
| | | private Double height;//高 |
| | | private Double thickness;//厚度 |
| | | private Integer layoutsequence;//原片版图片序 |
| | | private Integer state;//状态 |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.uppattenusage.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | public interface UpPattenUsageMapper extends BaseMapper<UpPattenUsage> { |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.uppattenusage.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | public interface UpPattenUsageService extends IService<UpPattenUsage> { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.uppattenusage.service.impl; |
| | | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | | import com.mes.uppattenusage.service.UpPattenUsageService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Service |
| | | public class UpPattenUsageServiceImpl extends ServiceImpl<UpPattenUsageMapper, UpPattenUsage> implements UpPattenUsageService { |
| | | |
| | | } |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.edgstoragecage.service.impl.EdgStorageCageServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.test.context.junit4.SpringRunner; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | @SpringBootTest(classes = CacheGlassModuleApplication.class) |
| | | public class CacheGlassModuleApplicationTest { |
| | | |
| | | @Autowired |
| | | EdgStorageCageServiceImpl edgStorageCageServiceImpl; |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | | log.info("完整路径:{}", Arrays.asList("123")); |
| | | } |
| | | |
| | | @Test |
| | | public void testCacheGlass() { |
| | | List<Map> map= edgStorageCageServiceImpl.selectEdgStorageCages(); |
| | | log.info("笼内信息:{}", Arrays.asList(map)); |
| | | } |
| | | @Test |
| | | public void testselectCacheEmpty() { |
| | | List<Map> map= edgStorageCageServiceImpl.selectCacheEmpty(); |
| | | log.info("笼内空格:{}", Arrays.asList(map)); |
| | | } |
| | | @Test |
| | | public void testScan() { |
| | | List<Map> map= edgStorageCageServiceImpl.selectEdgStorageCages(); |
| | | log.info("切割当前版图信息:{}", Arrays.asList(map)); |
| | | } |
| | | } |
| | |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>cacheVerticalGlass</artifactId> |
| | | <dependencies> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.yulichang</groupId> |
| | | <artifactId>mybatis-plus-join</artifactId> |
| | | <version>1.1.6</version> |
| | | </dependency> |
| | | </dependencies> |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | | <maven.compiler.target>8</maven.compiler.target> |