| | |
| | | import com.example.springboot.component.PLCAutoMes; |
| | | import com.example.springboot.component.Plchome; |
| | | import com.example.springboot.component.S7control; |
| | | import com.example.springboot.entity.FlowCard; |
| | | import com.example.springboot.entity.Flowcard; |
| | | import com.example.springboot.entity.GlassInfo; |
| | | import com.example.springboot.entity.Queue; |
| | | import com.example.springboot.entity.StorageCage; |
| | |
| | | // 查询进/出片任务 |
| | | public List<StorageTask> SelectStorageTask(int task_type) { |
| | | List<StorageTask> storageTasks = new ArrayList<>(); |
| | | String loadrack="0"; |
| | | if (task_type == 0) { |
| | | storageTasks = homeMapper.SelectStorageTask(task_type); |
| | | } else { |
| | | storageTasks = homeMapper.SelectStorageTask(task_type); |
| | | } |
| | | for (StorageTask storageTask : storageTasks) { |
| | | storageTask.setstorageCage(homeMapper.SelectStorageByCell(storageTask.getLoadrack())); |
| | | if (task_type == 0) { |
| | | loadrack=storageTask.getLoadrack(); |
| | | }else{ |
| | | loadrack=storageTask.getShelfRack(); |
| | | } |
| | | storageTask.setstorageCage(homeMapper.SelectStorageByCell(loadrack)); |
| | | } |
| | | return storageTasks; |
| | | } |
| | |
| | | } |
| | | |
| | | // 查询订单任务 |
| | | public List<FlowCard> SelectOrderTask() { |
| | | List<FlowCard> OrderTask = homeMapper.SelectOrderTask(); |
| | | for (FlowCard flowcard : OrderTask) { |
| | | public List<Flowcard> SelectOrderTask() { |
| | | List<Flowcard> OrderTask = homeMapper.SelectOrderTask(); |
| | | for (Flowcard flowcard : OrderTask) { |
| | | flowcard.setglassinfo(homeMapper.SelectOrderView(flowcard.getFlowcard())); |
| | | } |
| | | return OrderTask; |
| | |
| | | |
| | | // 开始任务 |
| | | public Result ClaimTasks(String flowcard, Integer state, Integer line) { |
| | | if (state == 1) { |
| | | homeMapper.ClaimTasks(flowcard, 0, line); |
| | | } else { |
| | | homeMapper.ClaimTasks(flowcard, 1, line); |
| | | } |
| | | int count=homeMapper.SelectTaskCount(flowcard,line); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", "200"); |
| | | if(count==0){ |
| | | if (state == 1) { |
| | | homeMapper.ClaimTasks(flowcard, 0, line); |
| | | } else { |
| | | homeMapper.ClaimTasks(flowcard, 1, line); |
| | | } |
| | | map.put("message", "200"); |
| | | }else{ |
| | | map.put("message", "300"); |
| | | } |
| | | |
| | | return Result.success(map); |
| | | } |
| | | |
| | |
| | | public Result StartChange(String flowcard) { |
| | | homeMapper.StartChange(flowcard, 1); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | int state=homeMapper.selectStartChange(flowcard); |
| | | map.put("message", "200"); |
| | | return Result.success(map); |
| | | } |
| | | // 删除工程 |
| | | public Result deleteTasks(String flowcard) { |
| | | int aa=homeMapper.deleteFlowcard(flowcard.trim()); |
| | | homeMapper.deleteGlassinfo(flowcard.trim()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("message", aa); |
| | | return Result.success(map); |
| | | } |
| | | |
| | |
| | | for (Map map : RemoveErrorData) { |
| | | String key = map.get("base").toString() + "_" + map.get("height").toString() + "_" |
| | | + map.get("thickness").toString() + "_" + map.get("films").toString(); |
| | | |
| | | |
| | | String tierkey = map.get("order").toString() + "_" + map.get("matching").toString(); |
| | | |
| | | String value = TypeData.get(key); |
| | | Integer glasstype; |
| | | System.out.println(key+":"+TypeData.get(key)); |
| | | if (TypeData.get(key) == null) { |
| | | |
| | | glasstype = homeMapper.SelectMaxTypes(key); |
| | | if(glasstype==null){ |
| | | glasstype = homeMapper.SelectMaxType(); |
| | | } |
| | | if (glasstype == null) { |
| | | glasstype = 1; |
| | | } |
| | | } |
| | | } else { |
| | | glasstype = Integer.valueOf(value); |
| | | } |