From 68d56160c32384f8d939df0bd25bdc9c50b042b9 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期一, 30 十月 2023 11:08:04 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes
---
CanadaMes-ui/src/views/home/index.vue | 193 ++++++++++++++++++++++++++++++++++++--
CanadaMes-ui/src/api/home.js | 8 +
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java | 4
CanadaMes-ui/src/lang/locales/en-US.json | 6 +
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java | 53 ++++++---
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java | 9 +
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java | 10 ++
CanadaMes-ui/src/lang/locales/zh-CN.json | 6 +
8 files changed, 256 insertions(+), 33 deletions(-)
diff --git a/CanadaMes-ui/src/api/home.js b/CanadaMes-ui/src/api/home.js
index 5f8aaad..7658487 100644
--- a/CanadaMes-ui/src/api/home.js
+++ b/CanadaMes-ui/src/api/home.js
@@ -131,3 +131,11 @@
data:""
})
}
+
+export function InsertQueueGlassId(glassid) {
+ return request({
+ url: '/home/InsertQueueGlassId?glassid=' + glassid,
+ method: 'post',
+ data: ""
+ })
+}
\ No newline at end of file
diff --git a/CanadaMes-ui/src/lang/locales/en-US.json b/CanadaMes-ui/src/lang/locales/en-US.json
index 994ccc2..0769742 100644
--- a/CanadaMes-ui/src/lang/locales/en-US.json
+++ b/CanadaMes-ui/src/lang/locales/en-US.json
@@ -292,6 +292,10 @@
"Enter the Order lD":"Enter the Order lD",
"OrderInfo":"OrderInfo",
"Query":"Query",
- "permission update":"permission update"
+ "permission update":"permission update",
+ "query was successful":"query was successful",
+ "Scan Code Point":"Scan Code Point",
+ "Upper film position":"Upper film position",
+ "Glass Information":"Glass Information"
}
\ No newline at end of file
diff --git a/CanadaMes-ui/src/lang/locales/zh-CN.json b/CanadaMes-ui/src/lang/locales/zh-CN.json
index 20c1032..767e722 100644
--- a/CanadaMes-ui/src/lang/locales/zh-CN.json
+++ b/CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -295,6 +295,10 @@
"Enter the Order lD":"璇疯緭鍏ヨ鍗昳d",
"OrderInfo":"璁㈠崟淇℃伅",
"Query":"鏌ヨ",
- "permission update":"鏉冮檺缂栬緫"
+ "permission update":"鏉冮檺缂栬緫",
+ "query was successful":"鏌ヨ鎴愬姛",
+ "Scan Code Point":"鎵爜浣�",
+ "Upper film position":"涓婄墖浣�",
+ "Glass Information":"鐜荤拑淇℃伅"
}
\ No newline at end of file
diff --git a/CanadaMes-ui/src/views/home/index.vue b/CanadaMes-ui/src/views/home/index.vue
index ec6e292..7012203 100644
--- a/CanadaMes-ui/src/views/home/index.vue
+++ b/CanadaMes-ui/src/views/home/index.vue
@@ -194,8 +194,8 @@
</div>
</div>
<div style="display:flex;justify-content: space-around;width: 95%;margin: 0 auto;">
- <el-input style="width:15%;" :placeholder="$t('Enter the glass lD')" v-model="glassid"></el-input>
- <el-button type="primary" @click="showform(1)">{{ $t('Infeed barcodid') }}</el-button>
+ <el-input style="width:15%;" :placeholder="$t('Enter the glass lD')" v-model="glassid1"></el-input>
+ <el-button type="primary" @click="SelectGlassByGlassIDs()">{{ $t('Infeed barcodid') }}</el-button>
<el-input style="width:15%;" :placeholder="$t('Enter the order number')" v-model="order"></el-input>
<el-button type="warning" @click="showform1();">{{ $t('Exit the glass by order number') }}</el-button>
</div>
@@ -304,7 +304,6 @@
</el-footer>
<el-dialog :visible.sync="dialogFormVisible" :title="$t('Please confirm the glass information')">
<el-form :model="form" label-width="100px" style="padding-right: 30px">
-
<el-form-item :label="$t('Barcodid')">
<el-input style="width:15%;" :placeholder="$t('Enter the glass lD')" v-model="glassid"></el-input>
<el-button type="primary" @click="showform(3)">{{ $t('Query') }}</el-button>
@@ -334,6 +333,75 @@
</span>
</template>
</el-dialog>
+
+ <el-dialog :visible.sync="dialogFormVisible5" :title="$t('Please confirm the glass information')">
+ <el-form :model="form" label-width="100px" style="padding-right: 30px">
+ <el-form-item style="text-align: center;">
+ <el-input style="width:15%;" :placeholder="$t('Enter the glass lD')" v-model="glassid1"></el-input>
+ <el-button type="primary" @click="SelectGlassByGlassIDs()">{{ $t('Query') }}</el-button>
+ </el-form-item>
+ <div style="display: flex;justify-content: space-around;height: 40px;">
+ <label for="">{{ $t('Scan Code Point') }}</label>
+ <label for="">{{ $t('Upper film position') }}</label>
+ <label for="">{{ $t('Glass Information') }}</label>
+ </div>
+ <div style="display: flex;justify-content: space-around;">
+ <el-form-item :label="$t('Barcodid')">
+ <el-input v-model="form2.glassId" readonly autocomplete="off" />
+ </el-form-item>
+ <el-form-item :label="$t('Barcodid')">
+ <el-input v-model="form3.glassId" readonly autocomplete="off" />
+ </el-form-item>
+ <el-form-item :label="$t('Barcodid')">
+ <el-input v-model="form4.glassId" readonly autocomplete="off" />
+ </el-form-item>
+ </div>
+ <div style="display: flex;justify-content: space-around;">
+ <el-form-item :label="$t('order')">
+ <el-input v-model="form2.orderId" readonly autocomplete="off" />
+ </el-form-item>
+ <el-form-item :label="$t('order')">
+ <el-input v-model="form3.orderId" readonly autocomplete="off" />
+ </el-form-item>
+ <el-form-item :label="$t('order')">
+ <el-input v-model="form4.orderId" 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.height" readonly autocomplete="off" />
+ </el-form-item>
+ <el-form-item :label="$t('length')">
+ <el-input v-model="form3.height" readonly autocomplete="off" />
+ </el-form-item>
+ <el-form-item :label="$t('length')">
+ <el-input v-model="form4.height" 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.width" readonly autocomplete="off" />
+ </el-form-item>
+ <el-form-item :label="$t('width')">
+ <el-input v-model="form3.width" readonly autocomplete="off" />
+ </el-form-item>
+ <el-form-item :label="$t('width')">
+ <el-input v-model="form4.width" readonly autocomplete="off" />
+ </el-form-item>
+ </div>
+
+ </el-form>
+ <template #footer>
+ <span class="dialog-footer">
+ <el-button @click="InsertQueueGlass()" type="primary" :disabled="disabled">{{ $t('confirm')
+ }}</el-button>
+ <el-button @click="InsertQueueGlass()" type="primary" :disabled="disabled">{{ $t('confirm')
+ }}</el-button>
+ <el-button @click="cancel3()">{{ $t('cancel') }}</el-button>
+ </span>
+ </template>
+ </el-dialog>
+
<el-dialog :visible.sync="dialogFormVisible1" :title="$t('Please confirm the Ordering Information')">
<el-form :model="form1" label-width="100px" style="padding-right: 30px">
<el-form-item :label="$t('order')">
@@ -387,21 +455,46 @@
<el-dialog :visible.sync="dialogFormVisible4" :title="$t('OrderInfo')" top="5vh">
<el-input style="width:15%;" :placeholder="$t('Enter the Order lD')" v-model="orderid"></el-input>
<el-button type="primary" @click="selectglassinfo()">{{ $t('Query') }}</el-button>
- <el-table :data="this.GlassInfo" :height="700" border style="width: 100%;overflow: auto;">
-
+ <el-table :data="GlassInfo.slice((currentPage - 1) * pagesize, currentPage * pagesize)
+ " :height="700" border style="width: 100%;overflow: auto;">
<el-table-column prop="glassId" :label="$t('Barcodid')"></el-table-column>
<el-table-column prop="orderId" :label="$t('Order Number')"></el-table-column>
<el-table-column prop="width" :label="$t('length')"></el-table-column>
<el-table-column prop="height" :label="$t('width')"></el-table-column>
</el-table>
+
+
+ <!-- <el-table :data="tableDatas.slice((currentPage - 1) * pagesize, currentPage * pagesize)
+ " style="width: 100%">
+ <el-table-column label="Date" prop="date"> </el-table-column>
+ <el-table-column label="Name" prop="name"> </el-table-column>
+ <el-table-column label="鎿嶄綔">
+ <template slot-scope="scope">
+ <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">Edit</el-button>
+ <el-button size="mini" type="danger"
+ @click="handleDelete(scope.$index, scope.row)">Delete</el-button>
+ </template>
+ </el-table-column>
+ </el-table> -->
+
+ <!-- 琛ㄦ牸鍒嗛〉 -->
+ <!-- pager-count pager-count灞炴�у彲浠ヨ缃渶澶ч〉鐮佹寜閽暟,瓒呭嚭鎶樺彔,榛樿涓�7-->
+ <!-- 娉ㄦ剰锛氳嫢鏁版嵁鏄悗绔帴鍙h繑鍥炵殑鍒欐鏃�:total="pageCount"-->
+ <el-pagination :style="'margin-top:-2px'" @size-change="handleSizeChange" @current-change="handleCurrentChange"
+ :pager-count="7" :current-page="currentPage" :page-sizes="[5, 10, 15, 20]" :page-size="pagesize"
+ layout="total, sizes, prev, pager, next, jumper" :total="GlassInfo.length > 0 ? GlassInfo.length : null"
+ background style="float: right; margin-top: 20px">
+ </el-pagination>
+
+
</el-dialog>
</el-container>
</template>
<script>
//:disabled="scope.row.glassId > 0 || scope.row.disabled == 1 ? true : false"
import {
- home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo,
- SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist, SelectPassword, SelectGlassByGlassID, Disabled, Inglassid, SelectGlass
+ home, home2, loadtask, InsertOrder, Addglassid, UpdateTask, SelectAlarmmgInfo, SelectCageInfo, DeleteByGlassID, OutByGlassID, Loadcarlist,
+ SelectPassword, SelectGlassByGlassID, Disabled, Inglassid, SelectGlass, InsertQueueGlassId
} from "../../api/home";
@@ -423,6 +516,7 @@
dialogFormVisible2: false,
dialogFormVisible3: false,
dialogFormVisible4: false,
+ dialogFormVisible5: false,
form: {
orderId: "",
glassId: "",
@@ -432,6 +526,24 @@
form1: {
order: "NG2210210",
number: 800,
+ },
+ form2: {
+ orderId: "1145",
+ glassId: "112",
+ height: "59.06",
+ width: "48.03"
+ },
+ form3: {
+ orderId: "1",
+ glassId: "2",
+ height: "3",
+ width: "4"
+ },
+ form4: {
+ orderId: "",
+ glassId: "",
+ height: "",
+ width: ""
},
alarm: [],
tableData: [],
@@ -445,6 +557,7 @@
tasklist2: [],
order: "",
glassid: "",
+ glassid1: "",
url: "../../img/bigcar01.png",
car1: 145,
car2: 210,
@@ -458,7 +571,12 @@
text: "",
zhuangtai: "",
orderid: "",
- GlassInfo: []
+ GlassInfo: [],
+ disabled: true,
+ disabled1: true,
+ currentPage: 1, //榛樿鍒濆椤�
+ pagesize: 15, //姣忛〉榛樿鏄剧ず鐨勬暟鎹�
+ pageCount: 0
};
},
created() {
@@ -486,7 +604,6 @@
};
// 娴忚鍣ㄧ鏀舵秷鎭紝鑾峰緱浠庢湇鍔$鍙戦�佽繃鏉ョ殑鏂囨湰娑堟伅
socket.onmessage = function (msg) {
-
//console.log("鏀跺埌鏁版嵁====" + msg.data);
let obj = JSON.parse(msg.data);
if (obj.params != null) {
@@ -505,6 +622,15 @@
this.alarm = obj.alarmmg[0];
this.loadglassheight = obj.loadglassheight;
this.zhuangtai = obj.zhuangtai[0];
+
+ this.glassid1 = obj.queid[0];
+ if (this.glassid1 != "") {
+ this.disabled1=false;
+ this.showform3();
+ }
+ this.form2 = obj.form2;
+ this.form2 = obj.form3;
+
//if (obj.dbconnected == "false") {
this.text = this.$t('DataBase Connection failed');
// }
@@ -632,7 +758,7 @@
if (res.data.form != null) {
this.form = res.data.form;
this.dialogFormVisible = true;
- this.$message.success('query was successful');
+ this.$message.success(this.$t('query was successful'));
} else {
this.dialogFormVisible = true;
this.$message.error(this.$t('There is no such glass'));
@@ -649,6 +775,27 @@
};
this.dialogFormVisible1 = true;
}
+ },
+ //鏄剧ず鎵爜浣嶅拰涓婄墖浣�
+ showform3(){
+ this.dialogFormVisible5 = true;
+ },
+ //鑾峰彇鎵爜浣嶅拰涓婄墖浣嶆暟鎹�
+ SelectGlassByGlassIDs() {
+ this.showform3();
+ SelectGlassByGlassID(this.glassid1).then(res => {
+ if (res.data.form != null) {
+ this.form4 = res.data.form;
+ this.$message.success(this.$t('query was successful'));
+ } else {
+ this.$message.error(this.$t('There is no such glass'));
+ }
+ if (this.form2.glassId == "") {
+ this.disabled = false;
+ } else {
+ this.disabled = true;
+ }
+ });
},
selectglassinfo() {
SelectGlass(this.orderid).then(res => {
@@ -674,6 +821,10 @@
//鍙栨秷鎿嶄綔鏃跺叧闂〉闈�
cancel1() {
this.dialogFormVisible1 = false;
+ this.form1 = {};
+ },
+ cancel3() {
+ this.dialogFormVisible5 = false;
this.form1 = {};
},
//缁撴潫杩�/鍑虹墖浠诲姟
@@ -821,6 +972,28 @@
this.$message.success(this.$t('Operation successful'));
}
});
+ },
+ handleEdit(index, row) {
+ console.log(index, row);
+ },
+ //琛ㄦ牸鍒犻櫎
+ handleDelete(index, row) {
+ console.log(index, row);
+ },
+ //鏀瑰彉姣忛〉瀹圭撼鐨勬暟鎹噺
+ handleSizeChange: function (size) {
+ this.pagesize = size;
+ },
+ //鍒囨崲椤电爜
+ handleCurrentChange: function (currentPage) {
+ this.currentPage = currentPage;
+ },
+ InsertQueueGlass() {
+ InsertQueueGlassId(this.glassid1).then(res => {
+ if (res.data.message == 200) {
+ this.$message.success(this.$t('Operation successful'));
+ }
+ });
}
}
}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
index 34e8c89..06a6a0f 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -3,18 +3,26 @@
import cn.hutool.json.JSONObject;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import org.springframework.web.bind.annotation.PostMapping;
+import com.example.springboot.common.Result;
+import com.example.springboot.entity.Glass;
import com.example.springboot.entity.StorageCage;
import com.example.springboot.entity.alarmmg;
import com.example.springboot.mapper.HomeMapper;
+import com.example.springboot.mapper.SpianMapper;
import com.example.springboot.service.JdbcConnections;
public class Plchome extends Thread {
private HomeMapper homeMapper;
+ private SpianMapper spianMapper;
private JdbcConnections dbserve;
+
@Override
public void run() {
while (this != null) {
@@ -27,6 +35,7 @@
// 娉ㄥ叆mapper
homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class);
+ spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
// 绗煎瓙浣跨敤鎯呭喌
List<StorageCage> tableData = homeMapper.selectAll();
jsonObject.append("tableData", tableData);
@@ -36,7 +45,7 @@
List<StorageCage> cagelist3 = homeMapper.selectRack3();
List<StorageCage> cagelist4 = homeMapper.selectRack4();
jsonObject.append("cagelist1", cagelist1);
- jsonObject.append("cagelist2", (Object)cagelist2);
+ jsonObject.append("cagelist2", (Object) cagelist2);
jsonObject.append("cagelist3", cagelist3);
jsonObject.append("cagelist4", cagelist4);
// 杩涘嚭鐗囦换鍔�
@@ -51,11 +60,19 @@
List<String> addressList = new ArrayList<String>();
addressList.add("DB106.12");
addressList.add("DB106.0");
- List<Short> paramlist= S7control.getinstance().ReadWord(addressList);
+ List<Short> paramlist = S7control.getinstance().ReadWord(addressList);
// 鑾峰彇杩涚墖杞︾姸鎬�
List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", 1);// 鑾峰彇杩涚墖杞︾姸鎬�
boolean exist1 = datas1ListState.contains((short) 0);
- jsonObject.append("zhuangtai",exist1);
+ jsonObject.append("zhuangtai", exist1);
+ // 浼� 鑾峰彇杩涙槸鍚︽湁寰呯‘璁ょ殑鐜荤拑id
+ String queid = spianMapper.Selectqueueid();
+ jsonObject.append("queid", queid);
+ // 鑾峰彇鎵爜浣嶄笌涓婄墖浣嶇幓鐠冧俊鎭�
+ List<Glass> form2 = homeMapper.GetQueueInfo(1);
+ List<Glass> form3 = homeMapper.GetQueueInfo(2);
+ jsonObject.append("form2", form2);
+ jsonObject.append("form3", form3);
// List<Short> paramlists = new ArrayList<Short>();
// short para1 = 11111;
// short para2 = 32000;
@@ -63,26 +80,24 @@
// paramlists.add(para2);
// System.out.println(paramlists);
-
-
- if(paramlist!=null){
- jsonObject.append("params", paramlist);
+ if (paramlist != null) {
+ jsonObject.append("params", paramlist);
}
- List<Short> inglassInfo= S7control.getinstance().ReadWord("DB106.24",1);
- if(inglassInfo!=null){
- if(inglassInfo.size()>0)
- jsonObject.append("loadglassheight", inglassInfo.get(0)*70);
+ List<Short> inglassInfo = S7control.getinstance().ReadWord("DB106.24", 1);
+ if (inglassInfo != null) {
+ if (inglassInfo.size() > 0)
+ jsonObject.append("loadglassheight", inglassInfo.get(0) * 70);
}
- dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
- boolean dbconnected=false;
- try {
+ dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
+ boolean dbconnected = false;
+ try {
dbserve.getConn();
- dbconnected=true;
- } catch (Exception e) {
+ dbconnected = true;
+ } catch (Exception e) {
// TODO: handle exception
- dbconnected=false;
- }
- jsonObject.append("dbconnected", dbconnected);
+ dbconnected = false;
+ }
+ jsonObject.append("dbconnected", dbconnected);
// jsonObject.append("params", new short[] { 30, 40, });
WebSocketServer sendwServer = WebSocketServer.sessionMap.get("Home");
if (sendwServer != null) {
diff --git a/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java b/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
index 09563f5..5f6f1f4 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -216,4 +216,14 @@
map.put("glass", glass);
return Result.success(map);
}
+
+ //鎵嬪姩娣诲姞鎵爜浣嶇幓鐠�
+ @PostMapping("/InsertQueueGlassId")
+ public Result InsertQueueGlassId(String glassid) {
+ homeMapper.InsertQueueGlassId(glassid);
+ Map<String, Object> map = new HashMap<>();
+ map.put("message", "200");
+ return Result.success(map);
+ }
+
}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
index ddec941..c5e465f 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -107,7 +107,14 @@
@Select("select count(*) from storage_cage where glass_id=#{glassId}")
short SelectStorageByGlassId(String glassId);
- @Select("select * from glass where orderid=#{orderid}")
+ @Select("select * from glass where position(#{orderid} in orderid)")
List<Glass> SelectGlass(String orderid);
+
+ @Select("select * from queue qe inner join glass gl on qe.glassid=gl.glassid where id=#{id}")
+ List<Glass> GetQueueInfo(int id);
+
+ @Select("update queue set glassid=#{glassid},state=0,time=now() where id=1")
+ void InsertQueueGlassId(String glassid);
+
}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
index 03e840e..0ed5faa 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
@@ -132,6 +132,8 @@
//瀵绘壘鍙互澶氱墖鍑虹墖鐨勭幓鐠�
@Select("select cage,cell,ROUND(id/2)as prcId,width,count(glass_id)shu from storage_cage where order_id=#{orderid} and (cage!=#{cage} or cell!=#{cell}) GROUP BY cage,cell HAVING shu=1 ORDER BY cage desc,cell desc limit 1")
StorageCage SelectQueout(String orderid,int cage,int cell);
-
+ //鑾峰彇杩涚墖闃熷垪id
+ @Select("select glassid from queue where type=1 and state=0;")
+ String Selectqueueid();
}
\ No newline at end of file
--
Gitblit v1.8.0