package com.mes.downstorage.service.impl;
import com.github.yulichang.toolkit.JoinWrappers;
import com.mes.common.PLCAutoMes;
import com.mes.common.S7control;
import com.mes.device.PlcParameterObject;
import com.mes.downglassinfo.entity.DownGlassTask;
import com.mes.downglassinfo.service.DownGlassTaskService;
import com.mes.downstorage.entity.DownStorageCage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.downstorage.entity.DownStorageCageDetails;
import com.mes.downstorage.mapper.DownStorageCageMapper;
import com.mes.downstorage.service.DownStorageCageDetailsService;
import com.mes.downstorage.service.DownStorageCageService;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.service.GlassInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
*
* 服务实现类
*
*
* @author zhoush
* @since 2024-03-27
*/
@Slf4j
@Service
public class DownStorageCageServiceImpl extends ServiceImpl implements DownStorageCageService {
@Autowired
private DownStorageCageMapper downStorageCageMapper;
@Autowired
private GlassInfoService glassInfoService;
@Autowired
private DownGlassTaskService downGlassTaskService;
@Autowired
private DownStorageCageDetailsService downStorageCageDetailsService;
public DownGlassTask createDownGlassTask(GlassInfo glassInfo, String startCell, String endCell,String taskType ) {
DownGlassTask downGlassTask = new DownGlassTask();
BeanUtils.copyProperties(glassInfo,downGlassTask);
downGlassTask.setStartCell(startCell);
downGlassTask.setTaskType(taskType);
downGlassTask.setEndCell(endCell);
return downGlassTask;
}
public DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, String startCell, String endCell,String taskType ) {
DownGlassTask downGlassTask = new DownGlassTask();
BeanUtils.copyProperties(glassInfo,downGlassTask);
downGlassTask.setStartCell(startCell);
downGlassTask.setTaskType(taskType);
downGlassTask.setEndCell(endCell);
return downGlassTask;
}
@Override
public boolean processInto(String Number) {
//按id查询玻璃信息表里的玻璃
GlassInfo GlassInfo = glassInfoService.selectGlassId(Number);
PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
//存在此玻璃编号
if (GlassInfo != null) {
//同找到同流程卡附近空格
List list = selectCacheEmpty();
// list