ZengTao
2024-04-01 bd456a3fca8cb8e8c1a15fa21ca02117512f3c5c
springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java
@@ -37,7 +37,7 @@
    //如果有同类型时直接增加
    if(cage!=null){
        //发送plc任务
        Mestast(glassid, 40, cage.getId(), 1,"MESID1",1);
        Mestast(glassid, 1001, cage.getId(), 1,"MESID1",1);
        //任务发送字
        
    }else{ 
@@ -52,6 +52,7 @@
        if(cage!=null){
            albaniaMapper.AddCage(cage.getId(), glassid, cage.getGlassWidth(), cage.getGlassHeight(), cage.getGlassWidthMm(), cage.getGlassHeightMm(), 1, cage.getGlasstype(), 0);
            Mestast(glassid,1001,cage.getId(),1,"MESID1",1);
            albaniaMapper.UpdateStorage(cage.getGlassWidth(),cage.getGlassHeight(),cage.getId());
            //发送plc任务
            
        }else{
@@ -85,10 +86,10 @@
                    return (400);
                }else{
                    
                    glass= albaniaMapper.SelectCageGlass(glassmate.getGlasstype());
                  if(glass!=null){
                glass= albaniaMapper.SelectCageGlass(glassmate.getGlasstype());
                  if(glass!=null){
                    //发送任务之前判断车上的剩余宽度是否大于此玻璃
                    width+=glassmate.getWidth()+50;
                    width=width+glassmate.getWidth()+50;
                    //大于车上空余宽度时提前发送出片启动
                    if(width>5000){
                        //本次配片完成发送启动命令
@@ -97,7 +98,7 @@
                      }
                      
                    //发送配片数据
                    Mestast(glass.getGlassId(), glass.getId(),7, 0,"MESID"+i,i);
                    Mestast(glass.getGlassId(), glass.getId(),line, 0,"MESID"+i,i);
                    albaniaMapper.AddFinishNumber(glassmate.getFlowcard(), glassmate.getMateid(), glassmate.getTier());
                    albaniaMapper.Inserttask(1, 0, glass.getId(), 2002, glassmate.getGlassid(), glassmate.getGlasstype(),glass.getFlowcard(),glassmate.getMateid(),glassmate.getTier());
                      if(glassmate.getTier()==glassmate.getId()){//当配片数量等于成品小片总片数时
@@ -131,9 +132,6 @@
        System.out.println("outmesidbytes:" + bytes.length);
        System.out.println(plcmes.getPlcParameter(address).getAddress());
        System.out.println();
        //S7control.getinstance().WriteByte(plcmes.getPlcParameter(address).getAddress(),bytes);
        //S7control.getinstance().WriteByte(address, bytes);// 派发出片id
    }