Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes
# Conflicts:
# springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
| | |
| | | "There is no glass for this order":"There is no glass for this order",
|
| | | "There are currently tasks":"There are currently tasks",
|
| | | "There is no such glass":"There is no such glass",
|
| | | "There is no such grid":"There is no such grid",
|
| | | "There is no such slot":"There is no such slot",
|
| | | "No delete allowed":"No delete allowed",
|
| | | "No out allowed":"No out allowed",
|
| | | "Are you sure to perform this operation ?":"Are you sure to perform this operation ?",
|
| | |
| | | "There is no such order": "没有此订单的玻璃",
|
| | | "There are currently tasks": "当前有任务",
|
| | | "There is no such glass": "没有此玻璃",
|
| | | "There is no such grid": "没有空闲格子",
|
| | | "There is no such slot": "没有空闲格子",
|
| | | "No delete allowed": "不能删除",
|
| | | "No out allowed": "不能出片",
|
| | | "Are you sure to perform this operation ?": "确定执行此操作?",
|
| | |
| | |
|
| | | <el-pagination :style="'margin-top:-2px'" @size-change="handleSizeChanges"
|
| | | @current-change="handleCurrentChanges" :pager-count="7" :current-page="currentPages"
|
| | | :page-sizes="[21, 42, 84, 420]" :page-size="pagesizes" layout="total, sizes, prev, pager, next, jumper"
|
| | | :page-sizes="[42, 84, 126, 420]" :page-size="pagesizes" layout="total, sizes, prev, pager, next, jumper"
|
| | | :total="cageinfo.length > 0 ? cageinfo.length : null" background style="float: right; margin-top: 20px">
|
| | | </el-pagination>
|
| | |
|
| | |
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column prop="sequence" :label="$t('Sequence')"></el-table-column>
|
| | | <el-table-column prop="position" :label="$t('Position')" style="font-size: 20px;">
|
| | | <el-table-column :min-width="300" prop="position" :label="$t('Position')" style="font-size: 20px;">
|
| | | <template slot-scope='scope'>
|
| | | {{ scope.row.position == 1 ? "▄▄▄" : "▋" }}
|
| | | <!-- {{ scope.row.position == 1 ? "<>▄▄▄" : "▋" }} -->
|
| | | <div :style="'width:'+(scope.row.position==1?'300':'100') +'px;height:'+(scope.row.position==1?'100':'300') +'px;background-Color:gray;'">
|
| | | <!-- <div :style="'width:100px;height:300px;background-Color:red;'"></div> -->
|
| | | </div>
|
| | | <!-- {{ scope.row.position == 1 ? "<div></div>" : "<div></div>" }} -->
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column prop="position" :label="$t('Flip')">
|
| | |
| | |
|
| | | <el-dialog :visible.sync="dialogFormCountDown" :title="$t('Approximately resettable time')" top="5vh">
|
| | | <div :style="'font-size: ' + PromptSize + 'px;text-align: center;'">
|
| | | <!-- {{ this.CountDowns }} -->
|
| | | {{ this.CountDowns }}
|
| | | </div>
|
| | | </el-dialog>
|
| | |
| | | pagesize: 15, //每页默认显示的数据
|
| | | pageCount: 0,
|
| | | currentPages: 1, //默认初始页
|
| | | pagesizes: 21, //每页默认显示的数据
|
| | | pagesizes: 42, //每页默认显示的数据
|
| | | pageCounts: 0,
|
| | | OutSlice: [],
|
| | | AluminumFrame: [],
|
| | |
| | | OutingQueue: true,
|
| | | OrderInfo: true,
|
| | | CageDetails: true,
|
| | | CountDowns: "EMERGENCY STOP",
|
| | | CountDowns: "EMERGENCY \r\n STOP",
|
| | | D01RequestState: false,
|
| | | EmergencyStop: false,
|
| | | PromptSize: 250
|
| | | PromptSize: 250,
|
| | | reset:false
|
| | | };
|
| | | },
|
| | | created() {
|
| | | this.load();
|
| | |
|
| | | this.init();
|
| | | }
|
| | | ,
|
| | |
| | | }
|
| | | //是否急停
|
| | | this.EmergencyStop = obj.emergencystop[0];
|
| | | console.log(this.EmergencyStop);
|
| | |
|
| | | //复位倒计时
|
| | | if ((obj.countdown[0] == true && this.CountDowns == 0) || this.EmergencyStop == true) {
|
| | | this.CountDown();
|
| | | }
|
| | | //复位完成信号
|
| | | this.reset=obj.reset[0];
|
| | | //是否有进片请求
|
| | | console.log(obj.D01RequestState[0]);
|
| | | this.D01RequestState = obj.D01RequestState[0];
|
| | |
|
| | | //是否允许出片
|
| | |
| | | this.cageinfo = res.data.cageinfo;
|
| | | });
|
| | | }
|
| | |
|
| | |
|
| | | this.$forceUpdate();
|
| | |
|
| | | }.bind(this);
|
| | |
| | | });
|
| | |
|
| | | });
|
| | | //加载小车位置信息
|
| | | Loadcarlist().then(res => {
|
| | | this.carlist = res.data.carlist;
|
| | | });
|
| | | //加载笼子使用情况数据
|
| | | home().then(res => {
|
| | | this.tableData = res.data.list;
|
| | |
| | | SelectAlarmmgInfo().then(res => {
|
| | | this.alarm = res.data.alarmmg;
|
| | | });
|
| | | //加载小车位置信息
|
| | | Loadcarlist().then(res => {
|
| | | this.carlist = res.data.carlist;
|
| | | });
|
| | | |
| | | //加载确认密码
|
| | | SelectPassword().then(res => {
|
| | | this.password = res.data.password;
|
| | |
| | | this.$message.error(this.$t('There is no such glass'));
|
| | | }
|
| | | else if (res.data.message2 == 400) {
|
| | | this.$message.error(this.$t('There is no such grid'));
|
| | | this.$message.error(this.$t('There is no such slot'));
|
| | | }
|
| | | });
|
| | | } else {
|
| | |
| | | this.form5 = {};
|
| | | this.$message.success(this.$t('Operation successful'));
|
| | | } else {
|
| | | alert(1);
|
| | | this.$message.error(this.$t('This glass ID already exists in the sorting cage'));
|
| | | }
|
| | | });
|
| | |
| | | rowIndex = column;
|
| | | let style = "";
|
| | | if (columnIndex === 8) {
|
| | | style = "font-size:25px;text-align: center;";
|
| | | style = "font-size:200px;text-align: center;height:200px;";
|
| | | }
|
| | | if (columnIndex === 9 && row.flip == 1) {
|
| | | style = "background-Color:yellow;";
|
| | |
| | | if (this.EmergencyStop == true) {
|
| | | clearInterval(timer);
|
| | | this.PromptSize = 250;
|
| | | this.CountDowns = "EMERGENCY STOP";
|
| | | this.CountDowns = "EMERGENCY \n STOP";
|
| | | } else {
|
| | | if (count > 0) {
|
| | | this.PromptSize = 500;
|
| | |
| | | }
|
| | | else {
|
| | | this.PromptSize = 250;
|
| | | this.CountDowns = "Waiting for reset";
|
| | | |
| | | // if(复位完成==true){
|
| | | // clearInterval(timer);
|
| | | // this.dialogFormCountDown = false;
|
| | | // }
|
| | | this.CountDowns = "Waiting \n for \n reset";
|
| | | if(this.reset==true){
|
| | | clearInterval(timer);
|
| | | this.dialogFormCountDown = false;
|
| | | }
|
| | | }
|
| | | }
|
| | | },
|
| | |
| | | private JdbcConnections jdbcConnections; |
| | | private SpianMapper spianMapper; |
| | | private SpianService spianService; |
| | | |
| | | int aaa; |
| | | @Override |
| | | public void run() { |
| | | boolean inglassbegin = false; |
| | | boolean outglassbegin = false; |
| | | |
| | | while (this != null) { |
| | | try { |
| | | |
| | | Thread.sleep(1000); |
| | | Thread.sleep(100); |
| | | } catch (InterruptedException e) { |
| | | // \\ TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | |
| | | // // TODO Auto-generated catch block |
| | | // e.printStackTrace(); |
| | | // } |
| | | List<Short> datas1List = S7control.getinstance().ReadWord("DB106.24", 1);// 获取prc进片请求数据 |
| | | // 出片任务//////////////////////////////// |
| | | List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 出片车状态 |
| | | List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.18", 1); // 出片任务是否启动 |
| | | // StringBuilder writedstrIdOut = new StringBuilder(); |
| | | // 获取已下发的出片id |
| | | byte[] writedglassidbytesOut = S7control.getinstance().ReadByte("DB105.30", 14); |
| | | String writedstrIdOut = new String(writedglassidbytesOut); |
| | | |
| | | boolean outstate = false;// 出片车空闲判断 |
| | | boolean outstate1 = false;// 出片车任务是否启动 |
| | | if (outlist != null && outlist1 != null) { |
| | | |
| | | outstate = outlist.contains((short) 0);// 出片车空闲判断 当出片车空闲时为true |
| | | outstate1 = outlist1.contains((short) 1);// 出片车任务是否启动 当出片车任务启动时为true |
| | | |
| | | // 判断当前是否有未执行的任务 |
| | | int outnum = spianMapper.SelectOutSliceshu(); |
| | | // 当没有任务执行并且出片车空闲时 |
| | | if (outnum == 0 && outstate == true && Plchome.isAllowQueue == true) { |
| | | // 判断铝框出片队列表是否有待出片的玻璃 |
| | | String outglassid = spianMapper.SelectOutSlice(); |
| | | if (outglassid != null) { |
| | | |
| | | spianService.selectout2(outglassid); |
| | | outstate = false; |
| | | } |
| | | } |
| | | if (outstate == true) {// 当出片车空闲时,且出片启动为1时,任务启动改为0 |
| | | if (outstate1 == true) { |
| | | S7control.getinstance().WriteWord("DB105.18", (short) 0);// 出片任务启动改为0 |
| | | } |
| | | } |
| | | } |
| | | |
| | | /////////////进片任务 |
| | | List<Short> datas1List = S7control.getinstance().ReadWord("DB106.24", 1);// 获取prc进片请求数据 |
| | | List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", 1);// 获取进片车状态 |
| | | List<Short> datas1ListState2 = S7control.getinstance().ReadWord("DB105.16", 1);// 获取进片车任务是否启动 |
| | | |
| | | boolean B01backs = spianService.listbool("DB106.60");// b01汇报 |
| | | |
| | | boolean B02backs = spianService.listbool("DB106.62");// b02汇报 |
| | | StringBuilder B01glassid = spianService.queGlassid("DB103.184", 14);// BO1的玻璃id |
| | | StringBuilder B02glassid = spianService.queGlassid("DB103.212", 14);// B02的玻璃id |
| | | int aaa=1; |
| | | |
| | | // 当进片小车完成任务时 |
| | | if (B01backs == true) { |
| | | // 当B01小车汇报完成时更改玻璃状态 为1 |
| | | spianService.overtask(B01glassid.toString());// 完成任务 |
| | | S7control.getinstance().WriteWord("DB106.60", (short) 0);// 恢复B01小车应答改为0 |
| | | System.out.println("汇报时B01|第"+aaa+"次"+ B01glassid); |
| | | boolean yingda = spianService.listbool("DB106.60");// b01汇报 |
| | | System.out.println("汇报时B01|第"+aaa+"次"+ B01glassid+"应答"+yingda); |
| | | aaa+=1; |
| | | } |
| | | |
| | |
| | | spianService.overtask(B02glassid.toString());// 完成任务 |
| | | S7control.getinstance().WriteWord("DB106.62", (short) 0);// 恢复B02小车应答改为0 |
| | | System.out.println("汇报时B02|" + B02glassid); |
| | | boolean yingda = spianService.listbool("DB106.62");// b01汇报 |
| | | System.out.println("汇报时B01|第"+aaa+"次"+ B02glassid+"应答"+yingda); |
| | | } |
| | | |
| | | // 获取DO1数据 |
| | |
| | | |
| | | } |
| | | |
| | | // 出片任务//////////////////////////////// |
| | | List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 出片车状态 |
| | | List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.18", 1); // 出片任务是否启动 |
| | | // StringBuilder writedstrIdOut = new StringBuilder(); |
| | | // 获取已下发的出片id |
| | | byte[] writedglassidbytesOut = S7control.getinstance().ReadByte("DB105.30", 14); |
| | | String writedstrIdOut = new String(writedglassidbytesOut); |
| | | |
| | | boolean outstate = false;// 出片车空闲判断 |
| | | boolean outstate1 = false;// 出片车任务是否启动 |
| | | if (outlist != null && outlist1 != null) { |
| | | |
| | | outstate = outlist.contains((short) 0);// 出片车空闲判断 当出片车空闲时为true |
| | | outstate1 = outlist1.contains((short) 1);// 出片车任务是否启动 当出片车任务启动时为true |
| | | |
| | | // 判断当前是否有未执行的任务 |
| | | int outnum = spianMapper.SelectOutSliceshu(); |
| | | // 当没有任务执行并且出片车空闲时 |
| | | if (outnum == 0 && outstate == true && Plchome.isAllowQueue == true) { |
| | | // 判断铝框出片队列表是否有待出片的玻璃 |
| | | String outglassid = spianMapper.SelectOutSlice(); |
| | | if (outglassid != null) { |
| | | |
| | | spianService.selectout2(outglassid); |
| | | outstate = false; |
| | | } |
| | | } |
| | | if (outstate == true) {// 当出片车空闲时,且出片启动为1时,任务启动改为0 |
| | | if (outstate1 == true) { |
| | | S7control.getinstance().WriteWord("DB105.18", (short) 0);// 出片任务启动改为0 |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // if (outstate == true) { // 出片车状态空闲时 |
| | | // Integer state = spianMapper.Selectoutstate(); |
| | |
| | | while (this != null) {
|
| | | try {
|
| | | Thread.sleep(1000);
|
| | | |
| | |
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | // 是否需要人工确认上片玻璃
|
| | | jsonObject.append("isConfirm", isConfirm);
|
| | |
|
| | | //获取进片请求状态
|
| | | // 获取进片请求状态
|
| | | List<Short> D01Request = S7control.getinstance().ReadWord("DB106.24", 1);
|
| | | boolean D01RequestState = D01Request.contains((short)1);
|
| | | boolean D01RequestState = D01Request.contains((short) 1);
|
| | | // boolean D01RequestState =true;
|
| | | jsonObject.append("D01RequestState", D01RequestState);
|
| | |
|
| | | //复位倒计时
|
| | | // 复位倒计时
|
| | | // 地址104.9.6
|
| | | List<Boolean> countdown = S7control.getinstance().ReadBits("DB104.9.6", 1);
|
| | | for (Boolean countdowns : countdown) {
|
| | | jsonObject.append("countdown", countdowns);
|
| | | }
|
| | | // jsonObject.append("countdown", true);
|
| | | // 复位完成信号
|
| | | List<Boolean> resets = S7control.getinstance().ReadBits("DB103.284", 1);
|
| | | for (Boolean reset : resets) {
|
| | | jsonObject.append("reset", reset);
|
| | | }
|
| | |
|
| | | //是否急停
|
| | | // 是否急停
|
| | | List<Boolean> emergencystops = S7control.getinstance().ReadBits("DB104.5.1", 1);
|
| | | for (Boolean emergencystop : emergencystops) {
|
| | | jsonObject.append("emergencystop", emergencystop);
|
New file |
| | |
| | | package com.example.springboot.component; |
| | | |
| | | import com.example.springboot.mapper.SpianMapper; |
| | | import com.example.springboot.service.SpianService; |
| | | |
| | | public class Plclog extends Thread { |
| | | |
| | | boolean b01 = false; |
| | | boolean b02 = false; |
| | | private SpianService spianService; |
| | | private SpianMapper spianMapper; |
| | | |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | try { |
| | | Thread.sleep(10); |
| | | } catch (InterruptedException e) { |
| | | // \\ TODO Auto-generated catch block |
| | | e.printStackTrace(); |
| | | } |
| | | spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class); |
| | | spianService = WebSocketServer.applicationContext.getBean(SpianService.class); |
| | | |
| | | boolean B01backs = spianService.listbool("DB106.60");// b01汇报 |
| | | boolean B02backs = spianService.listbool("DB106.62");// b01汇报 |
| | | if (b01 != B01backs) { |
| | | if (B01backs == true) { |
| | | spianMapper.insertlog("BO1:1"); |
| | | } else { |
| | | spianMapper.insertlog("BO1:0"); |
| | | } |
| | | b01 = B01backs; |
| | | } |
| | | |
| | | if (b02 != B02backs) { |
| | | if (B02backs == true) { |
| | | spianMapper.insertlog("BO2:1"); |
| | | } else { |
| | | spianMapper.insertlog("BO2:0"); |
| | | } |
| | | b02 = B02backs; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | // |
| | | System.out.println("启动完成"); |
| | | |
| | | new PlcHold().start(); |
| | | // new Plclog().start(); |
| | | |
| | | // new PlcHold().start(); |
| | | |
| | | new Plchome().start(); |
| | | |
| | | |
| | | |
| | | // new Plcalarm().start(); |
| | | |
| | | // new Plcsign().start(); |
| | |
| | | public Result UpdateTask(Integer types, Integer shelfrack, String glassid) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | homeMapper.UpdateTask(types, glassid); |
| | | StorageCage glass = homeMapper.SelectGlassInfo(glassid); |
| | | // StorageCage glass = homeMapper.SelectGlassInfo(glassid); |
| | | if (types == 0) { |
| | | homeMapper.UpdateCageTask1(glassid); |
| | | // S7control.getinstance().WriteWord("DB105.16", (short) 0); |
| | | } else { |
| | | spianMapper.UpdataOutCage1(glass.getGlassWidth(), glass.getCage(), glass.getCell()); |
| | | homeMapper.UpdateCageTask2(glassid); |
| | | // spianMapper.UpdataOutCage1(glass.getGlassWidth(), glass.getCage(), glass.getCell()); |
| | | homeMapper.DeleteByGlassID(glassid); |
| | | // S7control.getinstance().WriteWord("DB105.18", (short) 0); |
| | | } |
| | | map.put("message3", "200"); |
| | |
| | | } else { |
| | | map.put("message2", "300"); |
| | | } |
| | | |
| | | } else { |
| | | map.put("message2", "400"); |
| | | } |
| | |
| | | @Update("update storage_cage set state=1 where glass_id=#{glassid} and state=2") |
| | | void UpdateCageTask1(@Param("glassid") String glassid); |
| | | |
| | | // 手动完成出片任务修改笼子数据 |
| | | @Update("update storage_cage set state=0,glass_id=null,order_id=null,glasswidth=null,glassheight=null where glass_id=#{glassid} and state=3") |
| | | void UpdateCageTask2(@Param("glassid") String glassid); |
| | | |
| | | //获取报警信息 |
| | | @Select("select id,content,timeon as timeons,endTime from alarmmg where endTime is null") |
| | | List<alarmmg> SelectAlarmmgInfo(); |
| | |
| | | @Select("select * from storage_cage where position(#{cage} in ifnull(glass_id,\"\"))") |
| | | List<StorageCage> SelectCageInfo(String cage); |
| | | |
| | | // 手动完成出片任务修改笼子数据 |
| | | @Update("update storage_cage set state=0,glass_id=null,order_id=null,glasswidth=null,glassheight=null,glasswidthmm=null,glassheightmm=null,listid=null,boxid=null where glass_id=#{glassid}") |
| | | void DeleteByGlassID(String glassid); |
| | | |
| | |
| | | |
| | | public interface SpianMapper { |
| | | // 判断相邻笼子是否有空格 |
| | | @Select("select COUNT(if(a.state1=0,cell,null))as cell,ROUND(id/2)as id from (select *,max(state)as state1 from storage_cage a GROUP BY cage,cell)as a where (a.cage=#{cage1}-1 or a.cage=#{cage1}+1)and if(a.cage<6,a.cage>0 and a.cage<6,a.cage>5) and disabled=0 GROUP BY cage ORDER BY cell desc LIMIT 1") |
| | | @Select("select COUNT(if(a.state1=0,cell,0))as cell,ROUND(id/2)as id from (select *,max(state)as state1 from storage_cage a GROUP BY cage,cell)as a where (a.cage=#{cage1}-1 or a.cage=#{cage1}+1)and if(a.cage<6,a.cage>0 and a.cage<6,a.cage>5) and disabled=0 GROUP BY cage ORDER BY cell desc LIMIT 1") |
| | | int selectCage(int cage1); |
| | | |
| | | // @Select("(select*from storage_cage as a where a.state=0 and cage%2=0 ORDER BY |
| | |
| | | StorageCage selectCage1(int cage1, int cell, double width); |
| | | |
| | | // 判断笼子内玻璃数 |
| | | @Select("select COUNT(tier)as tier from storage_cage where cage=#{cage} and cell=#{cell} and state!=0;") |
| | | @Select("select COUNT(tier)as tier from storage_cage where cage=#{cage} and cell=#{cell} and state=1;") |
| | | int selectsum(int cage, int cell); |
| | | |
| | | // 完成进片中的玻璃状态 |
| | |
| | | int selectGlassState(int cage, int cell); |
| | | |
| | | // 判断该调拨的笼子 |
| | | @Select("select glass_id,cage,cell,max(state)as shu,ROUND(id/2)as prcid,id from storage_cage where width>=#{width} and cage>#{cage1} and cage<#{cage2} GROUP BY cage,cell HAVING shu=0 order by abs(#{cage} - cage),cell desc limit 1;") |
| | | StorageCage selectGlassCage(int cage, double width, int cage1, int cage2); |
| | | @Select("select glass_id,cage,cell,max(state)as shu,ROUND(id/2)as prcid,id,abs(#{cell}-cell)as xuhao from storage_cage where width>=#{width} and cage>#{cage1} and cage<#{cage2} GROUP BY cage,cell HAVING shu=0 order by abs(#{cage} - cage),xuhao desc limit 1;") |
| | | StorageCage selectGlassCage(int cage, double width, int cage1, int cage2,int cell); |
| | | |
| | | // 删除笼子信息(出片) |
| | | @Update("update storage_cage as a set state=#{state},glass_id=null,order_id=null,glasswidth=0,a.glassheight=null,a.glasswidthmm=null,a.glassheightmm=null,a.listid=null,a.boxid=null where glass_id=#{glassid} and state=3;") |
| | | @Update("update storage_cage as a set state=#{state},glass_id=null,order_id=null,glasswidth=null,a.glassheight=null,a.glasswidthmm=null,a.glassheightmm=null,a.listid=null,a.boxid=null where glass_id=#{glassid} and state=3;") |
| | | void UpdataGlassCage(String glassid, int state); |
| | | |
| | | // 改变玻璃状态为出片中 |
| | |
| | | void UpdataOutCage1(double width, int cage, int cell); |
| | | |
| | | // 调拨更换笼子信息 |
| | | @Update("update storage_cage as a,(select*from storage_cage b where b.cage=#{cage} and b.cell=#{cell} and b.tier=#{tier})as b set a.glass_id=b.glass_id,a.order_id=b.order_id,a.state=1,a.glasswidth=b.glasswidth,a.glassheight=b.glassheight,a.glasswidthmm=b.glasswidthmm,a.glassheightmm=b.glassheightmm,a.listid=b.listid,a.boxid=b.boxid where a.id=#{id1}") |
| | | @Update("update storage_cage as a,(select*from storage_cage b where b.cage=#{cage} and b.cell=#{cell} and b.tier=#{tier})as b set a.glass_id=b.glass_id,a.order_id=b.order_id,a.state=2,a.glasswidth=b.glasswidth,a.glassheight=b.glassheight,a.glasswidthmm=b.glasswidthmm,a.glassheightmm=b.glassheightmm,a.listid=b.listid,a.boxid=b.boxid where a.id=#{id1}") |
| | | void UpdateDBCage(int id1, int cage, int cell, int tier); |
| | | |
| | | // @Insert("insert into user(name, date, address, user_no) values (#{name}, |
| | |
| | | // 把该进片的玻璃更新到出片队列 |
| | | @Select("update out_slice set state=0 where glassId=#{glassId} and state=3") |
| | | void UpdateAddQueue(String glassId); |
| | | } |
| | | //新增日志表格 |
| | | @Insert("INSERT INTO `canadames`.`log`( `text`,time) VALUES (#{logtxt},now());") |
| | | void insertlog(String logtxt); |
| | | //获取该半区是否有执行的任务 |
| | | @Select(" select count(*) from storage_cage where state=#{state} and cage>#{cage1} and cage<#{cage2}") |
| | | int SelectCageTask(int state,int cage1,int cage2); |
| | | } |
| | |
| | | if(storageCage!=null){ |
| | | spianMapper.UpdataOutCage1(storageCage.getGlassWidth(), storageCage.getCage(), storageCage.getCell()); |
| | | } |
| | | homeMapper.UpdateCageTask2(glassid); |
| | | homeMapper.DeleteByGlassID(glassid); |
| | | S7control.getinstance().WriteWord("DB105.12", (short) 0); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | |
| | | cage1 = storageCage2.getCage(); |
| | | // 判断该笼子号相邻最大的空格数 |
| | | int cages = spianMapper.selectCage(cage1); |
| | | |
| | | // 如果相邻笼子没有空格,或者有正在执行的出片任务时返回400 |
| | | if (cages == 0) { |
| | | return (400); |
| | | } |
| | | StorageCage cages1; |
| | | // 判断是否是第二片需要加间隔物 |
| | | prctier = spianMapper.selectsum(cage1, storageCage2.getCell());// 传给prc的格子内玻璃数 |
| | |
| | | int cages; |
| | | int cells; |
| | | double glasswidth = cageout.getGlassWidth(); |
| | | |
| | | |
| | | // 判断玻璃内外片 |
| | | if (tier == 2) { |
| | | int state = spianMapper.selectGlassState(cage, cell);// 获取格子数量 |
| | |
| | | spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid, 1);// 新增任务 |
| | | spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 增加原格子宽度 |
| | | spianMapper.UpdataGlassCageState(glassid, 3);// 更改笼子表的玻璃状态 |
| | | spianMapper.OverOutSlice(glassid, 2);// 完成出片队列任务 |
| | | spianMapper.OverOutSlice(glassid, 1);// 更新出片队列任务 |
| | | System.out.println("出片任务|" + datas); |
| | | outmesid(glassid, "DB105.34");// 派发出片ID |
| | | S7control.getinstance().WriteWord(adddresslist, datas);// 派发出片车任务 |
| | |
| | | } else { |
| | | // 玻璃需要调拨时,判断属于哪个半区的笼子 |
| | | if (cage < 6) { |
| | | StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 0, 6); |
| | | StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 0, 6,cell); |
| | | if (cagecell == null) { |
| | | return (300); |
| | | } |
| | |
| | | datas.add((short) 1); |
| | | // 更换玻璃的笼子 |
| | | String glassids = spianMapper.SelectGlassid(cage, cell); // 获取被调拨的玻璃id |
| | | spianMapper.UpdataGlassCageState(glassids, 3);// 更改笼子表的玻璃状态 |
| | | spianMapper.UpdateDBCage(ids, cage, cell, 2);// 将原格子数据更新到新格子里 |
| | | spianMapper.UpdataAddCage1(glasswidth, cages, cells);// 减少新格子宽度 |
| | | spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 增加原格子宽度 |
| | | //spianMapper.UpdataGlassCageState(glassids, 3);// 更改笼子表的玻璃状态 |
| | | spianMapper.Inserttask(2, 0, cageout.getId(), ids, glassid, 2);// 新增调度任务 |
| | | // spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid);// 新增出片任务 |
| | | spianMapper.Inserttask(2, 0, cageout.getId(), ids, glassids, 2);// 新增调度任务 |
| | | // 传输mes数据,坐标,数据 |
| | | System.out.println("出片任务|" + datas); |
| | | S7control.getinstance().WriteWord(adddresslist, datas);// 派发出片车任务 |
| | |
| | | return (200); // 结束 |
| | | |
| | | } else {// 笼子号大于5时 |
| | | StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 5, 11); |
| | | StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 5, 11,cell); |
| | | if (cagecell == null) { |
| | | return (300); |
| | | } |
| | |
| | | datas.add((short) 2); |
| | | datas.add((short) 1); |
| | | String glassids = spianMapper.SelectGlassid(cage, cell); // 获取被调拨的玻璃id |
| | | spianMapper.Inserttask(2, 0, cageout.getId() + 1, ids, glassid, 2);// 新增调度任务 |
| | | spianMapper.UpdataGlassCageState(glassids, 3);// 更改笼子表的玻璃状态 |
| | | spianMapper.Inserttask(2, 0, cageout.getId() + 1, ids, glassids, 2);// 新增调度任务 |
| | | // spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid);// 新增出片任务 |
| | | spianMapper.UpdateDBCage(ids, cage, cell, 2);// 将原格子数据更新到新格子里 |
| | | spianMapper.UpdataAddCage1(glasswidth, cages, cells);// 减少新格子宽度 |
| | | spianMapper.UpdataOutCage1(glasswidth, cage, cell);// 增加原格子宽度 |
| | | //spianMapper.UpdataGlassCageState(glassids, 3);// 更改笼子表的玻璃状态 |
| | | // 传输mes数据,坐标,数据 |
| | | System.out.println("出片任务|" + datas); |
| | | S7control.getinstance().WriteWord(adddresslist, datas);// 派发出片车任务 |
| | |
| | | |
| | | // 根据玻璃id完成在进行中的任务 |
| | | public void overtask(String glassid) { |
| | | spianMapper.UpdateCageOver(glassid, 0);// 更改笼子表出片状态 |
| | | spianMapper.UpdatetaskOut(glassid); // 完成上一次出片或者进片任务 |
| | | |
| | | spianMapper.UpdatetaskOut(glassid);// 完成上一次 出片或者进片任务 |
| | | spianMapper.OverOutSlice(glassid, 2);// 完成出片队列任务 |
| | | spianMapper.UpdataGlassCage(glassid, 0);// 清除出片格子玻璃信息 |
| | | spianMapper.UpdateCageadd(glassid,1); |
| | | spianMapper.UpdateCageOver(glassid, 0);// 更改笼子表出片状态 |
| | | spianMapper.UpdateCageadd(glassid, 1);// 更改笼子表进片状态 |
| | | String barcode = spianMapper.SelectBarcode(glassid);// 获取该玻璃的铝框id |
| | | spianMapper.UpdateAddQueue(glassid);// 把进片的玻璃更新到出片队列中 |
| | | if (barcode != null) { |