Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes
| | |
| | | modules: {
|
| | | tags,
|
| | | },
|
| | | state: {
|
| | | tagData: {} // 存储标签数据的对象
|
| | | },
|
| | | // state: {
|
| | | // tagData: {} // 存储标签数据的对象
|
| | | // },
|
| | | mutations: {
|
| | | // 更新标签数据
|
| | | updateTagData(state, payload) {
|
| | |
| | | } |
| | | |
| | | let obj = JSON.parse(msg.data); |
| | | if (obj.params ){ |
| | | this.record.params[0] = obj.params[0]; |
| | | |
| | | for (let a = 0; a <= this.record.params[0].length - 1; a++) { |
| | |
| | | this.record.xyData[a].value = this.record.params[0][a].toString(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | // console.log(this.record.xyData); |
| | | this.$forceUpdate(); |
| | | }; |
| | |
| | | </script> |
| | | |
| | | |
| | | <style> |
| | | <style scoped> |
| | | .kuai_div { |
| | | /* width: 30%; */ |
| | | margin-bottom: 30px; |
| | |
| | | }
|
| | |
|
| | | let obj = JSON.parse(msg.data);
|
| | |
|
| | |
|
| | | if (obj.params && obj.state){
|
| | |
|
| | |
|
| | | |
| | |
|
| | | this.record.params[0] = obj.params[0];
|
| | | this.record.state = obj.state[0];
|
| | |
|
| | | if (obj.state && obj.state.length > 0) {
|
| | | let isButtonDisabled = this.record.state.includes(1);
|
| | | this.isButtonDisabled = isButtonDisabled;
|
| | |
|
| | | |
| | | // 判断state中是否存在1
|
| | | //console.log(isButtonDisabled)
|
| | | this.isButtonDisabled = isButtonDisabled; // 将判断结果保存到变量isButtonDisabled中
|
| | | // 将判断结果保存到变量isButtonDisabled中
|
| | |
|
| | | for (let a = 0; a <= this.record.params[0].length - 1; a++) {
|
| | | if (!this.record.xyData[a]) {
|
| | |
| | | this.record.xyData[a].value = this.record.params[0][a];
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | //console.log(this.record.xyData);
|
| | | this.$forceUpdate();
|
| | | };
|
| | |
| | | };
|
| | | </script>
|
| | |
|
| | | <style>
|
| | | <style scoped>
|
| | | .kuai_div {
|
| | | width: calc(100% / 2);
|
| | | margin-bottom: 15px;
|
| | |
| | |
|
| | | .el-input__inner {
|
| | | border: 1px solid black;
|
| | | border: none;
|
| | | }
|
| | |
|
| | | .in_mc {
|
| | |
| | |
|
| | | .blue-button {
|
| | | background-color: skyblue;
|
| | | color: #fff;
|
| | | |
| | | }
|
| | | #btn_div {
|
| | | width: 100%;
|
| | |
| | | <el-form label-width="100px" style="display: flex;flex-wrap: wrap;" :model="messagepack.data">
|
| | |
|
| | | <div class="kuai_div" v-for="item in this.record.xyData" :key="item.name">
|
| | | <el-input style="width: 280px;" class="in_mc" v-model="item.name"></el-input>
|
| | | <el-input style="width: 280px;" class="in_mc" v-model="item.name" readonly></el-input>
|
| | | <el-input v-model="item.value" readonly="readonly" style="width: 90px;"></el-input>
|
| | | </div>
|
| | |
|
| | |
| | |
|
| | | </script>
|
| | |
|
| | | <style>
|
| | | * {
|
| | | <style scoped>
|
| | | /* * {
|
| | | margin: 0px;
|
| | | padding: 0px;
|
| | | }
|
| | | } */
|
| | |
|
| | | .kuai_div {
|
| | | width: 30%;
|
| | |
| | | OutByGlassID(glassid).then(res => {
|
| | | if (res.data.message3 == 200) {
|
| | | this.$message.success(this.$t('Operation successful'));
|
| | | } |
| | | else if (res.data.message2 == 300) {
|
| | | this.$message.success(this.$t('There is no such grid'));
|
| | | }
|
| | | });
|
| | | } else {
|
| | |
| | | package com.example.springboot.component; |
| | | |
| | | import java.sql.SQLException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import com.example.springboot.service.SpianService; |
| | | import com.example.springboot.entity.Glass; |
| | | import com.example.springboot.mapper.AlarmMapper; |
| | | import com.example.springboot.mapper.SpianMapper; |
| | | |
| | | public class PlcHold extends Thread { |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private JdbcConnections jdbcConnections; |
| | | |
| | | private SpianMapper spianMapper; |
| | | private SpianService spianService; |
| | | |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | spianService = WebSocketServer.applicationContext.getBean(SpianService.class); |
| | | |
| | | spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class); |
| | | jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class); |
| | | |
| | | //根据玻璃id获取订单号 |
| | | try { |
| | | Glass glass=jdbcConnections.selectGlass(112); |
| | | |
| | | //System.out.println(glass.getOrderId()); |
| | | } catch (SQLException e) { |
| | | // TODO Auto-generated catch block |
| | |
| | | } |
| | | |
| | | |
| | | //spianService.selectout("11"); |
| | | //判断进片请求 |
| | | List<Short> datas1List=S7control.getinstance().ReadWord("DB106.24", 1); |
| | | List<Short> datas1ListState=S7control.getinstance().ReadWord("DB106.8", 1); |
| | | |
| | | if(datas1List!=null &&datas1ListState!=null){ |
| | | //获取prc进片请求数据 |
| | | boolean exist = datas1List.contains((short)1); |
| | |
| | | spianService.selectAll((short)list1); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //System.out.println(exist); |
| | | } |
| | | } |
| | | |
| | | List<Short> outlist=S7control.getinstance().ReadWord("DB106.20", 1); //出片车状态 |
| | | List<Short> outlist2=S7control.getinstance().ReadWord("DB106.20", 1); //出片任务完成 |
| | | |
| | | |
| | | List<Short>ceshi1=new ArrayList<Short>();//出片车状态 |
| | | List<Short>ceshi2=new ArrayList<Short>();//出片任务完成 |
| | | ceshi1.add((short)0); |
| | | ceshi2.add((short)1); |
| | | if(ceshi1!=null && ceshi2!=null){ |
| | | //判断按订单出片 |
| | | boolean outstate = ceshi1.contains((short)0); |
| | | boolean outstate2 = ceshi1.contains((short)1); |
| | | if(outstate=true){ //出片车状态空闲时 |
| | | if(outstate2=true){ //出片车任务完成时 |
| | | String orderid=spianMapper.SelectOrderout(); |
| | | if(orderid!=null){ |
| | | spianService.selectout(orderid); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | List<Short> arraylist = S7control.getinstance().ReadWord("DB100.DBW0", 12); |
| | | List<Short> state = S7control.getinstance().ReadWord("DB103.DBW0", 10); |
| | | List<Short> arraylist = S7control.getinstance().ReadWord("DB100.0", 12); |
| | | List<Short> state = S7control.getinstance().ReadWord("DB103.0", 10); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | // new short[]{65545,65545, 65545, 65545, 65545, 65545, 65545, 65545, 65545,65545, 65545, 65545} |
| | | // new short[]{65545,65545, 65545, 65545, 65545, 65545, 65545, 65545, 65545, 65545} |
| | | // new short[]{1,1, 1, 1, 1, 1, 2, 33, 2,3, 4, 5} |
| | | // new short[]{0,0, 0, 0, 0, 0, 0, 0, 0, 0} |
| | | jsonObject.append("params", arraylist ); |
| | | jsonObject.append("state", state); |
| | | WebSocketServer sendwServer = WebSocketServer.sessionMap.get("Parameter"); |
| | |
| | | if (webSocketServer != null) { |
| | | List<String> messages = webSocketServer.getMessages(); |
| | | |
| | | String addressList = "DB100.DBW0"; |
| | | String addressList = "DB100.0"; |
| | | |
| | | if (!messages.isEmpty()) { |
| | | // 将最后一个消息转换为 short 类型的列表 |
| | |
| | | // JSONObject jsonObject = new JSONObject();
|
| | | // jsonObject.append("params", new short[]{1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0});
|
| | |
|
| | | List<Boolean> paramlist = S7control.getinstance().ReadBits("DB2.DBX0.0 ", 26);
|
| | | List<Boolean> paramlist = S7control.getinstance().ReadBits("DB2.0.0 ", 26);
|
| | | // Boolean[] values = {true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,true, true,false, true};
|
| | | // List<Boolean> paramlist = new ArrayList<>(Arrays.asList(values));
|
| | | if (paramlist == null) {
|
| | |
| | |
|
| | | List<String> messages = webSocketServer.getMessages();
|
| | |
|
| | | String addressList = "DB100.DBW0";
|
| | | String addressList = "DB100.0";
|
| | |
|
| | | if (!messages.isEmpty()) {
|
| | | // 将最后一个消息转换为整数类型的列表
|
| | |
| | | public class S7control { |
| | | |
| | | S7PLC s7PLC; // PLC通讯类实例 |
| | | private EPlcType plcType = EPlcType.S1200; // 西门子PLC类型 |
| | | private String ip = "127.0.0.1"; // plc ip地址 |
| | | private int port = 21; // plc 端口号 |
| | | private EPlcType plcType = EPlcType.S1500; // 西门子PLC类型 |
| | | private String ip = "192.168.10.1"; // plc ip地址 |
| | | private int port = 102; // plc 端口号 |
| | | |
| | | private static volatile S7control instance = null; |
| | | |
| | | private S7control() { |
| | | if (s7PLC == null) |
| | | s7PLC = new S7PLC(plcType, ip, port); |
| | | s7PLC = new S7PLC(plcType, ip, port,0,0); |
| | | } |
| | | |
| | | // 单例模式 获取类的唯一实例 |
| | |
| | | * @param data word的值 |
| | | */ |
| | | public void WriteWord(String address, short data) { |
| | | if (!s7PLC.checkConnected()) |
| | | if (s7PLC==null) |
| | | { |
| | | return; |
| | | } |
| | | s7PLC.writeInt16(address, data); |
| | | } |
| | | |
| | |
| | | * @param datas word的值 |
| | | */ |
| | | public void WriteWord(String address, List<Short> datas) { |
| | | if (!s7PLC.checkConnected()) |
| | | if (s7PLC==null) |
| | | return; |
| | | // s7PLC.write(address, data); |
| | | List<String> addresslist = GetAddressList(address, datas.size(), 16); |
| | |
| | | * @param datas word的值 |
| | | */ |
| | | public void WriteWord(List<String> address, List<Short> datas) { |
| | | if (!s7PLC.checkConnected()) |
| | | if (s7PLC==null) |
| | | return; |
| | | // s7PLC.write(address, data); |
| | | |
| | |
| | | * @param data Bit的值 |
| | | */ |
| | | public void WriteBit(String address, Boolean data) { |
| | | if (!s7PLC.checkConnected()) |
| | | if (s7PLC==null) |
| | | return; |
| | | s7PLC.writeBoolean(address, data); |
| | | } |
| | |
| | | * @param datas bit的值 |
| | | */ |
| | | public void WriteBit(List<String> address, List<Boolean> datas) { |
| | | if (!s7PLC.checkConnected()) |
| | | if (s7PLC==null) |
| | | return; |
| | | // s7PLC.write(address, data); |
| | | |
| | |
| | | * @param datas word的值 |
| | | */ |
| | | public void WriteBit(String address, List<Boolean> datas) { |
| | | if (!s7PLC.checkConnected()) |
| | | if (s7PLC==null) |
| | | return; |
| | | // s7PLC.write(address, data); |
| | | List<String> addresslist = GetAddressList(address, datas.size(), 1); |
| | |
| | | * @return 结果 |
| | | */ |
| | | public List<Short> ReadWord(List<String> address) { |
| | | if (!s7PLC.checkConnected()) |
| | | return null; |
| | | if (s7PLC==null) |
| | | return new ArrayList<Short>(); |
| | | return s7PLC.readInt16(address); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | public List<Short> ReadWord(String address, int count) { |
| | | if (!s7PLC.checkConnected()) |
| | | return null; |
| | | if (s7PLC==null) |
| | | return new ArrayList<Short>(); |
| | | |
| | | List<String> addresslist = GetAddressList(address, count, 16); |
| | | return s7PLC.readInt16(addresslist); |
| | |
| | | * @return Boolean结果 |
| | | */ |
| | | public List<Boolean> ReadBits(List<String> addresslist) { |
| | | if (!s7PLC.checkConnected()) |
| | | return null; |
| | | if (s7PLC==null) |
| | | return new ArrayList<Boolean>(); |
| | | return s7PLC.readBoolean(addresslist); |
| | | } |
| | | |
| | |
| | | * @return Boolean结果 |
| | | */ |
| | | public List<Boolean> ReadBits(String address, int count) { |
| | | if (!s7PLC.checkConnected()) |
| | | return null; |
| | | if (s7PLC==null) |
| | | return new ArrayList<Boolean>(); |
| | | List<String> addresslist = GetAddressList(address, count, 1); |
| | | return s7PLC.readBoolean(addresslist); |
| | | } |
| | | |
| | | private List<String> GetAddressList(String address, int count, int addedbit) { |
| | | List<String> addresslist = new ArrayList<>(); |
| | | List<String> addresslist = new ArrayList<String>(); |
| | | |
| | | String[] stringdatas = address.split("."); |
| | | if (stringdatas.length < 2 || !address.startsWith("DB")) |
| | |
| | | |
| | | @GetMapping("/OutByGlassID") |
| | | public Result OutByGlassID(String glassid) { |
| | | spianService.selectout2(glassid); |
| | | |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message3", "200"); |
| | | // 调用伍上片函数 |
| | | Short results = spianService.selectout2(glassid); |
| | | if (results == 200) { |
| | | map.put("message2", "200"); |
| | | } else if (results == 300) { |
| | | map.put("message2", "300"); |
| | | } else if (results == 400) { |
| | | map.put("message2", "400"); |
| | | } |
| | | |
| | | return Result.success(map); |
| | | } |
| | | |
| | |
| | | void UpdataAddCage1(double width,int cage,int cell); |
| | | //修改同笼子格子宽度(出片) |
| | | @Update("update storage_cage set width=width+#{width} where cage=#{cage} and cell=#{cell};") |
| | | void UpdataOutCage(double width,int cage,int cell); |
| | | 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=2)as b set a.glass_id=b.glass_id,a.order_id=b.order_id,a.width=a.width-b.glasswidth,a.state=1 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=2)as b set a.glass_id=b.glass_id,a.order_id=b.order_id,a.state=1 where a.id=#{id1}") |
| | | void UpdateDBCage(int id1,int cage,int cell); |
| | | // @Insert("insert into user(name, date, address, user_no) values (#{name}, #{date}, #{address}, #{userNo})") |
| | | // void insert (Spian spian); |
| | | //新增任务表 |
| | | @Insert("INSERT INTO `canadames`.`storage_task`(`task_type`, `task_state`, `shelf_rack`, `load_rack`, `start_time`, `finsh_time`) VALUES (#{task_type},#{task_state},#{shelf_rack},#{load_rack},NOW(),NOW());") |
| | | void Inserttask(int task_type,int task_state,int shelf_rack,int load_rack); |
| | | |
| | | void UpdataAddCage(double glasswidth, int cages, int cells); |
| | | @Insert("INSERT INTO `canadames`.`storage_task`(`task_type`, `task_state`, `shelf_rack`, `load_rack`,start_time) VALUES (#{tasktype},#{taskstate},#{shelfrack},#{loadrack},now());") |
| | | void Inserttask(int tasktype,int taskstate,int shelfrack,int loadrack); |
| | | //修改任务表 |
| | | @Update("update storage_task set task_state=#{state} where task_type=#{type} and task_state=0;") |
| | | void Updatetask(int state,int type); |
| | | //修改任务表 |
| | | @Update("update storage_task set task_state=1 where (task_type=1 or task_type=2) and task_state=0;") |
| | | void UpdatetaskOut(); |
| | | //查询按订单出片 |
| | | @Select("select order_id state from order_out where state=0") |
| | | String SelectOrderout(); |
| | | } |
| | |
| | | while (rs.next()) { |
| | | glass.setOrderId(rs.getShort("orderid")); |
| | | } |
| | | |
| | | conn.close(); |
| | | return glass; |
| | | } |
| | | /** |
| | |
| | | |
| | | // @GetMapping("/all2") |
| | | public Result selectout(String orderid) { |
| | | |
| | | spianMapper.UpdatetaskOut(); //完成上一次出片或者调度任务 |
| | | // 定义PRC数据传送数组 |
| | | List<String> adddresslist = new ArrayList<>(); |
| | | adddresslist.add("DB105.6");// 出片车起始位置 |
| | |
| | | List<Short> datas = new ArrayList<>(); |
| | | // 获取优先出片的位置 |
| | | StorageCage cageout = spianMapper.selectOut(orderid); |
| | | if(cageout==null){ |
| | | return Result.success("200"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | int cage = cageout.getCage(); // 储存出片位置,笼子格子几号玻璃 |
| | | int cell = cageout.getCell();// 出片格号 |
| | | int tier = cageout.getTier();// 出片内外片 |
| | |
| | | if (tier == 2) { |
| | | // 判断玻璃可直接出片时 |
| | | // 修改数据库笼子表(出片) |
| | | spianMapper.UpdataOutCage(glasswidth, cage, cell);// 增加原格子宽度 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, tier, 0); |
| | | |
| | | datas.add((short) prcid); |
| | | datas.add((short) 1000); |
| | | datas.add((short) 1); |
| | | datas.add((short) 1); |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | return Result.success(datas); |
| | | |
| | | spianMapper.UpdataOutCage1(glasswidth, cage, cell);//增加原格子宽度 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, tier, 0);//清除格子玻璃信息 |
| | | spianMapper.Inserttask(1, 0,cageout.getId(),1000 );//新增任务 |
| | | |
| | | S7control.getinstance().WriteWord("DB106.22", (short)0); //出片任务完成改成0 |
| | | S7control.getinstance().WriteWord("DB106.20", (short)1); //出片车状态改成忙碌 |
| | | S7control.getinstance().WriteWord(adddresslist, datas);//派发出片车任务 |
| | | return Result.success(datas);//结束 |
| | | } else { |
| | | // 获取格子的玻璃数量 |
| | | int state = spianMapper.selectGlassState(cage, cell); |
| | |
| | | datas.add((short) 1000); |
| | | datas.add((short) 1); |
| | | datas.add((short) 1); |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | return Result.success("状态为0,直接出片"); |
| | | spianMapper.Inserttask(1, 0,cageout.getId(),1000 );//新增任务 |
| | | spianMapper.UpdataOutCage1(glasswidth, cage, cell);//增加原格子宽度 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, tier, 0);//清除格子玻璃信息 |
| | | S7control.getinstance().WriteWord("DB106.22", (short)0); //出片任务完成改成0 |
| | | S7control.getinstance().WriteWord("DB106.20", (short)1); //出片车状态改成忙碌 |
| | | S7control.getinstance().WriteWord(adddresslist, datas);//派发出片车任务 |
| | | //spianMapper.Updatetask(1, 1);//完成任务 |
| | | return Result.success(datas);//结束 |
| | | |
| | | } else { |
| | | // 玻璃需要调拨时,判断属于哪个半区的笼子 |
| | | if (cage < 6) { |
| | |
| | | ids = cagecell.getId();// 调拨目标位ID |
| | | cages = cagecell.getCage();// 调拨目标位笼子 |
| | | cells = cagecell.getCell();// 调拨目标位格子 |
| | | // 更换玻璃的笼子 |
| | | spianMapper.UpdataAddCage1(glasswidth, cages, cells);// 减少新格子宽度 |
| | | spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除原格子数据 |
| | | spianMapper.UpdataOutCage(glasswidth, cage, cell);// 增加原格子宽度 |
| | | |
| | | |
| | | |
| | | |
| | | // 填入调拨数据 |
| | | datas.add((short) prcid);// 调拨外片起始位置 |
| | | datas.add((short) prcid2); |
| | | datas.add((short) 2); |
| | | datas.add((short) 1); |
| | | // 更换玻璃的笼子 |
| | | spianMapper.UpdataAddCage1(glasswidth, cages, cells);//减少新格子宽度 |
| | | spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除被调拨格子数据 |
| | | spianMapper.Inserttask(2, 0,cageout.getId(),ids );//新增调度任务 |
| | | // 传输mes数据,坐标,数据 |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | datas.clear(); // 清空整个列表 |
| | | // 判断调拨结束后再次出片,填入出片数据 |
| | | datas.add((short) prcid); |
| | | datas.add((short) 1000); |
| | | datas.add((short) 1); |
| | | datas.add((short) 1); |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | // 修改数据库笼子表(出片) |
| | | |
| | | return Result.success(cagecell); // 调拨位置的参数内容 |
| | | S7control.getinstance().WriteWord("DB106.22", (short)0); //出片任务完成改成0 |
| | | S7control.getinstance().WriteWord("DB106.20", (short)1); //出片车状态改成忙碌 |
| | | S7control.getinstance().WriteWord(adddresslist, datas);//派发出片车任务 |
| | | return Result.success(cagecell); //结束 |
| | | |
| | | } else {// 笼子号大于5时 |
| | | StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 5, 11); |
| | |
| | | datas.add((short) prcid2); |
| | | datas.add((short) 2); |
| | | datas.add((short) 1); |
| | | // 转移原调拨格子数据 |
| | | spianMapper.Inserttask(2, 0,cageout.getId(),ids );//新增调度任务 |
| | | spianMapper.UpdataAddCage1(glasswidth, cages, cells);// 减少新格子宽度 |
| | | spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除原格子数据 |
| | | spianMapper.UpdataOutCage(glasswidth, cage, cell);// 增加原格子宽度 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除被调拨格子数据 |
| | | // 传输mes数据,坐标,数据 |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | datas.clear(); // 清空整个列表 |
| | | // 判断调拨结束后再次出片 |
| | | // 填入出片数据 |
| | | datas.add((short) prcid); |
| | | datas.add((short) 1000); |
| | | datas.add((short) 1); |
| | | datas.add((short) 1); |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | return Result.success(cagecell); // 调拨位置的参数内容 |
| | | S7control.getinstance().WriteWord("DB106.22", (short)0); //出片任务完成改成0 |
| | | S7control.getinstance().WriteWord("DB106.20", (short)1); //出片车状态改成忙碌 |
| | | S7control.getinstance().WriteWord(adddresslist, datas);//派发出片车任务 |
| | | return Result.success(cagecell); //结束 |
| | | |
| | | } |
| | | |
| | |
| | | int prcid; |
| | | int tiers; |
| | | int prctier; |
| | | |
| | | |
| | | Glass glasslist = spianMapper.selectGlass(glassid); |
| | | if (glasslist == null) { |
| | |
| | | tiers = cages1.getTier();// 内外片 |
| | | cells = cages1.getCell();// 格子号 |
| | | prcid = cages1.getPrcId();// 传给prc的目标地id |
| | | |
| | | |
| | | if (glasslist == null) { |
| | | return (300); |
| | | } |
| | | spianMapper.Inserttask(0, 0, 1000, ids);//新增任务 |
| | | prctier = spianMapper.selectsum(cage1, cells);// 传给prc的格子内玻璃数 |
| | | // 有合适空格时进片 |
| | | if (cages > 1 && cages1.getTier() != null) { |
| | |
| | | // 数据库修改笼子表新增一条玻璃 |
| | | spianMapper.UpdataAddCage(orderids, glassid, widths, cage1, cells, ids, 1); |
| | | spianMapper.UpdataAddCage1(widths, cage1, cells);// 减少格子宽度 |
| | | spianMapper.Updatetask(1, 0);//完成任务 |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | |
| | | return (200); |
| | |
| | | } |
| | | |
| | | // @GetMapping("/all2") |
| | | public Result selectout2(String glassid) { |
| | | public Short selectout2(String glassid) { |
| | | // 定义PRC数据传送数组 |
| | | List<String> adddresslist = new ArrayList<>(); |
| | | adddresslist.add("DB105.6");// 出片车起始位置 |
| | |
| | | List<Short> datas = new ArrayList<>(); |
| | | // 获取优先出片的位置 |
| | | StorageCage cageout = spianMapper.selectOut2(glassid); |
| | | if(cageout==null){ |
| | | return (300); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | int cage = cageout.getCage(); // 储存出片位置,笼子格子几号玻璃 |
| | | int cell = cageout.getCell();// 出片格号 |
| | | int tier = cageout.getTier();// 出片内外片 |
| | |
| | | if (tier == 2) { |
| | | // 判断玻璃可直接出片时 |
| | | // 修改数据库笼子表(出片) |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, tier, 0); |
| | | spianMapper.UpdataOutCage(glasswidth, cage, cell);// 增加原格子宽度 |
| | | datas.add((short) prcid); |
| | | datas.add((short) 1000); |
| | | datas.add((short) 1); |
| | | datas.add((short) 1); |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | return Result.success(datas); |
| | | |
| | | spianMapper.UpdataOutCage1(glasswidth, cage, cell);//增加原格子宽度 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, tier, 0);//清除格子玻璃信息 |
| | | spianMapper.Inserttask(1, 0,cageout.getId(),1000 );//新增任务 |
| | | |
| | | S7control.getinstance().WriteWord("DB106.22", (short)0); //出片任务完成改成0 |
| | | S7control.getinstance().WriteWord("DB106.20", (short)1); //出片车状态改成忙碌 |
| | | S7control.getinstance().WriteWord(adddresslist, datas);//派发出片车任务 |
| | | return (200);//结束 |
| | | } else { |
| | | // 获取格子的玻璃数量 |
| | | int state = spianMapper.selectGlassState(cage, cell); |
| | | // 判断内片是否需要调拨 |
| | | if (state == 0) { |
| | | return Result.success("状态为0,直接出片"); |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, tier, 0); |
| | | datas.add((short) prcid); |
| | | datas.add((short) 1000); |
| | | datas.add((short) 1); |
| | | datas.add((short) 1); |
| | | spianMapper.Inserttask(1, 0,cageout.getId(),1000 );//新增任务 |
| | | spianMapper.UpdataOutCage1(glasswidth, cage, cell);//增加原格子宽度 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, tier, 0);//清除格子玻璃信息 |
| | | S7control.getinstance().WriteWord("DB106.22", (short)0); //出片任务完成改成0 |
| | | S7control.getinstance().WriteWord("DB106.20", (short)1); //出片车状态改成忙碌 |
| | | S7control.getinstance().WriteWord(adddresslist, datas);//派发出片车任务 |
| | | //spianMapper.Updatetask(1, 1);//完成任务 |
| | | return (200);//结束 |
| | | |
| | | } else { |
| | | // 玻璃需要调拨时,判断属于哪个半区的笼子 |
| | | if (cage < 6) { |
| | | StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 0, 6); |
| | | if (cagecell == null) { |
| | | return Result.success(cagecell); |
| | | return (300); |
| | | } |
| | | // 获取调拨位置进行调拨 |
| | | prcid2 = cagecell.getPrcId();// 调拨目标位PRCID |
| | | ids = cagecell.getId();// 调拨目标位ID |
| | | cages = cagecell.getCage();// 调拨目标位笼子 |
| | | cells = cagecell.getCell();// 调拨目标位格子 |
| | | // 更换玻璃的笼子 |
| | | spianMapper.UpdataAddCage1(glasswidth, cages, cells);// 减少新格子宽度 |
| | | spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除原格子数据 |
| | | spianMapper.UpdataOutCage(glasswidth, cage, cell);// 增加原格子宽度 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 填入调拨数据 |
| | | datas.add((short) prcid);// 调拨外片起始位置 |
| | | datas.add((short) prcid2); |
| | | datas.add((short) 2); |
| | | datas.add((short) 1); |
| | | // 更换玻璃的笼子 |
| | | spianMapper.UpdataAddCage1(glasswidth, cages, cells);//减少新格子宽度 |
| | | spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除被调拨格子数据 |
| | | spianMapper.Inserttask(2, 0,cageout.getId(),ids );//新增调度任务 |
| | | // 传输mes数据,坐标,数据 |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | datas.clear(); // 清空整个列表 |
| | | // 判断调拨结束后再次出片,填入出片数据 |
| | | datas.add((short) prcid); |
| | | datas.add((short) 1000); |
| | | datas.add((short) 1); |
| | | datas.add((short) 1); |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | // 修改数据库笼子表(出片) |
| | | |
| | | return Result.success(cagecell); // 调拨位置的参数内容 |
| | | S7control.getinstance().WriteWord("DB106.22", (short)0); //出片任务完成改成0 |
| | | S7control.getinstance().WriteWord("DB106.20", (short)1); //出片车状态改成忙碌 |
| | | S7control.getinstance().WriteWord(adddresslist, datas);//派发出片车任务 |
| | | return (200); //结束 |
| | | |
| | | } else {// 笼子号大于5时 |
| | | StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 5, 11); |
| | | if (cagecell == null) { |
| | | return Result.success(cagecell); |
| | | return (300); |
| | | } |
| | | // 获取调拨位置进行调拨 |
| | | prcid2 = cagecell.getPrcId();// 调拨目标位prcID |
| | | ids = cagecell.getId();// 调拨目标位ID |
| | | cages = cagecell.getCage();// 调拨目标位笼子 |
| | | cells = cagecell.getCell();// 调拨目标位格子 |
| | | |
| | | // 填入调拨数据 |
| | | datas.add((short) prcid); |
| | | datas.add((short) prcid2); |
| | | datas.add((short) 2); |
| | | datas.add((short) 1); |
| | | // 转移原调拨格子数据 |
| | | spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里 |
| | | spianMapper.Inserttask(2, 0,cageout.getId(),ids );//新增调度任务 |
| | | spianMapper.UpdataAddCage1(glasswidth, cages, cells);// 减少新格子宽度 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除原格子数据 |
| | | spianMapper.UpdataOutCage(glasswidth, cage, cell);// 增加原格子宽度 |
| | | spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里 |
| | | spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除被调拨格子数据 |
| | | // 传输mes数据,坐标,数据 |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | datas.clear(); // 清空整个列表 |
| | | // 判断调拨结束后再次出片 |
| | | // 填入出片数据 |
| | | datas.add((short) prcid); |
| | | datas.add((short) 1000); |
| | | datas.add((short) 1); |
| | | datas.add((short) 1); |
| | | S7control.getinstance().WriteWord(adddresslist, datas); |
| | | return Result.success(cagecell); // 调拨位置的参数内容 |
| | | S7control.getinstance().WriteWord("DB106.22", (short)0); //出片任务完成改成0 |
| | | S7control.getinstance().WriteWord("DB106.20", (short)1); //出片车状态改成忙碌 |
| | | S7control.getinstance().WriteWord(adddresslist, datas);//派发出片车任务 |
| | | return (200);//结束 |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | // } |
| | | |
| | | } |
| | | |
| | |
| | | /*
|
| | | Navicat MySQL Data Transfer
|
| | |
|
| | | Source Server : server-150
|
| | | Source Server : 本地
|
| | | Source Server Type : MySQL
|
| | | Source Server Version : 80019
|
| | | Source Host : 10.153.19.150:3306
|
| | | Source Server Version : 80022
|
| | | Source Host : localhost:3306
|
| | | Source Schema : canadames
|
| | |
|
| | | Target Server Type : MySQL
|
| | | Target Server Version : 80019
|
| | | Target Server Version : 80022
|
| | | File Encoding : 65001
|
| | |
|
| | | Date: 13/09/2023 09:48:14
|
| | | Date: 14/09/2023 09:47:12
|
| | | */
|
| | |
|
| | | SET NAMES utf8mb4;
|
| | |
| | | `timeon` datetime(0) NULL DEFAULT NULL COMMENT '开始时间',
|
| | | `endTime` datetime(0) NULL DEFAULT NULL COMMENT '结束时间',
|
| | | PRIMARY KEY (`id`) USING BTREE
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 1338 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 1378 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
|
| | |
|
| | | -- ----------------------------
|
| | | -- Records of alarmmg
|
| | |
| | | `width` decimal(10, 2) NULL DEFAULT NULL,
|
| | | `height` decimal(10, 2) NULL DEFAULT NULL,
|
| | | PRIMARY KEY (`id`) USING BTREE
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
|
| | |
|
| | | -- ----------------------------
|
| | | -- Records of glass
|
| | |
| | | `order_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '订单号',
|
| | | `state` int NULL DEFAULT NULL COMMENT '状态(0:按此订单号出片,1结束出片)',
|
| | | PRIMARY KEY (`id`) USING BTREE
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
|
| | |
|
| | | -- ----------------------------
|
| | | -- Records of order_out
|
| | |
| | | INSERT INTO `role_permission` VALUES (69, 2, 26, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (70, 2, 27, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (71, 2, 28, 1, '2021-11-28 15:07:54', '2021-11-28 15:07:54');
|
| | | INSERT INTO `role_permission` VALUES (72, 2, 30, 0, '2023-08-24 08:55:34', '2023-08-24 08:55:34');
|
| | | INSERT INTO `role_permission` VALUES (73, 2, 29, 0, '2023-08-24 08:56:15', '2023-08-28 15:33:14');
|
| | | INSERT INTO `role_permission` VALUES (72, 2, 30, 1, '2023-08-24 08:55:34', '2023-08-24 08:55:34');
|
| | | INSERT INTO `role_permission` VALUES (73, 2, 29, 1, '2023-08-24 08:56:15', '2023-08-28 15:33:14');
|
| | | INSERT INTO `role_permission` VALUES (74, 2, 1, 1, '2023-08-30 16:29:46', '2023-08-30 16:29:46');
|
| | |
|
| | | -- ----------------------------
|
| | |
| | | INSERT INTO `storage_cage` VALUES (9, NULL, NULL, 1, 5, 1, 1500.00, NULL, NULL, 1, NULL);
|
| | | INSERT INTO `storage_cage` VALUES (10, NULL, NULL, 1, 5, 2, 1600.00, NULL, NULL, 0, NULL);
|
| | | INSERT INTO `storage_cage` VALUES (11, NULL, NULL, 1, 6, 1, 1600.00, NULL, NULL, 0, NULL);
|
| | | INSERT INTO `storage_cage` VALUES (12, '12', 'NG2202301', 1, 6, 2, 1602.00, 0.00, 2.00, 2, '2');
|
| | | INSERT INTO `storage_cage` VALUES (12, '12', 'NG2202301', 1, 6, 2, 1602.00, 0.00, 2.00, 1, '2');
|
| | | INSERT INTO `storage_cage` VALUES (13, NULL, NULL, 1, 7, 1, 1600.00, NULL, NULL, 0, NULL);
|
| | | INSERT INTO `storage_cage` VALUES (14, '122', 'NG2202302', 1, 7, 2, 1500.00, 2.00, 2.00, 3, '3');
|
| | | INSERT INTO `storage_cage` VALUES (14, NULL, NULL, 1, 7, 2, 1500.00, NULL, NULL, 0, NULL);
|
| | | INSERT INTO `storage_cage` VALUES (15, NULL, NULL, 1, 8, 1, 1500.00, NULL, NULL, 0, NULL);
|
| | | INSERT INTO `storage_cage` VALUES (16, NULL, NULL, 1, 8, 2, 1500.00, NULL, NULL, 0, NULL);
|
| | | INSERT INTO `storage_cage` VALUES (17, NULL, NULL, 1, 9, 1, 1500.00, NULL, NULL, 1, NULL);
|
| | |
| | | `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
|
| | | `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
|
| | | PRIMARY KEY (`id`) USING BTREE
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
|
| | | ) ENGINE = InnoDB AUTO_INCREMENT = 23 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = DYNAMIC;
|
| | |
|
| | | -- ----------------------------
|
| | | -- Records of user
|
| | |
| | | INSERT INTO `user` VALUES (1, 0, '', 0, 1, 'admin', 'b2f0c414a5ffb6944c424bc18ae3a8a0', NULL, NULL, NULL, 1, '2023-08-25 08:58:58', '2023-09-05 16:12:28');
|
| | | INSERT INTO `user` VALUES (2, 1, '1-', 1, 2, 'user1', '601b99523f82de29f87771d5f95accdc', 'user1@qq.com', NULL, NULL, 1, '2021-11-28 14:31:39', '2021-11-28 15:09:36');
|
| | | INSERT INTO `user` VALUES (3, 1, '1-', 1, 2, 'user2', 'f403c87893db29eb71b21905b57bbd0d', 'user2@qq.com', NULL, NULL, 1, '2021-11-28 14:31:39', '2021-11-28 15:09:36');
|
| | | INSERT INTO `user` VALUES (9, 1, '1-', 1, 1, 'yttttttttttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '666@qq.com', NULL, NULL, 1, '2023-08-23 20:35:32', '2023-08-23 20:35:32');
|
| | | INSERT INTO `user` VALUES (10, 1, '1-', 1, 2, '767655555', '500637c0d48b442a3be6d4fce12e0910', NULL, NULL, NULL, 1, '2023-08-23 20:42:58', '2023-08-23 20:42:58');
|
| | | INSERT INTO `user` VALUES (11, 1, '1-', 1, 5, 'uiuyiuy', 'e046c4175152aa3001d2c71c5bc1aee5', '767676767tt@qq.com', NULL, NULL, 1, '2023-08-23 20:43:42', '2023-08-23 20:43:42');
|
| | | INSERT INTO `user` VALUES (13, 1, '1-', 1, 2, 'user3', '500637c0d48b442a3be6d4fce12e0910', '2265557345@qq.com', NULL, NULL, 1, '2023-08-24 09:58:40', '2023-08-24 09:58:40');
|
| | | INSERT INTO `user` VALUES (13, 1, '1-', 1, 2, 'user3', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '2265557345@qq.com', NULL, NULL, 1, '2023-08-24 09:58:40', '2023-08-24 09:58:40');
|
| | | INSERT INTO `user` VALUES (15, 1, '1-', 1, 2, '99999', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '2267666@qq.com', NULL, NULL, 1, '2023-08-25 09:37:05', '2023-08-28 14:37:27');
|
| | | INSERT INTO `user` VALUES (16, 1, '1-', 1, 2, '5656tttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '5454@qq.com', NULL, NULL, 1, '2023-08-28 14:17:44', '2023-08-28 14:37:24');
|
| | | INSERT INTO `user` VALUES (17, 1, '1-', 1, 2, '6767ttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '225@qq.com', NULL, NULL, 1, '2023-08-28 14:20:05', '2023-08-28 14:23:53');
|
| | | INSERT INTO `user` VALUES (18, 1, '1-', 1, 2, '8989ttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '224@qq.com', NULL, NULL, 1, '2023-08-28 14:26:17', '2023-08-28 14:37:22');
|
| | | INSERT INTO `user` VALUES (19, 1, '1-', 1, 5, '8080ttt', 'b2f0c414a5ffb6944c424bc18ae3a8a0', '87@qq.com', NULL, NULL, 1, '2023-08-28 14:34:39', '2023-08-29 16:03:38');
|
| | |
|