clll
2023-09-13 716ad435a943659416f7678897eceaa637150056
Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

# Conflicts:
# CanadaMes-ui/src/lang/locales/en-US.json
# CanadaMes-ui/src/lang/locales/zh-CN.json
# springboot-vue3/src/main/resources/sql/canadames.sql

补充缺少的语言转换
16个文件已修改
2个文件已添加
1321 ■■■■■ 已修改文件
CanadaMes-ui/src/img/dipan.png 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/img/taimian.png 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/en-US.json 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/zh-CN.json 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/layout/index.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/main.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Action.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/home/index.vue 229 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/power/index.vue 183 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/user/index.vue 152 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java 565 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/resources/application.properties 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/img/dipan.png
CanadaMes-ui/src/img/taimian.png
CanadaMes-ui/src/lang/locales/en-US.json
@@ -204,5 +204,76 @@
  "alarmid": "id",
  "alacontent": "content",
  "time-on": "time-on",
  "End-Time": "End-Time"
  "End-Time": "End-Time",
  "langRegisterSuccessMessage": "Registration successful",
  "添加用户成功":"Successfully add user ",
  "confirmResetPassword": "Are you sure you want to reset the password to the default value?",
  "confirm": "Confirm",
  "cancel": "Cancel",
  "passwordResetSuccess": "Password has been reset to the default value",
  "confirmDeleteCategory": "This operation will permanently delete the category. Do you want to continue?",
  "prompt": "Prompt",
  "userDeleteSuccess": "User deleted successfully",
  "deleteCanceled": "Deletion canceled",
  "addUserSuccess": "User added successfully",
  "editUserSuccess": "User edited successfully",
  "addSuccessMessage": "Added successfully",
"deleteConfirmMessage": "Are you sure you want to delete this permission?",
"confirmButtonText": "Confirm",
"cancelButtonText": "Cancel",
"deleteSuccessMessage": "Deleted successfully",
"deleteCancelledMessage": "Deletion cancelled",
  "Enter the glass lD":"Enter the glass lD",
  "Manually feed the glass":"Manually feed the glass",
  "Enter the order number":"Enter the order number",
  "Exit the glass by order number":"Exit the glass by order number",
  "Please confirm the glass information":"Please confirm the glass information",
  "Please confirm the Ordering Information":"Please confirm the Ordering Information",
  "Alarm Information":"Alarm Information",
  "Cage Details":"Cage Details",
  "order":"order",
  "length":"length",
  "width":"width",
  "coating":"coating",
  "Operate":"Operate",
  "end task":"end task",
  "cancal":"cancal",
  "confirm":"confirm",
  "number":"number",
  "Coming out glass ID":"Coming out glass ID",
  "Incoming glass ID":"Incoming glass ID",
  "The Cage number being used":"The Cage number being used",
  "The Grille number being used":"The Grille number being used",
  "Order Nmuber":"Order Nmuber",
  "Length and width":"Length and width",
  "id":"id",
  "content":"content",
  "timeon":"timeon",
  "endTime":"endTime",
  "The Cage number":"The Cage number",
  "tier":"tier",
  "cell":"cell",
  "glassid":"glassid",
  "order number":"order number",
  "delete":"delete",
  "out":"out",
  "Operation successful":"Operation successful",
  "Operation canceled":"Operation canceled",
  "There is no glass for this order":"There is no glass for this order",
  "There are currently tasks":"There are currently tasks",
  "There is no such glass":"There is no such glass",
  "There is no such grid":"There is no such grid",
  "No delete allowed":"No delete allowed",
  "No out allowed":"No out allowed",
  "Are you sure to perform this operation ?":"Are you sure to perform this operation ?",
  "prompt":"prompt",
  "Yes":"Yes",
  "No":"No"
}
CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -196,6 +196,80 @@
  "langResetButton": "重置",
  "langCancelButton": "取消",
  "langRegisterSuccessMessage": "注册成功",
  "添加用户成功":"添加用户成功",
  "confirmResetPassword": "确认重置密码为默认值吗?",
  "confirm": "确定",
  "cancel": "取消",
  "passwordResetSuccess": "密码已重置为默认值",
  "confirmDeleteCategory": "此操作将永久删除该分类, 是否继续?",
  "prompt": "提示",
  "userDeleteSuccess": "删除用户成功",
  "deleteCanceled": "已取消删除",
  "addUserSuccess": "添加用户成功",
  "editUserSuccess": "修改用户成功",
  "effective": "有效",
"invalid": "无效",
"addSuccessMessage": "添加成功",
"deleteConfirmMessage": "确定要删除该权限吗?",
"confirmButtonText": "确定",
"cancelButtonText": "取消",
"deleteSuccessMessage": "删除成功",
"deleteCancelledMessage": "已取消删除操作",
  "Enter the glass lD":"输入玻璃id",
  "Manually feed the glass":"手动上片",
  "Enter the order number":"输入订单号",
  "Exit the glass by order number":"按订单出片",
  "Please confirm the glass information":"请确认玻璃信息",
  "Please confirm the Ordering Information":"请确认订单信息",
  "Alarm Information":"报警信息",
  "Cage Details":"理片笼详情",
  "order":"订单",
  "length":"长",
  "width":"宽",
  "coating":"涂层",
  "Operate":"操作",
  "end task":"完成任务",
  "cancal":"取消",
  "confirm":"确认",
  "number":"数量",
  "Coming out glass ID":"进片玻璃id",
  "Incoming glass ID":"出片玻璃id",
  "The Cage number being used":"笼子",
  "The Grille number being used":"格子",
  "Order Nmuber":"订单编号",
  "Length and width":"尺寸",
  "id":"id",
  "content":"内容",
  "timeon":"报警时间",
  "endTime":"结束时间",
  "The Cage number":"笼子",
  "tier":"层",
  "cell":"格子",
  "glassid":"玻璃id",
  "order number":"订单",
  "delete":"删除",
  "out":"出片",
  "Operation successful":"操作成功",
  "Operation canceled":"操作取消",
  "There is no such order":"没有此订单的玻璃",
  "There are currently tasks":"当前有任务",
  "There is no such glass":"没有此玻璃",
  "There is no such grid":"没有空闲格子",
  "No delete allowed":"不能删除",
  "No out allowed":"不能出片",
  "Are you sure to perform this operation ?":"确定执行此操作?",
  "prompt":"提示",
  "Yes":"是",
  "No":"否",
  "today": "今天",
  "yesterday": "昨天",
  "week": "一周前",
CanadaMes-ui/src/layout/index.vue
@@ -207,12 +207,14 @@
        '报警信息': 'AlarmInformation',
        '参数下发': 'ParameterSetting',
        '开关控制': 'SwitchControl',
        'I/O状态': 'I/O Status',
        'IO状态': 'Sign',
        '权限管理': 'PermissionManagement',
        '权限列表': 'PermissionList',
        '角色管理': 'RoleManagement',
        '角色列表': 'RoleList',
        '电气管理': 'Electrical management',
        '设备状态':'State',
        '主页': 'Home'
        // 根据实际需求继续添加对照关系
      };
CanadaMes-ui/src/main.js
@@ -2,6 +2,8 @@
import App from './App.vue'
import router from './router'
import ElementUI, {Message, MessageBox} from 'element-ui';
import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import 'element-ui/lib/theme-chalk/index.css';
// 导入全局样式表
import './assets/css/global.css'
@@ -23,7 +25,7 @@
const EventBus = new Vue();
Vue.prototype.$bus = EventBus;
Vue.use(ElementUI);
Vue.use(ElementUI,{locale});
Vue.config.productionTip = false;
CanadaMes-ui/src/views/Electrical/Action.vue
@@ -36,7 +36,7 @@
    return {
      activeButton: '',
      record: {
        params: [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        params: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        canshu: [
          'D01 VFD conveyor',
          'D02 VFD conveyor',
@@ -68,7 +68,7 @@
        xyData: [
          { name: 'D01 VFD conveyor', value: "0" },
          { name: 'D02 VFD conveyor', value: "0" },
          { name: 'D03 VFD conveyor', value: "1" },
          { name: 'D03 VFD conveyor', value: "0" },
          { name: 'D04 VFD conveyor', value: "0" },
          { name: 'D05 VFD conveyor', value: "0" },
          { name: 'D06 VFD conveyor', value: "0" },
CanadaMes-ui/src/views/home/index.vue
@@ -91,11 +91,36 @@
    background-size: 46px 94px;
    background-attachment: local;
    width: 32px;
    position: absolute;
    /* left: 116px; */
    /* left:1060px;18.88px */
    background-image: url('../../img/bigcar01.png');
}
.blocks-img2 {
    height: 100px;
    max-width: 100vw;
    background-repeat: no-repeat;
    background-size: 85px 100px;
    background-attachment: local;
    width: 100px;
    position: absolute;
    /* left: 116px; */
    /* left:1060px;18.88px */
    background-image: url('../../img/dipan.png');
}
.blocks-img3 {
    height: 90px;
    max-width: 100vw;
    background-repeat: no-repeat;
    background-size: 160px 40px;
    background-attachment: local;
    width: 160px;
    position: absolute;
    /* left: 116px; */
    /* left:1060px;18.88px */
    background-image: url('../../img/taimian.png');
}
.el-table td,
@@ -151,37 +176,37 @@
                </div>
            </div>
            <div style="display:flex;justify-content: space-around;width: 95%;margin: 0 auto;">
                <el-input style="width:15%;" placeholder="Enter the glass lD" v-model="glassid"></el-input>
                <el-button type="primary" @click="showform()">Manually feed the glass</el-button>
                <el-input style="width:15%;" placeholder="Enter the order number" v-model="order"></el-input>
                <el-button type="warning" @click="showform1();">Exit the glass by order number</el-button>
                <el-input style="width:15%;" :placeholder="$t('Enter the glass lD')" v-model="glassid"></el-input>
                <el-button type="primary" @click="showform()">{{ $t('Manually feed the glass') }}</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>
            <div>
                <el-table :data="this.tasklist1" border style="width: 100%">
                    <el-table-column prop="glassId" label="Coming out glass ID"></el-table-column>
                    <el-table-column :width="250" prop="cell" label="The Grille number being used"></el-table-column>
                    <el-table-column prop="orderId" label="Order Nmuber"></el-table-column>
                    <el-table-column prop="lengthWidth" label="Length and width"></el-table-column>
                    <el-table-column prop="coating" label="coating"></el-table-column>
                    <el-table-column label="Operate">
                    <el-table-column prop="glassId" :label="$t('Coming out glass ID')"></el-table-column>
                    <el-table-column :width="250" prop="cage" :label="$t('The Cage number being used')"></el-table-column>
                    <el-table-column :width="250" prop="cell" :label="$t('The Grille number being used')"></el-table-column>
                    <el-table-column prop="orderId" :label="$t('Order Nmuber')"></el-table-column>
                    <el-table-column prop="lengthWidth" :label="$t('Length and width')"></el-table-column>
                    <el-table-column prop="coating" :label="$t('coating')"></el-table-column>
                    <el-table-column :label="$t('Operate')">
                        <template slot-scope='scope'>
                            <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                                @click="endtask(0, scope.row.glassId, scope.row.cell)">end
                                task</el-button>
                                @click="endtask(0, scope.row.glassId, scope.row.cell)">{{ $t('end task') }}</el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <el-table :data="this.tasklist2" border style="width: 100%">
                    <el-table-column prop="glassId" label="Incoming glass ID"></el-table-column>
                    <el-table-column :width="250" prop="cell" label="The Grille number being used"></el-table-column>
                    <el-table-column prop="orderId" label="Order Nmuber"></el-table-column>
                    <el-table-column prop="lengthWidth" label="Length and width"></el-table-column>
                    <el-table-column prop="coating" label="coating"></el-table-column>
                    <el-table-column label="Operate">
                    <el-table-column prop="glassId" :label="$t('Incoming glass ID')"></el-table-column>
                    <el-table-column :width="250" prop="cage" :label="$t('The Cage number being used')"></el-table-column>
                    <el-table-column :width="250" prop="cell" :label="$t('The Grille number being used')"></el-table-column>
                    <el-table-column prop="orderId" :label="$t('Order Nmuber')"></el-table-column>
                    <el-table-column prop="lengthWidth" :label="$t('Length and width')"></el-table-column>
                    <el-table-column prop="coating" :label="$t('coating')"></el-table-column>
                    <el-table-column :label="$t('Operate')">
                        <template slot-scope='scope'>
                            <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                                @click="endtask(1, scope.row.glassId, scope.row.cell)">end
                                task</el-button>
                                @click="endtask(1, scope.row.glassId, scope.row.cell)">{{ $t('end task') }}</el-button>
                        </template>
                    </el-table-column>
                </el-table>
@@ -219,70 +244,73 @@
                </div>
                <div class="blocks-img" :style="{ left: car1 + 'px', top: '16px' }"></div>
                <div class="blocks-img" :style="{ left: car2 + 'px', top: '194px' }"></div>
                <div class="blocks-img2" :style="{ left: '912px', top: '366px' }"></div>
                <div class="blocks-img3" :style="{ left: '875px', top: '455px' }"></div>
            </div>
        </el-footer>
        <el-dialog :visible.sync="dialogFormVisible" title="Please confirm the information">
        <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="order">
                <el-form-item :label="$t('order')">
                    <el-input v-model="form.orderno" autocomplete="off" />
                </el-form-item>
                <el-form-item label="length">
                <el-form-item :label="$t('length')">
                    <el-input v-model="form.length" autocomplete="off" />
                </el-form-item>
                <el-form-item label="width">
                <el-form-item :label="$t('width')">
                    <el-input v-model="form.width" autocomplete="off" />
                </el-form-item>
                <el-form-item label="coating">
                <el-form-item :label="$t('coating')">
                    <el-input v-model="form.coating" autocomplete="off" />
                </el-form-item>
            </el-form>
            <template #footer>
                <span class="dialog-footer">
                    <el-button @click="cancal()">cancal</el-button>
                    <el-button @click="sbumitglassid()" type="primary">confirm</el-button>
                    <el-button @click="cancal()">{{ $t('cancal') }}</el-button>
                    <el-button @click="sbumitglassid()" type="primary">{{ $t('confirm') }}</el-button>
                </span>
            </template>
        </el-dialog>
        <el-dialog :visible.sync="dialogFormVisible1" title="Ordering Information">
        <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="order">
                <el-form-item :label="$t('order')">
                    <el-input v-model="form1.order" autocomplete="off" />
                </el-form-item>
                <el-form-item label="number">
                <el-form-item :label="$t('number')">
                    <el-input v-model="form1.number" autocomplete="off" />
                </el-form-item>
            </el-form>
            <template #footer>
                <span class="dialog-footer">
                    <el-button @click="cancal1()">cancal</el-button>
                    <el-button @click="getOrder();" type="primary">confirm</el-button>
                    <el-button @click="cancal1()">{{ $t('cancal') }}</el-button>
                    <el-button @click="getOrder();" type="primary">{{ $t('confirm') }}</el-button>
                </span>
            </template>
        </el-dialog>
        <el-dialog :visible.sync="dialogFormVisible2" title="Ordering Information">
        <el-dialog :visible.sync="dialogFormVisible2" :title="$t('Alarm Information')">
            <el-table :data="this.alarm" border style="width: 100%;">
                <el-table-column prop="id" label="id"></el-table-column>
                <el-table-column prop="content" label="content"></el-table-column>
                <el-table-column prop="timeons" label="timeon"></el-table-column>
                <el-table-column prop="endTime" label="endTime"></el-table-column>
                <el-table-column prop="id" :label="$t('id')"></el-table-column>
                <el-table-column prop="content" :label="$t('content')"></el-table-column>
                <el-table-column prop="timeons" :label="$t('timeon')"></el-table-column>
                <el-table-column prop="endTime" :label="$t('endTime')"></el-table-column>
            </el-table>
        </el-dialog>
        <el-dialog :visible.sync="dialogFormVisible3" title="Cage Details">
            <el-table :data="this.cageinfo" border style="width: 100%;height: 700px;overflow: auto;">
                <el-table-column :width="150" prop="cage" label="the grille number"></el-table-column>
                <el-table-column prop="cell" label="cell"></el-table-column>
                <el-table-column prop="tier" label="tier"></el-table-column>
                <el-table-column prop="glassId" label="glassid"></el-table-column>
                <el-table-column :width="130" prop="orderId" label="order number"></el-table-column>
                <el-table-column :width="150" prop="lengthWidth" label="length and width"></el-table-column>
                <el-table-column prop="coating" label="coating"></el-table-column>
                <el-table-column :width="150" label="operate">
        <el-dialog :visible.sync="dialogFormVisible3" :title="$t('Cage Details')">
            <el-table :data="this.cageinfo" :height="700" border style="width: 100%;overflow: auto;">
                <el-table-column :width="150" prop="cage" :label="$t('The Cage number')"></el-table-column>
                <el-table-column prop="cell" :label="$t('cell')"></el-table-column>
                <el-table-column prop="tier" :label="$t('tier')"></el-table-column>
                <el-table-column prop="glassId" :label="$t('glassid')"></el-table-column>
                <el-table-column :width="130" prop="orderId" :label="$t('order number')"></el-table-column>
                <el-table-column :width="150" prop="lengthWidth" :label="$t('Length and width')"></el-table-column>
                <el-table-column prop="coating" :label="$t('coating')"></el-table-column>
                <el-table-column :width="140" :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)">delete</el-button>
                            @click="deleteglass(scope.row.glassId, scope.row.state)">{{ $t('delete') }}</el-button>
                        <!-- <el-button type="primary" style="padding: 4px 10px;font-size: 12px;" @click="open">{{ $t('delete')
                        }}</el-button> -->
                        <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                            @click="outglass(scope.row.glassId, scope.row.state)">out</el-button>
                            @click="outglass(scope.row.glassId, scope.row.state)">{{ $t('out') }}</el-button>
                    </template>
                </el-table-column>
            </el-table>
@@ -442,9 +470,11 @@
            if (this.form1.order != "") {
                InsertOrder(this.order).then(res => {
                    if (res.data.message == 200) {
                        this.$message.success("Operation successful");
                        this.dialogFormVisible1 = false;
                        this.$message.success(this.$t('Operation successful'));
                    } else {
                        this.$message.success("There is no such order");
                        this.$message.success(this.$t('There is no glass for this order'));
                    }
                    this.load();
                });
@@ -456,16 +486,16 @@
            if (this.form.order != "") {
                Addglassid(this.glassid).then(res => {
                    if (res.data.message2 == 200) {
                        this.$message.success("Operation successful");
                        this.$message.success(this.$t('Operation successful'));
                        this.cancal();
                    } else if(res.data.message2 == 500) {
                        this.$message.success("There are currently tasks");
                    } else if (res.data.message2 == 500) {
                        this.$message.success(this.$t('There are currently tasks'));
                    }
                    else if(res.data.message2 == 300) {
                        this.$message.success("There is no such grid");
                    else if (res.data.message2 == 300) {
                        this.$message.success(this.$t('There is no such glass'));
                    }
                    else if(res.data.message2 == 400) {
                        this.$message.success("There is no such grid");
                    else if (res.data.message2 == 400) {
                        this.$message.success(this.$t('There is no such grid'));
                    }
                });
            }
@@ -503,11 +533,23 @@
            this.form1 = {};
        },
        endtask(type, glassid, cell) {
            UpdateTask(type, glassid, cell).then(res => {
                if (res.data.message3 == 200) {
                    this.$message.success("Operation successful");
                }
            this.$confirm(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
                confirmButtonText: this.$t('Yes'),
                cancelButtonText: this.$t('No'),
                type: 'warning'
            }).then(() => {
                UpdateTask(type, glassid, cell).then(res => {
                    if (res.data.message3 == 200) {
                        this.$message.success(this.$t('Operation successful'));
                    }
                });
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: this.$t('Operation canceled')
                });
            });
        },
        showcageinfo(cage) {
            this.cage = cage;
@@ -517,31 +559,52 @@
            });
        },
        deleteglass(glassid, state) {
            if (state == 1) {
                DeleteByGlassID(glassid).then(res => {
                    if (res.data.message3 == 200) {
                        this.$message.success("Operation successful");
                    }
            this.$confirm(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
                confirmButtonText: this.$t('Yes'),
                cancelButtonText: this.$t('No'),
                type: 'warning'
            }).then(() => {
                if (state == 1) {
                    DeleteByGlassID(glassid).then(res => {
                        if (res.data.message3 == 200) {
                            this.$message.success(this.$t('Operation successful'));
                        }
                    });
                } else {
                    this.$message.success(this.$t('No delete allowed'));
                }
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: this.$t('Operation canceled')
                });
            } else {
                this.$message.success("No out allowed");
            }
            });
        },
        outglass(glassid, state) {
            if (state == 1) {
                OutByGlassID(glassid).then(res => {
                    if (res.data.message3 == 200) {
                        this.$message.success("Operation successful");
                    }
            this.$confirm(this.$t('Are you sure to perform this operation ?'), this.$t('prompt'), {
                confirmButtonText: this.$t('Yes'),
                cancelButtonText: this.$t('No'),
                type: 'warning'
            }).then(() => {
                if (state == 1) {
                    OutByGlassID(glassid).then(res => {
                        if (res.data.message3 == 200) {
                            this.$message.success(this.$t('Operation successful'));
                        }
                    });
                } else {
                    this.$message.success(this.$t('No out allowed'));
                }
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: this.$t('Operation canceled')
                });
            } else {
                this.$message.success("No out allowed");
            }
            });
        }
    }
}
</script>
CanadaMes-ui/src/views/power/index.vue
@@ -201,100 +201,101 @@
    this.getPowerList();
  },
  methods: {
    getPowerList() {
      selectPage(this.queryInfo).then(res => {
        this.powerList.total = res.data.total;
        this.powerList.records = res.data.records;
  getPowerList() {
    selectPage(this.queryInfo).then(res => {
      this.powerList.total = res.data.total;
      this.powerList.records = res.data.records;
    });
  },
  // 监听pageSize改变的事件
  handleSizeChange(newSize) {
    this.queryInfo.pageSize = newSize;
    this.getPowerList()
  },
  // 监听pageNum改变的事件
  handleCurrentChange(newPage) {
    this.queryInfo.pageNum = newPage;
    this.getPowerList()
  },
  stateChange(info) {
    saveOrUpdate(info).then(() => {
      this.$message.success(this.$t('updateSuccessMessage'))
    });
  },
  // 监听添加权限对话框的关闭事件
  addDialogClosed() {
    this.$refs['powerRef'].resetFields();
  },
  // 点击按钮添加新权限
  addPower() {
    this.$refs.powerRef.validate(async valid => {
      if (!valid) return;
      // 发起添加权限的网络请求
      saveOrUpdate(this.addPowerForm).then(() => {
        // 重新获取权限列表
        this.getPowerList();
        // 隐藏添加权限对话框
        this.addDialogVisible = false;
        this.$message.success(this.$t('addSuccessMessage'));
      });
    },
    // 监听pageSize改变的事件
    handleSizeChange(newSize) {
      this.queryInfo.pageSize = newSize;
      this.getPowerList()
    },
    // 监听pageNum改变的事件
    handleCurrentChange(newPage) {
      this.queryInfo.pageNum = newPage;
      this.getPowerList()
    },
    stateChange(info) {
      saveOrUpdate(info).then(() => {
        this.$message.success("更新状态成功")
    })
  },
  // 展示修改权限的对话框
  showEditDialog(role) {
    getById({id: role.id}).then(res => {
      this.editRoleForm = res.data;
    });
    select(this.addPowerForm).then(res => {
      this.roleList = res.data;
    });
    selectPermission(this.addPowerForm).then(res => {
      this.permissionList = res.data;
    });
    this.editDialogVisible = true;
  },
  // 展示添加权限的对话框
  showAddDialog() {
    select(this.addPowerForm).then(res => {
      this.roleList = res.data;
    });
    selectPermission(this.addPowerForm).then(res => {
      this.permissionList = res.data;
    });
    this.addDialogVisible = true;
  },
  // 修改权限信息并提交
  editRoleInfo() {
    this.$refs.powerRef.validate(async valid => {
      if (!valid) return;
      // 发起修改权限的网络请求
      saveOrUpdate(this.editRoleForm).then(() => {
        // 重新获取权限列表
        this.getPowerList();
        // 隐藏添加权限对话框
        this.editDialogVisible = false;
        this.$message.success(this.$t('updateSuccessMessage'));
      });
    },
    // 监听添加权限对话框的关闭事件
    addDialogClosed() {
      this.$refs['powerRef'].resetFields();
    },
    // 点击按钮添加新权限
    addPower() {
      this.$refs.powerRef.validate(async valid => {
        if (!valid) return;
        // 发起添加权限的网络请求
        saveOrUpdate(this.addPowerForm).then(() => {
          // 重新获取权限列表
          this.getPowerList();
          // 隐藏添加权限对话框
          this.addDialogVisible = false;
          this.$message.success("添加权限成功");
        });
      })
    },
    // 展示修改权限的对话框
    showEditDialog(role) {
      getById({id: role.id}).then(res => {
        this.editRoleForm = res.data;
    })
  },
  // 根据id删除权限信息
  removeById(power) {
    // 弹框询问用户是否删除权限
    this.$confirm(this.$t('deleteConfirmMessage'), this.$t('prompt'), {
      confirmButtonText: this.$t('confirmButtonText'),
      cancelButtonText: this.$t('cancelButtonText'),
      type: 'warning'
    }).then(() => {
      // 删除权限
      removeById({id: power.id}).then(() => {
        // 重新获取权限列表
        this.getPowerList();
        this.$message.success(this.$t('deleteSuccessMessage'));
      });
      select(this.addPowerForm).then(res => {
        this.roleList = res.data;
      });
      selectPermission(this.addPowerForm).then(res => {
        this.permissionList = res.data;
      });
      this.editDialogVisible = true;
    },
    // 展示添加权限的对话框
    showAddDialog() {
      select(this.addPowerForm).then(res => {
        this.roleList = res.data;
      });
      selectPermission(this.addPowerForm).then(res => {
        this.permissionList = res.data;
      });
      this.addDialogVisible = true;
    },
    // 修改权限信息并提交
    editRoleInfo() {
      this.$refs.powerRef.validate(async valid => {
        if (!valid) return;
        // 发起修改权限的网络请求
        saveOrUpdate(this.editRoleForm).then(() => {
          // 重新获取权限列表
          this.getPowerList();
          // 隐藏添加权限对话框
          this.editDialogVisible = false;
          this.$message.success("修改权限成功");
        });
      })
    },
    // 根据id删除权限信息
    removeById(power) {
      // 弹框询问用户是否删除权限
      this.$confirm('此操作将永久删除该权限, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        // 删除权限
        removeById({id: power.id}).then(() => {
          // 重新获取权限列表
          this.getPowerList();
          this.$message.success("删除权限成功");
        });
      }).catch(() => {
        this.$message.info('已取消删除');
      })
    }
    }).catch(() => {
      this.$message.info(this.$t('deleteCancelledMessage'));
    })
  }
  }
}
</script>
CanadaMes-ui/src/views/user/index.vue
@@ -40,7 +40,7 @@
            </el-switch>
          </template>
        </el-table-column>
        <el-table-column label="操作">
        <el-table-column :label="$t('langOperation')">
          <template slot-scope="scope">
            <el-button type="primary" icon="el-icon-refresh" @click="resetPassword(scope.row)">
@@ -241,84 +241,84 @@
      });
    },
    resetPassword (info) {
      this.$confirm('确认重置密码为默认值吗?', '重置密码', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      })
        .then(() => {
          resetPass(info).then(() => {
            this.$message.success('密码已重置为默认值');
          });
        })
        .catch(() => {
          // 用户取消重置密码操作
        });
    },
    showEditDialog (id) {
      getById({ id: id }).then(res => {
        this.editUserForm = res.data;
        this.editDialogVisible = true;
  this.$confirm(this.$t('confirmResetPassword'), this.$t('resetPassword'), {
    confirmButtonText: this.$t('confirm'),
    cancelButtonText: this.$t('cancel'),
    type: 'warning',
  })
    .then(() => {
      resetPass(info).then(() => {
        this.$message.success(this.$t('passwordResetSuccess'));
      });
    })
    .catch(() => {
      // 用户取消重置密码操作
    });
},
showEditDialog (id) {
  getById({ id: id }).then(res => {
    this.editUserForm = res.data;
    this.editDialogVisible = true;
  });
  select().then(res => {
    this.roleList = res.data;
  });
},
removeUserById (user) {
  // 弹框询问用户是否删除分类
  this.$confirm(this.$t('confirmDeleteCategory'), this.$t('prompt'), {
    confirmButtonText: this.$t('confirm'),
    cancelButtonText: this.$t('cancel'),
    type: 'warning'
  }).then(() => {
    removeById({ id: user.id }).then(() => {
      // 重新获取分类列表
      this.getUserList();
      this.$message.success(this.$t('userDeleteSuccess'));
    });
  }).catch(() => {
    this.$message.info(this.$t('deleteCanceled'));
  });
},
handleSizeChange (newSize) {
  this.queryInfo.pageSize = newSize;
  this.getUserList()
},
handleCurrentChange (newPage) {
  this.queryInfo.pageNum = newPage;
  this.getUserList()
},
addDialogClosed () {
  this.$refs['addUserRef'].resetFields();
},
addUser () {
  this.$refs.addUserRef.validate(async valid => {
    if (!valid) return;
    saveOrUpdate(this.addUserForm).then(() => {
      const successMessage = this.$t('addUserSuccess');
      this.$message.success(successMessage);
      // 隐藏添加分类对话框
      this.addDialogVisible = false;
      // 重新获取分类列表
      this.getUserList();
    });
  })
},
editUserInfo () {
  this.$refs.addCategoryRef.validate(async valid => {
    if (!valid) return;
      select().then(res => {
        this.roleList = res.data;
      });
    },
    removeUserById (user) {
      // 弹框询问用户是否删除分类
      this.$confirm('此操作将永久删除该分类, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        removeById({ id: user.id }).then(() => {
          // 重新获取分类列表
          this.getUserList();
          this.$message.success("删除用户成功");
        });
      }).catch(() => {
        this.$message.info('已取消删除');
      });
    },
    handleSizeChange (newSize) {
      this.queryInfo.pageSize = newSize;
      this.getUserList()
    },
    handleCurrentChange (newPage) {
      this.queryInfo.pageNum = newPage;
      this.getUserList()
    },
    addDialogClosed () {
      this.$refs['addUserRef'].resetFields();
    },
    addUser () {
      this.$refs.addUserRef.validate(async valid => {
        if (!valid) return;
        saveOrUpdate(this.addUserForm).then(() => {
          this.$message.success("添加用户成功");
          // 隐藏添加分类对话框
          this.addDialogVisible = false;
          // 重新获取分类列表
          this.getUserList();
        });
      })
    },
    editUserInfo () {
      this.$refs.addCategoryRef.validate(async valid => {
        if (!valid) return;
        saveOrUpdate(this.editUserForm).then(() => {
          const 修改用户成功 = this.$t('修改用户成功');
          this.$message.success(修改用户成功);
          // 隐藏添加分类对话框
          this.editDialogVisible = false;
          // 重新获取分类列表
          this.getUserList();
        });
      })
    }
    saveOrUpdate(this.editUserForm).then(() => {
      const successMessage = this.$t('editUserSuccess');
      this.$message.success(successMessage);
      // 隐藏添加分类对话框
      this.editDialogVisible = false;
      // 重新获取分类列表
      this.getUserList();
    });
  })
}
  }
}
</script>
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -41,6 +41,7 @@
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
    
      //判断进片请求 
       List<Short> datas1List=S7control.getinstance().ReadWord("DB106.24", 1);
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java
@@ -15,11 +15,11 @@
                e.printStackTrace();
            }
            List<Short> paramlist = S7control.getinstance().ReadWord("DB100.DBW", 12);
            List<Short> arraylist = S7control.getinstance().ReadWord("DB100.DBW0", 12);
            List<Short> state = S7control.getinstance().ReadWord("DB103.DBW0", 10);
            JSONObject jsonObject = new JSONObject();
//            new short[]{1111,121, 3232, 0, 1, 0, 1, 0, 1, 0, 1, 0}
            jsonObject.append("params",paramlist );
            jsonObject.append("params",  arraylist );
            jsonObject.append("state", state);
            WebSocketServer sendwServer = WebSocketServer.sessionMap.get("Parameter");
            if (sendwServer != null) {
springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java
@@ -21,8 +21,8 @@
//      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("DB100.DBW", 12);
//      Boolean[] values = {false, true,false, true,false, true,false, true,false, true,false, true,false, true,false, true,false, true,false, true,false, true};
 List<Boolean> paramlist = S7control.getinstance().ReadBits("DB2.DBX0.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) {
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -17,7 +17,7 @@
    public void run() {
        while (this != null) {
            try {
                Thread.sleep(10000);
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
@@ -22,7 +22,7 @@
     List<StorageCage> selectAll(Short orderids);
     //判断该笼子是否有合适宽度空格
     @Select("select cage,cell,tier,id,ROUND(id/2)as prcId from storage_cage where cage=#{cage1} and state=0 and width>=#{width} ORDER BY cell,tier LIMIT 1")
     @Select("select cage,cell,tier,id,ROUND(id/2)as prcId from storage_cage where cage=#{cage1} and state=0 and width>=#{width} ORDER BY cell asc,tier desc LIMIT 1")
     StorageCage selectCage1(int  cage1,double width);
     //判断笼子内玻璃数
     @Select("select COUNT(tier)as tier from storage_cage where  cage=#{cage} and cell=#{cell} and state=1;")
@@ -54,16 +54,24 @@
     StorageCage selectGlassCage(int cage,double width,int cage1,int cage2);
    //删除笼子信息(出片)
    @Update("update storage_cage set state=#{state},width=width+#{width},glass_id=#{glassid},order_id=#{orderid},glasswidth=0 where cage=#{cage} and cell=#{cell} and tier=#{tier};")
    @Update("update storage_cage set state=#{state},glass_id=#{glassid},order_id=#{orderid},glasswidth=0 where cage=#{cage} and cell=#{cell} and tier=#{tier};")
    void UpdataGlassCage(String orderid,String glassid,double width,int cage,int cell,int tier,int state);
    //修改笼子信息(进片)
    @Update("update storage_cage set state=#{state},width=width-#{width},glass_id=#{glassid},order_id=#{orderid},glasswidth=#{width} where id=#{id};")
    @Update("update storage_cage set state=#{state},glass_id=#{glassid},order_id=#{orderid},glasswidth=#{width} where id=#{id};")
    void UpdataAddCage(Short orderid,Short glassid,double width,int cage,int cell,int id,int state);
    //修改同笼子格子宽度
     @Update("update storage_cage set width=width-#{width} where   cage=#{cage} and cell=#{cell};")
    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);
    //调拨更换笼子信息
    @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.glasswidth=b.glasswidth,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.width=a.width-b.glasswidth,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);
}
springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java
@@ -67,4 +67,6 @@
            e.printStackTrace();
        }
    }
}
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
@@ -14,300 +14,323 @@
@Service
public class SpianService {
    @Autowired
    private SpianMapper spianMapper;
  @Autowired
  private SpianMapper spianMapper;
    // @GetMapping("/all2")
    public Result selectout(String orderid) {
        // 定义PRC数据传送数组
        List<String> adddresslist = new ArrayList<>();
        adddresslist.add("DB105.6");// 出片车起始位置
        adddresslist.add("DB105.8");// 出片车目标位置
        adddresslist.add("DB105.10");// 出片笼玻璃数
        adddresslist.add("DB105.14");// 出片车启动 1为启动
        List<Short> datas = new ArrayList<>();
        // 获取优先出片的位置
        StorageCage cageout = spianMapper.selectOut(orderid);
        int cage = cageout.getCage(); // 储存出片位置,笼子格子几号玻璃
        int cell = cageout.getCell();// 出片格号
        int tier = cageout.getTier();// 出片内外片
        int prcid = cageout.getPrcId();// prcid
        int prcid2;
        int ids;
        double glasswidth = cageout.getGlassWidth();
        // 判断玻璃内外片
        if (tier == 2) {
            // 判断玻璃可直接出片时
            // 修改数据库笼子表(出片)
            spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, tier, 0);
  // @GetMapping("/all2")
  public Result selectout(String orderid) {
    // 定义PRC数据传送数组
    List<String> adddresslist = new ArrayList<>();
    adddresslist.add("DB105.6");// 出片车起始位置
    adddresslist.add("DB105.8");// 出片车目标位置
    adddresslist.add("DB105.10");// 出片笼玻璃数
    adddresslist.add("DB105.14");// 出片车启动 1为启动
    List<Short> datas = new ArrayList<>();
    // 获取优先出片的位置
    StorageCage cageout = spianMapper.selectOut(orderid);
    int cage = cageout.getCage(); // 储存出片位置,笼子格子几号玻璃
    int cell = cageout.getCell();// 出片格号
    int tier = cageout.getTier();// 出片内外片
    int prcid = cageout.getPrcId();// prcid
    int prcid2;
    int ids;
    int cages;
    int cells;
    double glasswidth = cageout.getGlassWidth();
    // 判断玻璃内外片
    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);
        } else {
            // 获取格子的玻璃数量
            int state = spianMapper.selectGlassState(cage, cell);
            // 判断内片是否需要调拨
            if (state == 0) {
                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("状态为0,直接出片");
            } else {
                // 玻璃需要调拨时,判断属于哪个半区的笼子
                if (cage < 6) {
                    StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 0, 6);
                    if (cagecell == null) {
                        return Result.success(cagecell);
                    }
                    // 获取调拨位置进行调拨
                    prcid2 = cagecell.getPrcId();// 调拨目标位PRCID
                    ids = cagecell.getId();// 调拨目标位ID
                    // 更换玻璃的笼子
                    spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里
                    spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除原格子数据
                    // 填入调拨数据
                    datas.add((short) prcid);// 调拨外片起始位置
                    datas.add((short) prcid2);
                    datas.add((short) 2);
                    datas.add((short) 1);
                    // 传输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);
                    // 修改数据库笼子表(出片)
      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);
    } else {
      // 获取格子的玻璃数量
      int state = spianMapper.selectGlassState(cage, cell);
      // 判断内片是否需要调拨
      if (state == 0) {
        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("状态为0,直接出片");
      } else {
        // 玻璃需要调拨时,判断属于哪个半区的笼子
        if (cage < 6) {
          StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 0, 6);
          if (cagecell == null) {
            return Result.success(cagecell);
          }
          // 获取调拨位置进行调拨
          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);
          // 传输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); // 调拨位置的参数内容
          return Result.success(cagecell); // 调拨位置的参数内容
                } else {// 笼子号大于5时
                    StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 5, 11);
                    if (cagecell == null) {
                        return Result.success(cagecell);
                    }
                    // 获取调拨位置进行调拨
                    prcid2 = cagecell.getPrcId();// 调拨目标位prcID
                    ids = cagecell.getId();// 调拨目标位ID
                    // 填入调拨数据
                    datas.add((short) prcid);
                    datas.add((short) prcid2);
                    datas.add((short) 2);
                    datas.add((short) 1);
                    // 转移原调拨格子数据
                    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); // 调拨位置的参数内容
        } else {// 笼子号大于5时
          StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 5, 11);
          if (cagecell == null) {
            return Result.success(cagecell);
          }
          // 获取调拨位置进行调拨
          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.UpdataAddCage1(glasswidth, cages, cells);// 减少新格子宽度
          spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里
          spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除原格子数据
          spianMapper.UpdataOutCage(glasswidth, cage, cell);// 增加原格子宽度
          // 传输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); // 调拨位置的参数内容
                }
            }
        }
      }
    }
    // @GetMapping("/all")
    // 进片任务,传订单id
    // 按订单优先进片
    public Short selectAll(Short glassid) {
  }
        int cage1;
        int cells;
        int ids;
        int prcid;
        int tiers;
        int prctier;
  // @GetMapping("/all")
  // 进片任务,传订单id
  // 按订单优先进片
  public Short selectAll(Short glassid) {
        Glass glasslist = spianMapper.selectGlass(glassid);
        if (glasslist == null) {
            return (300);
    int cage1;
    int cells;
    int ids;
    int prcid;
    int tiers;
    int prctier;
    Glass glasslist = spianMapper.selectGlass(glassid);
    if (glasslist == null) {
      return (300);
    }
    double widths = glasslist.getWidth();
    Short orderids = glasslist.getOrderId();
    List<String> adddresslist = new ArrayList<>();
    adddresslist.add("DB105.0");// 进片车起始位置
    adddresslist.add("DB105.2");// 进片车目标位置
    adddresslist.add("DB105.4");// 进片笼玻璃数
    adddresslist.add("DB105.12");// 进片车启动 1为启动
    List<Short> datas = new ArrayList<>();
    // String orderid="A001";
    // 获取订单相关度最高的笼子排序
    List<StorageCage> storageCage = spianMapper.selectAll(orderids);
    if (storageCage == null) {
      return (400);
    }
    for (StorageCage storageCage2 : storageCage) {
      // 保存订单优先顺序笼子号
      cage1 = storageCage2.getCage();
      // 判断该笼子号相邻最大的空格数
      int cages = spianMapper.selectCage(cage1);
      // 判断选中笼子是否有合适宽度空格
      StorageCage cages1 = spianMapper.selectCage1(cage1, widths);
      if (cages1 != null) {
        ids = cages1.getId();// 数据库ID
        tiers = cages1.getTier();// 内外片
        cells = cages1.getCell();// 格子号
        prcid = cages1.getPrcId();// 传给prc的目标地id
        prctier = spianMapper.selectsum(cage1, cells);// 传给prc的格子内玻璃数
        // 有合适空格时进片
        if (cages > 1 && cages1.getTier() != null) {
          // 执行进片
          datas.add((short) 1000);
          datas.add((short) prcid);
          datas.add((short) prctier);
          datas.add((short) 1);
          // 数据库修改笼子表新增一条玻璃
          spianMapper.UpdataAddCage(orderids, glassid, widths, cage1, cells, ids, 1);
          spianMapper.UpdataAddCage1(widths, cage1, cells);// 减少格子宽度
          S7control.getinstance().WriteWord(adddresslist, datas);
          return (200);
        }
        double widths = glasslist.getWidth();
        Short orderids = glasslist.getOrderId();
        List<String> adddresslist = new ArrayList<>();
        adddresslist.add("DB105.0");// 进片车起始位置
        adddresslist.add("DB105.2");// 进片车目标位置
        adddresslist.add("DB105.4");// 进片笼玻璃数
        adddresslist.add("DB105.12");// 进片车启动 1为启动
        List<Short> datas = new ArrayList<>();
        // String orderid="A001";
        // 获取订单相关度最高的笼子排序
        List<StorageCage> storageCage = spianMapper.selectAll(orderids);
        if (storageCage == null) {
            return (400);
        }
        for (StorageCage storageCage2 : storageCage) {
            // 保存订单优先顺序笼子号
            cage1 = storageCage2.getCage();
            // 判断该笼子号相邻最大的空格数
            int cages = spianMapper.selectCage(cage1);
            // 判断选中笼子是否有合适宽度空格
            StorageCage cages1 = spianMapper.selectCage1(cage1, widths);
            if (cages1 != null) {
                ids = cages1.getId();// 数据库ID
                tiers = cages1.getTier();// 内外片
                cells = cages1.getCell();// 格子号
                prcid = cages1.getPrcId();// 传给prc的目标地id
                prctier = spianMapper.selectsum(cage1, cells);// 传给prc的格子内玻璃数
                // 有合适空格时进片
                if (cages > 1 && cages1.getTier() != null) {
                    // 执行进片
                    datas.add((short) 1000);
                    datas.add((short) prcid);
                    datas.add((short) prctier);
                    datas.add((short) 1);
                    // 数据库修改笼子表新增一条玻璃
                    spianMapper.UpdataAddCage(orderids, glassid, widths, cage1, cells, ids, 1);
                    S7control.getinstance().WriteWord(adddresslist, datas);
                    return (200);
                }
            }
        }
        return (300);
      }
    }
    return (400);
    // @GetMapping("/all2")
    public Result selectout2(String glassid) {
        // 定义PRC数据传送数组
        List<String> adddresslist = new ArrayList<>();
        adddresslist.add("DB105.6");// 出片车起始位置
        adddresslist.add("DB105.8");// 出片车目标位置
        adddresslist.add("DB105.10");// 出片笼玻璃数
        adddresslist.add("DB105.14");// 出片车启动 1为启动
        List<Short> datas = new ArrayList<>();
        // 获取优先出片的位置
        StorageCage cageout = spianMapper.selectOut2(glassid);
        int cage = cageout.getCage(); // 储存出片位置,笼子格子几号玻璃
        int cell = cageout.getCell();// 出片格号
        int tier = cageout.getTier();// 出片内外片
        int prcid = cageout.getPrcId();// prcid
        int prcid2;
        int ids;
        double glasswidth = cageout.getGlassWidth();
        // 判断玻璃内外片
        if (tier == 2) {
            // 判断玻璃可直接出片时
            // 修改数据库笼子表(出片)
            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);
        } else {
            // 获取格子的玻璃数量
            int state = spianMapper.selectGlassState(cage, cell);
            // 判断内片是否需要调拨
            if (state == 0) {
                return Result.success("状态为0,直接出片");
            } else {
                // 玻璃需要调拨时,判断属于哪个半区的笼子
                if (cage < 6) {
                    StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 0, 6);
                    if (cagecell == null) {
                        return Result.success(cagecell);
                    }
                    // 获取调拨位置进行调拨
                    prcid2 = cagecell.getPrcId();// 调拨目标位PRCID
                    ids = cagecell.getId();// 调拨目标位ID
                    // 更换玻璃的笼子
                    spianMapper.UpdateDBCage(ids, cage, cell);// 将原格子数据更新到新格子里
                    spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除原格子数据
                    // 填入调拨数据
                    datas.add((short) prcid);// 调拨外片起始位置
                    datas.add((short) prcid2);
                    datas.add((short) 2);
                    datas.add((short) 1);
                    // 传输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);
                    // 修改数据库笼子表(出片)
  // @GetMapping("/all2")
  public Result selectout2(String glassid) {
    // 定义PRC数据传送数组
    List<String> adddresslist = new ArrayList<>();
    adddresslist.add("DB105.6");// 出片车起始位置
    adddresslist.add("DB105.8");// 出片车目标位置
    adddresslist.add("DB105.10");// 出片笼玻璃数
    adddresslist.add("DB105.14");// 出片车启动 1为启动
    List<Short> datas = new ArrayList<>();
    // 获取优先出片的位置
    StorageCage cageout = spianMapper.selectOut2(glassid);
    int cage = cageout.getCage(); // 储存出片位置,笼子格子几号玻璃
    int cell = cageout.getCell();// 出片格号
    int tier = cageout.getTier();// 出片内外片
    int prcid = cageout.getPrcId();// prcid
    int prcid2;
    int ids;
    int cages;
    int cells;
    double glasswidth = cageout.getGlassWidth();
    // 判断玻璃内外片
    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);
    } else {
      // 获取格子的玻璃数量
      int state = spianMapper.selectGlassState(cage, cell);
      // 判断内片是否需要调拨
      if (state == 0) {
        return Result.success("状态为0,直接出片");
      } else {
        // 玻璃需要调拨时,判断属于哪个半区的笼子
        if (cage < 6) {
          StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 0, 6);
          if (cagecell == null) {
            return Result.success(cagecell);
          }
          // 获取调拨位置进行调拨
          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);
          // 传输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); // 调拨位置的参数内容
          return Result.success(cagecell); // 调拨位置的参数内容
                } else {// 笼子号大于5时
                    StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 5, 11);
                    if (cagecell == null) {
                        return Result.success(cagecell);
                    }
                    // 获取调拨位置进行调拨
                    prcid2 = cagecell.getPrcId();// 调拨目标位prcID
                    ids = cagecell.getId();// 调拨目标位ID
                    // 填入调拨数据
                    datas.add((short) prcid);
                    datas.add((short) prcid2);
                    datas.add((short) 2);
                    datas.add((short) 1);
                    // 转移原调拨格子数据
                    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); // 调拨位置的参数内容
        } else {// 笼子号大于5时
          StorageCage cagecell = spianMapper.selectGlassCage(cage, glasswidth, 5, 11);
          if (cagecell == null) {
            return Result.success(cagecell);
          }
          // 获取调拨位置进行调拨
          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.UpdataAddCage1(glasswidth, cages, cells);// 减少新格子宽度
          spianMapper.UpdataGlassCage("", "", glasswidth, cage, cell, 2, 0);// 清除原格子数据
          spianMapper.UpdataOutCage(glasswidth, cage, cell);// 增加原格子宽度
          // 传输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); // 调拨位置的参数内容
            }
        }
      }
    }
    /*** 修改用户* @throws SQLException */
    // public static int updateUser(Glass user) throws SQLException {conn =
    // getConn();
    // String sql = "update t_user set name=?,gender=?,age=?,score=?"+ " where
    // id=?";ps = conn.prepareStatement(sql);
    // ps.setString(1, user.getName());ps.setString(2, user.getGender());
    // ps.setInt(3, user.getAge());ps.setDouble(4, user.getScore());ps.setInt(5,
    // user.getId());return ps.executeUpdate();}
    // /*** 增加用户* @throws SQLException */
    // public static int insertUser(User user) throws SQLException {
    // conn = getConn();
    // String sql = "insert into t_user(name,gender,age,score)"+ " values(?,?,?,?)";
    // ps = conn.prepareStatement(sql);ps.setString(1,
    // user.getName());ps.setString(2, user.getGender());
    // ps.setInt(3, user.getAge());ps.setDouble(4, user.getScore());return
    // ps.executeUpdate();
    // }
  }
  /*** 修改用户* @throws SQLException */
  // public static int updateUser(Glass user) throws SQLException {conn =
  // getConn();
  // String sql = "update t_user set name=?,gender=?,age=?,score=?"+ " where
  // id=?";ps = conn.prepareStatement(sql);
  // ps.setString(1, user.getName());ps.setString(2, user.getGender());
  // ps.setInt(3, user.getAge());ps.setDouble(4, user.getScore());ps.setInt(5,
  // user.getId());return ps.executeUpdate();}
  // /*** 增加用户* @throws SQLException */
  // public static int insertUser(User user) throws SQLException {
  // conn = getConn();
  // String sql = "insert into t_user(name,gender,age,score)"+ " values(?,?,?,?)";
  // ps = conn.prepareStatement(sql);ps.setString(1,
  // user.getName());ps.setString(2, user.getGender());
  // ps.setInt(3, user.getAge());ps.setDouble(4, user.getScore());return
  // ps.executeUpdate();
  // }
}
springboot-vue3/src/main/resources/application.properties
@@ -12,7 +12,7 @@
#\u6570\u636E\u5E93\u7528\u6237\u5BC6\u7801
spring.datasource.password=beibo.123/
#\u6620\u5C04\u6587\u4EF6\u7684\u4F4D\u7F6E
mybatis-plus.mapper-locations=classpath:com/example/springboot/dao/*Dao.xml
mybatis-plus.mapper-locations=classpath:com/example/springboot/mapper/*Mapper.xml
#\u7C7B\u578B\u522B\u540D
mybatis-plus.type-aliases-package=com.example.springboot.entity
#\u914D\u7F6Esql\u6253\u5370