ZengTao
2024-03-25 c317cf8f8ceb017941d1c8cb98c4d5c115cec0ec
Merge branch 'master' of http://10.153.19.25:10101/r/Albania_Mes
6个文件已修改
1个文件已删除
169 ■■■■ 已修改文件
Albania_Mes-ui/src/views/home/index.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/resources/application.properties 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Albania_Mes-ui/src/views/home/index.vue
@@ -516,13 +516,14 @@
                    <el-button type="primary" @click="AnewMeasure()" :disabled="SoftEmergencyStopState"
                        style="z-index: 999;">重新测量</el-button>
                </div>
                <br>
                <!--显示-->
                <div style="width:1000px;height: 720px;border: 2px solid #d1d1d1;margin: auto auto;">
                <div style="width:1000px;height: 720px;border: 2px solid #d1d1d1;">
                    <!--玻璃图  #81b337-->
                    <div :style="'top:10px;bottom: 10px;left: 10px;right: 10px;margin: auto;position:absolute;width:'
                + (this.LastQueue.glasswidth / 25 * 7) + 'px;height:'
                + (this.LastQueue.glassheight / 25 * 7) + 'px;line-height: '
                + (this.LastQueue.glassheight / 25 * 7) + 'px;background-color: #93d2f3;text-align: center;'">
                    <div :style="'top:10px;bottom: 10px;left: 10px;right: 10px;margin:auto auto;position:absolute;width:'
                        + (this.LastQueue.glasswidth / 25 * 7) + 'px;height:'
                        + (this.LastQueue.glassheight / 25 * 7) + 'px;line-height: '
                        + (this.LastQueue.glassheight / 25 * 7) + 'px;background-color: #93d2f3;text-align: center;'">
                        {{ this.LastQueue.glasswidth }}*{{ this.LastQueue.glassheight }}
                    </div>
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java
File was deleted
springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -127,39 +127,29 @@
                // String MesSend=S7control.getinstance().ReadWord("DB14.170", 1).get(0)+"";
                //获取测量的长,宽
                boolean istest = false;
                String PlcRequest = "1";
                String MesSend = "0";
                double width = 402;
                double height = 402;
                
                //String url="C:\\Users\\SNG-ZDH-012\\Desktop\\阿尔巴尼亚数据要求.xlsx";E:\
                //String url="E:\\阿尔巴尼亚数据要求.xlsx";
                // List result= HomeService.ReadExecl(url);
                // for(int i=0;i<result.size();i++){
                //     System.out.println(result.get(i));
                // }
                //匹配
                //System.err.println(PlcRequest+","+MesSend+","+width+","+height);
                if ("0".equals(PlcRequest)&&istest) {
                    S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 0);
                }
                if ("1".equals(PlcRequest)&&"0".equals(MesSend)) {
                    boolean is=HomeService.Normal(width, height, "1");
                    if (is&&istest) {
                        // 测量成功
                        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1);
                    }else if(istest){
                        // 重新测量
                        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 4);
                    }
                // String PlcRequest = "1";
                // String MesSend = "0";
                // double width = 402;
                // double height = 402;
                // //匹配
                // //System.err.println(PlcRequest+","+MesSend+","+width+","+height);
                // if ("0".equals(PlcRequest)) {
                //     S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 0);
                // }
                // if ("1".equals(PlcRequest)&&"0".equals(MesSend)) {
                //     boolean is=HomeService.Normal(width, height, "1");
                //     if (is) {
                //         // 测量成功
                //         S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1);
                //     }else{
                //         // 重新测量
                //         S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 4);
                //     }
                // }
                }
                Queue LastQueue= QueueMapper.selectLastQueue();
                // 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/config/AppRunnerConfig.java
@@ -16,9 +16,9 @@
        // TODO Auto-generated method stub
        //
        System.out.println("启动完成");
        // new PLCAutoMes().start();
        //new PLCAutoMes().start();
        // new PlcHold().start();
        // new PlcHoldNew().start();
        //new PlcHoldNew().start();
        new Plchome().start();
        // new PlcLayout().start();
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -312,4 +312,8 @@
  @Select("select * from storage_cage where cage=#{cage} order by id desc")
  List<StorageCage> SelectStorageCageByCage(Integer cage);
  // 添加出片队列
  @Insert("INSERT INTO flowcard(`flowcard`, `totaltier`, `number`, `line`, `state`, `method`, `starttime`) "
                    +" select #{flowcard}, 0, #{number}, 0, 0, 0, now() where 0=( select count(*) from flowcard where flowcard=#{flowcard});")
  void InsertFlowcard(String flowcard, Integer number);
}
springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
@@ -363,7 +363,8 @@
        List<Map> TypeDatas = homeMapper.SelectType();
        Map<String, String> TypeData = new HashMap<String, String>();// 得到处理完后所有的类型
        Map<String, Integer> groupby=new HashMap<String, Integer>(); // 得到处理完后所有总层数;
        Map<String, Integer> OrderFinishedProduct=new HashMap<String, Integer>(); // 得到处理完后订单成品总数量;
        //"order zong 0  1  10  2 10"
        List<Map> RemoveErrorData = IportDataStr.stream()
                .filter(item -> (item.get("order") != null && item.get("glasstype") != null && item.get("tier") != null
                        &&
@@ -377,6 +378,17 @@
        RemoveErrorData.forEach(item -> {
            String key=item.get("order").toString()+"_"+item.get("matching").toString();
            String keyCount=item.get("order").toString()+"_"+item.get("matching").toString()+"_"+item.get("tier").toString();
            String keyCountSum=item.get("order").toString()+"_"+item.get("matching").toString()+"_Sum";//订单总数
            if (OrderFinishedProduct.get(keyCount)!=null) {
                Integer count=OrderFinishedProduct.get(keyCount)+1;
                Integer sumcount=OrderFinishedProduct.get(keyCountSum)+Integer.parseInt(item.get("quantity").toString());
                OrderFinishedProduct.put(keyCount,count);
                OrderFinishedProduct.put(keyCountSum,sumcount);
            }else if(OrderFinishedProduct.get(keyCount)==null&&groupby.get(key)==null){
                OrderFinishedProduct.put(keyCount,1);
                OrderFinishedProduct.put(keyCountSum,Integer.parseInt(item.get("quantity").toString()));
            }
            if (groupby.get(key)!=null) {
                Integer Tiers=groupby.get(key)+1;
                groupby.put(key, Tiers);
@@ -407,7 +419,8 @@
                    Double.parseDouble(map.get("base").toString()), Double.parseDouble(map.get("height").toString()),
                    Double.parseDouble(map.get("thickness").toString()),
                    Integer.parseInt(map.get("quantity").toString()),groupby.get(tierkey));// 需要计算总层数
            //订单内总层数
            homeMapper.InsertFlowcard(map.get("order").toString(),OrderFinishedProduct.get(tierkey+"_Sum"));
        }
        Map<String, Object> ResultCode = new HashMap<>();
        ResultCode.put("message", "200");
springboot-vue3/src/main/resources/application.properties
@@ -6,6 +6,7 @@
#\u6570\u636E\u5E93\u9A71\u52A8
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#\u6570\u636E\u5E93\u8FDE\u63A5\u5730\u5740
#spring.datasource.url=jdbc:mysql://localhost:3306/albania?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
spring.datasource.url=jdbc:mysql://10.153.19.150:3306/albania?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
#\u6570\u636E\u5E93\u7528\u6237\u540D
spring.datasource.username=root