package com.mes.workstation.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.mes.uppattenusage.entity.UpPattenUsage;
|
import com.mes.uppattenusage.mapper.UpPattenUsageMapper;
|
import com.mes.workstation.entity.UpWorkSequence;
|
import com.mes.workstation.entity.UpWorkstation;
|
import com.mes.workstation.mapper.UpWorkstationMapper;
|
import com.mes.workstation.service.UpWorkstationService;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
|
/**
|
* <p>
|
* 服务实现类
|
* </p>
|
*
|
* @author zhoush
|
* @since 2024-04-07
|
*/
|
@Service
|
@Slf4j
|
|
public class UpWorkstationServiceImpl extends ServiceImpl<UpWorkstationMapper, UpWorkstation> implements UpWorkstationService {
|
@Resource
|
UpPattenUsageMapper upPattenUsageMapper;
|
public static final String DB_100_10 = "DB_100_10";
|
|
//判断是否可以吸片进行任务
|
public boolean isCanLoadGlass() {
|
String loadstart = "吸片信号";//plcmes.getPlcParameter("吸片信号").getValue();
|
return "1".equals(loadstart);
|
|
}
|
//显示正在进行任务的工程信息
|
|
|
//判断优先吸片位置后发送出片任务
|
|
public UpWorkSequence selectPriority() {
|
UpWorkSequence upwork= this.baseMapper.selectPriority(1);
|
String start = "1";//plcmes.getPlcParameter("吸片信号").getValue();
|
UpPattenUsage uplist=new UpPattenUsage();
|
if(start.equals("1")){
|
//发送出片任务
|
UpdateWrapper<UpPattenUsage> updateWrapper = new UpdateWrapper<>();
|
updateWrapper.eq("state",1).last("LIMIT 1");
|
uplist= upPattenUsageMapper.selectOne(updateWrapper);
|
log.info("查询出本次出片的玻璃信息[]",uplist);
|
}
|
return upwork;
|
}
|
|
/**
|
* 增加人工输入的工位玻璃信息/删除人工搬走的玻璃信息
|
* @param upwork
|
*/
|
@Override
|
public void updateGlassMessage(UpWorkstation upwork) {
|
UpdateWrapper<UpWorkstation> updateWrapper = new UpdateWrapper<>();
|
updateWrapper.eq("workstation_id", upwork.getWorkstationId());
|
int update = this.baseMapper.update(upwork, updateWrapper);
|
}
|
|
|
}
|