wuyouming666
2024-04-03 f9d0b853c119db7ab1639fea8a7f41d7c6f75b2d
UnLoadGlassModule/src/main/java/com/mes/service/DownGlassLogic.java
@@ -12,35 +12,48 @@
import org.springframework.stereotype.Service;
import java.util.List;
@Data
@Service
public class DownGlassLogic {
    PlcParameterObject plcread = PLCAutoMes.PlcReadObject;
    /**
     * // 机械手1PLC请求字
     */
    String robot1PLCrequestword = plcread.getPlcParameter("A01Position").getValue();
    /**
     * // 机械手2PLC请求字
     */
    String robot2PLCrequestword = plcread.getPlcParameter("A01Position").getValue();
    /**
     * // 玻璃id
     */
    String glassID = plcread.getPlcParameter("A01Position").getValue();
    String glasswidth = plcread.getPlcParameter("A01Position").getValue();
    String glassheight = plcread.getPlcParameter("A01Position").getValue();
    //
    String glassthickness = plcread.getPlcParameter("A01Position").getValue();
    String pLcwancheng = plcread.getPlcParameter("A01Position").getValue();
    @Autowired
    private DownWorkstationMapper downWorkstationMapper;
    private DownGlassInfo downGlassInfo;
    private DownWorkstation downWorkstation;
    private DownGlassInfoMapper downGlassInfoMapper;
    private DownGlassInfoService downGlassInfoService;
    /**
     * // 存放待处理的玻璃信息
     */
    private List<DownGlassInfo> glassList;
    /**
     * 存放玻璃放置在缓存笼中的详细信息
     */
    private List<DownStorageCageDetails> cageDetailsList;
    /**
     * //当下片任务表状态为1时候将数据插入到下片玻璃信息表
     */
    private List<DownGlassInfo> glassList; // 存放待处理的玻璃信息
    private List<DownStorageCageDetails> cageDetailsList; // 存放玻璃放置在缓存笼中的详细信息
    PlcParameterObject plcread=PLCAutoMes.PlcReadObject;
    String Robot1PLCrequestword=plcread.getPlcParameter("A01Position").getValue();// 机械手1PLC请求字
    String Robot2PLCrequestword=plcread.getPlcParameter("A01Position").getValue();// 机械手2PLC请求字
    String GlassID=plcread.getPlcParameter("A01Position").getValue();// 玻璃id
    String Glasswidth=plcread.getPlcParameter("A01Position").getValue();//玻璃宽度
    String Glassheight=plcread.getPlcParameter("A01Position").getValue();//玻璃高度
    String Glassthickness=plcread.getPlcParameter("A01Position").getValue();//厚度
    String PLCwancheng = plcread.getPlcParameter("A01Position").getValue();// plc完成字
    //当下片任务表状态为1时候将数据插入到下片玻璃信息表
    public void insertdownglassinfo() {
@@ -51,7 +64,7 @@
//
        if (taskdownGlassInf != null && !taskdownGlassInf.isEmpty()) {
//
            for (DownGlassInfo downGlassInfo : taskdownGlassInf) {
@@ -60,13 +73,15 @@
                newdownGlassInfo.setFlowCardId(downGlassInfo.getFlowCardId());
                Integer maxSequence = downGlassInfoMapper.getMaxSequenceByFlowCardId(downGlassInfo.getFlowCardId());
                int sequence = maxSequence != null ? maxSequence + 1 : 1; // 初始化顺序字段值
                // 初始化顺序字段值
                int sequence = maxSequence != null ? maxSequence + 1 : 1;
                newdownGlassInfo.setWidth(downGlassInfo.getWidth());
                newdownGlassInfo.setHeight(downGlassInfo.getHeight());
                newdownGlassInfo.setThickness(downGlassInfo.getThickness());
                newdownGlassInfo.setFilmsid(downGlassInfo.getFilmsid());
                newdownGlassInfo.setSequence(sequence); // 设置顺序字段值
                // 设置顺序字段值
                newdownGlassInfo.setSequence(sequence);
                // 插入数据到下片玻璃信息表
                downGlassInfoMapper.insert(newdownGlassInfo);
@@ -78,17 +93,18 @@
                sequence++; // 递增顺序字段值
            }
        }
    }
    //当机械手任务表中状态为1,工位表流程卡绑定了架子 更新已经落架数量,并且把下片任务表的对应记录删掉
    public void down_workstation(){
    /**
     * //当机械手任务表中状态为1,工位表流程卡绑定了架子 更新已经落架数量,并且把下片任务表的对应记录删掉
     */
        //downWorkstationMapper = WebSocketServer.applicationContext.getBean(DownWorkstationMapper.class);
        //downGlassInfoMapper = WebSocketServer.applicationContext.getBean(DownGlassInfoMapper.class);
    public void downWorkstation() {
        try {
            //查询下片工位表中架子是否绑定了流程卡号 工位表和任务表中状态为1的流程卡号和已落架数量
            List<DownWorkstation> taskdownWorkstation = downWorkstationMapper.selectdownWorkstationstate();
@@ -116,35 +132,23 @@
    }
    /**
     * @param downWorkstation // 绑定流程卡号架子
     */
    // 绑定流程卡号架子
    public void bindingshelf(DownWorkstation downWorkstation){
        downWorkstationMapper.updateFlowCardId(downWorkstation);
    }
    /**
     * @param downWorkstation // 满架拉走 清除流程卡信息
     */
    // 满架拉走 清除流程卡信息
    public void clearFlowCardId(DownWorkstation downWorkstation){
       downWorkstationMapper.clearFlowCardId(downWorkstation);
    }
}