rev 新增堆垛机策略类型
This commit is contained in:
@@ -1,25 +1,17 @@
|
||||
package org.nl.acs.custompolicy;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import org.nl.acs.custompolicy.server.CustomPolicyService;
|
||||
import org.nl.acs.custompolicy.server.dto.CustomPolicyDTO;
|
||||
import org.nl.acs.custompolicy.server.mapper.CustomPolicyMapper;
|
||||
import org.nl.acs.device.service.mapper.DeviceMapper;
|
||||
import org.nl.acs.instruction.domain.Instruction;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.storage_cell.domain.StorageCell;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
public class DequeCustomerDeviceStrategy implements DeviceStrategy {
|
||||
|
||||
@Autowired
|
||||
InstructionService instructionService;
|
||||
@Autowired
|
||||
CustomPolicyService customPolicyService;
|
||||
CustomerStragetyCacheService customerStragetyCacheService;
|
||||
|
||||
CustomPolicyMapper customPolicyMapper;
|
||||
|
||||
public DequeCustomerDeviceStrategy() {
|
||||
}
|
||||
@@ -32,13 +24,39 @@ public class DequeCustomerDeviceStrategy implements DeviceStrategy {
|
||||
return "自定义队列策略";
|
||||
}
|
||||
|
||||
private String getType(String type, String from, String to) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public WaitingInstructionDeque strategy(List<Instruction> instructions, String device_code) {
|
||||
//WaitingInstructionDeque deque = this.instructionService.findWaitingInstructionDequeByDeviceCode(device_code);
|
||||
StackerStrategyDto cacheStragety = this.customerStragetyCacheService.getStragety(device_code);
|
||||
System.out.println("自定义队列策略");
|
||||
Map<String, List<Instruction>> factory = new HashMap();
|
||||
|
||||
Instruction instruction;
|
||||
Object list;
|
||||
for(Iterator var5 = instructions.iterator(); var5.hasNext(); ((List)list).add(instruction)) {
|
||||
instruction = (Instruction)var5.next();
|
||||
String type = instruction.getInstruction_type();
|
||||
list = (List)factory.get(type);
|
||||
if (list == null) {
|
||||
list = new ArrayList();
|
||||
factory.put(instruction.getInstruction_type(), (List<Instruction>) list);
|
||||
}
|
||||
}
|
||||
|
||||
Set<String> keys = factory.keySet();
|
||||
List<String> sort_keys = new LinkedList();
|
||||
sort_keys.addAll(keys);
|
||||
Collections.sort(sort_keys);
|
||||
// SortUtlEx.sort(sort_keys, this.comparator);
|
||||
Iterator var12 = sort_keys.iterator();
|
||||
|
||||
while(var12.hasNext()) {
|
||||
String string = (String)var12.next();
|
||||
List<Instruction> list2 = (List)factory.get(string);
|
||||
if (list2 != null && list2.size() > 0) {
|
||||
//deque.offerIfNotExists((Instruction)list2.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ public class DequeDefaultDeviceStrategy implements DeviceStrategy {
|
||||
|
||||
public WaitingInstructionDeque strategy(List<Instruction> instructions, String device_code) {
|
||||
//WaitingInstructionDeque deque = this.instructionService.findWaitingInstructionDequeByDeviceCode(device_code);
|
||||
System.out.println("默认队列策略");
|
||||
Map<String, List<Instruction>> factory = new HashMap();
|
||||
|
||||
Instruction instruction;
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
package org.nl.acs.custompolicy;
|
||||
|
||||
import org.nl.acs.instruction.domain.Instruction;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
public class StockinFirstDeviceStrategy implements DeviceStrategy {
|
||||
|
||||
@Autowired
|
||||
InstructionService instructionService;
|
||||
|
||||
public StockinFirstDeviceStrategy() {
|
||||
}
|
||||
|
||||
@@ -19,6 +25,38 @@ public class StockinFirstDeviceStrategy implements DeviceStrategy {
|
||||
}
|
||||
|
||||
public WaitingInstructionDeque strategy(List<Instruction> instructions, String device_code) {
|
||||
//WaitingInstructionDeque deque = this.instructionService.findWaitingInstructionDequeByDeviceCode(device_code);
|
||||
System.out.println("入库优先策略");
|
||||
Map<String, List<Instruction>> factory = new HashMap();
|
||||
|
||||
Instruction instruction;
|
||||
Object list;
|
||||
for(Iterator var5 = instructions.iterator(); var5.hasNext(); ((List)list).add(instruction)) {
|
||||
instruction = (Instruction)var5.next();
|
||||
String type = instruction.getInstruction_type();
|
||||
list = (List)factory.get(type);
|
||||
if (list == null) {
|
||||
list = new ArrayList();
|
||||
factory.put(instruction.getInstruction_type(), (List<Instruction>) list);
|
||||
}
|
||||
}
|
||||
|
||||
Set<String> keys = factory.keySet();
|
||||
List<String> sort_keys = new LinkedList();
|
||||
sort_keys.addAll(keys);
|
||||
Collections.sort(sort_keys);
|
||||
// SortUtlEx.sort(sort_keys, this.comparator);
|
||||
Iterator var12 = sort_keys.iterator();
|
||||
|
||||
while(var12.hasNext()) {
|
||||
String string = (String)var12.next();
|
||||
List<Instruction> list2 = (List)factory.get(string);
|
||||
if (list2 != null && list2.size() > 0) {
|
||||
//deque.offerIfNotExists((Instruction)list2.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
package org.nl.acs.custompolicy;
|
||||
|
||||
import org.nl.acs.instruction.domain.Instruction;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
public class StockoutFirstDeviceStrategy implements DeviceStrategy {
|
||||
|
||||
@Autowired
|
||||
InstructionService instructionService;
|
||||
|
||||
public StockoutFirstDeviceStrategy() {
|
||||
}
|
||||
|
||||
@@ -19,6 +25,38 @@ public class StockoutFirstDeviceStrategy implements DeviceStrategy {
|
||||
}
|
||||
|
||||
public WaitingInstructionDeque strategy(List<Instruction> instructions, String device_code) {
|
||||
//WaitingInstructionDeque deque = this.instructionService.findWaitingInstructionDequeByDeviceCode(device_code);
|
||||
System.out.println("出库优先策略");
|
||||
Map<String, List<Instruction>> factory = new HashMap();
|
||||
|
||||
Instruction instruction;
|
||||
Object list;
|
||||
for(Iterator var5 = instructions.iterator(); var5.hasNext(); ((List)list).add(instruction)) {
|
||||
instruction = (Instruction)var5.next();
|
||||
String type = instruction.getInstruction_type();
|
||||
list = (List)factory.get(type);
|
||||
if (list == null) {
|
||||
list = new ArrayList();
|
||||
factory.put(instruction.getInstruction_type(), (List<Instruction>) list);
|
||||
}
|
||||
}
|
||||
|
||||
Set<String> keys = factory.keySet();
|
||||
List<String> sort_keys = new LinkedList();
|
||||
sort_keys.addAll(keys);
|
||||
Collections.sort(sort_keys);
|
||||
// SortUtlEx.sort(sort_keys, this.comparator);
|
||||
Iterator var12 = sort_keys.iterator();
|
||||
|
||||
while(var12.hasNext()) {
|
||||
String string = (String)var12.next();
|
||||
List<Instruction> list2 = (List)factory.get(string);
|
||||
if (list2 != null && list2.size() > 0) {
|
||||
//deque.offerIfNotExists((Instruction)list2.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -161,12 +161,12 @@ public class CustomPolicyServiceImpl extends CommonServiceImpl<CustomPolicyMappe
|
||||
|
||||
public List<Map> findDeviceStrategyOption() {
|
||||
List<DeviceStrategy> strategys = this.findAllDeviceStrategy();
|
||||
Map<String, String> map = new HashMap();
|
||||
List<Map> strings = new ArrayList<>();
|
||||
Iterator var3 = strategys.iterator();
|
||||
|
||||
while(var3.hasNext()) {
|
||||
DeviceStrategy strategy = (DeviceStrategy)var3.next();
|
||||
Map<String, String> map = new HashMap();
|
||||
map.put("code",strategy.getCode());
|
||||
map.put("name",strategy.getName());
|
||||
strings.add(map);
|
||||
|
||||
Reference in New Issue
Block a user