CanadaMes-ui/src/api/home.js
@@ -21,13 +21,6 @@ }) } export function loadtask(type) { return request({ url: '/home/loadinout?types=' + type, method: 'get', }) } export function InsertOrder(orderid) { return request({ url: '/home/InsertOrder?orderid=' + orderid, @@ -132,11 +125,11 @@ }) } export function InsertQueueGlassId(glassid, id) { export function InsertQueueGlassId(id,data) { return request({ url: '/home/InsertQueueGlassId?glassid=' + glassid + '&id=' + id, url: '/home/InsertQueueGlassId?id=' + id, method: 'post', data: "" data }) } @@ -195,3 +188,12 @@ data }) } export function isAllowQueues(isAllowQueue) { return request({ url: '/home/AddOutSliceS?isAllowQueue'+isAllowQueue, method: 'post', data:"" }) } CanadaMes-ui/src/lang/locales/en-US.json
@@ -305,6 +305,10 @@ "Glass information corresponding to aluminum frame":"Glass information corresponding to aluminum frame", "In the cage":"In the cage", "Flip":"Flip", "In the queue":"In the queue" "In the queue":"In the queue", "Normal":"Normal", "Entering":"Entering", "Outing":"Outing", "Suspend":"Suspend" } CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -301,6 +301,10 @@ "In the queue":"在队列", "Enter the Frame No":"请输入铝框id", "Manually Infeed Glass":"手动进片", "Normal":"正常", "Entering":"正在进", "Outing":"正在出", "Suspend":"暂停", "langparameter": { "conveyor Velocity(Auto FAST)": "D01-D06 皮带输送自动快速", "conveyor Velocity(Auto SLOW)": "D01-D06 皮带输送自动慢速", CanadaMes-ui/src/views/home/index.vue
@@ -215,14 +215,13 @@ <el-table-column :width="130" prop="cage" :label="$t('Cage No')"></el-table-column> <el-table-column :width="130" prop="cell" :label="$t('Slot No')"></el-table-column> <el-table-column :width="180" prop="glassId" :label="$t('Outfeed glass barcode')"></el-table-column> <el-table-column :width="130" prop="north_glass_buffer1s.ordernumber" <el-table-column :width="130" prop="orderId" :label="$t('Order No')"></el-table-column> <el-table-column prop="north_glass_buffer1s.listnumber" :label="$t('List No')"></el-table-column> <el-table-column prop="north_glass_buffer1s.boxnumber" :label="$t('Box No')"></el-table-column> <el-table-column prop="orderId" :label="$t('List No')"></el-table-column> <el-table-column prop="orderId" :label="$t('Box No')"></el-table-column> <el-table-column :width="130" prop="lengthWidth" :label="$t('Dim')"> <template slot-scope='scope'> {{ scope.row.north_glass_buffer1s.glasslength }}*{{ scope.row.north_glass_buffer1s.glassheight }} {{ scope.row.glasswidthmm }}*1{{ scope.row.glassheightmm }} </template> </el-table-column> <el-table-column :label="$t('Terminate Task')"> @@ -237,14 +236,13 @@ <el-table-column :width="130" prop="cage" :label="$t('Cage No')"></el-table-column> <el-table-column :width="130" prop="cell" :label="$t('Slot No')"></el-table-column> <el-table-column :width="180" prop="glassId" :label="$t('Infeed glass barcode')"></el-table-column> <el-table-column :width="130" prop="north_glass_buffer1s.ordernumber" <el-table-column :width="130" prop="orderId" :label="$t('Order No')"></el-table-column> <el-table-column prop="north_glass_buffer1s.listnumber" :label="$t('List No')"></el-table-column> <el-table-column prop="north_glass_buffer1s.boxnumber" :label="$t('Box No')"></el-table-column> <el-table-column prop="orderId" :label="$t('List No')"></el-table-column> <el-table-column prop="orderId" :label="$t('Box No')"></el-table-column> <el-table-column :width="130" prop="lengthWidth" :label="$t('Dim')"> <template slot-scope='scope'> {{ scope.row.north_glass_buffer1s.glasslength }}*{{ scope.row.north_glass_buffer1s.glassheight }} {{ scope.row.glasswidthmm }}*1{{ scope.row.glassheightmm }} </template> </el-table-column> @@ -336,28 +334,28 @@ <el-button type="primary" @click="showform(3)">{{ $t('Query') }}</el-button> </el-form-item> <el-form-item :label="$t('Barcode')"> <el-input v-model="form.barcode" readonly autocomplete="off" /> <el-input v-model="form.glassId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Order No')"> <el-input v-model="form.ordernumber" readonly autocomplete="off" /> <el-input v-model="form.orderId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('List No')"> <el-input v-model="form.listnumber" readonly autocomplete="off" /> <el-input v-model="form.listId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Box No')"> <el-input v-model="form.boxnumber" readonly autocomplete="off" /> <el-input v-model="form.boxId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Length')"> <el-input v-model="form.glasslength" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Width')"> <el-input v-model="form.glassheight" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Length')"> <el-input v-model="form.glasslengthmm" readonly autocomplete="off" /> <el-input v-model="form.glasswidthmm" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Width')"> <el-input v-model="form.glassheightmm" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Length')"> <el-input v-model="form.glasswidth" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Width')"> <el-input v-model="form.glassheight" readonly autocomplete="off" /> </el-form-item> </el-form> @@ -407,20 +405,29 @@ <el-table-column :width="55" prop="tier" :label="$t('The Side')"></el-table-column> <el-table-column :width="145" prop="glassId" :label="$t('Barcode')"></el-table-column> <el-table-column :width="100" prop="orderId" :label="$t('Order No')"></el-table-column> <el-table-column :width="80" prop="north_glass_buffer1s.listnumber" <el-table-column :width="80" prop="listId" :label="$t('List No')"></el-table-column> <el-table-column :width="100" prop="north_glass_buffer1s.boxnumber" :label="$t('Box No')"></el-table-column> <el-table-column :width="150" prop="lengthWidth" :label="$t('Dim')"></el-table-column> <el-table-column :width="100" prop="boxId" :label="$t('Box No')"></el-table-column> <el-table-column :width="100" prop="state" :label="$t('State')"> <template slot-scope='scope'> {{ scope.row.state==1?$t('Normal'):scope.row.state==2?$t('Entering'):scope.row.state==3?$t('Outing'):"" }} </template> </el-table-column> <el-table-column :width="150" prop="lengthWidth" :label="$t('Dim')"> <template slot-scope='scope'> {{ scope.row.glassWidthMm }}{{scope.row.glassWidthMm>0?"*":""}}{{ scope.row.glassHeightMm }} </template> </el-table-column> <el-table-column :width="280" :label="$t('Operate')"> <template slot-scope='scope'> <el-button type="primary" style="padding: 4px 10px;font-size: 12px;" @click="deleteglass(scope.row.glassId, scope.row.state)">{{ $t('Delete') }}</el-button> <el-button type="primary" style="padding: 4px 10px;font-size: 12px;" <el-button type="primary" style="padding: 4px 10px;font-size: 12px;" :disabled="scope.row.state==1?false:true" @click="outglass(scope.row.glassId, scope.row.state)">{{ $t('Out') }}</el-button> <el-button type="primary" style="padding: 4px 10px;font-size: 12px;" @click="UpdateDisabled(scope.row.cage, scope.row.cell, scope.row.disabled == 0 ? 1 : 0)"> {{ scope.row.disabled == 0 ? $t('Enable') : $t('Disable') }}</el-button> <el-button type="primary" style="padding: 4px 10px;font-size: 12px;" <el-button type="primary" style="padding: 4px 10px;font-size: 12px;" :disabled="scope.row.glassId!=null?true:false" @click="insertglass(scope.row.cage, scope.row.cell, scope.row.tier)">{{ $t('Increase') }}</el-button> </template> @@ -465,106 +472,106 @@ <el-form-item> <el-input style="width:50%;margin-left: 20%;" :placeholder="$t('Enter the glass barcode')" v-model="glassid2"></el-input> <el-button type="primary" @click="SelectGlassByGlassIDs(1)" :disabled="disabled">{{ $t('Query') <el-button type="primary" @click="SelectGlassByGlassIDs(1)" >{{ $t('Query') }}</el-button> </el-form-item> <el-form-item> <el-input style="width:50%;margin-left: 20%;" :placeholder="$t('Enter the glass barcode')" v-model="glassid1"></el-input> <el-button type="primary" @click="SelectGlassByGlassIDs(2)" :disabled="disabled">{{ $t('Query') <el-button type="primary" @click="SelectGlassByGlassIDs(2)" >{{ $t('Query') }}</el-button> </el-form-item> </div> <div style="display: flex;justify-content: space-around;"> <el-form-item :label="$t('Barcode')"> <el-input v-model="form2.barcode" readonly autocomplete="off" /> <el-input v-model="form2.glassId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Barcode')"> <el-input v-model="form4.barcode" readonly autocomplete="off" /> <el-input v-model="form4.glassId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Barcode')"> <el-input v-model="form3.barcode" readonly autocomplete="off" /> <el-input v-model="form3.glassId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Barcode')"> <el-input v-model="form5.barcode" readonly autocomplete="off" /> <el-input v-model="form5.glassId" readonly autocomplete="off" /> </el-form-item> </div> <div style="display: flex;justify-content: space-around;"> <el-form-item :label="$t('Order No')"> <el-input v-model="form2.ordernumber" readonly autocomplete="off" /> <el-input v-model="form2.orderId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Order No')"> <el-input v-model="form4.ordernumber" readonly autocomplete="off" /> <el-input v-model="form4.orderId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Order No')"> <el-input v-model="form3.ordernumber" readonly autocomplete="off" /> <el-input v-model="form3.orderId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Order No')"> <el-input v-model="form5.ordernumber" readonly autocomplete="off" /> <el-input v-model="form5.orderId" readonly autocomplete="off" /> </el-form-item> </div> <div style="display: flex;justify-content: space-around;"> <el-form-item :label="$t('List No')"> <el-input v-model="form2.listnumber" readonly autocomplete="off" /> <el-input v-model="form2.listId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('List No')"> <el-input v-model="form4.listnumber" readonly autocomplete="off" /> <el-input v-model="form4.listId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('List No')"> <el-input v-model="form3.listnumber" readonly autocomplete="off" /> <el-input v-model="form3.listId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('List No')"> <el-input v-model="form5.listnumber" readonly autocomplete="off" /> <el-input v-model="form5.listId" readonly autocomplete="off" /> </el-form-item> </div> <div style="display: flex;justify-content: space-around;"> <el-form-item :label="$t('Box No')"> <el-input v-model="form2.boxnumber" readonly autocomplete="off" /> <el-input v-model="form2.boxId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Box No')"> <el-input v-model="form4.boxnumber" readonly autocomplete="off" /> <el-input v-model="form4.boxId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Box No')"> <el-input v-model="form3.boxnumber" readonly autocomplete="off" /> <el-input v-model="form3.boxId" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Box No')"> <el-input v-model="form5.boxnumber" readonly autocomplete="off" /> <el-input v-model="form5.boxId" readonly autocomplete="off" /> </el-form-item> </div> <div style="display: flex;justify-content: space-around;"> <el-form-item :label="$t('Length')"> <el-input v-model="form2.glasslength" readonly autocomplete="off" /> <el-input v-model="form2.glasswidthmm" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Length')"> <el-input v-model="form4.glasslength" readonly autocomplete="off" /> <el-input v-model="form4.glasswidthmm" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Length')"> <el-input v-model="form3.glasslength" readonly autocomplete="off" /> <el-input v-model="form3.glasswidthmm" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Length')"> <el-input v-model="form5.glasslength" readonly autocomplete="off" /> <el-input v-model="form5.glasswidthmm" readonly autocomplete="off" /> </el-form-item> </div> <div style="display: flex;justify-content: space-around;"> <el-form-item :label="$t('Width')"> <el-input v-model="form2.glassheight" readonly autocomplete="off" /> <el-input v-model="form2.glassheightmm" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Width')"> <el-input v-model="form4.glassheight" readonly autocomplete="off" /> <el-input v-model="form4.glassheightmm" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Width')"> <el-input v-model="form3.glassheight" readonly autocomplete="off" /> <el-input v-model="form3.glassheightmm" readonly autocomplete="off" /> </el-form-item> <el-form-item :label="$t('Width')"> <el-input v-model="form5.glassheight" readonly autocomplete="off" /> <el-input v-model="form5.glassheightmm" readonly autocomplete="off" /> </el-form-item> </div> <div style="display: flex;justify-content: space-around;"> <el-button @click="DeleteQueueGlasss(2)" type="primary" :disabled="disabled">{{ $t('Clear Current') <el-button @click="DeleteQueueGlasss(2)" type="primary" >{{ $t('Clear Current') }}</el-button> <el-button @click="InsertQueueGlass(2)" type="primary" :disabled="disabled"> {{ $t('Confirm Modification') }}</el-button> <el-button @click="DeleteQueueGlasss(1)" type="primary" :disabled="disabled">{{ $t('Clear Current') <el-button @click="DeleteQueueGlasss(1)" type="primary" >{{ $t('Clear Current') }}</el-button> <el-button @click="InsertQueueGlass(1)" type="primary" :disabled="disabled1"> {{ $t('Confirm Modification') }}</el-button> @@ -579,14 +586,16 @@ <el-dialog :visible.sync="dialogFormVisible6" :title="$t('Production queue')" top="5vh"> <el-button type="primary" @click="showform7()">{{ $t('Increase') }}</el-button> <el-button type="primary" @click="isAllowQueueState()">{{ this.isAllowQueue==true?$t('Stop'):$t('Start') }}</el-button> <el-table :data="this.OutSlice" :height="700" border style="width: 100%;overflow: auto;"> <el-table-column prop="glassId" :label="$t('Barcode')"></el-table-column> <el-table-column prop="north_glass_buffer1s.ordernumber" :label="$t('Order No')"></el-table-column> <el-table-column prop="north_glass_buffer1s.listnumber" :label="$t('List No')"></el-table-column> <el-table-column prop="north_glass_buffer1s.boxnumber" :label="$t('Box No')"></el-table-column> <el-table-column prop="barCode" :label="$t('Frame No')"></el-table-column> <el-table-column prop="north_glass_buffer1s.glasslength" :label="$t('Length')"></el-table-column> <el-table-column prop="north_glass_buffer1s.glassheight" :label="$t('Width')"></el-table-column> <el-table-column prop="storageCage.orderId" :label="$t('Order No')"></el-table-column> <el-table-column prop="storageCage.listId" :label="$t('List No')"></el-table-column> <el-table-column prop="storageCage.boxId" :label="$t('Box No')"></el-table-column> <el-table-column prop="barcode" :label="$t('Frame No')"></el-table-column> <el-table-column prop="storageCage.glasswidthmm" :label="$t('Length')"></el-table-column> <el-table-column prop="storageCage.glassheightmm" :label="$t('Width')"></el-table-column> <el-table-column :width="280" :label="$t('Operate')"> <template slot-scope='scope'> <el-button type="text" size="small" @click="getTopMove(scope.row, scope.$index)" @@ -651,9 +660,9 @@ <script> import { home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist, home, home2, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist, SelectPassword, SelectGlassByGlassID, Disabled, Inglassid, SelectGlass, InsertQueueGlassId, UpdateQueueState, DeleteQueueGlass, SelectGlassNo, SelectAluminumFrameInfoById, SelectProductionqueue, DeleteProductionQueueGlass, AddOutSliceS SelectAluminumFrameInfoById, SelectProductionqueue, DeleteProductionQueueGlass, AddOutSliceS, isAllowQueues } from "../../api/home"; @@ -724,7 +733,8 @@ pageCount: 0, OutSlice: [], AluminumFrame: [], framebarcode: "" framebarcode: "", isAllowQueue:true }; }, created() { @@ -768,6 +778,8 @@ this.tasklist2 = obj.tasklist2[0]; this.alarm = obj.alarmmg[0]; this.isAllowQueue=obj.isAllowQueue; console.log(obj); //出片队列 this.OutSlice = obj.listoutslice[0]; this.loadglassheight = obj.loadglassheight; @@ -791,7 +803,7 @@ if (obj.form3 != null && obj.form3 != "" && obj.state[0] == 0) { this.form5 = obj.form3[0]; this.showform3(); if (this.form5.glassheightmm < 380 || this.form5.glasslengthmm < 390 || this.form5.glassheightmm > 1810 || this.form5.glasslengthmm > 2760) { if (this.form5.glassheight < 380 || this.form5.glasswidth < 390 || this.form5.glassheight > 1810 || this.form5.glasswidth > 2760) { if (this.disabled1 == false) { this.disabled1 = true; this.$message.error(this.$t('The glass size is not within the range')); @@ -800,7 +812,7 @@ this.disabled1 = false; } } else { if (this.form5.glassheightmm < 380 || this.form5.glasslengthmm < 390 || this.form5.glassheightmm > 1810 || this.form5.glasslengthmm > 2760) { if (this.form5.glassheight < 380 || this.form5.glasswidth < 390 || this.form5.glassheight > 1810 || this.form5.glasswidth > 2760) { if (this.disabled1 == false) { this.disabled1 = true; // this.$message.error(this.$t('The glass size is not within the range')); @@ -817,9 +829,6 @@ this.cageinfo = res.data.cageinfo; }); } SelectGlass(this.orderid).then(res => { this.GlassInfo = res.data.glass; }); this.$forceUpdate(); @@ -846,14 +855,14 @@ this.cagelist3 = res.data.list3; this.cagelist4 = res.data.list4; }); //加载进片任务数据 loadtask(this.task1).then(res => { this.tasklist1 = res.data.list; }); //加载进出片任务数据 loadtask(this.task2).then(res => { this.tasklist2 = res.data.list; }); // //加载进片任务数据 // loadtask(this.task1).then(res => { // this.tasklist1 = res.data.list; // }); // //加载进出片任务数据 // loadtask(this.task2).then(res => { // this.tasklist2 = res.data.list; // }); //加载报警信息 SelectAlarmmgInfo().then(res => { this.alarm = res.data.alarmmg; @@ -937,6 +946,7 @@ SelectGlassByGlassID(this.glassid).then(res => { if (res.data.form != null) { this.form = res.data.form; console.log(this.form); this.dialogFormVisible = true; this.$message.success(this.$t('query was successful')); } else { @@ -967,6 +977,14 @@ if (res.data.form != null) { this.form4 = res.data.form; this.$message.success(this.$t('query was successful')); if (this.form4.glassheight < 380 || this.form4.glasswidth < 390 || this.form4.glassheight > 1810 || this.form4.glasswidth > 2760) { if (this.disabled == false) { this.disabled = true; this.$message.error(this.$t('The glass size is not within the range')); } } else { this.disabled = false; } } else { this.$message.error(this.$t('There is no such glass')); } @@ -984,13 +1002,12 @@ if (res.data.form != null) { this.form5 = res.data.form; this.$message.success(this.$t('query was successful')); if (this.form5.glassheightmm < 380 || this.form5.glasslengthmm < 390 || this.form5.glassheightmm > 1810 || this.form5.glasslengthmm > 2760) { if (this.form5.glassheight < 380 || this.form5.glasswidth < 390 || this.form5.glassheight > 1810 || this.form5.glasswidth > 2760) { if (this.disabled1 == false) { this.disabled1 = true; this.$message.error(this.$t('The glass size is not within the range')); } } else { alert(1); this.disabled1 = false; } } else { @@ -1138,11 +1155,8 @@ if (res.data.message3 == 200) { this.$message.success(this.$t('Operation successful')); } else if (res.data.message2 == 300) { this.$message.error(this.$t('There is no such grid')); } else if (res.data.message2 == 500) { this.$message.error(this.$t('This glass is already in the cage')); this.$message.error(this.$t('This glass is already in the Queue')); } }); } else { @@ -1245,9 +1259,9 @@ }, //手动添加扫码位玻璃 InsertQueueGlass(parameter) { if (parameter == 1 && this.form5.barcode != "") { if (this.form5.barcode != this.form2.barcode) { InsertQueueGlassId(this.form5.barcode, 1).then(res => { if (parameter == 1 && this.form5.glassId != "") { if (this.form5.glassId != this.form2.glassId) { InsertQueueGlassId(1,this.form5).then(res => { if (res.data.message == 200) { this.form5 = {}; this.$message.success(this.$t('Operation successful')); @@ -1258,9 +1272,9 @@ } else { this.$message.error(this.$t('The glass ID already exists in the loading queue')); } } else if (parameter == 2 && this.form4.barcode != "") { if (this.form4.barcode != this.form3.barcode) { InsertQueueGlassId(this.form4.barcode, 2).then(res => { } else if (parameter == 2 && this.form4.glassId != "") { if (this.form4.glassId != this.form3.glassId) { InsertQueueGlassId(2,this.form4).then(res => { if (res.data.message == 200) { this.form4 = {}; this.$message.success(this.$t('Operation successful')); @@ -1335,6 +1349,14 @@ getDownMove(row, index) { let arr = this.OutSlice; arr.splice(index, 1, ...arr.splice(index + 1, 1, arr[index])); }, //切换出片队列状态 isAllowQueueState(){ isAllowQueues(!this.isAllowQueue).then(res=>{ if (res.data.message == 200) { this.$message.success(this.$t('Operation successful')); } }) } } } springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -2,19 +2,18 @@ import cn.hutool.json.JSONObject; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import com.example.springboot.entity.Out_slice; import com.example.springboot.entity.Queue; import com.example.springboot.entity.StorageCage; import com.example.springboot.entity.alarmmg; import com.example.springboot.entity.north_glass_buffer1; import com.example.springboot.mapper.HomeMapper; import com.example.springboot.mapper.SpianMapper; import com.example.springboot.service.JdbcConnections; public class Plchome extends Thread { @@ -24,6 +23,10 @@ private JdbcConnections dbserve; private JdbcConnections jdbcConnections; public static Boolean isAllowQueue=true; // public static Map b=new HashMap<>(); // b.put() @Override public void run() { while (this != null) { @@ -53,30 +56,6 @@ // 进出片任务 List<StorageCage> tasklist1 = homeMapper.selectinout(3); List<StorageCage> tasklist2 = homeMapper.selectinout(2); for (StorageCage storageCage : tasklist1) { // storageCage.setnorth_glass_buffer1s(homeMapper.SelectBoxNo(storageCage.getGlassId())); try { storageCage.setnorth_glass_buffer1s(jdbcConnections.SelectGlassByGlassIdOrderIdFrameId("", "", "")); } catch (SQLException e) { e.printStackTrace(); } try { storageCage.setnorth_glass_buffer1s( jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(storageCage.getGlassId(), "", "")); } catch (SQLException e) { e.printStackTrace(); } } for (StorageCage storageCage : tasklist2) { // storageCage.setnorth_glass_buffer1s(homeMapper.SelectBoxNo(storageCage.getGlassId())); try { storageCage.setnorth_glass_buffer1s( jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(storageCage.getGlassId(), "", "")); } catch (SQLException e) { e.printStackTrace(); } } jsonObject.append("tasklist1", tasklist1); jsonObject.append("tasklist2", tasklist2); // 查询报警信息 @@ -107,39 +86,23 @@ jsonObject.append("queid", queid); jsonObject.append("state", state); // 获取扫码位与上片位玻璃信息 String queueglassid2 = homeMapper.GetQueueInfo(2); String queueglassid1 = homeMapper.GetQueueInfo(1); // north_glass_buffer1 form2 = homeMapper.SelectGlassByGlassID(queueglassid2); // north_glass_buffer1 form3 = homeMapper.SelectGlassByGlassID(queueglassid1); north_glass_buffer1 form2; if(queueglassid2.length()!=0){ try { form2 = jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(queueglassid2, "", ""); jsonObject.append("form2", form2); } catch (SQLException e) { e.printStackTrace(); } Queue form2 = homeMapper.GetQueueInfo(2); Queue form3 = homeMapper.GetQueueInfo(1); if(form2.getglassId()!=null&&form2.getglassId()!=""){ jsonObject.append("form2", form2); } north_glass_buffer1 form3; if(queueglassid1.length()!=0){ try { form3 = jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(queueglassid1, "", ""); jsonObject.append("form3", form3); } catch (SQLException e) { e.printStackTrace(); } if(form3.getglassId()!=null&&form3.getglassId()!=""){ jsonObject.append("form3", form3); } // 获取出片队列信息 List<Out_slice> listoutslice = homeMapper.SelectProductionqueue(); for (Out_slice out_slice : listoutslice) { out_slice.setnorth_glass_buffer1s(homeMapper.SelectBoxNo(out_slice.getGlassId())); out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId())); } jsonObject.append("listoutslice", listoutslice); //获取当前出片队列状态 jsonObject.append("isAllowQueue", isAllowQueue); dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class); boolean dbconnected = false; springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
@@ -35,7 +35,7 @@ // new Plcaction().start(); // // new Plchome().start(); new Plchome().start(); // // new PlcParameter().start(); // @@ -44,11 +44,11 @@ // new Plcsign().start(); // // new Plcstate().start(); new PlcPositioning1().start(); new PlcPositioning2().start(); new PlcParameter2().start(); new PlcParameter1().start(); new PLCAutomaticParameterSetting().start(); // new PlcPositioning1().start(); // new PlcPositioning2().start(); // new PlcParameter2().start(); // new PlcParameter1().start(); // new PLCAutomaticParameterSetting().start(); // new PlcServoManualone().start(); } } springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -13,12 +13,15 @@ import com.example.springboot.service.JdbcConnections; import com.example.springboot.service.SpianService; import com.example.springboot.common.Result; import com.example.springboot.component.Plchome; import com.example.springboot.component.S7control; import com.example.springboot.entity.CarPosition; import com.example.springboot.entity.StorageCage; import com.example.springboot.entity.alarmmg; import com.example.springboot.entity.north_glass_buffer1; import com.example.springboot.entity.Out_slice; import com.example.springboot.entity.Queue; import org.springframework.web.bind.annotation.*; @@ -61,21 +64,6 @@ map.put("list2", storageCagelist2); map.put("list3", storageCagelist3); map.put("list4", storageCagelist4); return Result.success(map); } // 查询进/出片任务 @GetMapping("/loadinout") public Result selectinout(Integer types) throws SQLException{ List<StorageCage> storageCageinout = homeMapper.selectinout(types); for (StorageCage storageCage : storageCageinout) { storageCage.setnorth_glass_buffer1s(jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(storageCage.getGlassId(), "", "")); // storageCage.setnorth_glass_buffer1s(homeMapper.SelectBoxNo(storageCage.getGlassId())); } Map<String, Object> map = new HashMap<>(); map.put("list", storageCageinout); return Result.success(map); } @@ -146,11 +134,6 @@ @GetMapping("/SelectCageInfo") public Result SelectCageInfo(short cage) throws SQLException { List<StorageCage> cageinfo = homeMapper.SelectCageInfo(cage); for (StorageCage storageCage : cageinfo) { // storageCage.setnorth_glass_buffer1s(homeMapper.SelectBoxNo(storageCage.getGlassId())); storageCage.setnorth_glass_buffer1s(jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(storageCage.getGlassId(), "", "")); } Map<String, Object> map = new HashMap<>(); map.put("cageinfo", cageinfo); return Result.success(map); @@ -169,21 +152,17 @@ // 根据玻璃id手动出片 @GetMapping("/OutByGlassID") public Result OutByGlassID(String glassid) { public Result OutByGlassID(String glassid) throws SQLException { Map<String, Object> map = new HashMap<>(); // 调用伍上片函数 short result = homeMapper.SelectStorageByGlassId(glassid); if (result > 0) { Short results = spianService.selectout2(glassid); if (results == 200) { map.put("message2", "200"); } else if (results == 300) { map.put("message2", "300"); } Out_slice result = homeMapper.SelectQueueByglassid(glassid); if(result==null) { north_glass_buffer1 north_glass_buffer1=jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(glassid, "", ""); String flip=jdbcConnections.SelectFlipByFrameBarcode(north_glass_buffer1.getFrameBarcode()); homeMapper.AddOutSliceS(glassid, flip, north_glass_buffer1.getFrameBarcode(), north_glass_buffer1.getglasslengthmm().toString(), north_glass_buffer1.getglassheightmm().toString()); map.put("message2", "200"); } else { map.put("message2", "500"); } return Result.success(map); } @@ -209,13 +188,10 @@ @GetMapping("/SelectGlassByGlassID") public Result SelectGlassByGlassID(String glassid) throws SQLException { // north_glass_buffer1 north_glass_buffer1s = homeMapper.SelectGlassByGlassID(glassid); north_glass_buffer1 north_glass_buffer1s=jdbcConnections.SelectGlassByGlassIdOrderIdFrameId(glassid, "", ""); Queue queue=jdbcConnections.SelectGlassByGlassIdOrderIdFrameIdQueue(glassid, "", ""); Map<String, Object> map = new HashMap<>(); if(glassid!=""){ map.put("form", north_glass_buffer1s); map.put("form", queue); } return Result.success(map); } @@ -231,14 +207,14 @@ // 手动往理片笼添加玻璃 @PostMapping("/Inglassid") public Result Inglassid(short cage, short cell, short tier, @RequestBody north_glass_buffer1 north_glass_buffer1s) { public Result Inglassid(short cage, short cell, short tier, @RequestBody Queue queue) { Map<String, Object> map = new HashMap<>(); short result = homeMapper.SelectStorageByGlassId(north_glass_buffer1s.getbarcode()); short result = homeMapper.SelectStorageByGlassId(queue.getglassId()); if (result > 0) { map.put("message", "300"); } else { homeMapper.Inglassid(north_glass_buffer1s, cage, cell, tier); spianMapper.UpdataAddCage1(north_glass_buffer1s.getglasslengthmm(), cage, cell); homeMapper.Inglassid(queue, cage, cell, tier); spianMapper.UpdataAddCage1(queue.getglasswidth(), cage, cell); } return Result.success(map); } @@ -254,15 +230,15 @@ // 手动添加扫码位玻璃 @PostMapping("/InsertQueueGlassId") public Result InsertQueueGlassId(String glassid, Short id) { public Result InsertQueueGlassId(Short id,@RequestBody Queue queue) { Map<String, Object> map = new HashMap<>(); short result = homeMapper.SelectStorageByGlassId(glassid); short result = homeMapper.SelectStorageByGlassId(queue.getglassId()); if (result > 0) { map.put("message", "300"); } else { homeMapper.InsertQueueGlassId(glassid, id); homeMapper.InsertQueueGlassId(queue, id); //调用伍存储过程 spianService.selectAll(glassid); spianService.selectAll(queue.getglassId()); map.put("message", "200"); } return Result.success(map); @@ -298,10 +274,8 @@ // 根据铝框id获取对应玻璃信息 @PostMapping("/SelectAluminumFrameInfoById") public Result SelectAluminumFrameInfoById(String FrameBarcode) throws SQLException { // List<north_glass_buffer1> listAluminumFrame = homeMapper.SelectAluminumFrameInfoById(FrameBarcode); List<north_glass_buffer1> listAluminumFrame = jdbcConnections.SelectGlassByGlassIdOrderIdFrameIds("","",FrameBarcode); String flip=homeMapper.SelectFlipByFrameBarcode(FrameBarcode); String flip=jdbcConnections.SelectFlipByFrameBarcode(FrameBarcode); for (north_glass_buffer1 north_glass_buffer1 : listAluminumFrame) { north_glass_buffer1.setstorageCage(homeMapper.SelectStorageGlassById(north_glass_buffer1.getbarcode())); north_glass_buffer1.setOut_slice(homeMapper.SelectQueueByglassid(north_glass_buffer1.getbarcode())); @@ -312,8 +286,6 @@ return Result.success(map); } // 查询出片队列数据 @PostMapping("/SelectProductionqueue") public Result SelectProductionqueue() throws SQLException { @@ -324,7 +296,9 @@ } Map<String, Object> maps = new HashMap<>(); maps.put("listoutslice", listoutslice); // Plchome.isAllowQueue=false; return Result.success(maps); } // 根据玻璃id删除出片队列玻璃 @@ -336,7 +310,7 @@ return Result.success(map); } // //添加出片 @PostMapping("/AddOutSliceS") public Result AddOutSliceS(@RequestBody String[][] AluminumFrames ) { for (String[] item : AluminumFrames) { @@ -344,7 +318,15 @@ homeMapper.AddOutSliceS(item[0],item[2],item[3],item[4],item[5]); } } System.out.println(AluminumFrames); Map<String, Object> map = new HashMap<>(); map.put("message", "200"); return Result.success(map); } //修改出片队列状态 @PostMapping("/isAllowQueues") public Result isAllowQueues(Boolean isAllowQueue) { Plchome.isAllowQueue=isAllowQueue; Map<String, Object> map = new HashMap<>(); map.put("message", "200"); return Result.success(map); springboot-vue3/src/main/java/com/example/springboot/entity/Out_slice.java
@@ -78,7 +78,7 @@ this.glassId = glassId; } public void setBarCode(String barCode) { public void setBarCode(String barCode) { barcode = barCode; } springboot-vue3/src/main/java/com/example/springboot/entity/Queue.java
New file @@ -0,0 +1,113 @@ package com.example.springboot.entity; public class Queue { private int id; private String glassId; private String orderId; private String listId; private String boxId; private double glasswidth; private double glassheight; private double glasswidthmm; private double glassheightmm; private int type; private int state; private String time; public int getid() { return id; } public void setid(int id) { this.id = id; } public String getglassId() { return glassId; } public void setglassId(String glassId) { this.glassId = glassId; } public String getorderId() { return orderId; } public void setorderId(String orderId) { this.orderId = orderId; } public String getlistId() { return listId; } public void setlistId(String listId) { this.listId = listId; } public String getboxId() { return boxId; } public void setboxId(String boxId) { this.boxId = boxId; } public double getglasswidth() { return glasswidth; } public void setglasswidth(double glasswidth) { this.glasswidth = glasswidth; } public double getglassheight() { return glassheight; } public void setglassheight(double glassheight) { this.glassheight = glassheight; } public double getglasswidthmm() { return glasswidthmm; } public void setglasswidthmm(double glasswidthmm) { this.glasswidthmm = glasswidthmm; } public double getglassheightmm() { return glassheightmm; } public void setglassheightmm(double glassheightmm) { this.glassheightmm = glassheightmm; } public int gettype() { return type; } public void settype(int type) { this.type = type; } public int getstate() { return state; } public void setstate(int state) { this.state = state; } public String gettime() { return time; } public void settime(String time) { this.time = time; } } springboot-vue3/src/main/java/com/example/springboot/entity/StorageCage.java
@@ -1,7 +1,5 @@ package com.example.springboot.entity; public class StorageCage { private Integer id; private Integer prcId; @@ -11,20 +9,21 @@ private Double width; private Double glasswidth; private Double glassheight; private Double glasswidthmm; private Double glassheightmm; private String state; private Integer tier; private String orderId; private Integer disabled; private String lengthWidth; private String listno; private String boxno; private String listId; private String boxId; private north_glass_buffer1 north_glass_buffer1s; public void setnorth_glass_buffer1s(north_glass_buffer1 north_glass_buffer1s) { this.north_glass_buffer1s = north_glass_buffer1s; } public north_glass_buffer1 getnorth_glass_buffer1s() { return north_glass_buffer1s; } @@ -34,7 +33,7 @@ public void setout_slice(Out_slice outSlice) { this.outSlice = outSlice; } public Out_slice getout_slice() { return outSlice; } @@ -50,6 +49,7 @@ public Integer getId() { return id; } public Integer getPrcId() { return prcId; } @@ -57,7 +57,6 @@ public void setPrcId(Integer prcId) { this.prcId = prcId; } public String getGlassId() { return glassId; @@ -131,6 +130,22 @@ this.glassheight = glassheight; } public Double getGlassWidthMm() { return glasswidthmm; } public void setGlassWidthMm(Double glasswidthmm) { this.glasswidthmm = glasswidthmm; } public Double getGlassHeightMm() { return glassheightmm; } public void setGlassHeightMm(Double glassheightmm) { this.glassheightmm = glassheightmm; } public Integer getDisabled() { return disabled; } @@ -139,29 +154,20 @@ this.disabled = disabled; } public String getLengthWidth() { return lengthWidth; public String getListId() { return listId; } public void setLengthWidth(String lengthWidth) { this.lengthWidth = lengthWidth; public void setListno(String listId) { this.listId = listId; } public String getListno() { return listno; public String getBoxId() { return boxId; } public void setListno(String listno) { this.listno = listno; public void setBoxno(String boxId) { this.boxId = boxId; } public String getBoxno() { return boxno; } public void setBoxno(String boxno) { this.boxno = boxno; } } springboot-vue3/src/main/java/com/example/springboot/entity/north_glass_buffer1.java
@@ -102,7 +102,7 @@ } public Double getglassheightmm() { return glasslengthmm; return glassheightmm; } public void setglassheightmm(Double glassheightmm) { this.glassheightmm = glassheightmm; springboot-vue3/src/main/java/com/example/springboot/entity/out_slice.java
@@ -78,7 +78,7 @@ this.glassId = glassId; } public void setBarCode(String barCode) { public void setBarCode(String barCode) { barcode = barCode; } springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -3,11 +3,11 @@ import org.apache.ibatis.annotations.*; import com.example.springboot.entity.CarPosition; import com.example.springboot.entity.Glass; import com.example.springboot.entity.StorageCage; import com.example.springboot.entity.alarmmg; import com.example.springboot.entity.north_glass_buffer1; import com.example.springboot.entity.Out_slice; import com.example.springboot.entity.Queue; import java.util.List; @@ -34,7 +34,7 @@ List<StorageCage> selectRack4(); // 根据任务类型查询当前正在出片,进片的玻璃信息 @Select("select *,concat(glasswidth,' x ',glassheight) as lengthwidth from storage_cage where state=#{task_type}") @Select("select * from storage_cage where state=#{task_type}") List<StorageCage> selectinout(@Param("task_type") Integer task_type); // 查询是否存在此订单 @@ -98,8 +98,8 @@ void Disabled(short cage, short cell, short disabled); //理片笼新增玻璃 @Update("update storage_cage set state=1,glass_id=#{glass.barcode},order_id=#{glass.ordernumber},glasswidth=#{glass.glasslengthmm},glassheight=#{glass.glassheightmm} where cage=#{cage} and cell=#{cell} and tier=#{tier}") void Inglassid(north_glass_buffer1 glass, short cage, short cell, short tier); @Update("update storage_cage set state=1,glass_id=#{glass.glassId},order_id=#{glass.orderId},glasswidth=#{glass.glasswidth},glassheight=#{glass.glassheight},glasswidthmm=#{glass.glasswidthmm},glassheightmm=#{glass.glassheightmm},listid=#{glass.listId},boxid=#{glass.boxId} where cage=#{cage} and cell=#{cell} and tier=#{tier}") void Inglassid(Queue glass, short cage, short cell, short tier); //查询理片笼中是否有此玻璃 @Select("select count(*) from storage_cage where glass_id=#{glassId}") @@ -110,12 +110,12 @@ List<north_glass_buffer1> SelectGlass(String orderid); //获取上片队列信息 @Select("select glassid from queue where id=#{id}") String GetQueueInfo(int id); @Select("select * from queue where id=#{id}") Queue GetQueueInfo(int id); //手动添加扫码位玻璃 @Select("update queue set glassid=#{glassid},state=1 where id=#{id}") void InsertQueueGlassId(String glassid,Short id); @Select("update queue set glassid=#{queue.glassId},orderid=#{queue.orderId},listId=#{queue.listId},boxId=#{queue.boxId},glasswidth=#{queue.glasswidth},glassheight=#{queue.glassheight},glasswidthmm=#{queue.glasswidthmm},glassheightmm=#{queue.glassheightmm},state=1 where id=#{id}") void InsertQueueGlassId(Queue queue,Short id); //确认扫码位玻璃信息 @Select("update queue set state=1 where id=1") @@ -150,20 +150,14 @@ @Select("select * from north_glass_buffer1 where FrameBarcode=#{FrameBarcode}") List<north_glass_buffer1> SelectAluminumFrameInfoById(String FrameBarcode); //查询根据id查询 @Select("select b.* from storage_cage a inner join out_slice b on a.glass_id=b.glassId where b.glassId=#{glassId}") List<Out_slice> SelectOutSliceById(String glassId); //查询玻璃id是否 @Select("select Flip from north_glass_buffer1_frames where Barcode=#{frameBarcode} limit 1") String SelectFlipByFrameBarcode(String frameBarcode); //查询玻璃是否已存在于出片队列 @Select("select * from out_slice where glassid=#{getbarcode} and (state=0 or state=1)") Out_slice SelectQueueByglassid(String getbarcode); //查询玻璃是否已存在于出片队列 //添加出片队列 @Select("INSERT INTO out_slice( `glassId`, `barcode`, `glasswidth`, `glassheight`, `state`, `flip`) VALUES ( #{glassid}, #{FrameNo}, #{glasslengthMm}, #{glassheightMm}, 0, #{flip});") void AddOutSliceS(String glassid, String flip, String FrameNo, String glasslengthMm, String glassheightMm); } springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java
@@ -11,6 +11,7 @@ import org.springframework.stereotype.Component; import com.example.springboot.entity.Glass; import com.example.springboot.entity.Queue; import com.example.springboot.entity.north_glass_buffer1; @Component public class JdbcConnections { @@ -69,12 +70,41 @@ // conn.close(); return north_glass_buffer1s; } //根据玻璃id,订单id,铝框id查询客户玻璃信息 public Queue SelectGlassByGlassIdOrderIdFrameIdQueue(String glassid,String orderid,String frameid) throws SQLException { conn = getConn(); Queue queue=new Queue(); String sql = "select * from north_glass_buffer1 where barcode=? or ordernumber=? or FrameBarcode=?"; ps = conn.prepareStatement(sql); ps.setString(1, glassid); ps.setString(2, orderid); ps.setString(3, frameid); rs= ps.executeQuery(); while (rs.next()) { queue.setid(rs.getInt("Id")); queue.setorderId(rs.getString("ordernumber")); queue.setlistId(rs.getString("listnumber")); queue.setboxId(rs.getString("boxnumber")); queue.setglassId(rs.getString("barcode")); queue.setglasswidthmm(rs.getDouble("glasslength")); queue.setglassheightmm(rs.getDouble("glassheight")); queue.setglasswidth(rs.getDouble("glasslength_mm")); queue.setglassheight(rs.getDouble("glassheight_mm")); // queue.setitemtype(rs.getString("itemtype")); // queue.setslotnumber(rs.getString("slotnumber")); // queue.setdatemodified(rs.getString("datemodified")); // queue.setdatecreated(rs.getString("datecreated")); // queue.setFrameBarcode(rs.getString("FrameBarcode")); } // conn.close(); return queue; } public List<north_glass_buffer1> SelectGlassByGlassIdOrderIdFrameIds(String glassid,String orderid,String frameid) throws SQLException { conn = getConn(); // north_glass_buffer1 glass=new north_glass_buffer1(); List<north_glass_buffer1> glass=new ArrayList<north_glass_buffer1>(); String sql = "select * from north_glass_buffer1 where barcode=? or ordernumber=? or FrameBarcode=?"; String sql = "select * from north_glass_buffer1 where position(? in barcode) and position(? in ordernumber) and position(? in FrameBarcode)"; ps = conn.prepareStatement(sql); ps.setString(1, glassid); ps.setString(2, orderid); @@ -105,6 +135,23 @@ // conn.close(); return glass; } public String SelectFlipByFrameBarcode(String frameBarcode) throws SQLException { conn = getConn(); // north_glass_buffer1 glass=new north_glass_buffer1(); String flip=""; String sql1 = "select * from north_glass_buffer1_frames where Barcode=? limit 1"; ps = conn.prepareStatement(sql1); ps.setString(1, frameBarcode); rs= ps.executeQuery(); while (rs.next()) { flip=rs.getString("Flip"); } // conn.close(); return flip; } /** * 1. 加载驱动 @@ -138,4 +185,5 @@ } }