fix: CustomPolicy
This commit is contained in:
@@ -39,60 +39,14 @@ public class AbstractDriverService<T> implements IDriverService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public JSONObject getCommonDeviceInfo(T t) {
|
|
||||||
JSONObject map = new JSONObject();
|
|
||||||
try {
|
|
||||||
Class<?> tClass = t.getClass();
|
|
||||||
Method methodMode = tClass.getMethod("getMode");
|
|
||||||
Method methodMove = tClass.getMethod("getMove");
|
|
||||||
Integer mode = (Integer) methodMode.invoke(t);
|
|
||||||
Integer move = (Integer) methodMove.invoke(t);
|
|
||||||
/* map.put("move",StageActorUtil.getMove(move));
|
|
||||||
map.put("hasGoods",StageActorUtil.getHasGoods(move));
|
|
||||||
map.put("mode",StageActorUtil.getMode(mode));
|
|
||||||
map.put("isOnline",StageActorUtil.getIsOnline(mode));*/
|
|
||||||
} catch (NoSuchMethodException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InvocationTargetException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JSONObject getCommonDeviceInfo(T t, int i) {
|
|
||||||
JSONObject map = new JSONObject();
|
|
||||||
try {
|
|
||||||
Class<?> tClass = t.getClass();
|
|
||||||
Method methodMode = tClass.getMethod("getMode");
|
|
||||||
Integer mode = (Integer) methodMode.invoke(t);
|
|
||||||
/* map.put("mode",StageActorUtil.getMode(mode));
|
|
||||||
map.put("isOnline",StageActorUtil.getIsOnline(mode));*/
|
|
||||||
} catch (NoSuchMethodException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InvocationTargetException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JSONObject getCommonDeviceInfo(T t, int i, int j) {
|
public JSONObject getCommonDeviceInfo(T t, int i, int j) {
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
try {
|
try {
|
||||||
Class<?> tClass = t.getClass();
|
Class<?> tClass = t.getClass();
|
||||||
Method methodMode = tClass.getMethod("getMode");
|
|
||||||
Method methodMove = tClass.getMethod("getMove");
|
|
||||||
Method methodGetHasGoods = tClass.getMethod("getHasGoods");
|
Method methodGetHasGoods = tClass.getMethod("getHasGoods");
|
||||||
Method methodGetIsonline = tClass.getMethod("getIsonline");
|
Method methodGetIsonline = tClass.getMethod("getIsonline");
|
||||||
Integer mode = (Integer) methodMode.invoke(t);
|
|
||||||
Integer move = (Integer) methodMove.invoke(t);
|
|
||||||
Integer hasGoods = (Integer) methodGetHasGoods.invoke(t);
|
Integer hasGoods = (Integer) methodGetHasGoods.invoke(t);
|
||||||
Boolean isOnline = (Boolean) methodGetIsonline.invoke(t);
|
Boolean isOnline = (Boolean) methodGetIsonline.invoke(t);
|
||||||
/* map.put("mode",StageActorUtil.getMode(mode,0));
|
|
||||||
map.put("move",StageActorUtil.getMove(move));*/
|
|
||||||
map.put("hasGoods", hasGoods);
|
map.put("hasGoods", hasGoods);
|
||||||
map.put("isOnline", isOnline);
|
map.put("isOnline", isOnline);
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException e) {
|
||||||
|
|||||||
@@ -14,7 +14,10 @@ public interface IDriverService {
|
|||||||
JSONObject getDeviceInfo(Device device);
|
JSONObject getDeviceInfo(Device device);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取db值
|
* getDbValue
|
||||||
|
* @param device
|
||||||
|
* @param dbName
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
Integer getDbValue(Device device, String dbName);
|
Integer getDbValue(Device device, String dbName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ public class StandardOrdinarySiteDevice extends AbstractDriverService {
|
|||||||
public JSONObject getDeviceInfo(Device device) {
|
public JSONObject getDeviceInfo(Device device) {
|
||||||
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
// jo.put("move", StageActorUtil.getMove(standardOrdinarySiteDeviceDriver.getHasGoods()));
|
|
||||||
jo.put("container", standardOrdinarySiteDeviceDriver.getContainer());
|
jo.put("container", standardOrdinarySiteDeviceDriver.getContainer());
|
||||||
jo.put("hasGoods", standardOrdinarySiteDeviceDriver.getHasGoods());
|
jo.put("hasGoods", standardOrdinarySiteDeviceDriver.getHasGoods());
|
||||||
jo.put("isOnline", true);
|
jo.put("isOnline", true);
|
||||||
|
|||||||
@@ -16,18 +16,35 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface CommonMapper<E> extends BaseMapper<E> {
|
public interface CommonMapper<E> extends BaseMapper<E> {
|
||||||
|
/**
|
||||||
|
* 查询
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
default QueryChainWrapper<E> query() {
|
default QueryChainWrapper<E> query() {
|
||||||
return ChainWrappers.queryChain(this);
|
return ChainWrappers.queryChain(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* lambdaQuery
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
default LambdaQueryChainWrapper<E> lambdaQuery() {
|
default LambdaQueryChainWrapper<E> lambdaQuery() {
|
||||||
return ChainWrappers.lambdaQueryChain(this);
|
return ChainWrappers.lambdaQueryChain(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
default UpdateChainWrapper<E> update() {
|
default UpdateChainWrapper<E> update() {
|
||||||
return ChainWrappers.updateChain(this);
|
return ChainWrappers.updateChain(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* lambdaUpdate
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
default LambdaUpdateChainWrapper<E> lambdaUpdate() {
|
default LambdaUpdateChainWrapper<E> lambdaUpdate() {
|
||||||
return ChainWrappers.lambdaUpdateChain(this);
|
return ChainWrappers.lambdaUpdateChain(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,13 @@ import java.util.List;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class QueryHelpMybatisPlus {
|
public class QueryHelpMybatisPlus {
|
||||||
|
|
||||||
// TODO DataPermission
|
/**
|
||||||
|
*
|
||||||
|
* @param query
|
||||||
|
* @param <R>
|
||||||
|
* @param <Q>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static <R, Q> QueryWrapper<R> getPredicate(Q query) {
|
public static <R, Q> QueryWrapper<R> getPredicate(Q query) {
|
||||||
QueryWrapper<R> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<R> queryWrapper = new QueryWrapper<>();
|
||||||
if (query == null) {
|
if (query == null) {
|
||||||
@@ -47,7 +53,6 @@ public class QueryHelpMybatisPlus {
|
|||||||
// 模糊多字段
|
// 模糊多字段
|
||||||
if (ObjectUtil.isNotEmpty(blurry)) {
|
if (ObjectUtil.isNotEmpty(blurry)) {
|
||||||
String[] blurrys = blurry.split(",");
|
String[] blurrys = blurry.split(",");
|
||||||
//queryWrapper.or();
|
|
||||||
queryWrapper.and(wrapper -> {
|
queryWrapper.and(wrapper -> {
|
||||||
for (String blurry1 : blurrys) {
|
for (String blurry1 : blurrys) {
|
||||||
String column = humpToUnderline(blurry1);
|
String column = humpToUnderline(blurry1);
|
||||||
@@ -62,7 +67,6 @@ public class QueryHelpMybatisPlus {
|
|||||||
String finalAttributeName = attributeName;
|
String finalAttributeName = attributeName;
|
||||||
switch (q.type()) {
|
switch (q.type()) {
|
||||||
case EQUAL:
|
case EQUAL:
|
||||||
//queryWrapper.and(wrapper -> wrapper.eq(finalAttributeName, val));
|
|
||||||
queryWrapper.eq(attributeName, val);
|
queryWrapper.eq(attributeName, val);
|
||||||
break;
|
break;
|
||||||
case GREATER_THAN:
|
case GREATER_THAN:
|
||||||
@@ -88,11 +92,6 @@ public class QueryHelpMybatisPlus {
|
|||||||
queryWrapper.in(finalAttributeName, (Collection<Long>) val);
|
queryWrapper.in(finalAttributeName, (Collection<Long>) val);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// case NOT_IN:
|
|
||||||
// if (CollUtil.isNotEmpty((Collection<Long>) val)) {
|
|
||||||
// queryWrapper.notIn(finalAttributeName, (Collection<Long>) val);
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
case NOT_EQUAL:
|
case NOT_EQUAL:
|
||||||
queryWrapper.ne(finalAttributeName, val);
|
queryWrapper.ne(finalAttributeName, val);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -16,16 +16,18 @@ public class DequeCustomerDeviceStrategy implements DeviceStrategy {
|
|||||||
public DequeCustomerDeviceStrategy() {
|
public DequeCustomerDeviceStrategy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getCode() {
|
public String getCode() {
|
||||||
return DequeCustomerDeviceStrategy.class.getSimpleName();
|
return DequeCustomerDeviceStrategy.class.getSimpleName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "自定义队列策略";
|
return "自定义队列策略";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public WaitingInstructionDeque strategy(List<Instruction> instructions, String device_code) {
|
public WaitingInstructionDeque strategy(List<Instruction> instructions, String device_code) {
|
||||||
//WaitingInstructionDeque deque = this.instructionService.findWaitingInstructionDequeByDeviceCode(device_code);
|
|
||||||
System.out.println("自定义队列策略");
|
System.out.println("自定义队列策略");
|
||||||
Map<String, List<Instruction>> factory = new HashMap();
|
Map<String, List<Instruction>> factory = new HashMap();
|
||||||
|
|
||||||
@@ -45,14 +47,12 @@ public class DequeCustomerDeviceStrategy implements DeviceStrategy {
|
|||||||
List<String> sort_keys = new LinkedList();
|
List<String> sort_keys = new LinkedList();
|
||||||
sort_keys.addAll(keys);
|
sort_keys.addAll(keys);
|
||||||
Collections.sort(sort_keys);
|
Collections.sort(sort_keys);
|
||||||
// SortUtlEx.sort(sort_keys, this.comparator);
|
|
||||||
Iterator var12 = sort_keys.iterator();
|
Iterator var12 = sort_keys.iterator();
|
||||||
|
|
||||||
while (var12.hasNext()) {
|
while (var12.hasNext()) {
|
||||||
String string = (String) var12.next();
|
String string = (String) var12.next();
|
||||||
List<Instruction> list2 = (List) factory.get(string);
|
List<Instruction> list2 = (List) factory.get(string);
|
||||||
if (list2 != null && list2.size() > 0) {
|
if (list2 != null && list2.size() > 0) {
|
||||||
//deque.offerIfNotExists((Instruction)list2.get(0));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,16 +17,18 @@ public class DequeDefaultDeviceStrategy implements DeviceStrategy {
|
|||||||
public DequeDefaultDeviceStrategy() {
|
public DequeDefaultDeviceStrategy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getCode() {
|
public String getCode() {
|
||||||
return DequeDefaultDeviceStrategy.class.getSimpleName();
|
return DequeDefaultDeviceStrategy.class.getSimpleName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "默认队列策略";
|
return "默认队列策略";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public WaitingInstructionDeque strategy(List<Instruction> instructions, String device_code) {
|
public WaitingInstructionDeque strategy(List<Instruction> instructions, String device_code) {
|
||||||
//WaitingInstructionDeque deque = this.instructionService.findWaitingInstructionDequeByDeviceCode(device_code);
|
|
||||||
System.out.println("默认队列策略");
|
System.out.println("默认队列策略");
|
||||||
Map<String, List<Instruction>> factory = new HashMap();
|
Map<String, List<Instruction>> factory = new HashMap();
|
||||||
|
|
||||||
@@ -46,14 +48,12 @@ public class DequeDefaultDeviceStrategy implements DeviceStrategy {
|
|||||||
List<String> sort_keys = new LinkedList();
|
List<String> sort_keys = new LinkedList();
|
||||||
sort_keys.addAll(keys);
|
sort_keys.addAll(keys);
|
||||||
Collections.sort(sort_keys);
|
Collections.sort(sort_keys);
|
||||||
// SortUtlEx.sort(sort_keys, this.comparator);
|
|
||||||
Iterator var12 = sort_keys.iterator();
|
Iterator var12 = sort_keys.iterator();
|
||||||
|
|
||||||
while (var12.hasNext()) {
|
while (var12.hasNext()) {
|
||||||
String string = (String) var12.next();
|
String string = (String) var12.next();
|
||||||
List<Instruction> list2 = (List) factory.get(string);
|
List<Instruction> list2 = (List) factory.get(string);
|
||||||
if (list2 != null && list2.size() > 0) {
|
if (list2 != null && list2.size() > 0) {
|
||||||
//deque.offerIfNotExists((Instruction)list2.get(0));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,24 @@ import org.nl.acs.instruction.domain.Instruction;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface DeviceStrategy {
|
public interface DeviceStrategy {
|
||||||
|
/**
|
||||||
|
* 获取名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
String getName();
|
String getName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取Code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
String getCode();
|
String getCode();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 策略
|
||||||
|
* @param instructions
|
||||||
|
* @param device_code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
default WaitingInstructionDeque strategy(List<Instruction> instructions, String device_code) {
|
default WaitingInstructionDeque strategy(List<Instruction> instructions, String device_code) {
|
||||||
throw new RuntimeException("未实现");
|
throw new RuntimeException("未实现");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,13 @@ import java.util.List;
|
|||||||
|
|
||||||
public class StackerStrategyDto {
|
public class StackerStrategyDto {
|
||||||
private String deviceCode;
|
private String deviceCode;
|
||||||
//策略
|
/**
|
||||||
|
* 策略
|
||||||
|
*/
|
||||||
private List<StackerInstruction> plan = new ArrayList();
|
private List<StackerInstruction> plan = new ArrayList();
|
||||||
//禁止策略 暂时未开发
|
/**
|
||||||
|
* 禁止策略 暂时未开发
|
||||||
|
*/
|
||||||
private List<StackerInstruction> forbid = new ArrayList();
|
private List<StackerInstruction> forbid = new ArrayList();
|
||||||
|
|
||||||
public StackerStrategyDto() {
|
public StackerStrategyDto() {
|
||||||
|
|||||||
@@ -16,16 +16,18 @@ public class StockinFirstDeviceStrategy implements DeviceStrategy {
|
|||||||
public StockinFirstDeviceStrategy() {
|
public StockinFirstDeviceStrategy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getCode() {
|
public String getCode() {
|
||||||
return StockinFirstDeviceStrategy.class.getSimpleName();
|
return StockinFirstDeviceStrategy.class.getSimpleName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "入库优先策略";
|
return "入库优先策略";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public WaitingInstructionDeque strategy(List<Instruction> instructions, String device_code) {
|
public WaitingInstructionDeque strategy(List<Instruction> instructions, String device_code) {
|
||||||
//WaitingInstructionDeque deque = this.instructionService.findWaitingInstructionDequeByDeviceCode(device_code);
|
|
||||||
System.out.println("入库优先策略");
|
System.out.println("入库优先策略");
|
||||||
Map<String, List<Instruction>> factory = new HashMap();
|
Map<String, List<Instruction>> factory = new HashMap();
|
||||||
|
|
||||||
@@ -45,14 +47,12 @@ public class StockinFirstDeviceStrategy implements DeviceStrategy {
|
|||||||
List<String> sort_keys = new LinkedList();
|
List<String> sort_keys = new LinkedList();
|
||||||
sort_keys.addAll(keys);
|
sort_keys.addAll(keys);
|
||||||
Collections.sort(sort_keys);
|
Collections.sort(sort_keys);
|
||||||
// SortUtlEx.sort(sort_keys, this.comparator);
|
|
||||||
Iterator var12 = sort_keys.iterator();
|
Iterator var12 = sort_keys.iterator();
|
||||||
|
|
||||||
while (var12.hasNext()) {
|
while (var12.hasNext()) {
|
||||||
String string = (String) var12.next();
|
String string = (String) var12.next();
|
||||||
List<Instruction> list2 = (List) factory.get(string);
|
List<Instruction> list2 = (List) factory.get(string);
|
||||||
if (list2 != null && list2.size() > 0) {
|
if (list2 != null && list2.size() > 0) {
|
||||||
//deque.offerIfNotExists((Instruction)list2.get(0));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,16 +16,18 @@ public class StockoutFirstDeviceStrategy implements DeviceStrategy {
|
|||||||
public StockoutFirstDeviceStrategy() {
|
public StockoutFirstDeviceStrategy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getCode() {
|
public String getCode() {
|
||||||
return StockoutFirstDeviceStrategy.class.getSimpleName();
|
return StockoutFirstDeviceStrategy.class.getSimpleName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "出库优先策略";
|
return "出库优先策略";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public WaitingInstructionDeque strategy(List<Instruction> instructions, String device_code) {
|
public WaitingInstructionDeque strategy(List<Instruction> instructions, String device_code) {
|
||||||
//WaitingInstructionDeque deque = this.instructionService.findWaitingInstructionDequeByDeviceCode(device_code);
|
|
||||||
System.out.println("出库优先策略");
|
System.out.println("出库优先策略");
|
||||||
Map<String, List<Instruction>> factory = new HashMap();
|
Map<String, List<Instruction>> factory = new HashMap();
|
||||||
|
|
||||||
@@ -45,14 +47,12 @@ public class StockoutFirstDeviceStrategy implements DeviceStrategy {
|
|||||||
List<String> sort_keys = new LinkedList();
|
List<String> sort_keys = new LinkedList();
|
||||||
sort_keys.addAll(keys);
|
sort_keys.addAll(keys);
|
||||||
Collections.sort(sort_keys);
|
Collections.sort(sort_keys);
|
||||||
// SortUtlEx.sort(sort_keys, this.comparator);
|
|
||||||
Iterator var12 = sort_keys.iterator();
|
Iterator var12 = sort_keys.iterator();
|
||||||
|
|
||||||
while (var12.hasNext()) {
|
while (var12.hasNext()) {
|
||||||
String string = (String) var12.next();
|
String string = (String) var12.next();
|
||||||
List<Instruction> list2 = (List) factory.get(string);
|
List<Instruction> list2 = (List) factory.get(string);
|
||||||
if (list2 != null && list2.size() > 0) {
|
if (list2 != null && list2.size() > 0) {
|
||||||
//deque.offerIfNotExists((Instruction)list2.get(0));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,8 +77,8 @@ public class CustomPolicyController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/updateOn")
|
@GetMapping("/updateOn")
|
||||||
@Log("自定义策略列表")
|
@Log("是否启用")
|
||||||
@ApiOperation("自定义策略列表")
|
@ApiOperation("是否启用")
|
||||||
public ResponseEntity<Object> updateOn(@RequestParam Long id, @RequestParam Integer is_on) {
|
public ResponseEntity<Object> updateOn(@RequestParam Long id, @RequestParam Integer is_on) {
|
||||||
customPolicyService.updateOn(id, is_on);
|
customPolicyService.updateOn(id, is_on);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
|||||||
@@ -17,21 +17,56 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
public interface CustomPolicyService extends CommonService<CustomPolicy> {
|
public interface CustomPolicyService extends CommonService<CustomPolicy> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
* @param whereJson
|
||||||
|
* @param page
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
PageInfo<CustomPolicyDTO> queryAll(Map whereJson, Pageable page);
|
PageInfo<CustomPolicyDTO> queryAll(Map whereJson, Pageable page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
* @param dto
|
||||||
|
*/
|
||||||
void create(CustomPolicyDTO dto);
|
void create(CustomPolicyDTO dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新
|
||||||
|
* @param dto
|
||||||
|
*/
|
||||||
void update(CustomPolicyDTO dto);
|
void update(CustomPolicyDTO dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param ids
|
||||||
|
*/
|
||||||
void deleteAll(String[] ids);
|
void deleteAll(String[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增自定义策略
|
||||||
|
* @param customPolicyPlantVO
|
||||||
|
*/
|
||||||
void createPlant(CustomPolicyPlantVO customPolicyPlantVO);
|
void createPlant(CustomPolicyPlantVO customPolicyPlantVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义策略列表
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
CustomPolicyPlantVO plantList(Long id);
|
CustomPolicyPlantVO plantList(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否启用
|
||||||
|
* @param id
|
||||||
|
* @param is_on
|
||||||
|
*/
|
||||||
void updateOn(Long id, Integer is_on);
|
void updateOn(Long id, Integer is_on);
|
||||||
|
|
||||||
DeviceStrategy findByCode(String var1);
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设备策略
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
List<Map> findDeviceStrategyOption();
|
List<Map> findDeviceStrategyOption();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,11 +7,21 @@ package org.nl.acs.custompolicy.server.enums;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum CustomPolicyTaskTypeEnum {
|
public enum CustomPolicyTaskTypeEnum {
|
||||||
|
/**
|
||||||
|
* 入库
|
||||||
|
*/
|
||||||
IN(1, "入库"),
|
IN(1, "入库"),
|
||||||
|
/**
|
||||||
|
* 出库
|
||||||
|
*/
|
||||||
OUT(2, "出库"),
|
OUT(2, "出库"),
|
||||||
|
/**
|
||||||
|
* 移库
|
||||||
|
*/
|
||||||
MOVE(3, "移库");
|
MOVE(3, "移库");
|
||||||
|
|
||||||
Integer code;
|
Integer code;
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ public class CustomPolicyServiceImpl extends CommonServiceImpl<CustomPolicyMappe
|
|||||||
customPolicyMapper.updateById(customPolicy);
|
customPolicyMapper.updateById(customPolicy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public DeviceStrategy findByCode(String code) {
|
public DeviceStrategy findByCode(String code) {
|
||||||
List<DeviceStrategy> strategys = this.findAllDeviceStrategy();
|
List<DeviceStrategy> strategys = this.findAllDeviceStrategy();
|
||||||
Iterator var3 = strategys.iterator();
|
Iterator var3 = strategys.iterator();
|
||||||
@@ -160,6 +160,7 @@ public class CustomPolicyServiceImpl extends CommonServiceImpl<CustomPolicyMappe
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public List<Map> findDeviceStrategyOption() {
|
public List<Map> findDeviceStrategyOption() {
|
||||||
List<DeviceStrategy> strategys = this.findAllDeviceStrategy();
|
List<DeviceStrategy> strategys = this.findAllDeviceStrategy();
|
||||||
List<Map> strings = new ArrayList<>();
|
List<Map> strings = new ArrayList<>();
|
||||||
|
|||||||
@@ -16,5 +16,9 @@ import java.util.Set;
|
|||||||
@Repository
|
@Repository
|
||||||
public interface CustomPolicyMapper extends CommonMapper<CustomPolicy> {
|
public interface CustomPolicyMapper extends CommonMapper<CustomPolicy> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新
|
||||||
|
* @param idsSet
|
||||||
|
*/
|
||||||
void upBatchIds(@Param("ids") Set<String> idsSet);
|
void upBatchIds(@Param("ids") Set<String> idsSet);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user