package com.example.springboot.service;
|
|
import java.sql.SQLException;
|
import java.util.List;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import com.example.springboot.entity.north_glass_buffer1;
|
import com.example.springboot.mapper.HomeMapper;
|
|
@Service
|
public class North_Glass_Buffer1Service {
|
@Autowired
|
private HomeMapper homeMapper;
|
|
@Autowired
|
private JdbcConnections jdbcConnections;
|
|
// 获取玻璃是否在笼子,是否在出片队列
|
public List<north_glass_buffer1> SelectAluminumFrameInfoById(String FrameBarcode) throws SQLException {
|
List<north_glass_buffer1> listAluminumFrame = jdbcConnections
|
.SelectGlassByGlassIdOrderIdFrameIdss(FrameBarcode);
|
for (north_glass_buffer1 north_glass_buffer1 : listAluminumFrame) {
|
north_glass_buffer1.setstorageCage(homeMapper.SelectStorageGlassById(north_glass_buffer1.getbarcode()));
|
north_glass_buffer1.setOut_slice(homeMapper.SelectQueueByglassid(north_glass_buffer1.getbarcode()));
|
}
|
return listAluminumFrame;
|
}
|
|
// 根据铝框id添加玻璃到出片队列
|
public void AddOutSliceS(String FrameBarcode) throws SQLException {
|
List<north_glass_buffer1> north_glass_buffer1s = SelectAluminumFrameInfoById(FrameBarcode);
|
String flip = jdbcConnections.SelectFlipByFrameBarcode(FrameBarcode);
|
String position = jdbcConnections.SelectPositionByFrameBarcode(FrameBarcode);
|
int sequence = homeMapper.SelectMaxSquence();
|
for (north_glass_buffer1 north_glass_buffer1 : north_glass_buffer1s) {
|
Short state = 0;
|
if (north_glass_buffer1.getOut_slice() == null) {
|
if (north_glass_buffer1.getstorageCage() == null) {
|
state = 3;
|
}
|
homeMapper.AddOutSliceS(north_glass_buffer1.getbarcode(), flip, FrameBarcode,
|
north_glass_buffer1.getglasslengthmm().toString(),
|
north_glass_buffer1.getglassheightmm().toString(), sequence, position, state,
|
north_glass_buffer1.getordernumber(), north_glass_buffer1.getlistnumber(),
|
north_glass_buffer1.getboxnumber(), north_glass_buffer1.getglasslength().toString(),
|
north_glass_buffer1.getglassheight().toString());
|
sequence += 1;
|
}
|
}
|
}
|
|
}
|