Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
| | |
| | | package com.mes.pp.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @DS("pp") |
| | | @Mapper |
| | | public interface OptimizeDetailMapper extends BaseMapper<OptimizeDetail> { |
| | | public interface OptimizeDetailMapper extends MPJBaseMapper<OptimizeDetail> { |
| | | |
| | | } |
| | |
| | | package com.mes.pp.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | |
| | | /** |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | public interface OptimizeDetailService extends IService<OptimizeDetail> { |
| | | public interface OptimizeDetailService extends MPJBaseService<OptimizeDetail> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.mapper.OptimizeDetailMapper; |
| | | import com.mes.pp.service.OptimizeDetailService; |
| | |
| | | */ |
| | | @Service |
| | | @DS("pp") |
| | | public class OptimizeDetailServiceImpl extends ServiceImpl<OptimizeDetailMapper, OptimizeDetail> implements OptimizeDetailService { |
| | | public class OptimizeDetailServiceImpl extends MPJBaseServiceImpl<OptimizeDetailMapper, OptimizeDetail> implements OptimizeDetailService { |
| | | |
| | | } |
| | |
| | | // 2、全局配置 |
| | | // 全局配置 |
| | | GlobalConfig gc = new GlobalConfig(); |
| | | gc.setOutputDir("D:\\Documents\\hangzhoumesParent1\\"); |
| | | gc.setOutputDir("D:\\Documents\\hangzhoumesParent2\\"); |
| | | |
| | | gc.setServiceName("%sService"); //去掉Service接口的首字母I |
| | | gc.setAuthor("zhoush"); |
| | | gc.setAuthor("wu"); |
| | | gc.setOpen(false); |
| | | mpg.setGlobalConfig(gc); |
| | | |
| | |
| | | // 4、包配置 |
| | | PackageConfig pc = new PackageConfig(); |
| | | pc.setParent("com.mes"); |
| | | pc.setModuleName("userinfo"); //模块名 |
| | | pc.setModuleName("engineering"); //模块名 |
| | | pc.setController("controller"); |
| | | pc.setService("service"); |
| | | pc.setMapper("mapper"); |
| | |
| | | // 5、策略配置 |
| | | StrategyConfig strategy = new StrategyConfig(); |
| | | |
| | | strategy.setInclude("up_patten_usage"); |
| | | strategy.setInclude("engineering"); |
| | | |
| | | strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 |
| | | |
| | |
| | | package com.mes.edgstoragecage.controller; |
| | | |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.edgstoragecage.service.impl.EdgStorageCageServiceImpl; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Api("磨边前缓存") |
| | | @Api(tags = "理片笼缓存") |
| | | @RestController |
| | | @RequestMapping("/edgStorageCage") |
| | | public class EdgStorageCageController { |
| | |
| | | @ApiOperation("删除磨边缓存理片笼信息 功能:对笼内栅格玻璃进行【清除】") |
| | | @PostMapping("/deleteEdgStorageCage") |
| | | @ResponseBody |
| | | public Result deleteEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) { |
| | | public Result deleteEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage, EdgStorageCageDetails edgStorageCageDetails) { |
| | | boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage); |
| | | return Result.build(200,"删除成功",1); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | /** |
| | | * 识别 破损/拿走 |
| | | * @param glassid |
| | | * @param glassId |
| | | * @param ControlsId |
| | | * @return |
| | | */ |
| | | boolean identWorn(String glassid,int ControlsId); |
| | | //获取 切割当前版图 |
| | | List<Map> selectCutTerritory(); |
| | | //获取 工程下的当前版图 |
| | | List<Map> selectCurrentCutTerritory(String current); |
| | | boolean identWorn(String glassId,int ControlsId); |
| | | |
| | | /** |
| | | * 获取 切割当前版图 |
| | | * @return |
| | | */ |
| | | List<OptimizeDetail> selectCutTerritory(); |
| | | |
| | | /** |
| | | * 获取 工程下的当前版图 |
| | | * @param current |
| | | * @return |
| | | */ |
| | | List<OptimizeDetail> selectCurrentCutTerritory(String current); |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface EdgStorageCageService extends MPJBaseService<EdgStorageCage> { |
| | | |
| | | //查询笼内空格 |
| | | /** |
| | | * 查询笼内空格 |
| | | * @return |
| | | */ |
| | | List<Map> selectCacheEmpty(); |
| | | |
| | | //查询笼内出片顺序详情 |
| | | /** |
| | | * 查询笼内出片顺序详情 |
| | | * @return |
| | | */ |
| | | List<Map> selectCacheOut(); |
| | | |
| | | //查询笼内详情 |
| | | /** |
| | | * 查询笼内详情 |
| | | * @return |
| | | */ |
| | | List<Map> selectEdgStorageCages(); |
| | | |
| | | //修改理片笼内信息 |
| | | /** |
| | | * 修改理片笼内信息 |
| | | * @param edgStorageCage |
| | | * @return |
| | | */ |
| | | boolean updateEdgStorageCage(EdgStorageCage edgStorageCage); |
| | | } |
| | |
| | | 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)); |
| | | } |
| | | |
| | | ; |
| | |
| | | @Autowired |
| | | UpPattenUsageMapper upPattenUsageMapper; |
| | | |
| | | /** |
| | | * 查询笼内空格 |
| | | * @return |
| | | */ |
| | | @Override |
| | | //查询笼内空格 |
| | | public List<Map> selectCacheEmpty(){ |
| | | List<Map> map=baseMapper.selectJoinList( |
| | | return baseMapper.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; |
| | | } |
| | | |
| | | /** |
| | | * 查询笼内出片任务 按钢化版图号+版图内序号 |
| | | * @return |
| | | */ |
| | | @Override |
| | | //查询笼内出片任务 按钢化版图号+版图内序号 |
| | | public List<Map> selectCacheOut(){ |
| | | List<Map> list= upPattenUsageMapper.selectJoinList( |
| | | return upPattenUsageMapper.selectJoinList( |
| | | Map.class,new MPJQueryWrapper<UpPattenUsage>().selectAll(UpPattenUsage.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; |
| | | } |
| | | |
| | | /** |
| | | * 理片缓存详情 |
| | | * @return |
| | | */ |
| | | @Override |
| | | //理片缓存详情 |
| | | public List<Map> selectEdgStorageCages(){ |
| | | List<Map> map=baseMapper.selectJoinList( |
| | | return baseMapper.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; |
| | | } |
| | | |
| | | /** |
| | | * 修改理片笼内信息 功能:对笼内栅格玻璃 【添加/删除/更换】 |
| | | * @param edgStorageCage |
| | | * @return |
| | | */ |
| | | @Override |
| | | //修改理片笼内信息 功能:对笼内栅格玻璃 【添加/删除/更换】 |
| | | public boolean updateEdgStorageCage(EdgStorageCage edgStorageCage){ |
| | | baseMapper.updateById(edgStorageCage); |
| | | return true; |
| | |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Api(tags = "玻璃信息小片") |
| | | @RestController |
| | | @RequestMapping("/glassInfo") |
| | | public class GlassInfoController { |
| | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private Integer engineerId; |
| | | private String engineerId; |
| | | |
| | | /** |
| | | * 生产规则id |
| | | */ |
| | | private Integer ruleId; |
| | | |
| | | /** |
| | | * 玻璃ID |
| | | */ |
| | | private String glassId; |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface GlassInfoService extends IService<GlassInfo> { |
| | | |
| | | /** |
| | | * 查询所有玻璃小片信息 |
| | | * @return |
| | | */ |
| | | public List<GlassInfo> selectAll(); |
| | | |
| | | /** |
| | | * 根据玻璃编号查询玻璃小片信息 |
| | | * @param glassId |
| | | * @return |
| | | */ |
| | | public List<GlassInfo> selectId(String glassId); |
| | | |
| | | /** |
| | | * 根据工程号查询玻璃小片信息 |
| | | * @param flowCardId |
| | | * @return |
| | | */ |
| | | public List<GlassInfo> selectFlowCardId(String flowCardId); |
| | | } |
| | |
| | | public class GlassInfoServiceImpl extends ServiceImpl<GlassInfoMapper, GlassInfo> implements GlassInfoService { |
| | | |
| | | |
| | | //根据ID 获取小片数据 |
| | | /** |
| | | * 根据ID 获取小片数据 |
| | | * @param glassId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<GlassInfo> selectId(String glassId){ |
| | | return baseMapper.selectList(new QueryWrapper<GlassInfo>().eq("id",glassId)); |
| | | return baseMapper.selectList(new QueryWrapper<GlassInfo>().eq("glass_id",glassId)); |
| | | }; |
| | | |
| | | //获取全部小片数据 |
| | | /** |
| | | * 获取全部小片数据 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<GlassInfo> selectAll(){ |
| | | return baseMapper.selectList(null); |
| | | }; |
| | | |
| | | //根据工程 获取小片数据 |
| | | /** |
| | | * 根据工程 获取小片数据 |
| | | * @param flowCardId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<GlassInfo> selectFlowCardId(String flowCardId){ |
| | | return baseMapper.selectList(new QueryWrapper<GlassInfo>().eq("flowCardId",flowCardId)); |
| | | return baseMapper.selectList(new QueryWrapper<GlassInfo>().eq("flow_card_id",flowCardId)); |
| | | }; |
| | | } |
| | |
| | | |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | 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.pp.entity.OptimizeDetail; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Api(tags = "识别显示") |
| | | @RestController |
| | | @RequestMapping("/taskCache") |
| | | public class TaskCacheController { |
| | |
| | | private EdgStorageCageDetailsService edgStorageCageDetailsService; |
| | | |
| | | @Autowired |
| | | private HangzhoumesService hangzhoumesService; |
| | | private EdgStorageCageService edgStorageCageService; |
| | | @Autowired |
| | | private TaskCacheService taskCacheService; |
| | | |
| | | @ApiOperation("查询切割版图信息-根据 工程号 参数(工程号)") |
| | | @PostMapping("/cutTerritory") |
| | | @ResponseBody |
| | | public Result cutTerritory(String current) { |
| | | List<Map> h = edgStorageCageDetailsService.selectCurrentCutTerritory(current); |
| | | List<OptimizeDetail> h = edgStorageCageDetailsService.selectCurrentCutTerritory(current); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | @ApiOperation("识别显示 当前版图 参数()") |
| | | @PostMapping("/currentCutTerritory") |
| | | @ResponseBody |
| | | public Result currentCutTerritory() { |
| | | List<Map> h = edgStorageCageDetailsService.selectCutTerritory(); |
| | | List<OptimizeDetail> h = edgStorageCageDetailsService.selectCutTerritory(); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | @ApiOperation("识别显示 特定版图 参数(版图编号)") |
| | | @PostMapping("/selectCutTerritory") |
| | | @ResponseBody |
| | | public Result selectCutTerritory(String TerritoryId) { |
| | | List<Map> h = edgStorageCageDetailsService.selectCutTerritory(); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | @ApiOperation("识别操作: 破损/拿走 参数(ID,功能[0:破损,1:拿走])") |
| | | @ApiOperation("识别操作: 破损/拿走 参数(ID,功能[200:拿走,201:破损])") |
| | | @PostMapping("/identControls") |
| | | @ResponseBody |
| | | public Result identControls(@RequestParam(name = "identId", required = false) String identId,@RequestParam(name = "controlsId", required = false) int controlsId) { |
| | |
| | | boolean issucess = edgStorageCageDetailsService.identWorn(identId,controlsId); |
| | | return Result.build(200,"成功",issucess); |
| | | } |
| | | @ApiOperation("查询笼内信息 参数()") |
| | | @PostMapping("/selectCageInfo") |
| | | @ResponseBody |
| | | public Result selectCageInfo() { |
| | | List<Map> h = hangzhoumesService.SelectCageInfo(); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | |
| | | @ApiOperation("磨边任务 参数()") |
| | | @PostMapping("/selectEdgTask") |
| | | @ResponseBody |
| | | public Result selectEdgTask(String ProcessId) { |
| | | List<Map> EdgTasks = hangzhoumesService.SelectEdgInfo("1"); |
| | | public Result selectEdgTask(String line) { |
| | | List<TaskCache> EdgTasks = taskCacheService.selectEdgInfo(line); |
| | | return Result.build(200,"成功",EdgTasks); |
| | | } |
| | | |
| | |
| | | @TableName("task_cache") |
| | | public class TaskCache { |
| | | private String ID;//任务编号 |
| | | private String startcell;//起始 |
| | | private String endcell;//结束 |
| | | private String tasktype;//任务类型 |
| | | private String taskstauts;//任务状态 |
| | | private String startCell;//起始 |
| | | private String endCell;//结束 |
| | | private String taskType;//任务类型 |
| | | private String taskStatus;//任务状态 |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface TaskCacheService extends IService<TaskCache> { |
| | | |
| | | //添加理片笼任务 |
| | | /** |
| | | * 添加理片笼任务 |
| | | * @param taskCache |
| | | * @return |
| | | */ |
| | | boolean insertTaskCache(TaskCache taskCache); |
| | | |
| | | //查询磨边任务 |
| | | /** |
| | | * 查询磨边任务 |
| | | * @param line |
| | | * @return |
| | | */ |
| | | List<TaskCache> selectEdgInfo(String line); |
| | | |
| | | //查询理片任务 |
| | | /** |
| | | * 查询理片任务 |
| | | * @return |
| | | */ |
| | | List<TaskCache> selectCacheInfo(); |
| | | |
| | | //查询全部任务 |
| | | /** |
| | | * 查询全部任务 |
| | | * @return |
| | | */ |
| | | List<TaskCache> selectAll(); |
| | | |
| | | //查询进片任务 |
| | | /** |
| | | * 查询进片任务 |
| | | * @return |
| | | */ |
| | | List<TaskCache> selectInputTaskCache(); |
| | | |
| | | //查询出片任务 |
| | | /** |
| | | * 查询出片任务 |
| | | * @return |
| | | */ |
| | | List<TaskCache> selectOutTaskCache(); |
| | | |
| | | //查询 A09 或 A10 最新的一片 出片任务 |
| | | /** |
| | | * 查询 A09 或 A10 最新的一片 出片任务 |
| | | * @param line |
| | | * @return |
| | | */ |
| | | List<TaskCache> selectLastOutCacheInfo(String line); |
| | | } |
| | |
| | | @Service |
| | | public class TaskCacheServiceImpl extends ServiceImpl<TaskCacheMapper, TaskCache> implements TaskCacheService { |
| | | |
| | | //添加理片笼任务 |
| | | /** |
| | | * 添加理片笼任务 |
| | | * @param taskCache |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean insertTaskCache(TaskCache taskCache){ |
| | | baseMapper.insert(taskCache); |
| | | return true; |
| | | } |
| | | //查询磨边任务 |
| | | |
| | | /** |
| | | * 查询磨边任务 |
| | | * @param line |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectEdgInfo(String line) { |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("endcell",line)); |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("end_cell",line)); |
| | | } |
| | | //查询待理片工作的任务 |
| | | |
| | | /** |
| | | * 查询待理片工作的任务 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectCacheInfo(){ |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("taskstauts",0)); |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0)); |
| | | } |
| | | //查询全部任务 |
| | | |
| | | /** |
| | | * 查询全部任务 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectAll() { |
| | | return baseMapper.selectList(null); |
| | | } |
| | | //查询待进片任务 |
| | | |
| | | /** |
| | | * 查询待进片任务 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectInputTaskCache(){ |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("taskstauts",0).eq("tasktype",1)); |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0).eq("task_type",1)); |
| | | } |
| | | |
| | | //查询待出片任务 |
| | | /** |
| | | * 查询待出片任务 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectOutTaskCache(){ |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("taskstauts",0).eq("tasktype",2)); |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0).eq("task_type",2)); |
| | | } |
| | | |
| | | //查询 A09 或 A10 最新的一片 出片任务 |
| | | /** |
| | | * 查询 A09 或 A10 最新的一片 出片任务 |
| | | * @param line |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectLastOutCacheInfo(String line){ |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("endcell",line).eq("taskstauts",1).orderByDesc("ID")); |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("end_xxxxcell",line).eq("task_status",1).orderByDesc("ID")); |
| | | } |
| | | } |
| | |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | pp: |
| | | url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # pp: |
| | | # url: jdbc:mysql://10.153.19.150:3306/pp?serverTimezone=GMT%2b8 |
| | | # username: root |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # salve_hangzhoumes: |
| | | # url: jdbc:sqlserver://10.153.19.150:1433;databasename=hangzhoumes |
| | | # username: sa |
| | | # password: beibo.123/ |
| | | # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | package com.mes; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.edgstoragecage.service.impl.EdgStorageCageServiceImpl; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.mapper.OptimizeDetailMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | |
| | | @Autowired |
| | | EdgStorageCageDetailsService edgStorageCageDetailsService; |
| | | |
| | | @Autowired |
| | | OptimizeDetailMapper optimizeDetailMapper; |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | | log.info("完整路径:{}", Arrays.asList("123")); |
| | |
| | | } |
| | | @Test |
| | | public void testScan() { |
| | | List<Map> map= edgStorageCageDetailsService.selectCutTerritory(); |
| | | List<OptimizeDetail> map= edgStorageCageDetailsService.selectCutTerritory(); |
| | | log.info("切割当前版图信息:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | @Test |
| | | public void testPpOptimizeDetail() { |
| | | List<OptimizeDetail> optimizeDetail=optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>() |
| | | .eq("project_no", "P24032204") |
| | | .eq("stock_id",5) |
| | | ); |
| | | log.info("切割当前版图信息:{}", Arrays.asList(optimizeDetail)); |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.engineering.controller; |
| | | |
| | | |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.service.impl.EngineeringServiceImpl; |
| | | import com.mes.utils.Result; |
| | | import com.mes.workstation.service.UpWorkstationService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-04-22 |
| | | */ |
| | | @RestController |
| | | @Slf4j |
| | | @RequestMapping("/engineering/engineering") |
| | | public class EngineeringController { |
| | | @Autowired |
| | | private EngineeringService engineeringService; |
| | | |
| | | @ApiOperation("开始/暂停任务/传递工程号和状态,开始是1 暂停是0") |
| | | @PostMapping("/changeTask") //调用上片任务 |
| | | @ResponseBody |
| | | public Result <Engineering> changeTask(String projectId , Integer state) { |
| | | boolean work=engineeringService.changeTask(projectId,state); |
| | | log.info("开始任务返回:{}", work); |
| | | return Result.build(200, "",null); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.mes.engineering.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-04-22 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class Engineering implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 工程表id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private String engineerId; |
| | | |
| | | /** |
| | | * 工程名称 |
| | | */ |
| | | private String engineerName; |
| | | |
| | | /** |
| | | * 平均利用率 |
| | | */ |
| | | private Double avgAvailability; |
| | | |
| | | /** |
| | | * 有效利用率 |
| | | */ |
| | | private Double validAvailability; |
| | | |
| | | /** |
| | | * 尾片利用率 |
| | | */ |
| | | private Double lastAvailability; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | private Integer state; |
| | | |
| | | /** |
| | | * 小片总数 |
| | | */ |
| | | private Integer glassTotal; |
| | | |
| | | /** |
| | | * 小片总面积 |
| | | */ |
| | | private Double glassTotalArea; |
| | | |
| | | /** |
| | | * 计划原片总数 |
| | | */ |
| | | private Integer planPatternTotal; |
| | | |
| | | /** |
| | | * 计划原片总面积 |
| | | */ |
| | | private Double planPatternTotalArea; |
| | | |
| | | /** |
| | | * 实际原片总数 |
| | | */ |
| | | private Integer realityPatternTotal; |
| | | |
| | | /** |
| | | * 实际原片总面积 |
| | | */ |
| | | private Double realityPatternTotalArea; |
| | | |
| | | /** |
| | | * 膜系id |
| | | */ |
| | | private Integer filmsId; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String notes; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.mes.engineering.mapper; |
| | | |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-04-22 |
| | | */ |
| | | public interface EngineeringMapper extends BaseMapper<Engineering> { |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.mes.engineering.mapper.EngineeringMapper"> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.mes.engineering.service; |
| | | |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-04-22 |
| | | */ |
| | | public interface EngineeringService extends IService<Engineering> { |
| | | |
| | | boolean changeTask(String projectId,Integer state); |
| | | } |
New file |
| | |
| | | package com.mes.engineering.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.mapper.EngineeringMapper; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author wu |
| | | * @since 2024-04-22 |
| | | */ |
| | | @Service |
| | | public class EngineeringServiceImpl extends ServiceImpl<EngineeringMapper, Engineering> implements EngineeringService { |
| | | //开始/暂停任务 |
| | | @Override |
| | | public boolean changeTask(String projectId, Integer state) { |
| | | LambdaUpdateChainWrapper<Engineering> wrapper = new LambdaUpdateChainWrapper<>(this.getBaseMapper()); |
| | | wrapper.set(Engineering::getState,state); |
| | | wrapper.eq(Engineering::getEngineerId,projectId); |
| | | return wrapper.update(); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.mes.utils.Result; |
| | | import com.mes.workstation.entity.GlassInfo; |
| | | import com.mes.workstation.entity.UpWorkSequence; |
| | | import com.mes.workstation.entity.UpWorkstation; |
| | | import com.mes.workstation.service.UpWorkstationService; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | public class UpWorkstationController { |
| | | @Autowired |
| | | private UpWorkstationService upWorkstationService; |
| | | private GlassInfo glassInfo; |
| | | @ApiOperation("显示工位上的玻璃信息") |
| | | @GetMapping("/list") //查询现在上片机的玻璃信息 |
| | | public Result<List<UpWorkstation>> list() { |
| | |
| | | @ApiOperation("修改工位表增加玻璃信息或者删除玻璃信息,传递Upworkstation类,只修改宽高厚数量膜系") |
| | | @PostMapping("/updateGlassMessage") |
| | | @ResponseBody |
| | | public void updateGlassMessage(@RequestBody UpWorkstation upwork) { |
| | | public Result<UpWorkstation> updateGlassMessage(@RequestBody UpWorkstation upwork) { |
| | | upWorkstationService.updateGlassMessage(upwork); |
| | | return Result.build(200, "", upwork); |
| | | } |
| | | |
| | | @ApiOperation("开始上片任务") |
| | | @PostMapping("/selectPriority") //开始上片任务 |
| | | @PostMapping("/selectPriority") //调用上片任务 |
| | | @ResponseBody |
| | | public void selectPriority() { |
| | | upWorkstationService.selectPriority(); |
| | | UpWorkSequence work=upWorkstationService.selectPriority(); |
| | | log.info("显示可上的玻璃信息:{}", work); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | public class UpWorkSequence { |
| | | |
| | | private int sequence; |
| | | |
| | | private int workId; |
| | | private int number; |
| | | |
| | | } |
| | |
| | | * @since 2024-04-07 |
| | | */ |
| | | public interface UpWorkstationMapper extends BaseMapper<UpWorkstation> { |
| | | //获取工位信息 |
| | | UpWorkSequence selectPriority(@Param("id") int id); |
| | | |
| | | List<UpWorkSequence> selectPriority(@Param("id") int id); |
| | | |
| | | //获取下一片玻璃信息 |
| | | } |
| | |
| | | package com.mes.workstation.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.workstation.entity.UpWorkSequence; |
| | | import com.mes.workstation.entity.UpWorkstation; |
| | | |
| | | /** |
| | |
| | | public interface UpWorkstationService extends IService<UpWorkstation> { |
| | | //PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; |
| | | |
| | | //删除人工搬走的玻璃信息 |
| | | // public void deleteGlass(int id); |
| | | //判断是否可以吸片进行任务 |
| | | |
| | | |
| | | //判断优先吸片位置后发送出片任务 |
| | | public void selectPriority(); |
| | | public UpWorkSequence selectPriority(); |
| | | |
| | | //查询正在进行的工程 |
| | | |
| | |
| | | * |
| | | * @param upwork |
| | | */ |
| | | //修改工位表增加玻璃信息或者删除玻璃信息 |
| | | void updateGlassMessage(UpWorkstation upwork); |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | //判断优先吸片位置后发送出片任务 |
| | | public void selectPriority() { |
| | | //todo:判断是否可以吸片进行任务 |
| | | // String loadstart="吸片信号";//plcmes.getPlcParameter("吸片信号").getValue(); |
| | | // if (!"1".equals(loadstart)) { |
| | | // return; |
| | | // } |
| | | UpWorkSequence loadid1 = this.baseMapper.selectPriority(1).get(0); |
| | | UpWorkSequence loadid2 = this.baseMapper.selectPriority(2).get(0); |
| | | //判断一二号工位哪边的顺序更先 |
| | | // if(loadid1.getSequence()>loadid2.getSequence()) { |
| | | // S7object.getinstance().plccontrol.WriteWord(DB_100_10, (short)2); |
| | | // }else if(loadid1.getSequence()==loadid2.getSequence()){ |
| | | // //当两个工位上的玻璃数相同时,判断哪个工位上的玻璃数更少,优先清空一个架子 |
| | | // int glassnum1=loadid1.getNumber();//Integer.parseInt(plcmes.getPlcParameter("玻璃数").getValue()); |
| | | // int glassnum2=loadid2.getNumber();//Integer.parseInt(plcmes.getPlcParameter("玻璃数").getValue()); |
| | | // if(glassnum1>glassnum2){ |
| | | // S7object.getinstance().plccontrol.WriteWord(DB_100_10, (short)2); |
| | | // }else{ |
| | | // S7object.getinstance().plccontrol.WriteWord(DB_100_10, (short)1); |
| | | // } |
| | | // }else{ |
| | | // S7object.getinstance().plccontrol.WriteWord(DB_100_10, (short)1); |
| | | // } |
| | | public UpWorkSequence selectPriority() { |
| | | UpWorkSequence upwork= this.baseMapper.selectPriority(1); |
| | | String start = "吸片信号";//plcmes.getPlcParameter("吸片信号").getValue(); |
| | | if(upwork!=null&&start.equals("1")){ |
| | | //发送出片任务 |
| | | //plcmes.getPlcParameter("出片信号").setValue("1"); |
| | | } |
| | | return upwork; |
| | | } |
| | | |
| | | /** |
| | |
| | | int update = this.baseMapper.update(upwork, updateWrapper); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | <mapper namespace="com.mes.workstation.mapper.UpWorkstationMapper"> |
| | | |
| | | <resultMap id="sequenceMap" type="com.mes.workstation.entity.UpWorkSequence"> |
| | | <id property="sequence" column="layout_sequence"/> |
| | | <result property="number" column="number"/> |
| | | <id property="workId" column="workstation_id"/> |
| | | <!-- <result property="number" column="number"/>--> |
| | | </resultMap> |
| | | |
| | | <select id="selectPriority" resultMap="sequenceMap"> |
| | | SELECT |
| | | b.layout_sequence,a."number" |
| | | b.workstation_id |
| | | FROM |
| | | up_workstation a |
| | | LEFT JOIN up_patten_usage b ON a.pattern_width = b.width |
| | | AND a.pattern_heigth = b.width |
| | | AND a.pattern_thickness = b.thickness |
| | | WHERE |
| | | a.workstation_id = #{id} |
| | | ( SELECT * FROM up_patten_usage a WHERE state = 1 ORDER BY a.layout_sequence LIMIT 1 )as a |
| | | LEFT JOIN up_workstation b ON a.width =b.pattern_width |
| | | AND a.height = b.pattern_heigth |
| | | AND a.thickness = b.pattern_thickness |
| | | AND a.films_id = b.films_id |
| | | </select> |
| | | |
| | | |