严智鑫
2024-03-18 331e7fc1b8f332ccecb8e9af59a826d6ae80ba10
springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java
@@ -7,11 +7,8 @@
import com.example.springboot.component.PLCAutoMes;
import com.example.springboot.component.S7control;
import com.example.springboot.entity.GlassInfo;
import com.example.springboot.entity.StorageCage;
import com.example.springboot.entity.glassinfo;
import com.example.springboot.entity.device.PlcParameterObject;
import com.example.springboot.mapper.AlbaniaMapper;
import com.example.springboot.mapper.SpianMapper;
import com.google.common.primitives.Bytes;
@@ -24,11 +21,20 @@
public Short selectAll(GlassInfo glassInfo) {
    //定义初始字段
    int cageid;
    String glassid=glassInfo.getGlassid();
    Double width=glassInfo.getWidth();
    Double height=glassInfo.getHeight();
    int glasstype=glassInfo.getGlasstype();
    //判断是否有同类型的
     cageid=albaniaMapper.SelectCage(glassInfo.getGlasstype(), glassInfo.getWidth(), 50);
    //如果有同类型时直接增加
    if(cageid!=Integer.MIN_VALUE){
        //发送plc任务
        //任务完成后增加数量
        albaniaMapper.UpdateCageNumberAdd(cageid);
    }else{
         //判断玻璃是否进入大片笼
@@ -36,17 +42,26 @@
            cageid=albaniaMapper.SelectNewCell(3,5);
        }else{
            cageid=albaniaMapper.SelectNewCell(3,5);
            //发送plc任务
        }
        //当返回的格子号为空时,返回400笼子已满
        if(cageid==Integer.MIN_VALUE){
            return(400);
        }else{
            //判断完成任务后增加数量
            albaniaMapper.AddCage(cageid, glassid, width, height, width, height, 0, glasstype, 1);
        }
    }
    //增加任务记录
    albaniaMapper.Inserttask(0, 0, 0, cageid, glassInfo.getGlassid(), 0, 0);
    return(200);
}
    public Short selectout2(String glassid) {
    public Short selectout(String glasstype) {
        //判断笼子最先出哪片
       
        return(200);// 结束
    }