代码更新
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -202,8 +202,10 @@ public class DeviceOpcProtocolRunable implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception var30) {
|
} catch (Exception var30) {
|
||||||
|
|
||||||
if (group != null) {
|
if (group != null) {
|
||||||
try {
|
try {
|
||||||
|
group.getServer().dispose();
|
||||||
group.clear();
|
group.clear();
|
||||||
group.remove();
|
group.remove();
|
||||||
} catch (Exception var6) {
|
} catch (Exception var6) {
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAllByCache(Map whereJson, Pageable page) {
|
public Map<String, Object> queryAllByCache(Map whereJson, Pageable page) {
|
||||||
synchronized (TaskServiceImpl.class){
|
|
||||||
|
|
||||||
|
|
||||||
this.reload();
|
this.reload();
|
||||||
@@ -151,6 +151,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
String task_type = (String) whereJson.get("task_type");
|
String task_type = (String) whereJson.get("task_type");
|
||||||
List<TaskDto> taskList = new ArrayList();
|
List<TaskDto> taskList = new ArrayList();
|
||||||
|
|
||||||
|
synchronized (TaskServiceImpl.class){
|
||||||
Iterator<TaskDto> it = tasks.iterator();
|
Iterator<TaskDto> it = tasks.iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
TaskDto task = it.next();
|
TaskDto task = it.next();
|
||||||
@@ -193,6 +194,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
DateUtil.parse(task2.getCreate_time())))
|
DateUtil.parse(task2.getCreate_time())))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Integer currentPageNumber = page.getPageNumber() + 1;
|
Integer currentPageNumber = page.getPageNumber() + 1;
|
||||||
Integer pageMaxSize = page.getPageSize();
|
Integer pageMaxSize = page.getPageSize();
|
||||||
List<TaskDto> taskDtoList =
|
List<TaskDto> taskDtoList =
|
||||||
@@ -204,7 +207,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
jo.put("content", taskDtoList);
|
jo.put("content", taskDtoList);
|
||||||
jo.put("totalElements", taskList.size());
|
jo.put("totalElements", taskList.size());
|
||||||
return jo;
|
return jo;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -653,7 +656,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(TaskDto dto) {
|
public void update(TaskDto dto) {
|
||||||
synchronized (TaskServiceImpl.class) {
|
|
||||||
TaskDto entity = this.findById(dto.getTask_id());
|
TaskDto entity = this.findById(dto.getTask_id());
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
@@ -669,6 +672,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
|
|
||||||
wo.update(json);
|
wo.update(json);
|
||||||
|
|
||||||
|
synchronized (TaskServiceImpl.class) {
|
||||||
Iterator<TaskDto> iterator = tasks.iterator();
|
Iterator<TaskDto> iterator = tasks.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
TaskDto task = iterator.next();
|
TaskDto task = iterator.next();
|
||||||
@@ -679,6 +683,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
if (StrUtil.equals(dto.getTask_status(), "0") || StrUtil.equals(dto.getTask_status(), "1")) {
|
if (StrUtil.equals(dto.getTask_status(), "0") || StrUtil.equals(dto.getTask_status(), "1")) {
|
||||||
tasks.add(dto);
|
tasks.add(dto);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 判断是否为WMS下发的任务,如果是反馈任务状态给WMS
|
// 判断是否为WMS下发的任务,如果是反馈任务状态给WMS
|
||||||
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
||||||
if (!StrUtil.startWith(dto.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
if (!StrUtil.startWith(dto.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
||||||
@@ -767,7 +772,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -916,7 +921,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
JSONObject json = (JSONObject) JSONObject.toJSON(entity);
|
JSONObject json = (JSONObject) JSONObject.toJSON(entity);
|
||||||
wo.update(json);
|
wo.update(json);
|
||||||
|
|
||||||
try {
|
synchronized (TaskServiceImpl.class){
|
||||||
Iterator<TaskDto> it = tasks.iterator();
|
Iterator<TaskDto> it = tasks.iterator();
|
||||||
// 清理缓存
|
// 清理缓存
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
@@ -924,10 +929,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
if (taskDto.getTask_id().equals(id)) {
|
if (taskDto.getTask_id().equals(id)) {
|
||||||
tasks.remove(taskDto);
|
tasks.remove(taskDto);
|
||||||
}
|
}
|
||||||
}
|
}}
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
// 判断是否为WMS下发的任务,如果是反馈任务状态给WMS
|
// 判断是否为WMS下发的任务,如果是反馈任务状态给WMS
|
||||||
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
||||||
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
||||||
@@ -1089,7 +1092,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
|||||||
if (acsTask == null) {
|
if (acsTask == null) {
|
||||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
}
|
}
|
||||||
ParamService paramService = SpringContextHolder.getBean(ParamService.class);
|
|
||||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||||
InstructionService instructionservice = SpringContextHolder.getBean("instructionServiceImpl");
|
InstructionService instructionservice = SpringContextHolder.getBean("instructionServiceImpl");
|
||||||
InstructionDto inst = instructionservice.findByTaskid(ids, "instruction_status < 2 ");
|
InstructionDto inst = instructionservice.findByTaskid(ids, "instruction_status < 2 ");
|
||||||
|
|||||||
Reference in New Issue
Block a user