wuyouming666
2024-01-26 3fdf3c82bc1ac5f5fdce0f841db7bdeacf75704c
Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes

# Conflicts:
# springboot-vue3/src/main/java/com/example/springboot/component/InitUtil.java
# springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
10个文件已修改
12个文件已添加
1155 ■■■■ 已修改文件
CanadaMes-ui/src/lang/locales/en-US.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/zh-CN.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/layout/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/home/index.vue 153 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java 191 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcRead.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterObject.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/resources/JsonFile/PlcMes.json 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/resources/JsonFile/PlcRead.json 195 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/resources/JsonFile/Plcframe.json 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/canadames/controller/device/DeviceController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/canadames/entity/device/DeviceEntity.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/canadames/mapper/device/DeviceDao.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/canadames/service/device/DeviceService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/canadames/service/device/impl/DeviceServiceImpl.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/device/DeviceEntityMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/en-US.json
@@ -1,6 +1,6 @@
{
  "Clear":"Clear",
  "ip":"localhost",
  "ip":"192.168.10.21",
  "systemTitle": "Login System",
  "usernamePlaceholder": "Please enter username",
  "passwordPlaceholder": "Please enter password",
CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -1,6 +1,6 @@
{
  "Clear":"清除",
  "ip":"localhost",
  "ip":"192.168.10.21",
  "systemTitle": "登录系统",
  "usernamePlaceholder": "请输入用户名",
  "passwordPlaceholder": "请输入密码",
CanadaMes-ui/src/layout/index.vue
@@ -310,10 +310,10 @@
        }
      }
    },
    //45秒复位倒数计时
    //60秒复位倒数计时
    CountDown() {
      clearInterval(timer);
      let count = 45;
      let count = 60;
      timer = setInterval(
        () => {
          if (this.EmergencyStop == true) {
CanadaMes-ui/src/views/home/index.vue
@@ -375,6 +375,17 @@
                <div class="device" :style="'top: 262px;left: 150px;background-color: ' + ShowDeviceList(8) + ';'">D05</div>
                <div class="device" :style="'top: 339px;left: 150px;background-color: ' + ShowDeviceList(9) + ';'">D06</div>
                <div class="device" :style="'top: 395px;left: 90px;background-color: ;'">E01</div>
                <div class="device" :style="'top: 395px;left: 243px;background-color: ;'">E02</div>
                <div class="device" :style="'top: 395px;left: 395px;background-color: ;'">E03</div>
                <div class="device" :style="'top: 345px;left: 655px;background-color: ;'">E04</div>
                <div class="device" :style="'top: 345px;left: 810px;background-color: ;'">E05</div>
                <div class="device" :style="'top: 345px;left: 960px;background-color: ;'">E06</div>
                <div class="device" :style="'top: 345px;left: 525px;background-color: ;'">J01</div>
                <div class="device" :style="'top: 345px;left: 1100px;background-color: ;'">F01</div>
                <div class="device" :style="'top: 275px;left: 1100px;background-color: ;'">G01</div>
                <div class="glass D01" style="top: 39px;left: 1055px;position: absolute;">{{ ShowGlassIdList(0) }}
                    <br />
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.9.2', 0)">
@@ -405,13 +416,13 @@
                <div class="glass A01" style="top: 315px;left: 289px;position: absolute;">A01.2:{{ ShowGlassIdList(5) }}
                    <br />
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.1,5', 5)">
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.0', 5)">
                        {{ $t('Clear') }}</el-button>
                </div>
                <div class="glass A02" style="top: 360px;left: 289px;position: absolute;">A02:{{ ShowGlassIdList(6) }}
                    <br />
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.2,6', 6)">
                    <el-button type="primary" size="mini" @click="ClearGlassId('DB101.10.1', 6)">
                        {{ $t('Clear') }}</el-button>
                </div>
@@ -599,12 +610,6 @@
        <el-dialog :visible.sync="dialogFormVisible5" :title="$t('Please confirm the glass information')">
            <el-form :model="form" label-width="100px" style="padding-right: 30px">
                <div style="display: flex;justify-content: center;">
                    <!-- <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)">{{ $t('Query')
                        }}</el-button>
                    </el-form-item> -->
                    <el-form-item>
                        {{ $t('Confirm State') }}:{{ this.isConfirm == true ? $t('Allow') : $t('Not Allow') }}
                        <el-button type="primary" @click="isConfirmState()">
@@ -723,22 +728,11 @@
                    </el-form-item>
                </div>
                <div style="display: flex;justify-content: right;">
                    <!-- <el-button @click="DeleteQueueGlasss(2)" type="primary">{{ $t('Clear Current')
                    }}</el-button>
                    <el-button @click="InsertQueueGlass(2)" type="primary" :disabled="disabled">
                        {{ $t('Confirm') }}</el-button>
                    <el-button @click="DeleteQueueGlasss(1)" type="primary">{{ $t('Clear Current')
                    }}</el-button> -->
                    <el-button @click="InsertQueueGlass(1)" style="margin-right: 100px;" type="primary"
                        :disabled="disabled1">
                        {{ $t('Confirm') }}</el-button>
                </div>
            </el-form>
            <!-- <template #footer>
                <span class="dialog-footer">
                    <el-button @click="cancel3()">{{ $t('cancel') }}</el-button>
                </span>
            </template> -->
        </el-dialog>
        <el-dialog :visible.sync="dialogFormVisible6" :title="$t('Outing Queue')" top="5vh">
@@ -761,9 +755,6 @@
            <label style="background-color:yellow;font-size: 23px;" for="">
                {{ isQueueWarning == true ? $t('The cage is disabled') : "" }}
            </label>
            <!-- <span style="background-color:yellow;">
                {{ isQueueWarning== true ? $t('The cage is disabled') : $t('The cage is disabled') }}
            </span> -->
            <div style="display:flex;">
                <div style="width:70%;">
                    <el-table :data="this.OutSlice" :height="700" :span-method="objectSpanMethod" border
@@ -793,45 +784,12 @@
                                    }}</el-button>
                            </template>
                        </el-table-column>
                        <!-- <el-table-column :min-width="300" prop="position" :label="$t('Position')" style="font-size: 20px;">
                    <template slot-scope='scope'>
                        <div
                            :style="'width:' + (scope.row.position == 1 ? '300' : '100') + 'px;height:' + (scope.row.position == 1 ? '100' : '200') + 'px;background-Color:gray;margin:0 auto;'">
                        </div>
                    </template>
                </el-table-column> -->
                        <!-- <el-table-column prop="position" :label="$t('Flipped')" :min-width="200">
                    <template slot-scope='scope'>
                        {{ scope.row.flip == true ? $t('EXTERIQR OUT AND BYPASS TO THE LEFT')
                            : $t('EXTERIQR OUT AND BYPASS TO THE RIGHT') }}
                    </template>
                </el-table-column> -->
                        <el-table-column :width="100" :label="$t('Operate')">
                            <template slot-scope='scope'>
                                <!-- <el-button type="text" size="small" @click="getTopMove(scope.row, scope.$index)"
                            style="font-size: 15px;"
                            :disabled="(scope.$index == 0 || isAllowReordering == true || scope.row.state == 1)">
                            {{ $t('Top') }}
                        </el-button>
                        <el-button type="text" size="small" @click="getUpMove(scope.row, scope.$index)"
                            style="font-size: 15px;"
                            :disabled="(scope.$index == 0 || isAllowReordering == true || scope.row.state == 1)">
                            {{ $t('Up') }}
                        </el-button>
                        <el-button type="text" size="small" @click="getDownMove(scope.row, scope.$index)"
                            style="font-size: 15px;"
                            :disabled="(OutSlice.length - 1 == scope.$index || isAllowReordering == true || scope.row.state == 1)">
                            {{ $t('Down') }}
                        </el-button> -->
                                <el-button type="primary" style="padding: 4px 10px;font-size: 12px;"
                                    :disabled="isAllowQueue" @click="deleteproductionqueueglass(scope.row.barcode)">{{
                                        $t('Delete') }}</el-button>
                                <!-- <el-button type="primary" style="padding: 4px 10px;font-size: 12px;" :disabled="isAllowQueue"
                            @click="FrameStateUpdate(scope.row.barcode,scope.row.framestate)">{{
                            scope.row.framestate == 0 ? $t('Stop') : $t('Start') }}</el-button> -->
                            </template>
                        </el-table-column>
                    </el-table>
@@ -881,7 +839,6 @@
                    </template>
                </el-table-column>
                <!-- <el-table-column prop="Flip" :label="$t('Flipped')"></el-table-column> -->
                <el-table-column prop="out_slice.state" :label="$t('In the queue')">
                    <template slot-scope='scope'>
                        {{ scope.row.out_slice != null ? $t('Yes') : $t('No') }}
@@ -893,12 +850,6 @@
                        {{ scope.row.storageCage != null ? $t('Yes') : $t('No') }}
                    </template>
                </el-table-column>
                <!-- <el-table-column :width="80" :label="$t('Operate')">
                    <template slot-scope='scope'>
                        <el-checkbox label="" :disabled="!(scope.row.storageCage != null && scope.row.out_slice == null)"
                            :checked="scope.row.isCheck" @change="CheckBoxchange(scope.row.barcode, $event)"></el-checkbox>
                    </template>
                </el-table-column> -->
            </el-table>
        </el-dialog>
        <el-dialog :visible.sync="dialogFormCountDown" :title="$t('Approximately resettable time')" top="5vh">
@@ -1019,6 +970,9 @@
    },
    created() {
        this.load();
    },
    activated() {
        this.init();
    }
    ,
@@ -1076,9 +1030,9 @@
                    this.CurrentFrame = obj.CurrentFrame;
                    
                    //获取设备状态
                    // if (obj.DeviceList != null) {
                    //     this.DeviceList = obj.DeviceList[0];
                    // }
                    if (obj.DeviceList != null) {
                        this.DeviceList = obj.DeviceList[0];
                    }
                    //获取设备上的玻璃id
                    if (obj.GlassIdList != null) {
                        this.GlassIdList = obj.GlassIdList[0];
@@ -1196,6 +1150,10 @@
                socket.onerror = function () {
                    console.log("websocket发生了错误");
                }
                //跳转页面时关闭socket
                this.$router.afterEach(function () {
                    socket.close();
                });
            }
        },
        load() {
@@ -1248,14 +1206,6 @@
                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;
            // });
            //加载报警信息
            SelectAlarmmgInfo().then(res => {
                this.alarm = res.data.alarmmg;
@@ -1296,7 +1246,6 @@
        },
        //手动上片
        sbumitglassid() {
            console.log(1111111);
            if (this.form.order != "") {
                if (this.form.height < 380 || this.form.width < 390 || this.form.height > 1810 || this.form.width > 2760) {
                    this.$message.error(this.$t('The glass size is not within the range'));
@@ -1371,36 +1320,6 @@
        //获取扫码位和上片位数据
        SelectGlassByGlassIDs() {
            this.showform3();
            // if (parameter == 1) {
            //     SelectGlassByGlassID(this.glassid2).then(res => {
            //         if (res.data.form != null) {
            //             if (res.data.form.glassId != null) {
            //                 this.form4 = res.data.form;
            //                 this.$message.success(this.$t('query was successful'));
            //                 this.Sizerange(this.form4, 2);
            //             } else {
            //                 this.$message.error(this.$t('There is no such glass'));
            //             }
            //         } else {
            //             this.$message.error(this.$t('There is no such glass'));
            //         }
            //     });
            // } else {
            //     SelectGlassByGlassID(this.glassid1).then(res => {
            //         if (res.data.form != null) {
            //             if (res.data.form.glassId != null) {
            //                 this.form5 = res.data.form;
            //                 this.$message.success(this.$t('query was successful'));
            //                 this.Sizerange(this.form5, 1);
            //             } else {
            //                 this.$message.error(this.$t('There is no such glass'));
            //             }
            //         } else {
            //             this.$message.error(this.$t('There is no such glass'));
            //         }
            //     });
            // }
        },
        //查询客户玻璃信息
@@ -1426,16 +1345,6 @@
            //查询铝框id对应玻璃信息
            SelectAluminumFrameInfoById(this.framebarcode).then(res => {
                this.AluminumFrame = res.data.AluminumFrame;
                console.log(this.AluminumFrame);
                // this.AluminumFrame.forEach(item => {
                //     if (item.storageCage != null && item.out_slice == null) {
                //         item.isCheck = true;
                //     } else {
                //         item.isCheck = false;
                //     }
                //     item.Flip = res.data.flip;
                //     item.FrameNo = this.framebarcode;
                // });
            });
            this.dialogFormVisible7 = true;
        },
@@ -1668,6 +1577,7 @@
        InsertQueueGlass(parameter) {
            if (parameter == 1 && this.form5.glassId != "") {
                if (this.form5.glassId != this.form2.glassId && this.form5.glassId != this.form3.glassId) {
                    if (this.dialogFormVisible5 == true) {
                    InsertQueueGlassId(1, this.form5).then(res => {
                        if (res.data.message == 200) {
                            this.form5 = {};
@@ -1679,6 +1589,7 @@
                            this.$message.error(this.$t('This glass ID already exists in the sorting cage'));
                        }
                    });
                    }
                } else {
                    this.$message.error(this.$t('The glass ID already exists in the loading queue'));
                }
@@ -1854,7 +1765,7 @@
            }
            this.UpdateSequence(Sequence);
        },
        //修改顺序
        //修改出片顺序
        UpdateSequence(Sequence) {
            let i = 0;
            this.OutSlice.forEach(item => {
@@ -1969,9 +1880,9 @@
                    } else {
                        this.disabled = false;
                    }
                    if (position == 3 && this.isConfirm == true && this.D01RequestState == true) {
                        this.InsertQueueGlass(1);
                    }
                    // if (position == 3 && this.isConfirm == true && this.D01RequestState == true && this.dialogFormVisible5 == true) {
                    //     this.InsertQueueGlass(1);
                    // }
                }
            }
        },
@@ -1987,9 +1898,9 @@
                }
            });
        },
        //45秒复位倒数计时
        //60秒复位倒数计时
        CountDown() {
            let count = 45;
            let count = 60;
            let timer = setInterval(
                () => {
                    if (this.EmergencyStop == true) {
@@ -2094,7 +2005,7 @@
                            type: 'warning'
                        }).then(() => {
                            ClearGlassId(position, this.GlassIdList[num]).then(res => {
                                if (res.data.message3 == 200) {
                                if (res.data.message == 200) {
                                    this.$message.success(this.$t('Operation successful'));
                                } else {
                                    this.$message.success(this.$t('operation failed'));
springboot-vue3/src/main/java/com/example/springboot/component/PLCAutoMes.java
New file
@@ -0,0 +1,90 @@
package com.example.springboot.component;
import com.example.springboot.entity.device.PlcBitObject;
import com.example.springboot.entity.device.PlcParameterObject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import static com.example.springboot.component.InitUtil.readAndUpdateBitValues;
import static com.example.springboot.component.InitUtil.readAndUpdateWordValues;
public class PLCAutoMes extends Thread {
    // 用于存储应用程序的配置信息
    private Configuration config;
    private static InitUtil initUtil;
    // 创建一个自定义的 S7 控制器消息处理器对象
    MessageHandler customS7Control = new MessageHandler();
    // 单例实例
    private static PLCAutoMes instance;
    // 私有构造函数
    public PLCAutoMes() throws IOException {
        config = new Configuration("config.properties");
        initUtil = new InitUtil();
    }
    // 获取单例实例
    public static synchronized PLCAutoMes getInstance() throws IOException {
        if (instance == null) {
            instance = new PLCAutoMes();
        }
        return instance;
    }
    @Override
    public void run() {
        while (this != null) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            String jsonFilePath = PLCAutoMes.class.getResource("/JsonFile/PlcMes.json").getPath();
            String jsonFilePath2 = PLCAutoMes.class.getResource("/JsonFile/PlcRead.json").getPath();
            // String jsonFilePath3 = PLCAutoMes.class.getResource("/JsonFile/Plcframe.json").getPath();
            // System.out.println(jsonFilePath);
            // 调用initword方法
            PlcParameterObject  PlcMesObject= initUtil.initword(jsonFilePath);
            // 调用initbit方法
             PlcParameterObject  PlcReadObject= initUtil.initword(jsonFilePath2);
            //  // 调用initbit方法
            // PlcParameterObject  PlcframeObject= initUtil.initword(jsonFilePath3);
            readAndUpdateWordValues(PlcReadObject);
            readAndUpdateWordValues(PlcMesObject);
            // readAndUpdateWordValues(PlcframeObject);
            // readAndUpdateWordValues(plcStateObject);
            int index = PlcMesObject.getPlcParameter("AddStart").getAddressIndex();
            //System.out.println(index);
            PlcMesObject.getPlcParameter("AddStart").getAddress(index);
            //System.out.println(PlcMesObject.getPlcParameter("AddStart").getAddress(index));
            List<String> addresses = new ArrayList<>();
            addresses.add("FeedID");
            addresses.add("AddStart");
            //System.out.println(addresses);
            //System.out.println(PlcMesObject.getPlcParameterValues(addresses));
            List<String> addresses2 = new ArrayList<>();
            addresses2.add("FeedID");
            addresses2.add("FeedCarStatus");
            System.out.println(PlcReadObject.getPlcParameterValues(addresses2));
        }
    }
}
springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
New file
@@ -0,0 +1,191 @@
package com.example.springboot.component;
import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.springboot.service.JdbcConnections;
import com.example.springboot.service.SpianService;
import com.example.springboot.entity.north_glass_buffer1;
import com.example.springboot.mapper.AlarmMapper;
import com.example.springboot.mapper.SpianMapper;
public class PlcHoldNew extends Thread {
  private AlarmMapper alarmMapper;
  @Autowired
  private JdbcConnections jdbcConnections;
  private SpianMapper spianMapper;
  private SpianService spianService;
  int aaa;
  @Override
  public void run() {
    while (this != null) {
      try {
        Thread.sleep(100);
      } catch (InterruptedException e) {
        // \\ TODO Auto-generated catch block
        e.printStackTrace();
      }
      // if (S7control.getinstance().CheckConnected() == false) {
      spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
      spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
      jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
      // 根据玻璃id获取订单号,单独数据源
      // try {
      // north_glass_buffer1 glass = jdbcConnections.selectGlass(112);
      // // System.out.println(glass.getOrderId());
      // } catch (SQLException e) {
      // // TODO Auto-generated catch block
      // e.printStackTrace();
      // }
      // 出片任务////////////////////////////////
      List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 出片车状态
      List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.18", 1); // 出片任务是否启动
      boolean Plcout = spianService.listbool("DB106.64"); // 出片请求字
      boolean Plcout2 = spianService.listbool("DB105.18"); // 出片启动
      if (Plcout == false&&Plcout2==true) {
        S7control.getinstance().WriteWord("DB105.18", (short) 0);// 出片任务启动改为0
        System.out.println("关闭出片启动" + LocalDateTime.now());// 出片任务发送字改为0
      }
      boolean Plcadd = spianService.listbool("DB106.24"); // 进片请求字
      boolean Plcadd2 = spianService.listbool("DB105.16"); // 进片启动
      if (Plcadd == false&&Plcadd2==true) {
        S7control.getinstance().WriteWord("DB105.16", (short) 0);//进片任务启动改为0
        System.out.println("关闭进片启动" + LocalDateTime.now());// 进片任务发送字改为0
      }
      // StringBuilder writedstrIdOut = new StringBuilder();
      // 获取已下发的出片id
      byte[] writedglassidbytesOut = S7control.getinstance().ReadByte("DB105.30", 14);
      String writedstrIdOut = new String(writedglassidbytesOut);
      if (Plcout == true) {
        // 判断当前是否有未执行的任务
        int outnum = spianMapper.SelectOutSliceshu();//是否有正在出片的任务
        int cageoutsum = spianMapper.Selectcageout(3);//笼子内是否还有在出片的玻璃
        // 当没有任务执行并且出片车空闲时
        if (outnum == 0 &&  Plchome.isAllowQueue == true && cageoutsum == 0) {
          // 判断铝框出片队列表是否有待出片的玻璃
          String outglassid = spianMapper.SelectOutSlice();
          // 当有待出片的玻璃时
          if (outglassid != null) {
            // 获取该玻璃是否被禁用
            int glassdisabled = spianMapper.SelectCageGlassState(outglassid);
            // 未禁用下发任务
            if (glassdisabled == 0) {
              spianService.selectout2(outglassid);
              Plchome.isQueueWarning = false;
            } else { // 禁用更改状态弹出提示
              Plchome.isQueueWarning = true;
            }
          }
        }
      }
      ///////////// 进片任务
      List<Short> datas1List = S7control.getinstance().ReadWord("DB106.24", 1);// 获取prc进片请求数据
      List<Short> datas1ListState = S7control.getinstance().ReadWord("DB106.8", 1);// 获取进片车状态
      List<Short> datas1ListState2 = S7control.getinstance().ReadWord("DB105.16", 1);// 获取进片车任务是否启动
      boolean B01backs = spianService.listbool("DB106.60");// b01汇报
      boolean B02backs = spianService.listbool("DB106.62");// b02汇报
      StringBuilder B01glassid = spianService.queGlassid("DB103.184", 14);// BO1的玻璃id
      StringBuilder B02glassid = spianService.queGlassid("DB103.212", 14);// B02的玻璃id
      // 当进片小车完成任务时
      if (B01backs == true) {
        // 判断是否汇报正确的id
        int HB = spianMapper.SelectHB(B01glassid.toString());
        if (HB > 0) {
          // 当B01小车汇报完成时更改玻璃状态 为1
          S7control.getinstance().WriteWord("DB105.48", (short) 1);// 恢复B01小车应答改为1
          boolean yingda = spianService.listbool("DB105.48");// b01汇报
          if (yingda == true) {
            spianService.overtask(B01glassid.toString());// 完成任务
          }
          System.out.println("汇报时B01|第" + aaa + "次" + B01glassid + "应答" + yingda);
          aaa += 1;
        }
      }else{
        S7control.getinstance().WriteWord("DB105.48", (short) 0);// 恢复B01小车应答改为1
      }
      // 当出片小车完成任务时
      if (B02backs == true) {
        // 判断是否汇报正确的id
        int HB = spianMapper.SelectHB(B02glassid.toString());
        System.out.println("汇报时B02|" + B02glassid);
        if (HB > 0) {
          // 当B02小车汇报完成时更改玻璃状态为0
          S7control.getinstance().WriteWord("DB105.50", (short) 1);// 恢复B02小车应答改为1
          System.out.println("汇报时B02ID|" + B02glassid);
          boolean yingda = spianService.listbool("DB105.50");// b02汇报
          if (yingda == true) {
            spianService.overtask(B02glassid.toString());// 完成任务
          }
          System.out.println("汇报时B02|第" + aaa + "次" + B02glassid + "应答" + yingda);
        }
      }else{
         S7control.getinstance().WriteWord("DB105.50", (short) 0);// 恢复B02小车应答改为0
      }
      // 获取DO1数据
      StringBuilder queueid1 = spianService.queGlassid("DB106.26", 14);// 获取请求的id跟DO1同时清
      // 获取DO2数据
      StringBuilder queueid2 = spianService.queGlassid("DB103.58", 14);
      int questate = spianMapper.Selectquecount(queueid1.toString());// 判断扫码位是否有玻璃已确认
      // queueid1.toString().isEmpty()
      north_glass_buffer1 glass1 = spianMapper.selectGlass(queueid1.toString());// D01的玻璃信息
      north_glass_buffer1 glass2 = spianMapper.selectGlass(queueid2.toString());// D02玻璃信息
      // 当扫码位玻璃id为空时 宽度为0
      if (queueid1 != null && questate == 0) {
        // 写入D01的数据到上片队列表
        if (glass1 == null) { // 当没有值时传空
          spianMapper.Updatequeue(null, null, null, null, 0, null, null, null, null, 1);
        } else {
          spianMapper.Updatequeue(queueid1.toString(), glass1.getordernumber(), glass1.getlistnumber(),
              glass1.getboxnumber(), 0, glass1.getglasslengthmm().toString(), glass1.getglassheightmm().toString(),
              glass1.getglasslength().toString(), glass1.getglassheight().toString(), 1);
        }
      }
      if (queueid2 != null) {
        // 写入D02的数据到上片队列表
        if (glass2 == null) {
          spianMapper.Updatequeue(null, null, null, null, 0, null, null, null, null, 2);
        } else {
          spianMapper.Updatequeue(queueid2.toString(), glass2.getordernumber(), glass2.getlistnumber(),
              glass2.getboxnumber(), 0, glass2.getglasslengthmm().toString(), glass2.getglassheightmm().toString(),
              glass2.getglasslength().toString(), glass2.getglassheight().toString(), 2);
          spianMapper.overqueue2(queueid2.toString(), 0, 1);// 更改扫码位任务表的状态为0
          S7control.getinstance().WriteWord("DB105.16", (short) 0);// 关闭任务启动
        }
      }
      // 查询数据库
      // 推送到前端
      // }
    }
  }
}
springboot-vue3/src/main/java/com/example/springboot/component/PlcRead.java
New file
@@ -0,0 +1,91 @@
package com.example.springboot.component;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Arrays;
public class PlcRead extends Thread {
  String name = "";
  Integer count = 0;
  public void readValue() {
    String str = "";
    BufferedReader bufferedReader = null;
    FileInputStream fileInputStream;
    try {
      // 从文件中读取字节数据存入 fileInputStream
      fileInputStream = new FileInputStream("CanadaMes-ui/src/configuration/Read.json");
      // 读取 fileInputStream 中字节并将其解码为字符
      InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "utf-8");
      // 提高读取效率,在 BufferedReader 内包装 InputStreamReader
      bufferedReader = new BufferedReader(inputStreamReader);
      String line = null;
      // 将 bufferedReader 内容一行一行赋值给str
      while ((line = bufferedReader.readLine()) != null) {
        str += line;
      }
      // 将str字符串格式转为json
      JSONObject jsonObject = new JSONObject(str);
      // 获取json中的值
      JSONArray address = jsonObject.getJSONArray("address");
      for (int i = 0; i < address.size(); i++) {
        JSONObject ress = (JSONObject) address.get(i);
        this.name = ress.getStr("name");
        this.count = ress.getInt("count");
      }
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
  @Override
  public void run() {
    while (this != null) {
      try {
        Thread.sleep(1000);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      List<Boolean> plclist = S7control.getinstance().ReadBits("DB106.0.0", 78);
      if (plclist != null) {
        // 将获取的布尔类型转换为整数类型
        List<Integer> Intlist = new ArrayList<>();
        for (Boolean value : plclist) {
          if (value != null) {
            Intlist.add(value == true ? 0 : 1);
          }
        }
        JSONObject jsonObject = new JSONObject();
        jsonObject.append("sig", Intlist);
        ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Mes");
        if (sendwServer != null) {
          for (WebSocketServer webserver : sendwServer) {
            webserver.sendMessage(jsonObject.toString());
          }
        }
      }
    }
  }
}
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -12,6 +12,7 @@
import com.example.springboot.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.example.springboot.entity.Glass;
import com.example.springboot.entity.Out_slice;
import com.example.springboot.entity.Queue;
import com.example.springboot.entity.StorageCage;
@@ -45,6 +46,8 @@
    private StorageCageService storageCageService;
    public static Boolean FeedState = false;
    // public Plchome() throws IOException {
    // config = new Configuration("config.properties");
    // }
@@ -58,12 +61,12 @@
            try {
                Thread.sleep(1000);
                // 注入mapper
            homeMapper = WebSocketServer.applicationContext.getBean(HomeMapper.class);
            spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
            spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
            outSliceServive = WebSocketServer.applicationContext.getBean(OutSliceServive.class);
            north_Glass_Buffer1Service = WebSocketServer.applicationContext.getBean(North_Glass_Buffer1Service.class);
                north_Glass_Buffer1Service = WebSocketServer.applicationContext
                        .getBean(North_Glass_Buffer1Service.class);
            storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
            dbserve = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
@@ -120,14 +123,10 @@
            // String E01id = new String( S7controlLK.getinstance().ReadByte("DB17.0",16));
            // String J01id = new String( S7controlLK.getinstance().ReadByte("DB17.22",14));
                if (S7control.getinstance().CheckConnected() == true) {
            // 铝框线交互
                    if (S7controlLK.getinstance().CheckConnected() == true) {
            if (CurrentFrame != null) {
                S7controlLK.getinstance().writeStrings(CurrentFrame.getBarCode(),"DB17.0");
            }
@@ -155,19 +154,16 @@
                    }
                    S7controlLK.getinstance().WriteWord("DB17.38", (short) send);
                }
                    }
            
            if (S7control.getinstance().CheckConnected() == true) {
                // 获取当前扫码方式
                List<Boolean> Scanningmethods = S7control.getinstance().ReadBits("DB101.11.4", 1);
                if (Scanningmethods != null) {
                    for (Boolean Scanningmethod : Scanningmethods) {
                        jsonObject.append("Scanningmethod", Scanningmethod);
                    }
                }
                    // 获取当前扫码枪玻璃id
                String CurrrentGlassId = spianService.queGlassid("DB103.256", 14).toString();
                jsonObject.append("CurrrentGlassId", CurrrentGlassId);
@@ -244,12 +240,6 @@
                    jsonObject.append("AluminumFrame", AluminumFrame);
                }
                // 获取进片请求状态
                List<Short> D01Request = S7control.getinstance().ReadWord("DB106.24", 1);
                boolean D01RequestState = D01Request.contains((short) 1);
                // boolean D01RequestState =true;
                jsonObject.append("D01RequestState", D01RequestState);
                // 复位倒计时
                // 地址104.9.6
                List<Boolean> countdown = S7control.getinstance().ReadBits("DB104.9.6", 1);
@@ -268,14 +258,30 @@
                for (Boolean emergencystop : emergencystops) {
                    jsonObject.append("emergencystop", emergencystop);
                }
                    // 获取进片请求状态
                    List<Short> D01Request = S7control.getinstance().ReadWord("DB106.24", 1);
                    boolean D01RequestState = D01Request.contains((short) 1);
                    jsonObject.append("D01RequestState", D01RequestState);
                    // 获取进片发送状态
                    List<Short> D01respnse = S7control.getinstance().ReadWord("DB106.16", 1);
                    boolean D01ResponseState = D01respnse.contains((short) 1);
                    // jsonObject.append("D01RequestState", D01RequestState);
                    // 自动进片
                    if ((form3.getglassheight() < 380 || form3.getglasswidth() < 390 || form3.getglassheight() > 1810
                            || form3.getglasswidth() > 2760)
                            || (form3.getglassheight() < 390 || form3.getglasswidth() < 380
                                    || form3.getglassheight() > 2760 || form3.getglasswidth() > 1810)) {
                        if (isConfirm == true && D01RequestState == true && D01ResponseState == false) {
                            storageCageService.InsertQueueGlassId((short) 1, form3);
                        }
                    }
            }
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            
            boolean dbconnected = false;
            try {
springboot-vue3/src/main/java/com/example/springboot/controller/HomeController.java
@@ -274,24 +274,8 @@
  // 手动添加扫码位玻璃
  @PostMapping("/InsertQueueGlassId")
  public Result InsertQueueGlassId(Short id, @RequestBody Queue queue) {
    Map<String, Object> map = new HashMap<>();
    Short zhi=200;
    short result = homeMapper.SelectStorageByGlassId(queue.getglassId());
    if (result > 0) {
      map.put("message", "300");
    } else {
    return storageCageService.InsertQueueGlassId(id, queue);
      
      if (id == 1) {
        // 调用伍存储过程
        zhi=spianService.selectAll(queue.getglassId());
        if(zhi==200){
          homeMapper.InsertQueueGlassId(queue, id);
        }
      }
      map.put("message",zhi);
    }
    return Result.success(map);
  }
  // 确认扫码位玻璃信息
springboot-vue3/src/main/java/com/example/springboot/entity/device/PlcParameterObject.java
@@ -139,14 +139,15 @@
     */
    public void setPlcParameterList(byte[] plcValueArray) {
        if (plcParameterList != null) {
            for (PlcParameterInfo plcParameterInfo : plcParameterList) {
                byte[] valueList = new byte[plcParameterInfo.getAddressLength()];
//                System.out.println(plcParameterInfo.getAddressLength());
                for (int i = 0; i < plcParameterInfo.getAddressLength(); i++) {
                    Array.setByte(valueList, i, plcValueArray[plcParameterInfo.getAddressIndex() + i]);
                }
                if (plcParameterInfo.getAddressLength()==2) { 
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -216,7 +216,7 @@
  Out_slice SelectCurrentFrame();
  //根据玻璃id查询任务信息
  @Select("select task_type from storage_task where glass_id=#{glassid} and task_state!=2")
  @Select("select task_type from storage_task where glass_id=#{glassid} and task_state!=1")
  Short SelectTaskByGlassId(String glassid);
  //修改格子宽度
springboot-vue3/src/main/java/com/example/springboot/service/SpianService.java
@@ -117,6 +117,11 @@
                    int qidong2 = 0;
                    if (qidong == true) {
                        qidong2 = 1;
                    }else{
                        while (qidong) {
                            S7control.getinstance().WriteWord("DB105.16", (short) 1);// 出片任务发送字改为1
                            qidong = listbool("DB105.16");
                        }
                    }
                    spianMapper.Inserttask(0, 0, 1000, ids, glassid.toString(), prctier,qidong2);// 新增任务
                    System.out.println("进片任务|" + datas);
@@ -193,6 +198,11 @@
            int qidong2 = 0;
            if (qidong == true) {
                qidong2 = 1;
            }else{
                while (qidong) {
                    S7control.getinstance().WriteWord("DB105.18", (short) 1);// 出片任务发送字改为1
                    qidong = listbool("DB105.18");
                }
            }
            spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid, state, qidong2);// 新增任务
            outmesid(glassid, "DB105.34");// 派发出片ID
@@ -221,6 +231,11 @@
                int qidong2 = 0;
                if (qidong == true) {
                    qidong2 = 1;
                }else{
                    while (qidong) {
                        S7control.getinstance().WriteWord("DB105.18", (short) 1);// 出片任务发送字改为1
                        qidong = listbool("DB105.18");
                    }
                }
                spianMapper.Inserttask(1, 0, cageout.getId(), 1000, glassid, 1, qidong2);// 新增任务
                return (200);// 结束
@@ -259,6 +274,11 @@
                    int qidong2 = 0;
                    if (qidong == true) {
                        qidong2 = 1;
                    }else{
                        while (qidong) {
                            S7control.getinstance().WriteWord("DB105.18", (short) 1);// 出片任务发送字改为1
                            qidong = listbool("DB105.18");
                        }
                    }
                    spianMapper.Inserttask(2, 0, cageout.getId(), ids, glassids, 2, qidong2);// 新增调度任务
@@ -291,6 +311,11 @@
                    int qidong2 = 2;
                    if (qidong == true) {
                        qidong2 = 1;
                    }else{
                        while (qidong) {
                            S7control.getinstance().WriteWord("DB105.18", (short) 1);// 出片任务发送字改为1
                            qidong = listbool("DB105.18");
                        }
                    }
                    spianMapper.Inserttask(2, 0, cageout.getId() + 1, ids, glassids, 2, qidong2);// 新增调度任务
                    spianMapper.UpdateDBCage(ids, cage, cell, 2);// 将原格子数据更新到新格子里
springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
@@ -9,7 +9,9 @@
import org.springframework.stereotype.Service;
import com.example.springboot.common.Result;
import com.example.springboot.component.Plchome;
import com.example.springboot.component.S7control;
import com.example.springboot.entity.Queue;
import com.example.springboot.entity.StorageCage;
import com.example.springboot.entity.StorageTask;
import com.example.springboot.mapper.HomeMapper;
@@ -36,7 +38,8 @@
            List<StorageTask> cageList = homeMapper.SelectTaskByState(types);
            for (StorageTask storageTask : cageList) {
                // 判断出片任务位置并清除对应玻璃id
                if ((storageTask.getGlassId().equals(A01glassid1)|| storageTask.getGlassId().equals(A01glassid2))&&DeviceList.get(4)==0) {
                if ((storageTask.getGlassId().equals(A01glassid1) || storageTask.getGlassId().equals(A01glassid2))
                        && DeviceList.get(4) == 0) {
                    outSliceServive.StopTask(storageTask.getGlassId(), types);
                    ClearGlassId("DB101.10.0");
                } 
@@ -89,7 +92,8 @@
            // List<StorageCage> storageCages = homeMapper.selectinout(3);
            // for (StorageCage storageCage : storageCages) {
            //     List<StorageCage> storageCagess = homeMapper.SelectStoragesGlassById(storageCage.getGlassId());
            // List<StorageCage> storageCagess =
            // homeMapper.SelectStoragesGlassById(storageCage.getGlassId());
            //     for (StorageCage storageCagez : storageCagess) {
@@ -175,4 +179,29 @@
        return Result.success(map);
    }
    public Result InsertQueueGlassId(Short id, Queue queue) {
        Map<String, Object> map = new HashMap<>();
        if (Plchome.FeedState == false) {
            Plchome.FeedState = true;
            Short zhi = 200;
            short result = homeMapper.SelectStorageByGlassId(queue.getglassId());
            if (result > 0) {
                map.put("message", "300");
            } else {
                if (id == 1) {
                    // 调用伍存储过程
                    zhi = spianService.selectAll(queue.getglassId());
                    if (zhi == 200) {
                        homeMapper.InsertQueueGlassId(queue, id);
                    }
                }
                map.put("message", zhi);
            }
            Plchome.FeedState = false;
        } else {
            map.put("message", 200);
        }
        return Result.success(map);
    }
}
springboot-vue3/src/main/resources/JsonFile/PlcMes.json
New file
@@ -0,0 +1,107 @@
{
   "plcAddressBegin":"DB105.0",
   "plcAddressLenght":"52",
   "dataType":"word",
   "parameteInfor":[
      {
         "codeId": "AddStart",
         "addressIndex":"0",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
          "codeId": "Addgoal",
          "addressIndex":"2",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"m/min"
       },
       {
          "codeId": "AddLength",
          "addressIndex":"4",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"m/min"
       },
       {
          "codeId": "AddWidth",
          "addressIndex":"6",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "AddCount",
          "addressIndex":"8",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "OutStart",
          "addressIndex":"10",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "Outgoal",
          "addressIndex":"12",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "OutCount",
          "addressIndex":"14",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "AddActivate",
          "addressIndex":"16",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
         "codeId": "OutActivate",
         "addressIndex":"18",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"mm/S"
      },
     {
       "codeId": "FeedID",
       "addressIndex":"20",
       "addressLenght":"14",
       "ratio":"1",
       "unit":"mm/S"
     },
     {
       "codeId": "ReleaseID",
       "addressIndex":"34",
       "addressLenght":"14",
       "ratio":"1",
       "unit":"mm/S"
     },
     {
       "codeId": "B01report",
       "addressIndex":"48",
       "addressLenght":"2",
       "ratio":"1",
       "unit":"mm/S"
     },
     {
       "codeId": "B02report",
       "addressIndex":"50",
       "addressLenght":"2",
       "ratio":"1",
       "unit":"m/min"
     }
   ]
}
springboot-vue3/src/main/resources/JsonFile/PlcRead.json
New file
@@ -0,0 +1,195 @@
{
   "plcAddressBegin": "DB106.0",
   "plcAddressLenght": "66",
   "dataType": "word",
   "parameteInfor": [{
         "codeId": "A01Position",
         "addressIndex": "0",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "A01FlipPosition",
         "addressIndex": "2",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "A01QuestStartPosition",
         "addressIndex": "4",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "A01EndPosition",
         "addressIndex": "6",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "FeedCarStatus",
         "addressIndex": "8",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "A02QuestOver",
         "addressIndex": "10",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "A02Position",
         "addressIndex": "12",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "A02FlipPosition",
         "addressIndex": "14",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "A02QuestStartPosition",
         "addressIndex": "16",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "A02EndPosition",
         "addressIndex": "18",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "ExitCarStatus",
         "addressIndex": "20",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "A02QuestOver",
         "addressIndex": "22",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "FeedRequest",
         "addressIndex": "24",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "FeedID",
         "addressIndex": "26",
         "addressLenght":"14",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "B01Position",
         "addressIndex": "40",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "B01QuestPosition",
         "addressIndex": "42",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "B01CurrentTaskMode",
         "addressIndex": "44",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "B01CarStatus",
         "addressIndex": "46",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "B01CarTaskStatus",
         "addressIndex": "48",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "B02Position",
         "addressIndex": "50",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "B02CarCurrentTask",
         "addressIndex": "52",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "B02CurrentTaskMode",
         "addressIndex": "54",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "B02CarStatus",
         "addressIndex": "56",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "B02CarSaskStatus",
         "addressIndex": "58",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "B01CompleteTheReport",
         "addressIndex": "60",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "B02CompleteTheReport",
         "addressIndex": "62",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      },
      {
         "codeId": "OutRequest",
         "addressIndex": "64",
         "addressLenght":"2",
         "ratio":"1",
         "unit":"m/min"
      }
   ]
}
springboot-vue3/src/main/resources/JsonFile/Plcframe.json
New file
@@ -0,0 +1,51 @@
{
   "plcAddressBegin":"DB17.0",
   "plcAddressLenght":"40",
   "dataType":"word",
   "parameteInfor":[
      {
         "codeId": "E01id",
         "addressIndex":"0",
         "addressLenght":"14",
         "ratio":"1",
         "unit":"m/min"
      },
      {
          "codeId": "E01Quest",
          "addressIndex":"16",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"m/min"
       },
       {
          "codeId": "E01Reply",
          "addressIndex":"18",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"m/min"
       },
       {
          "codeId": "J01Quest",
          "addressIndex":"20",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "J01id",
          "addressIndex":"22",
          "addressLenght":"14",
          "ratio":"1",
          "unit":"mm/S"
       },
       {
          "codeId": "J01TurnGo",
          "addressIndex":"38",
          "addressLenght":"2",
          "ratio":"1",
          "unit":"mm/S"
       }
   ]
}
src/main/java/com/canadames/controller/device/DeviceController.java
New file
@@ -0,0 +1,20 @@
package com.canadames.controller.device;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yyq
 * @since 2024-01-17
 */
@RestController
@RequestMapping("/device-entity")
public class DeviceController {
}
src/main/java/com/canadames/entity/device/DeviceEntity.java
New file
@@ -0,0 +1,61 @@
package com.canadames.entity.device;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
 * <p>
 *
 * </p>
 *
 * @author yyq
 * @since 2024-01-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("device")
@ApiModel(value="DeviceEntity对象", description="")
public class DeviceEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    private String deviceId;
    private String createUser;
    private LocalDateTime createTime;
    private String deviceName;
    private String status;
    private String info;
    private String model;
    private LocalDateTime countTimeFlag;
    private String address;
    private String gps;
    private LocalDate debugTime;
    private LocalDate endTime;
    private String customerName;
    private String customerDeviceName;
    private LocalDate lastProductCountDate;
}
src/main/java/com/canadames/mapper/device/DeviceDao.java
New file
@@ -0,0 +1,16 @@
package com.canadames.mapper.device;
import com.canadames.entity.device.DeviceEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yyq
 * @since 2024-01-17
 */
public interface DeviceDao extends BaseMapper<DeviceEntity> {
}
src/main/java/com/canadames/service/device/DeviceService.java
New file
@@ -0,0 +1,16 @@
package com.canadames.service.device;
import com.canadames.entity.device.DeviceEntity;
import com.baomidou.mybatisplus.extension.service.IService;
/**
 * <p>
 *  服务类
 * </p>
 *
 * @author yyq
 * @since 2024-01-17
 */
public interface DeviceService extends IService<DeviceEntity> {
}
src/main/java/com/canadames/service/device/impl/DeviceServiceImpl.java
New file
@@ -0,0 +1,20 @@
package com.canadames.service.device.impl;
import com.canadames.entity.device.DeviceEntity;
import com.canadames.mapper.device.DeviceDao;
import com.canadames.service.device.DeviceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yyq
 * @since 2024-01-17
 */
@Service
public class DeviceServiceImpl extends ServiceImpl<DeviceDao, DeviceEntity> implements DeviceService {
}
src/main/resources/mapper/device/DeviceEntityMapper.xml
New file
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.canadames.mapper.device.DeviceDao">
</mapper>