代码更新
This commit is contained in:
@@ -18,6 +18,7 @@ import org.springframework.stereotype.Component;
|
|||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -68,7 +69,7 @@ public class AutoCreateTask {
|
|||||||
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
|
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
|
||||||
JSONArray tasks = taskTab.query("( task_status = '04' or task_status = '05') and (start_point_code LIKE 'BCPSL%' OR next_point_code LIKE 'BCPSL%' )").getResultJSONArray(0);
|
JSONArray tasks = taskTab.query("( task_status = '04' or task_status = '05') and (start_point_code LIKE 'BCPSL%' OR next_point_code LIKE 'BCPSL%' )").getResultJSONArray(0);
|
||||||
int size = tasks.size();
|
int size = tasks.size();
|
||||||
for (int i = 0, j = taskList.size(); i < j; i++) {
|
/* for (int i = 0, j = taskList.size(); i < j; i++) {
|
||||||
String start_point_code = taskList.get(i).getStart_device_code();
|
String start_point_code = taskList.get(i).getStart_device_code();
|
||||||
String next_point_code = taskList.get(i).getNext_device_code();
|
String next_point_code = taskList.get(i).getNext_device_code();
|
||||||
boolean isBcpsl = StrUtil.contains(start_point_code, "BCPSL") || StrUtil.contains(next_point_code, "BCPSL");
|
boolean isBcpsl = StrUtil.contains(start_point_code, "BCPSL") || StrUtil.contains(next_point_code, "BCPSL");
|
||||||
@@ -80,7 +81,25 @@ public class AutoCreateTask {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
Iterator<AcsTaskDto> iterator = taskList.iterator();
|
||||||
|
while(iterator.hasNext()){
|
||||||
|
AcsTaskDto taskDto = iterator.next();
|
||||||
|
String start_point_code = taskDto.getStart_device_code();
|
||||||
|
String next_point_code = taskDto.getNext_device_code();
|
||||||
|
boolean isBcpsl = StrUtil.contains(start_point_code, "BCPSL") || StrUtil.contains(next_point_code, "BCPSL");
|
||||||
|
|
||||||
|
if (isBcpsl) {
|
||||||
|
if (size < 2) {
|
||||||
|
size++;
|
||||||
|
} else {
|
||||||
|
iterator.remove();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(taskList)) {
|
if (ObjectUtil.isEmpty(taskList)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import net.sf.json.JSONArray;
|
|||||||
import net.sf.json.JSONObject;
|
import net.sf.json.JSONObject;
|
||||||
import org.nl.exception.BadRequestException;
|
import org.nl.exception.BadRequestException;
|
||||||
import org.nl.modules.system.util.CodeUtil;
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
import org.nl.service.LocalStorageService;
|
|
||||||
import org.nl.utils.FileUtil;
|
import org.nl.utils.FileUtil;
|
||||||
import org.nl.utils.SecurityUtils;
|
import org.nl.utils.SecurityUtils;
|
||||||
import org.nl.wms.pdm.enu.ProducStatus;
|
import org.nl.wms.pdm.enu.ProducStatus;
|
||||||
@@ -25,7 +24,6 @@ import org.nl.wms.sch.tasks.InEmptyVehicleTask;
|
|||||||
import org.nl.wms.sch.tasks.MaterialBackTask;
|
import org.nl.wms.sch.tasks.MaterialBackTask;
|
||||||
import org.nl.wms.sch.tasks.TaskTypeEnum;
|
import org.nl.wms.sch.tasks.TaskTypeEnum;
|
||||||
import org.nl.wms.st.core.IOStoreMst;
|
import org.nl.wms.st.core.IOStoreMst;
|
||||||
import org.nl.wms.st.core.service.EmptyVehicleService;
|
|
||||||
import org.nl.wms.st.core.service.IOStoreService;
|
import org.nl.wms.st.core.service.IOStoreService;
|
||||||
import org.nl.wms.st.util.StructFindUtil;
|
import org.nl.wms.st.util.StructFindUtil;
|
||||||
import org.nl.wql.WQL;
|
import org.nl.wql.WQL;
|
||||||
@@ -49,9 +47,9 @@ import java.util.*;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ProduceTaskServiceImpl implements ProduceTaskService {
|
public class ProduceTaskServiceImpl implements ProduceTaskService {
|
||||||
private final LocalStorageService localStorageService;
|
|
||||||
private final IOStoreService ioStoreService;
|
private final IOStoreService ioStoreService;
|
||||||
private final EmptyVehicleService emptyVehicleService;
|
|
||||||
|
private final Object lockObj=new Object();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
@@ -266,7 +264,6 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public JSONArray querAllTask() {
|
public JSONArray querAllTask() {
|
||||||
JSONArray arr = WQL.getWO("QPDM_BIGSCREEN_001").addParam("flag", "1").process().getResultJSONArray(0);
|
JSONArray arr = WQL.getWO("QPDM_BIGSCREEN_001").addParam("flag", "1").process().getResultJSONArray(0);
|
||||||
return arr;
|
return arr;
|
||||||
@@ -282,6 +279,7 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void callMaterial(Map map) {
|
public void callMaterial(Map map) {
|
||||||
|
synchronized (lockObj) {
|
||||||
if (ObjectUtil.isEmpty(map)) {
|
if (ObjectUtil.isEmpty(map)) {
|
||||||
throw new BadRequestException("没有要执行的任务");
|
throw new BadRequestException("没有要执行的任务");
|
||||||
}
|
}
|
||||||
@@ -377,6 +375,7 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
|
|||||||
map.put("start_time", now);
|
map.put("start_time", now);
|
||||||
WQLObject.getWQLObject("pdm_base_producetask").update(map);
|
WQLObject.getWQLObject("pdm_base_producetask").update(map);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -463,6 +462,7 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void materialBack(Map map) {
|
public void materialBack(Map map) {
|
||||||
|
synchronized (lockObj) {
|
||||||
if (ObjectUtil.isEmpty(map)) {
|
if (ObjectUtil.isEmpty(map)) {
|
||||||
throw new BadRequestException("没有要完成的任务");
|
throw new BadRequestException("没有要完成的任务");
|
||||||
}
|
}
|
||||||
@@ -519,11 +519,14 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
|
|||||||
taskObj.put("update_by", currentUsername);
|
taskObj.put("update_by", currentUsername);
|
||||||
taskObj.put("update_time", now);
|
taskObj.put("update_time", now);
|
||||||
taskTab.insert(taskObj);
|
taskTab.insert(taskObj);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void emptyVehicleBack(Map map) {
|
public void emptyVehicleBack(Map map) {
|
||||||
|
synchronized (lockObj) {
|
||||||
String id = MapUtil.getStr(map, "id");
|
String id = MapUtil.getStr(map, "id");
|
||||||
if (StrUtil.isEmpty(id)) throw new BadRequestException("所选屏位置不能为空!");
|
if (StrUtil.isEmpty(id)) throw new BadRequestException("所选屏位置不能为空!");
|
||||||
|
|
||||||
@@ -543,9 +546,9 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
|
|||||||
InEmptyVehicleTask inEmptyVehicleTask = new InEmptyVehicleTask();
|
InEmptyVehicleTask inEmptyVehicleTask = new InEmptyVehicleTask();
|
||||||
inEmptyVehicleTask.createTask(param);
|
inEmptyVehicleTask.createTask(param);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public JSONArray queryIdDevice(String id) {
|
public JSONArray queryIdDevice(String id) {
|
||||||
String device_code = "BCPSL0" + id;
|
String device_code = "BCPSL0" + id;
|
||||||
JSONArray arr = WQL.getWO("QPDM_PRODUCETASK_003").addParam("flag", "1").addParam("id", device_code).process().getResultJSONArray(0);
|
JSONArray arr = WQL.getWO("QPDM_PRODUCETASK_003").addParam("flag", "1").addParam("id", device_code).process().getResultJSONArray(0);
|
||||||
@@ -560,7 +563,6 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public JSONArray queryOne() {
|
public JSONArray queryOne() {
|
||||||
JSONArray arr = WQLObject.getWQLObject("pdm_base_producetask").query("device_code = 'BCPSL01' and produce_status = '00' and is_delete = '0'", "order_seq ASC").getResultJSONArray(0);
|
JSONArray arr = WQLObject.getWQLObject("pdm_base_producetask").query("device_code = 'BCPSL01' and produce_status = '00' and is_delete = '0'", "order_seq ASC").getResultJSONArray(0);
|
||||||
return arr;
|
return arr;
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ public class PointServiceImpl implements PointService {
|
|||||||
is_active = "0";
|
is_active = "0";
|
||||||
}
|
}
|
||||||
json.put("is_active", is_active);
|
json.put("is_active", is_active);
|
||||||
WQLObject.getWQLObject("md_base_material").update(json);
|
WQLObject.getWQLObject("sch_base_point").update(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="app" @mousemove="moveEvent" @click="moveEvent">
|
<!-- <div id="app" @mousemove="moveEvent" @click="moveEvent">-->
|
||||||
|
<div id="app">
|
||||||
<router-view />
|
<router-view />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user