严智鑫
2024-03-18 a65b82e86951db8540d38141715be2444b12dc99
更新
6个文件已修改
66 ■■■■■ 已修改文件
Albania_Mes-ui/src/views/home/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/entity/GlassInfo.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/entity/glassinfo.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/GlassInfoMapper.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Albania_Mes-ui/src/views/home/index.vue
@@ -253,18 +253,18 @@
            </div>
            <div style="display:flex;justify-content: space-around;width: 95%;margin: 0 auto;">
                <el-button type="primary" @click="showform(1)" :disabled="SoftEmergencyStopState"
                    :class="SoftEmergencyStopState == true ? 'hide' : ''">
                    :class="SoftEmergencyStopState == true ? 'hide' : ''" style="z-index: 999;">
                    {{ $t('Import order') }}</el-button>
                    
                <el-button type="primary" @click="showform(2)" :disabled="SoftEmergencyStopState"
                    :class="SoftEmergencyStopState == true ? 'hide' : ''">
                    :class="SoftEmergencyStopState == true ? 'hide' : ''" style="z-index: 999;">
                    {{ $t('Measure') }}</el-button>
                <el-button type="primary" @click="showform(3)" :disabled="SoftEmergencyStopState"
                    :class="SoftEmergencyStopState == true ? 'hide' : ''">
                    :class="SoftEmergencyStopState == true ? 'hide' : ''" style="z-index: 999;">
                    {{ $t('StorageCage') }}</el-button>
                <el-button type="primary" @click="showform(4)" :disabled="SoftEmergencyStopState"
                    :class="SoftEmergencyStopState == true ? 'hide' : ''">
                    :class="SoftEmergencyStopState == true ? 'hide' : ''" style="z-index: 999;">
                    {{ $t('Task queue') }}</el-button>
            </div>
            <div style="display: flex;align-items: center;">
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -144,27 +144,9 @@
                double width = 402;
                double height = 402;
                
                //获取匹配设置
                //匹配
                if ("1".equals(PlcRequest)) {
                    List<GlassInfo> Result=HomeService.NormalGlassInfo(width, height, "1");
                    if(Result.size()==1){
                        //匹配成功  就一种类型  添加数据
                        GlassInfo GlassInfo=Result.get(0);
                        QueueMapper.insert(GlassInfo.getGlassid(),width,height,1);
                        System.out.println("匹配成功");
                        //S7control.getinstance().WriteWord(plcmes.getPlcParameter("GaToMES").getAddress(), (short) 1);
                        System.out.println(GlassInfo.getGlassid());
                    }else if(Result.size()>1){
                        //匹配失败 匹配到多条符合的数据  添加数据
                        QueueMapper.insert(null,width,height,2);
                        System.out.println("匹配失败");
                    }
                    else{
                        //匹配失败 未找到符合的数据 添加数据
                        QueueMapper.insert(null,width,height,3);
                        System.out.println("未找到符合的数据");
                    }
                    boolean Result=HomeService.Normal(width, height, "1");
                }
                // String E01id = new String( S7controlLK.getinstance().ReadByte("DB17.0",16));
                // String J01id = new String( S7controlLK.getinstance().ReadByte("DB17.22",14));
springboot-vue3/src/main/java/com/example/springboot/entity/GlassInfo.java
@@ -20,4 +20,5 @@
  private Double thickness;// 厚
  private Integer number;// 数量
  private Integer finishnumber;// 完成数量
  private Integer measurenumber;// 测量完成数量
}
springboot-vue3/src/main/java/com/example/springboot/entity/glassinfo.java
@@ -20,4 +20,5 @@
  private Double thickness;// 厚
  private Integer number;// 数量
  private Integer finishnumber;// 完成数量
  private Integer measurenumber;// 测量完成数量
}
springboot-vue3/src/main/java/com/example/springboot/mapper/GlassInfoMapper.java
@@ -15,15 +15,15 @@
@Repository
public interface GlassInfoMapper extends BaseMapper<GlassInfo> {
    @Select("SELECT * FROM glassinfo where width<=#{maxwidth} and width>=#{minwidth} and height<=#{maxheight} and height>=#{minheight}")
    @Select("SELECT * FROM glassinfo where width<=#{maxwidth} and width>=#{minwidth} and height<=#{maxheight} and height>=#{minheight} and measurenumber<number")
    List<GlassInfo> selectGlassInfos(@Param("maxwidth") double maxwidth, @Param("minwidth") double minwidth, @Param("maxheight") double maxheight, @Param("minheight") double minheight);
    // @Select("SELECT COUNT(*) FROM role_permission WHERE role_id = #{roleId} AND permission_id = #{permissionId}")
    // boolean checkExists(@Param("roleId") int roleId, @Param("permissionId") int permissionId);
    // @Update("UPDATE role_permission SET state = #{state} WHERE role_id = #{roleId} AND permission_id = #{permissionId}")
    // void updateState(@Param("roleId") int roleId, @Param("permissionId") int permissionId, @Param("state") int state);
    @Update("UPDATE glassinfo SET measurenumber = measurenumber+1 WHERE id = #{id}")
    void updatemeasurenumber(@Param("id") int roleId);
    // @Insert("INSERT INTO role_permission (role_id, permission_id, state) VALUES (#{roleId}, #{permissionId}, #{state})")
    // void insert(@Param("roleId") int roleId, @Param("permissionId") int permissionId, @Param("state") int state);
springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java
@@ -61,6 +61,33 @@
        return Results;
    }
    // 匹配逻辑
    public boolean Normal(double width, double height, String line) {
        List<GlassInfo> Result = NormalGlassInfo(width, height, "1");
        if (Result.size() == 1) {
            // 匹配成功 就一种类型 添加数据
            GlassInfo GlassInfo = Result.get(0);
            QueueMapper.insert(GlassInfo.getGlassid(), width, height, 1);
            GlassInfoMapper.updatemeasurenumber(GlassInfo.getId());
            System.out.println("匹配成功");
            // S7control.getinstance().WriteWord(plcmes.getPlcParameter("GaToMES").getAddress(),
            // (short) 1);
            System.out.println(GlassInfo.getGlassid());
            return true;
        } else if (Result.size() > 1) {
            // 匹配失败 匹配到多条符合的数据 添加数据
            QueueMapper.insert(null, width, height, 2);
            System.out.println("匹配失败");
            return false;
        } else {
            // 匹配失败 未找到符合的数据 添加数据
            QueueMapper.insert(null, width, height, 3);
            System.out.println("未找到符合的数据");
            return false;
        }
    }
    //Execl表格 传入文件路径  
    public List ReadExecl(String filename) {
        try {
@@ -119,6 +146,5 @@
        }
       
    }
}