wuyouming666
2023-12-11 7ae7bcc0245afa4d94516feddc2b8bd60e4253c6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.example.springboot.service;
 
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import com.example.springboot.common.Result;
import com.example.springboot.entity.Out_slice;
import com.example.springboot.mapper.HomeMapper;
 
@Service
public class OutSliceServive {
 
  @Autowired
  private HomeMapper homeMapper;
 
  @Autowired
  private JdbcConnections jdbcConnections;
 
  public void AddOutSliceS(String[][] AluminumFrames) throws SQLException {
    int sequence = homeMapper.SelectMaxSquence();
 
    // 添加到数据库
    for (String[] item : AluminumFrames) {
      if (item[1] == "true") {
        String position = jdbcConnections.SelectPositionByFrameBarcode(item[3]);
        homeMapper.AddOutSliceS(item[0], item[2], item[3], item[4], item[5], sequence, position);
        sequence += 1;
      }
    }
  }
 
  // 查询出片队列
  public List<Out_slice> SelectProductionqueue() {
    List<Out_slice> listoutslice = homeMapper.SelectProductionqueue();
    for (Out_slice out_slice : listoutslice) {
      out_slice.setstorageCage(homeMapper.SelectStorageGlassById(out_slice.getGlassId()));
    }
    return listoutslice;
  }
 
public Result CompleteQueue(String id, String frameid) {
  homeMapper.CompleteQueue(id);
  Short num=homeMapper.SelectCountByFrameNo(frameid);
  if(num==0){
    homeMapper.CompleteQueueByFrameNo(frameid);
  }
  Map<String, Object> map = new HashMap<>();
  map.put("message", "200");
  return Result.success(map);
}
 
}