Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
| | |
| | | // export default { |
| | | // serverUrl: "localhost:8083/api/loadGlass", |
| | | // serverUrl2: "localhost:8085" |
| | | // //serverUrl:"res.abeim.cn" |
| | | // } |
| | | export default { |
| | | serverUrl: "localhost:88/api", |
| | | serverUrl2: "localhost:8085" |
| | | //serverUrl:"res.abeim.cn" |
| | | } |
| | | serverUrl: "localhost:88/api/loadGlass", |
| | | //serverUrl: "localhost:88/api/", |
| | | serverUrl2: "localhost:8085" |
| | | //serverUrl:"res.abeim.cn" |
| | | } |
| | |
| | | import {useRouter} from 'vue-router' |
| | | import useUserInfoStore from '@/stores/userInfo' |
| | | import userInfo from '@/stores/userInfo' |
| | | import request from "@/utils/request"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {ref, watch} from "vue" |
| | | import deepClone from "@/utils/deepClone" |
| | | |
| | | import request from '@/utils/request' |
| | | import {ElMessage} from 'element-plus' |
| | | import {ref, watch} from 'vue' |
| | | import deepClone from '@/utils/deepClone' |
| | | |
| | | const store = userInfo() |
| | | |
| | | |
| | | const router = useRouter() |
| | | const userStore = useUserInfoStore() |
| | | const user = userStore.user.userName |
| | | |
| | | |
| | | // store.createWebSocket(); |
| | | function quit() { |
| | | userStore.$patch({ |
| | | user: null |
| | | user: null, |
| | | }) |
| | | router.push("/login") |
| | | router.push('/login') |
| | | } |
| | | |
| | | |
| | | //提取模块列表 |
| | | |
| | | //提取菜单模块列表 |
| | | let menuList = $ref([]) |
| | | request.get('/loadGlass/menu/sysMenu/list').then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | router.push('/login') |
| | | } |
| | | }) |
| | | |
| | | //获取菜单列表 |
| | | // let menuItemList = $ref([]) |
| | | // request.get('/menuItem').then((res) => { |
| | | // if (res.code == 200) { |
| | | // menuItemList = deepClone(res.data) |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // router.push('/login') |
| | | // } |
| | | // }) |
| | | |
| | | |
| | | const menu = ref(null) |
| | | let indexKey = ref(null) |
| | | |
| | | |
| | | function handleOpen(key) { |
| | | indexKey.value = key |
| | | } |
| | | |
| | | watch(indexKey, (newVal, oldVal) => { |
| | | |
| | | watch( |
| | | indexKey, |
| | | (newVal, oldVal) => { |
| | | if (oldVal !== newVal && oldVal !== null) { |
| | | menu.value.close(oldVal) |
| | | } |
| | | }, |
| | | {deep:true} |
| | | }, |
| | | {deep: true} |
| | | ) |
| | | |
| | | |
| | | router.beforeEach((to, from) => { |
| | | //return false |
| | | }) |
| | | |
| | | |
| | | |
| | | let openFlag = $ref(null) |
| | | //原始菜单打开 |
| | | const openMenu = (menuID) => { |
| | | if(menuID===openFlag){ |
| | | openFlag = null |
| | | }else { |
| | | openFlag = menuID |
| | | } |
| | | if (menuID === openFlag) { |
| | | openFlag = null |
| | | } else { |
| | | openFlag = menuID |
| | | } |
| | | } |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div id="all"> |
| | | <el-container> |
| | | <el-header > |
| | | <el-header> |
| | | <div style="height: 100%;width: 100%;display: flex;background-color: #fff;"> |
| | | <img src="../assets/northGlass.ico" alt="" style="max-width: 100%;max-height: 100%"> |
| | | <img src="../assets/northGlass.ico" |
| | | alt="" |
| | | style="max-width: 100%;max-height: 100%"> |
| | | <h3 style="margin: 1rem ;font-weight: bold;width: 20vw;"> 欢迎{{ user }}使用北玻MES系统!</h3> |
| | | <span style="height: 70%;width: 78vw;margin-top: 1rem;"> |
| | | <el-button class="sys-quit" @click="quit" round> |
| | | <el-icon size="large"><SwitchButton size=""/></el-icon> |
| | | <el-button class="sys-quit" |
| | | @click="quit" |
| | | round> |
| | | <el-icon size="large"> |
| | | <SwitchButton size=""/>退出 |
| | | </el-icon> |
| | | </el-button> |
| | | </span> |
| | | </div> |
| | |
| | | </div> |
| | | <ul class='enter-x-left' |
| | | v-show="openFlag==items.id"> |
| | | |
| | | |
| | | <li v-for="menuItem in items.children" |
| | | style="margin-bottom:2px"> |
| | | <router-link :to="{path:menuItem.url}"> |
| | | {{ menuItem.menuName }} |
| | | </router-link> |
| | | |
| | | |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | </el-aside> |
| | | |
| | | |
| | | <el-main> |
| | | <div id="main"> |
| | | <router-view></router-view> |
| | | </div> |
| | | </el-main> |
| | | |
| | | |
| | | </el-container> |
| | | </el-container> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | #all{ |
| | | #all { |
| | | background-color: #eee; |
| | | height: 100%; |
| | | } |
| | | .el-container{ |
| | | |
| | | .el-container { |
| | | height: 100vh; |
| | | width: 99vw |
| | | width: 99vw; |
| | | } |
| | | |
| | | *{ |
| | | |
| | | * { |
| | | padding: 0; |
| | | margin: 0; |
| | | } |
| | | :deep(.sys-quit){ |
| | | |
| | | :deep(.sys-quit) { |
| | | float: right; |
| | | margin-right: 1rem; |
| | | width: 5rem; |
| | | } |
| | | |
| | | /* 横线 */ |
| | | #line{ |
| | | float:right; |
| | | width: 100%; |
| | | height: 1px; |
| | | /* margin-top: 0.5em; */ |
| | | margin-bottom: 0.5em; |
| | | background:#d4c4c4; |
| | | position: relative; |
| | | text-align: center; |
| | | #line { |
| | | float: right; |
| | | width: 100%; |
| | | height: 1px; |
| | | /* margin-top: 0.5em; */ |
| | | margin-bottom: 0.5em; |
| | | background: #d4c4c4; |
| | | position: relative; |
| | | text-align: center; |
| | | } |
| | | :deep(span){ |
| | | |
| | | :deep(span) { |
| | | margin-right: 0; |
| | | |
| | | } |
| | | .el-collapse{ |
| | | |
| | | .el-collapse { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | } |
| | | #main{ |
| | | |
| | | #main { |
| | | width: 99%; |
| | | float: right; |
| | | height: 99%; |
| | | background-color: #fff; |
| | | } |
| | | /*------------*/ |
| | | |
| | | |
| | | /* .menu div div{ |
| | | |
| | | width: 138px; |
| | |
| | | margin-bottom:4px; |
| | | text-align: left; |
| | | cursor: pointer; */ |
| | | /* border-radius:8px; */ |
| | | /* outline: none; */ |
| | | /* background-color:#5CADFE; */ |
| | | /* box-shadow: 0 8px 16px 0 rgba(0,0,0,0), 0 6px 5px 0 rgba(0,0,0,0.19); */ |
| | | /* border-radius:8px; */ |
| | | /* outline: none; */ |
| | | /* background-color:#5CADFE; */ |
| | | /* box-shadow: 0 8px 16px 0 rgba(0,0,0,0), 0 6px 5px 0 rgba(0,0,0,0.19); */ |
| | | /* } */ |
| | | |
| | | |
| | | .menu { |
| | | width: 138px; |
| | | height: 33px; |
| | | line-height: 25px; |
| | | |
| | | |
| | | color: #000000; |
| | | font-size: 16px; |
| | | padding-left: 15px; |
| | | padding-right: 2px; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | ul { |
| | | height: auto; |
| | | margin: 1px auto; |
| | | text-align: center; |
| | | } |
| | | |
| | | |
| | | ul li { |
| | | |
| | | height: 28px; |
| | | line-height: 30px; |
| | | /* background: rgb(128, 128, 128); */ |
| | |
| | | text-align: left; |
| | | /* border-radius:8px; */ |
| | | /* outline: none; */ |
| | | |
| | | |
| | | /* background: #5CADFE; */ |
| | | /* box-shadow: 0 8px 16px 0 rgba(0,0,0,0), 0 6px 5px 0 rgba(0,0,0,0.19); */ |
| | | } |
| | | |
| | | |
| | | ul li:hover { |
| | | /* background:#5CADFE ; */ |
| | | color: #ffffff; |
| | | } |
| | | |
| | | |
| | | ul li a { |
| | | text-decoration: none; |
| | | color: #000000; |
| | | font-size: 14px; |
| | | } |
| | | ul li a:hover { |
| | | |
| | | color: #1087ff; |
| | | } |
| | | |
| | | |
| | | .item_divider { |
| | | width: 118px; |
| | | height: 0px; |
| | | /* background-color: white; |
| | | opacity: 0.8; */ |
| | | margin-bottom:2px; |
| | | margin-bottom: 2px; |
| | | } |
| | | .item a{ |
| | | |
| | | .item a { |
| | | width: 138px; |
| | | height: 35px; |
| | | display: block; |
| | |
| | | font-size: 14px; |
| | | text-decoration: none; |
| | | } |
| | | |
| | | |
| | | .menu_title { |
| | | width: 140px; |
| | | height: 45px; |
| | |
| | | position: relative; |
| | | font-weight: bold; |
| | | overflow: hidden; |
| | | |
| | | } |
| | | |
| | | |
| | | .menu_title:hover { |
| | | /* background: #dedede; */ |
| | | color: #3b9af9; |
| | | } |
| | | |
| | | |
| | | .indicator { |
| | | display: block; |
| | | width: 40px; |
| | |
| | | transition: all 0.3s ease; |
| | | text-align: center; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /* 动画效果 */ |
| | | .enter-x-left { |
| | | z-index: 9; |
| | |
| | | transform: translateX(-50px); |
| | | transition: all 0.3s ease; |
| | | } |
| | | .enter-x-left:nth-child(1){ |
| | | |
| | | .enter-x-left:nth-child(1) { |
| | | animation-delay: 0.1s; |
| | | } |
| | | .enter-x-left:nth-child(2){ |
| | | |
| | | .enter-x-left:nth-child(2) { |
| | | animation-delay: 0.2s; |
| | | } |
| | | |
| | | .enter-x-left:nth-child(3) { |
| | | animation-delay: 0.3s; |
| | | } |
| | | .enter-x-left:nth-child(4){ |
| | | |
| | | .enter-x-left:nth-child(4) { |
| | | animation-delay: 0.4s; |
| | | } |
| | | @keyframes enter-x-left { |
| | |
| | | transform: translateX(0); |
| | | } |
| | | } |
| | | |
| | | |
| | | </style> |
| | |
| | | <template> |
| | | <div> |
| | | <el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading"> |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;max-height: 240px;"> |
| | | <el-table height="100%" ref="table" |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="240" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | <el-table-column prop="id" align="center" label="玻璃ID" min-width="80" /> |
| | |
| | | <template> |
| | | <el-card style="margin-left: 10px; margin-top: 10px; margin-right: 10px;" v-loading="loading"> |
| | | <div style="display: flex;"> |
| | | <div style="display: flex;margin-bottom: 30px;"> |
| | | <div style="margin-left: 400px; font-size: 20px;">工程号:P20240305001 </div> |
| | | <div style="margin-left: 150px; font-size: 20px;">版图编号:1</div> |
| | | </div> |
| | | <el-scrollbar height="650px"> |
| | | <div id="home-card"> |
| | | <div id="home-item" v-for="n in 20" :key="n"> |
| | | <svg width="100%" height="690" xmlns="http://www.w3.org/2000/svg" style="margin-top: -40px;"> |
| | | <svg width="100%" height="400" xmlns="http://www.w3.org/2000/svg" style="margin-top: -100px;margin-left: -80px;"> |
| | | <defs> |
| | | <marker id="arrow" markerUnits="strokeWidth" markerWidth="12" markerHeight="12" viewBox="0 0 12 12" refX="6" |
| | | refY="6" orient="auto"> |
| | |
| | | border-color: #E4E4E4; |
| | | width: calc(34% - 20px); |
| | | padding: 20px 0px 20px 20px; |
| | | margin-right: 10px; |
| | | margin-right: 20px; |
| | | margin-bottom: 10px; |
| | | display: flex; |
| | | justify-content: center; |
| | | /* align-items: center; */ |
| | | background: #fff; |
| | | width: 700px; |
| | | #home-img { |
| | | display: inline-block; |
| | | width: 160px; |
| | |
| | | <!-- <div id="awatch"> |
| | | <img src="../../assets/lpl.jpg" alt="" style="width: 10%;height: 10%;margin-left: 160px;"> |
| | | </div> --> |
| | | |
| | | |
| | | <div id="awatch"> |
| | | <img src="../../assets/cp.png" alt="" style="width: 1305px;height: 400px;margin-left: 240px;margin-top: 50px;"> |
| | | </div> |
| | | <!-- // 父级框 --> |
| | | <div class="img-list"> |
| | | <!-- // 浮在上方的图片 --> |
| | | <img class="check-img" src="../../assets/lpl.jpg" alt="" style="width: 13%;height: 12%;margin-left: 160px;"> |
| | | <img class="check-imga" src="../../assets/lpl.jpg" alt="" style="width: 13%;height: 12%;margin-left: 160px;"> |
| | | <!-- // 底图 --> |
| | | <img class="data-img " src="../../assets/dlpl.png" alt="" style="width: 1200px;height: 400px;margin-left: 130px;margin-top: 50px;"> |
| | | </div> |
| | | </div> |
| | | <el-dialog v-model="dialogFormVisible" top="12vh" width="85%" title="请确认玻璃信息" > |
| | | <div style="margin-left: 50px;margin-bottom: 10px;"> |
| | |
| | | width: 3.3125rem; |
| | | height: 2.9375rem; |
| | | top:20rem; |
| | | right: 52rem; |
| | | right: 57rem; |
| | | z-index: 10; |
| | | |
| | | } |
| | |
| | | width: 3.3125rem; |
| | | height: 2.9375rem; |
| | | top:15rem; |
| | | right: 37rem; |
| | | right: 29rem; |
| | | z-index: 10; |
| | | |
| | | } |
| | |
| | | https: false, |
| | | proxy: { |
| | | '/api': { |
| | | target: 'http://localhost:8080/mesModuleTools', |
| | | target: 'http://localhost:88/', |
| | | changeOrigin: true, |
| | | rewrite: (path) => path.replace(/^\/api/, '/'), |
| | | }, |
| | | '/api2': { |
| | | target: 'http://localhost:8085/mesModuleTools', |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '^/api2': '', |
| | | }, |
| | | }, |
| | | // '/api2': { |
| | | // target: 'http://localhost:8085/mesModuleTools', |
| | | // changeOrigin: true, |
| | | // pathRewrite: { |
| | | // '^/api2': '', |
| | | // }, |
| | | // }, |
| | | }, |
| | | }, |
| | | configureServer: ({ middlewares }) => { |
| | |
| | | |
| | | <artifactId>servicebase</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> |
| | |
| | | return Result.build(200, "", glass); |
| | | } |
| | | |
| | | // public Result<List<OptimizeProject>> saveProject(@RequestBody OptimizeRequest optimizeRequest) { |
| | | // log.info("将请求参数封装在请求类里面"); |
| | | // List<OptimizeProject> glass = optimizeProjectService.saveProject(optimizeRequest); |
| | | // log.info("显示工程选择信息:{}", glass); |
| | | // return Result.build(200, "", glass); |
| | | // } |
| | | @ApiOperation("保存工程信息") |
| | | @PostMapping("/saveProject") //显示工程选择信息 |
| | | public Result<List<OptimizeProject>> saveProject(@RequestBody OptimizeRequest optimizeRequest) { |
| | | log.info("获取选择好的工程id进行查询数据后保存"); |
| | | List<OptimizeProject> glass = optimizeProjectService.saveProject(optimizeRequest); |
| | | log.info("显示工程选择信息后进行保存:{}", glass); |
| | | //void insetProject(glass); |
| | | return Result.build(200, "", glass); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | */ |
| | | @Data |
| | | public class OptimizeRequest { |
| | | @ApiParam("") |
| | | private String projectNo; |
| | | |
| | | @ApiParam("") |
| | | private Integer state; |
| | | |
| | | @ApiParam("") |
| | | private String projectNo; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | package com.mes.pp.mapper; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.entity.request.OptimizeRequest; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-04-16 |
| | | */ |
| | | @Mapper |
| | | @DS("pp") |
| | | public interface OptimizeProjectMapper extends BaseMapper<OptimizeProject> { |
| | | |
| | | List<OptimizeProject> saveProject(OptimizeRequest optimizeRequest); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询可领取的任务工程信息 |
| | | * |
| | | * @return |
| | | */ |
| | | List<OptimizeProject> listByState(OptimizeRequest optimizeRequest); |
| | | |
| | | /** |
| | | * 查询保存到原片使用详情表的数据 |
| | | * |
| | | * @return |
| | | */ |
| | | List<OptimizeProject> saveProject(OptimizeRequest optimizeRequest); |
| | | |
| | | /** |
| | | * 将工程信息保存到原片使用详情表 |
| | | * |
| | | * @return |
| | | */ |
| | | void insetProject(OptimizeProject glass); |
| | | } |
| | |
| | | LambdaQueryWrapper<OptimizeProject> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(OptimizeProject::getState, optimizeRequest.getState()) |
| | | .like(StringUtils.isNotBlank(optimizeRequest.getProjectNo()), OptimizeProject::getProjectNo, optimizeRequest.getProjectNo()) |
| | | .groupBy(OptimizeProject::getProjectNo); |
| | | //.groupBy(OptimizeProject::getProjectNo) |
| | | ; |
| | | log.info("返回工程信息"); |
| | | return this.list(wrapper); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void insetProject(OptimizeProject glass) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<OptimizeProject> saveProject(OptimizeRequest optimizeRequest) { |
| | | log.info("将参数传入到查询类里,工程号做非空判断模糊查询"); |
| | | |
| | | log.info("返回工程信息"); |
| | | return this.baseMapper.saveProject(optimizeRequest); |
| | | } |
| | | |
| | | } |
| | |
| | | // 2、全局配置 |
| | | // 全局配置 |
| | | GlobalConfig gc = new GlobalConfig(); |
| | | gc.setOutputDir("D:\\workspace\\hangzhoumesParent1\\"); |
| | | gc.setOutputDir("D:\\Documents\\hangzhoumesParent1\\"); |
| | | |
| | | gc.setServiceName("%sService"); //去掉Service接口的首字母I |
| | | gc.setAuthor("zhoush"); |
| | |
| | | // 5、策略配置 |
| | | StrategyConfig strategy = new StrategyConfig(); |
| | | |
| | | // strategy.setInclude("activity_info", "activity_rule", "activity_sku", "coupon_info", "coupon_range", |
| | | // "coupon_use"); |
| | | strategy.setInclude("up_patten_usage"); |
| | | |
| | | strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 |
| | | |
| | |
| | | <artifactId>mybatis-plus-join</artifactId> |
| | | <version>1.1.6</version> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.yulichang</groupId>--> |
| | | <!-- <artifactId>mybatis-plus-join-boot-starter</artifactId>--> |
| | | <!-- </dependency>--> |
| | | </dependencies> |
| | | |
| | | <properties> |
| | |
| | | |
| | | 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 |
| | |
| | | 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> |
| | | * 前端控制器 |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | @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); |
| | | } |
| | | |
| | | } |
| | |
| | | * 磨边前理片笼详情表id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设备id |
| | |
| | | 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> { |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | public interface EdgStorageCageDetailsService extends IService<EdgStorageCageDetails> { |
| | | //获取全部 磨边前缓存笼信息 |
| | | public List<Map> getEdgStorageInfos(); |
| | | |
| | | //修改 笼内数据 |
| | | public List<Map> setEdgStorageInfos(); |
| | | /** |
| | | * 识别 破损/拿走 |
| | | * @param glassid |
| | | * @param ControlsId |
| | | * @return |
| | | */ |
| | | boolean identWorn(String glassid,int ControlsId); |
| | | //获取 切割当前版图 |
| | | List<Map> selectCutTerritory(); |
| | | //获取 工程下的当前版图 |
| | | 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | |
| | | public class EdgStorageCageDetailsServiceImpl extends ServiceImpl<EdgStorageCageDetailsMapper, EdgStorageCageDetails> implements EdgStorageCageDetailsService { |
| | | //获取全部数据 |
| | | @Autowired |
| | | private HangzhouMesMapper hangzhouMesMapper; |
| | | @Autowired |
| | | private EdgStorageCageDetailsMapper edgStorageCageDetailsMapper; |
| | | |
| | | //获取磨边前缓存理片笼信息 |
| | | @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") |
| | | ); |
| | | return map; |
| | | //识别 破损/拿走 |
| | | 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> setEdgStorageInfos() { |
| | | return hangzhouMesMapper.selectCachInfo(); |
| | | 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; |
| | | } |
| | | |
| | | //获取 工程下的当前版图 |
| | | @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; |
| | | } |
| | | |
| | | ; |
| | |
| | | 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.query.MPJQueryWrapper; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageMapper; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | 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.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | EdgStorageCageMapper edgStorageCageMapper; |
| | | @Autowired |
| | | EdgStorageCageDetailsMapper edgStorageCageDetailsMapper; |
| | | @Autowired |
| | | UpPattenUsageMapper upPattenUsageMapper; |
| | | |
| | | @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= 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; |
| | | } |
| | | |
| | | @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; |
| | | |
| | | /** |
| | | * 流程卡玻璃类型 |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | public interface GlassInfoService extends IService<GlassInfo> { |
| | | |
| | | public List<GlassInfo> selectAll(); |
| | | |
| | | public List<GlassInfo> selectId(String glassId); |
| | | |
| | | public List<GlassInfo> selectFlowcardId(String flowcard_id); |
| | | public List<GlassInfo> selectFlowCardId(String flowCardId); |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | |
| | | //根据ID 获取小片数据 |
| | | @Override |
| | | public List<GlassInfo> selectId(String glassId) { |
| | | QueryWrapper<GlassInfo> queryWrapper = new QueryWrapper<GlassInfo>(); |
| | | queryWrapper.eq("id", glassId); |
| | | return glassInfoMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | ; |
| | | public List<GlassInfo> selectId(String glassId){ |
| | | return glassInfoMapper.selectList(new QueryWrapper<GlassInfo>().eq("id",glassId)); |
| | | }; |
| | | |
| | | //获取全部小片数据 |
| | | @Override |
| | | public List<GlassInfo> selectAll() { |
| | | public List<GlassInfo> selectAll(){ |
| | | return glassInfoMapper.selectList(null); |
| | | } |
| | | |
| | | ; |
| | | }; |
| | | |
| | | //根据工程 获取小片数据 |
| | | @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; |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | 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); |
| | | return Result.build(200, "成功", h); |
| | | 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); |
| | | return Result.build(200, "成功", 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); |
| | | return Result.build(200, "成功", h); |
| | | 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); |
| | | 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); |
| | | return Result.build(200,"成功",EdgTasks); |
| | | } |
| | | |
| | | } |
| | |
| | | // } |
| | | // } |
| | | // } |
| | | //理片 进 |
| | | 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"); |
| | | // //理片 进 |
| | | // 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; |
| | | } |
| | | // 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | @Service |
| | | public class TaskCacheServiceImpl extends ServiceImpl<TaskCacheMapper, TaskCache> implements TaskCacheService { |
| | | |
| | | @Autowired |
| | | GlassInfoMapper glassInfoMapper; |
| | | @Autowired |
| | | TaskCacheMapper taskCacheMapper; |
| | | //添加理片笼任务 |
| | | @Override |
| | | public boolean insertTaskCache() { |
| | | return false; |
| | | public boolean insertTaskCache(TaskCache taskCache){ |
| | | taskCacheMapper.insert(taskCache); |
| | | return true; |
| | | } |
| | | |
| | | //查询磨边任务 |
| | | @Override |
| | | public List<TaskCache> selectEdgInfo(String line) { |
| | | return null; |
| | | return taskCacheMapper.selectList(new QueryWrapper<TaskCache>().eq("endcell",line)); |
| | | } |
| | | |
| | | //查询理片任务 |
| | | //查询待理片工作的任务 |
| | | @Override |
| | | public List<TaskCache> selectCacheInfo() { |
| | | return null; |
| | | public List<TaskCache> selectCacheInfo(){ |
| | | return taskCacheMapper.selectList(new QueryWrapper<TaskCache>().eq("taskstauts",0)); |
| | | } |
| | | |
| | | //查询全部任务 |
| | | @Override |
| | | public List<TaskCache> selectAll() { |
| | | return null; |
| | | return taskCacheMapper.selectList(null); |
| | | } |
| | | //查询待进片任务 |
| | | @Override |
| | | public List<TaskCache> selectInputTaskCache(){ |
| | | return taskCacheMapper.selectList(new QueryWrapper<TaskCache>().eq("taskstauts",0).eq("tasktype",1)); |
| | | } |
| | | |
| | | //查询进片任务 |
| | | //查询待出片任务 |
| | | @Override |
| | | public List<TaskCache> selectInputTaskCache() { |
| | | return null; |
| | | } |
| | | |
| | | //查询出片任务 |
| | | @Override |
| | | public List<TaskCache> selectOutTaskCache() { |
| | | return null; |
| | | public List<TaskCache> selectOutTaskCache(){ |
| | | return taskCacheMapper.selectList(new QueryWrapper<TaskCache>().eq("taskstauts",0).eq("tasktype",2)); |
| | | } |
| | | |
| | | //查询 A09 或 A10 最新的一片 出片任务 |
| | | @Override |
| | | public boolean selectLastOutCacheInfo() { |
| | | return false; |
| | | public List<TaskCache> selectLastOutCacheInfo(String line){ |
| | | return taskCacheMapper.selectList(new QueryWrapper<TaskCache>().eq("endcell",line).eq("taskstauts",1).orderByDesc("ID")); |
| | | } |
| | | } |
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.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-07 |
| | | */ |
| | | public interface UpPattenUsageMapper extends MPJBaseMapper<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> |
| | |
| | | |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 大理片笼信息 |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @ApiModel("大理片笼信息") |
| | | @ApiModel("理片笼信息") |
| | | @RestController |
| | | @RequestMapping("/bigStorageCage") |
| | | public class BigStorageCageController { |
| | |
| | | @Autowired |
| | | private BigStorageCageService bigStorageCageService; |
| | | |
| | | // public Result<BigStorageCageDetails> feedGlass(GlassInfo glassInfo, BigStorageCageDetails bigStorageCageDetails){ |
| | | // |
| | | // } |
| | | //todo: 实例代码 待删除 |
| | | @ApiOperation("测试") |
| | | @GetMapping("/index") |
| | | public String index() { |
| | | return "hello world"; |
| | | } |
| | | |
| | | @ApiOperation("理片笼信息") |
| | | @GetMapping("/bigStorageCage") |
| | | public Result<List<BigStorageCage>> querybigStorageCageDetail() { |
| | | return Result.success(bigStorageCageService.querybigStorageCageDetail()); |
| | | public List<BigStorageCage> querybigStorageCageDetail() { |
| | | return bigStorageCageService.querybigStorageCageDetail(); |
| | | } |
| | | |
| | | @ApiOperation("手动完成任务") |
| | | @PostMapping("/finishTask") |
| | | public Result<String> finishTask(int type, int id) { |
| | | // bigStorageCageDetailsService.FinishTask(); |
| | | return Result.success("success"); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | /** |
| | | * 大理片笼详情表id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设备id |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import feign.Param; |
| | | |
| | | |
| | | /** |
| | |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | */ |
| | | public interface BigStorageCageService extends IService<BigStorageCage> { |
| | | |
| | | void updateRemainWidth(int slot); |
| | | void updateRemainWidth(int Slot); |
| | | |
| | | BigStorageCageDetails feedGlass(GlassInfo glassInfo, BigStorageCageDetails bigStorageCageDetails); |
| | | |
| | |
| | | package com.mes.bigstorage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | |
| | | import com.mes.bigstorage.mapper.BigStorageCageMapper; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | @Service |
| | | @Slf4j |
| | | public class BigStorageCageServiceImpl extends ServiceImpl<BigStorageCageMapper, BigStorageCage> implements BigStorageCageService { |
| | | @Resource |
| | | private BigStorageCageMapper bigStorageCageMapper; |
| | | |
| | | @Resource |
| | | private BigStorageCageDetailsMapper bigStorageCageDetailsMapper; |
| | | |
| | | @Resource |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | |
| | | @Override |
| | | public BigStorageCageDetails feedGlass(GlassInfo glassInfo, BigStorageCageDetails bigStorageCageDetails) { |
| | | |
| | | //1、查询理片笼内玻璃片序等于当前玻璃片序-1的玻璃 |
| | | log.info("1、查询理片笼内片序+1等于当前玻璃片序的玻璃"); |
| | | LambdaQueryWrapper<BigStorageCageDetails> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(BigStorageCageDetails::getTemperingLayoutId, glassInfo.getTemperingLayoutId()) |
| | | .eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() + 1); |
| | | BigStorageCageDetails layoutSlotInfo; |
| | | layoutSlotInfo= bigStorageCageDetailsMapper.selectOne(wrapper); |
| | | |
| | | BigStorageCageDetails layoutSlotInfo = bigStorageCageDetailsMapper.selectOne(wrapper); |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setSlot(layoutSlotInfo.getSlot()); |
| | | |
| | | //2、有符合条件的格子活片序为1时 |
| | | log.info("有符合条件的格子活片序为1时"); |
| | | log.info("2、查询理片笼内片序+1等于当前玻璃片序的玻璃的结果不为空时"); |
| | | if (layoutSlotInfo.getSlot() != null) { |
| | | bigStorageCageDetails.setSlot(layoutSlotInfo.getSlot()); |
| | | } else { |
| | | //获取不到时: |
| | | // LambdaQueryWrapper<BigStorageCageDetails> BigStorageCageDetailslambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | // BigStorageCageDetailslambdaQueryWrapper |
| | | // .select(BigStorageCageDetails::getTemperingLayoutId) |
| | | // .groupBy(BigStorageCageDetails::getTemperingLayoutId); |
| | | // List<Map<String, Object>> temperingLayoutIdList= bigStorageCageDetailsMapper.selectMaps(BigStorageCageDetailslambdaQueryWrapper); |
| | | // for (Map<String, Object> map : temperingLayoutIdList) { |
| | | // for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | // String prefix = entry.getKey().substring(0, entry.getKey().indexOf('-')); |
| | | // String suffix = entry.getKey().substring(entry.getKey().indexOf('-') + 1); |
| | | // if(suffix.equals(entry.getValue())){ |
| | | // |
| | | // } |
| | | // } |
| | | // } |
| | | log.info("3、查询理片笼内片序+1等于当前玻璃片序的玻璃的结果为空时获取当前玻璃版图id是否存在理片笼内"); |
| | | LambdaQueryWrapper<BigStorageCageDetails> BigStorageCageDetailslambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | BigStorageCageDetailslambdaQueryWrapper |
| | | .select(BigStorageCageDetails::getTemperingLayoutId); |
| | | layoutSlotInfo = bigStorageCageDetailsMapper.selectOne(BigStorageCageDetailslambdaQueryWrapper); |
| | | |
| | | if(layoutSlotInfo != null){ |
| | | log.info("4、获取笼子内适合的格子"); |
| | | BigStorageCage bigStorageCage=bigStorageCageSlot(layoutSlotInfo.getDeviceId()); |
| | | bigStorageCageDetails.setSlot(bigStorageCage.getSlot()); |
| | | }else{ |
| | | log.info("5、获取每个笼子版图id的个数"); |
| | | QueryWrapper<BigStorageCageDetails> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.select("a.device_id", "COUNT(DISTINCT b.tempering_layout_id) AS layoutCount") |
| | | .groupBy("a.device_id") |
| | | .apply("LEFT JOIN (SELECT device_id, tempering_layout_id FROM big_storage_cage_details) b ON a.device_id = b.device_id AND a.slot = b.slot") |
| | | .orderByAsc("layoutCount") |
| | | .orderByAsc("a.device_id"); |
| | | List<Map<String, Object>> BigStorageCageDetailsCount= bigStorageCageDetailsMapper.selectMaps(queryWrapper); |
| | | |
| | | //获取可进片格子信息 |
| | | // BigStorageCageDetails EmptySlotInfo = bigStorageCageMapper.selectEmptyFeedSlot(); |
| | | // if (EmptySlotInfo != null) { |
| | | // bigStorageCageDetails.setSlot(EmptySlotInfo.getSlot()); |
| | | // } else { |
| | | // //获取其他笼格子- |
| | | // BigStorageCageDetails OtherSlotInfo = bigStorageCageMapper.selectOtherFeedSlot(); |
| | | // bigStorageCageDetails.setSlot(OtherSlotInfo.getSlot()); |
| | | // } |
| | | //将玻璃信息放入该格子 |
| | | |
| | | log.info("5、查询笼子内是否有合适的格子"); |
| | | for (Map<String, Object> map : BigStorageCageDetailsCount) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | int deviceId = Integer.parseInt(entry.getKey()); |
| | | BigStorageCage bigStorageCage=bigStorageCageSlot(deviceId); |
| | | if(bigStorageCage!=null){ |
| | | bigStorageCageDetails.setSlot(bigStorageCage.getSlot()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | log.info("6、当找到合适的格子时添加玻璃到笼子表"); |
| | | if (bigStorageCageDetails.getSlot() != null) { |
| | | bigStorageCageDetails.setState(0); |
| | | bigStorageCageDetailsMapper.insert(bigStorageCageDetails); |
| | | updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | | updateRemainWidth(bigStorageCageDetails.getSlot()) ; |
| | | } |
| | | return bigStorageCageDetails; |
| | | } |
| | | |
| | | //获取笼子内的空格子 |
| | | private BigStorageCage bigStorageCageSlot(Integer deviceId) { |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper=new LambdaQueryWrapper<>(); |
| | | bigStorageCageWrapper |
| | | .eq(BigStorageCage::getRemainWidth,"5000") |
| | | .eq(BigStorageCage::getEnableState,"0") |
| | | .eq(BigStorageCage::getDeviceId,deviceId) |
| | | .orderByAsc(BigStorageCage::getSlot) |
| | | .last("LIMIT 1"); |
| | | return bigStorageCageMapper.selectOne(bigStorageCageWrapper); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public boolean outGlass() { |
| | | // // 1、查询钢化小片任务表是否有待出玻璃 |
| | | // List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.SelectTemperingGlassInfo(); |
| | | // //没有可出的玻璃时 |
| | | // if (temperingGlassInfoList != null) { |
| | | // //查询是否有小片全部到齐的钢化版图 |
| | | // } else { |
| | | // //继续当前钢化版图的任务 |
| | | // } |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailslambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailslambdaQueryWrapper |
| | | .select(BigStorageCageDetails::getTemperingLayoutId) |
| | | .groupBy(BigStorageCageDetails::getTemperingLayoutId); |
| | | List<Map<String, Object>> temperingLayoutIdList = bigStorageCageDetailsMapper.selectMaps(bigStorageCageDetailslambdaQueryWrapper); |
| | | for (Map<String, Object> map : temperingLayoutIdList) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | String prefix = entry.getKey().substring(0, entry.getKey().indexOf('-')); |
| | | String suffix = entry.getKey().substring(entry.getKey().indexOf('-') + 1); |
| | | if (suffix.equals(entry.getValue())) { |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list(); |
| | | log.info("1、查询钢化小片任务表是否有待出玻璃"+temperingGlassInfoList.size()); |
| | | |
| | | if(temperingGlassInfoList!=null){ |
| | | temperingGlassInfoService.addOutTask(temperingGlassInfoList); |
| | | log.info("2、添加任务到任务表"); |
| | | return true; |
| | | }else{ |
| | | log.info("3、没有可出的玻璃时获取是否有小片到齐的版图"); |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailslambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailslambdaQueryWrapper |
| | | .select(BigStorageCageDetails::getTemperingLayoutId) |
| | | .groupBy(BigStorageCageDetails::getTemperingLayoutId); |
| | | List<Map<String, Object>> temperingLayoutIdList = bigStorageCageDetailsMapper.selectMaps(bigStorageCageDetailslambdaQueryWrapper); |
| | | for (Map<String, Object> map : temperingLayoutIdList) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | String layoutId = entry.getKey().substring(0, entry.getKey().indexOf('-')); |
| | | String layoutNum = entry.getKey().substring(entry.getKey().indexOf('-') + 1); |
| | | if (layoutNum.equals(entry.getValue())) { |
| | | //4、添加此钢化版图id所有小片小片到钢化小片表 |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | return false; |
| | | } |
| | | |
| | | //修改格子剩余宽度 |
| | | //计算格子剩余宽度 |
| | | @Override |
| | | public void updateRemainWidth(int slot) { |
| | | //获取该格子内玻璃信息 |
| | | log.info("获取该格子内玻璃信息,计算格子剩余宽度"); |
| | | Integer width = 5000; |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = Collections.singletonList(bigStorageCageDetailsMapper.selectById(slot)); |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList |
| | |
| | | bigStorageCage.setRemainWidth(width); |
| | | UpdateWrapper<BigStorageCage> bigStorageCageWrapper = new UpdateWrapper<>(); |
| | | bigStorageCageWrapper.eq("remain_width", width); |
| | | baseMapper.update(bigStorageCage, bigStorageCageWrapper); |
| | | bigStorageCageMapper.update(bigStorageCage, bigStorageCageWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageCage> querybigStorageCageDetail() { |
| | | //1、获取大理片笼信息 |
| | | List<BigStorageCage> bigStorageCages = baseMapper.selectList(null); |
| | | List<BigStorageCage> bigStorageCages = bigStorageCageMapper.selectList(null); |
| | | log.info("1、获取大理片笼信息完成,获取到的数据{}", bigStorageCages.size()); |
| | | //2获取理片笼所有信息 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = bigStorageCageDetailsMapper.selectList(null); |
| | |
| | | package com.mes.userinfo.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | |
| | | @Autowired |
| | | private BigStorageCageOutTaskService bigStorageCageOutTaskService; |
| | | |
| | | @ApiOperation("进片任务信息") |
| | | @GetMapping("/querybigStorageCageTask") |
| | | public List<BigStorageCageOutTask> querybigStorageCageOutTask(int taskState) { |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | private Long id; |
| | | |
| | | private Integer tragetSlot; |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | private Long id; |
| | | |
| | | private Integer startSlot; |
| | | |
| | |
| | | package com.mes.bigstoragetask.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public interface BigStorageCageOutTaskService extends IService<BigStorageCageOutTask> { |
| | | |
| | | List<BigStorageCageOutTask> querybigStorageCageOutTask(int taskState); |
| | | |
| | | void updateOutTask(); |
| | | |
| | | void deleteOutTask(Long taskId); |
| | | } |
| | |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageFeedTaskMapper; |
| | | import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import net.bytebuddy.matcher.FilterableList; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | package com.mes.bigstoragetask.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageOutTaskMapper; |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-16 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class BigStorageCageOutTaskServiceImpl extends ServiceImpl<BigStorageCageOutTaskMapper, BigStorageCageOutTask> implements BigStorageCageOutTaskService { |
| | | |
| | | @Resource |
| | | TemperingGlassInfoMapper temperingGlassInfoMapper; |
| | | @Resource |
| | | BigStorageCageOutTaskMapper bigStorageCageOutTaskMapper; |
| | | @Resource |
| | | BigStorageCageDetailsMapper bigStorageCageDetailsMapper; |
| | | @Override |
| | | public List<BigStorageCageOutTask> querybigStorageCageOutTask(int taskState) { |
| | | LambdaQueryWrapper<BigStorageCageOutTask> getOutTaskWrapper = new LambdaQueryWrapper<>(); |
| | | getOutTaskWrapper.eq(BigStorageCageOutTask::getTaskState, taskState); |
| | | public List<BigStorageCageOutTask> querybigStorageCageOutTask(int taskState){ |
| | | log.info("根据传入的任务状态查询任务信息:"+taskState); |
| | | LambdaQueryWrapper<BigStorageCageOutTask> getOutTaskWrapper=new LambdaQueryWrapper<>(); |
| | | getOutTaskWrapper.eq(BigStorageCageOutTask::getTaskState,taskState); |
| | | return baseMapper.selectList(getOutTaskWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void updateOutTask(){ |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList=querybigStorageCageOutTask(1); |
| | | log.info("查询任务表是否有已完成的出片任务"+bigStorageCageOutTaskList.size()); |
| | | for (BigStorageCageOutTask bigStorageCageOutTask:bigStorageCageOutTaskList |
| | | ) { |
| | | deleteOutTask(bigStorageCageOutTask.getId()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void deleteOutTask(Long taskId){ |
| | | log.info("根据任务id修改钢化小片表状态,删除已完成的出片任务,删除笼子表玻璃"); |
| | | temperingGlassInfoMapper.deleteById(taskId); |
| | | bigStorageCageOutTaskMapper.deleteById(taskId); |
| | | bigStorageCageDetailsMapper.deleteById(taskId); |
| | | } |
| | | } |
| | |
| | | package com.mes.component; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.service.BigStorageCageFeedTaskService; |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | | import com.mes.edgstoragetask.service.TaskCacheService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | public class PlcStorageCage extends Thread { |
| | | |
| | | @Autowired |
| | |
| | | @Autowired |
| | | private BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @Autowired |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | @Autowired |
| | | private BigStorageCageFeedTaskService bigStorageCageFeedTaskService; |
| | | @Autowired |
| | | private BigStorageCageOutTaskService bigStorageCageOutTaskService; |
| | | @Autowired |
| | | private TaskCacheService taskCacheService; |
| | | |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | try { |
| | | Thread.sleep(500); |
| | | String plcFeedReq = "0"; |
| | | String plcFeedGlassid = "111"; |
| | | //Plc进片请求时 |
| | | if ("1".equals(plcFeedReq)) { |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | //传入玻璃id |
| | | GlassInfo glassInfo = glassInfoService.getById(plcFeedGlassid); |
| | | Thread.sleep(300); |
| | | boolean bigStorageCageFullAlarm=false; |
| | | |
| | | String plcD01FeedReq = "0"; |
| | | String plcD04FeedReq = "0"; |
| | | String plcFeedGlassid = "111"; |
| | | String plcFeedReqLine="0"; |
| | | if("1".equals(plcD01FeedReq)){ |
| | | plcFeedReqLine="1"; |
| | | }else { |
| | | //plc任务发送字0 |
| | | } |
| | | if("1".equals(plcD04FeedReq)){ |
| | | plcFeedReqLine="2"; |
| | | }else { |
| | | //plc任务发送字0 |
| | | } |
| | | |
| | | if (!("0".equals(plcFeedReqLine))) { |
| | | log.info("1、Plc进片请求时"); |
| | | BigStorageCageDetails bigStorageCageDetails = new BigStorageCageDetails(); |
| | | GlassInfo glassInfo = glassInfoService.getById(plcFeedGlassid); |
| | | log.info("2、根据玻璃id获取玻璃信息"+glassInfo); |
| | | BigStorageCageDetails slotInfo = bigStorageCageService.feedGlass(glassInfo, bigStorageCageDetails); |
| | | if (slotInfo != null) { |
| | | //plc任务发送字 |
| | | int taskType=taskCacheService.judgeTasktype(); |
| | | log.info("3、查询任务表判断当前任务类型为上车等到还是上车启动"+taskType); |
| | | bigStorageCageFeedTaskService.addFeedTask(slotInfo,Integer.parseInt(plcFeedReqLine),taskType); |
| | | log.info("4、添加任务到任务表"); |
| | | //plc任务发送字1 |
| | | bigStorageCageFullAlarm=false; |
| | | }else{ |
| | | //理片笼爆笼报警 |
| | | bigStorageCageFullAlarm=true; |
| | | } |
| | | }else{ |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTaskList=bigStorageCageFeedTaskService.querybigStorageCageFeedTask(1); |
| | | log.info("5、查询任务表是否有已经完成的进片任务"+bigStorageCageFeedTaskList.size()); |
| | | for (BigStorageCageFeedTask bigStorageCageFeedTask:bigStorageCageFeedTaskList |
| | | ) { |
| | | BigStorageCageDetails bigStorageCageDetails=new BigStorageCageDetails(); |
| | | bigStorageCageDetails.setId(bigStorageCageFeedTask.getId()); |
| | | bigStorageCageDetails.setState(1); |
| | | bigStorageCageDetailsService.updateById(bigStorageCageDetails); |
| | | log.info("6、修改理片笼详情玻璃状态"); |
| | | bigStorageCageFeedTaskService.removeById(bigStorageCageFeedTask); |
| | | log.info("7、删除已经完成的进片任务"); |
| | | } |
| | | } |
| | | |
| | |
| | | String plcOutReq = "0"; |
| | | boolean result = false; |
| | | if ("1".equals(plcOutReq)) { |
| | | //获取钢化小片表未出笼信息 |
| | | |
| | | |
| | | if (result == true) { |
| | | //plc任务发送字 |
| | | result=bigStorageCageService.outGlass(); |
| | | log.info("8、出片请求时调用出片接口"+result); |
| | | if (result) { |
| | | //plc任务发送字1 |
| | | } |
| | | }else{ |
| | | bigStorageCageOutTaskService.updateOutTask(); |
| | | //plc任务发送字0 |
| | | } |
| | | |
| | | //显示剩余空格子 |
| | | |
| | | //报警信息 |
| | | jsonObject.append("bigStorageCageFullAlarm", bigStorageCageFullAlarm); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | package com.mes.edgstoragetask.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | /** |
| | | * ID编号 |
| | | */ |
| | | @TableId("ID") |
| | | private String id; |
| | | @TableId("ID") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 起始 |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private Integer engineerId; |
| | | private Long engineerId; |
| | | |
| | | /** |
| | | * 生产规则id |
| | |
| | | * @since 2024-03-27 |
| | | */ |
| | | public interface TemperingGlassInfoService extends IService<TemperingGlassInfo> { |
| | | |
| | | public void addOutTask(List<TemperingGlassInfo> temperingGlassInfoList); |
| | | |
| | | public List<TemperingGlassInfo> SelectTemperingGlassInfo(); |
| | | } |
| | |
| | | package com.mes.temperingglass.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class TemperingGlassInfoServiceImpl extends ServiceImpl<TemperingGlassInfoMapper, TemperingGlassInfo> implements TemperingGlassInfoService { |
| | | |
| | | @Override |
| | | public void addOutTask(List<TemperingGlassInfo> temperingGlassInfoList) { |
| | | double carwidth = 5000; |
| | | double gay = 50; |
| | | double carWidth=5000; |
| | | double gap=50; |
| | | //写入任务到任务表 |
| | | for (TemperingGlassInfo temperingGlassInfo : temperingGlassInfoList |
| | | for (TemperingGlassInfo temperingGlassInfo:temperingGlassInfoList |
| | | ) { |
| | | if ((carwidth - gay - temperingGlassInfo.getWidth()) > 0) { |
| | | //添加任务到任务表 |
| | | } else { |
| | | log.info("1、当出片车宽度大于玻璃宽度时"); |
| | | if((carWidth-temperingGlassInfo.getWidth())>0){ |
| | | carWidth-=temperingGlassInfo.getWidth()-gap; |
| | | log.info("2、添加刚小片表信息到任务表"); |
| | | temperingGlassInfo.setState(1); |
| | | baseMapper.updateById(temperingGlassInfo); |
| | | log.info("3、添加刚小片表信息到任务表"); |
| | | BigStorageCageOutTask bigStorageCageOutTask =new BigStorageCageOutTask(); |
| | | bigStorageCageOutTask.setId(temperingGlassInfo.getId()); |
| | | }else{ |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<TemperingGlassInfo> SelectTemperingGlassInfo() { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | |
| | | spring: |
| | | datasource: |
| | | dynamic: |
| | | primary: hangzhoumes #设置默认的数据源或者数据源组,默认值即为master |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | hangzhoumes: |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8 |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8&characterEncoding=utf-8&useSSL=false |
| | | username: root |
| | | password: beibo.123/ |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | return Result.build(200, "", glass); |
| | | } |
| | | |
| | | |
| | | //新增工位信息修改一条工位信息,接收实例类字段为宽高厚膜系数量工位id |
| | | //删除工位信息也用这个,除了工位id玻璃信息传null |
| | | @ApiOperation("修改工位表增加玻璃信息或者删除玻璃信息") |
| | | @PostMapping("/updateGlassMessage") |
| | | @ResponseBody |
| | | public void updateGlassMessage(@RequestBody UpWorkstation upwork) { |
| | | upWorkstationService.updateGlassMessage(upwork); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("开始上片任务") |
| | | @PostMapping("/selectPriority") //开始上片任务 |
| | | @ResponseBody |
| | | public void selectPriority() { |
| | |
| | | /** |
| | | * 工程号 |
| | | */ |
| | | private Integer engineerId; |
| | | private Long engineerId; |
| | | |
| | | /** |
| | | * 生产规则id |
| | |
| | | public interface UpWorkstationMapper extends BaseMapper<UpWorkstation> { |
| | | |
| | | List<UpWorkSequence> selectPriority(@Param("id") int id); |
| | | |
| | | } |
| | |
| | | //判断是否可以吸片进行任务 |
| | | |
| | | //判断优先吸片位置后发送出片任务 |
| | | public void selectPriority() ; |
| | | public void selectPriority(); |
| | | |
| | | //查询正在进行的工程 |
| | | |
| | | |
| | | /** |
| | | * 增加人工输入的工位玻璃信息 |
| | | * |
| | | * @param upwork |
| | | */ |
| | | void updateGlassMessage(UpWorkstation upwork); |
| | |
| | | import com.mes.workstation.entity.UpWorkstation; |
| | | import com.mes.workstation.mapper.UpWorkstationMapper; |
| | | import com.mes.workstation.service.UpWorkstationService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | * @since 2024-04-07 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class UpWorkstationServiceImpl extends ServiceImpl<UpWorkstationMapper, UpWorkstation> implements UpWorkstationService { |
| | | |
| | | public static final String DB_100_10 = "DB_100_10"; |
| | | |
| | | //判断是否可以吸片进行任务 |
| | | public boolean isCanLoadGlass() { |
| | | String loadstart="吸片信号";//plcmes.getPlcParameter("吸片信号").getValue(); |
| | | String loadstart = "吸片信号";//plcmes.getPlcParameter("吸片信号").getValue(); |
| | | return "1".equals(loadstart); |
| | | |
| | | } |
| | | //显示正在进行任务的工程信息 |
| | | |
| | | |
| | | //判断优先吸片位置后发送出片任务 |
| | | public void selectPriority() { |
| | | //todo:判断是否可以吸片进行任务 |
| | |
| | | /** |
| | | * 下片玻璃信息表id |
| | | */ |
| | | private int id; |
| | | private Long id; |
| | | |
| | | /** |
| | | * 流程卡号 |
| | |
| | | * id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | private Long id; |
| | | |
| | | /** |
| | | * 起始 |
| | |
| | | |
| | | List<DownGlassTask> getUnloadingTaskState(); |
| | | |
| | | void updateTaskStateToZero(String flowCardId, int state); |
| | | void updateTaskStateToZero(String flowCardId); |
| | | |
| | | void deleteTask(String flowCardId); |
| | | |
| | | DownGlassTask selectLastOutCacheInfo(String endCell); |
| | | |
| | | Integer insertCacheTask(int id, String start, String end, String type, double width, double height, String filmsId, double thickness, String flowCardId); |
| | | Integer insertCacheTask(long id, String start, String end, String type, double width, double height, String filmsId, double thickness, String flowCardId); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateTaskStateToZero(String flowCardId,int state) { |
| | | public void updateTaskStateToZero(String flowCardId) { |
| | | UpdateWrapper<DownGlassTask> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.set("task_stauts", 0).eq("flow_card_id", flowCardId); |
| | | baseMapper.update(null, updateWrapper); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer insertCacheTask(int id, String start, String end, String type, double width, double height, String filmsId, double thickness, String flowCardId) { |
| | | public Integer insertCacheTask(long id, String start, String end, String type, double width, double height, String filmsId, double thickness, String flowCardId) { |
| | | DownGlassTask glassInfo = new DownGlassTask(); |
| | | glassInfo.setId(id); |
| | | glassInfo.setStartCell(start); |
| | |
| | | private static final int START_VALUE = 0; |
| | | private static final int END_VALUE = 5; |
| | | @GetMapping("/leisure2") |
| | | public List<Map> getLeisureData2() { |
| | | public List<DownStorageCageDetails> getLeisureData2() { |
| | | // 调用Service层获取数据 |
| | | return downStorageCageService.getCacheOut(START_VALUE, END_VALUE); |
| | | } |
| | |
| | | * 下片前理片笼明细表id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设备id |
| | |
| | | private DownStorageCageService downStorageCageService; |
| | | private DownGlassTaskService downGlassTaskService; |
| | | |
| | | /** |
| | | * @param Number //识别逻辑 不交互 |
| | | */ |
| | | |
| | | |
| | | // public void identify(String Number) { |
| | | // //查询任务 |
| | |
| | | //存在此玻璃编号 |
| | | if (GlassInfo != null) { |
| | | //同钢化版图内的栅格号 找到相同版图id并且大于前面的顺序的空格 |
| | | List<DownStorageCageDetails> list = selectInfo.SelectIsExistIntoCache(GlassInfo.getTemperingLayoutId(), GlassInfo.getTemperingFeedSequence(), GlassInfo.getWidth()); |
| | | List<DownStorageCageDetails> list = downStorageCageService.getIsExistIntoCacheByLayoutAndSequence(GlassInfo.getTemperingLayoutId(), GlassInfo.getTemperingFeedSequence(), GlassInfo.getWidth()); |
| | | //空栅格号 |
| | | if (list.size() == 0) { |
| | | //查询笼子内空闲 |
| | | list = selectInfo.SelectCacheLeisure(); |
| | | list = downStorageCageService.getCacheLeisure(); |
| | | } |
| | | //小于此玻璃钢化版图序号的栅格号 |
| | | if (list.size() == 0) { |
| | | list = selectInfo.SelectIsExistIntoCache(GlassInfo.getTemperingLayoutId(), GlassInfo.getWidth()); |
| | | list = downStorageCageService.getIsExistIntoCacheByLayout(GlassInfo.getTemperingLayoutId(), GlassInfo.getWidth()); |
| | | } |
| | | if (list.size() > 0) { |
| | | //存在空格 |
| | |
| | | String G11 = S7control.getinstance().ReadWord("DB14.58", 1).get(0) + ""; |
| | | String G13 = S7control.getinstance().ReadWord("DB14.58", 1).get(0) + ""; |
| | | PlcParameterObject plcmes = PLCAutoMes.PlcMesObject; |
| | | log.println("666"); ; |
| | | |
| | | List<DownStorageCageDetails> list = selectInfo.SelectCacheOut(1, 5); |
| | | List<DownStorageCageDetails> list2 = selectInfo.SelectCacheOut(6, 10); |
| | | List<DownStorageCageDetails> list3 = selectInfo.SelectCacheOut(1, 10); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | public List<Map> gettask(); |
| | | |
| | | // List<Map<String, Object>> selectCacheLeisure(); |
| | | List<Map> getCacheLeisure(); |
| | | List<Map> getCacheOut(int start, int end); |
| | | List<DownStorageCageDetails> getCacheLeisure(); |
| | | List<DownStorageCageDetails> getCacheOut(int start, int end); |
| | | List<Map> getCacheInfo(); |
| | | List<Map> getIsExistIntoCacheByLayoutAndSequence(Integer tempering_layout_id, Integer tempering_feed_sequence, double width); |
| | | List<Map> getIsExistIntoCacheByLayout(Integer tempering_layout_id, double width); |
| | | List<DownStorageCageDetails> getIsExistIntoCacheByLayoutAndSequence(Integer tempering_layout_id, Integer tempering_feed_sequence, double width); |
| | | List<DownStorageCageDetails> getIsExistIntoCacheByLayout(Integer tempering_layout_id, double width); |
| | | |
| | | } |
| | |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.mapper.DownStorageCageDetailsMapper; |
| | | import com.mes.downstorage.mapper.DownStorageCageMapper; |
| | | import com.mes.downstorage.service.DownStorageCageService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collections; |
| | | import java.util.Comparator; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<Map> getCacheLeisure() { |
| | | public List<DownStorageCageDetails> getCacheLeisure() { |
| | | log.info(" 查询笼子内空闲"); |
| | | List<Map> map = downStorageCageMapper.selectJoinList( |
| | | Map.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNull("escd.slot") |
| | | .orderByAsc("escd.slot") |
| | | ); |
| | | return map; |
| | | return list; |
| | | } |
| | | |
| | | |
| | | // @Override |
| | | // public List<Map> getCacheOut(int start, int end) { |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<Map> getCacheOut(int start, int end) { |
| | | public List<DownStorageCageDetails> getCacheOut(int start, int end) { |
| | | log.info("根据传入的工位查询符合按照顺序和大小出片的小片"); |
| | | List<Map> map = downStorageCageMapper.selectJoinList( |
| | | Map.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .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) |
| | | .orderByAsc("escd.tempering_layout_id, escd.tempering_feed_sequence") |
| | | .orderByDesc("gi.width, gi.height, escd.tempering_layout_id") |
| | | ); |
| | | |
| | | // 对获取的数据列表按照宽度进行排序 |
| | | Collections.sort(map, new Comparator<Map>() { |
| | | @Override |
| | | public int compare(Map o1, Map o2) { |
| | | // 获取宽度并比较 |
| | | double width1 = (double) o1.get("width"); |
| | | double width2 = (double) o2.get("width"); |
| | | return Double.compare(width2, width1); |
| | | } |
| | | }); |
| | | |
| | | return map; |
| | | return list; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map> getIsExistIntoCacheByLayoutAndSequence(Integer tempering_layout_id, Integer tempering_feed_sequence, double width) { |
| | | public List<DownStorageCageDetails> getIsExistIntoCacheByLayoutAndSequence(Integer tempering_layout_id, Integer tempering_feed_sequence, double width) { |
| | | log.info(" 查询可进此片玻璃的栅格号 找到相同版图id并且大于前面的顺序的空格"); |
| | | |
| | | |
| | | List<Map> map = downStorageCageMapper.selectJoinList( |
| | | Map.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNotNull("escd.slot") |
| | |
| | | .gt("t.remain_width", width) |
| | | .orderByAsc("escd.tempering_feed_sequence") |
| | | ); |
| | | return map; |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<Map> getIsExistIntoCacheByLayout(Integer tempering_layout_id, double width) { |
| | | List<Map> map = downStorageCageMapper.selectJoinList( |
| | | Map.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | public List<DownStorageCageDetails> getIsExistIntoCacheByLayout(Integer tempering_layout_id, double width) { |
| | | log.info(" 查询可进此片玻璃的栅格号"); |
| | | List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .lt("escd.tempering_layout_id", tempering_layout_id) |
| | | .gt("t.remain_width", width) |
| | | // 条件 t.remain_width - width > 0 |
| | | .apply("t.remain_width - " + width + " > 0") |
| | | .orderByDesc("escd.tempering_layout_id, escd.tempering_feed_sequence") |
| | | ); |
| | | return map; |
| | | return list; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | private Long id; |
| | | |
| | | /** |
| | | * 宽 |
| | |
| | | |
| | | downWorkstationTaskService.insertdownWorkstationtask(newdownGlassInfo); |
| | | //更新下片任务表状态为0 |
| | | downGlassTaskService.updateTaskStateToZero(downGlassInfo.getFlowCardId(),downGlassInfo.getId()); |
| | | downGlassTaskService.updateTaskStateToZero(downGlassInfo.getFlowCardId()); |
| | | |
| | | sequence++; // 递增顺序字段值 |
| | | |
New file |
| | |
| | | package mes; |
| | | |
| | | import com.mes.UnLoadGlassApplication; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | import com.mes.downstorage.service.impl.DownStorageCageServiceImpl; |
| | | |
| | | 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 |
| | | * @Date: 2024/3/27 16:37 |
| | | * @Description: |
| | | */ |
| | | @Slf4j |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = UnLoadGlassApplication.class) |
| | | public class UnloadGlassModuleApplicationTest { |
| | | |
| | | @Autowired |
| | | DownStorageCageServiceImpl downStorageCageServiceImpl; |
| | | |
| | | @Test |
| | | public void testFindPath() { |
| | | log.info("完整路径:{}", Arrays.asList("123")); |
| | | } |
| | | |
| | | @Test |
| | | public void testCacheGlass() { |
| | | List<Map> map= downStorageCageServiceImpl.getCacheInfo(); |
| | | log.info("笼内信息:{}", Arrays.asList(map)); |
| | | } |
| | | @Test |
| | | public void testselectCacheEmpty() { |
| | | List<DownStorageCageDetails> map= downStorageCageServiceImpl.getCacheLeisure(); |
| | | log.info("笼内空格:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void testgetCacheOut() { |
| | | List<DownStorageCageDetails> map= downStorageCageServiceImpl.getCacheOut(1,5); |
| | | log.info("根据传入的工位查询符合按照顺序和大小出片的小片:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | | } |