This commit is contained in:
USER-20220102CG\noblelift
2023-02-03 15:10:38 +08:00
parent 1a7c2073ab
commit 4db31e92d6

View File

@@ -35,6 +35,7 @@ import org.nl.acs.opc.DeviceAppServiceImpl;
import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.route.service.dto.RouteLineDto;
import org.nl.acs.route.service.impl.RouteLineServiceImpl; import org.nl.acs.route.service.impl.RouteLineServiceImpl;
import org.nl.acs.task.TaskInstructionLock;
import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto; import org.nl.acs.task.service.dto.TaskDto;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
@@ -271,6 +272,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
@Override @Override
public void create(Instruction dto) { public void create(Instruction dto) {
Class var2 = TaskInstructionLock.class;
synchronized(TaskInstructionLock.class) {
dto = foramte(dto); dto = foramte(dto);
String task_code = dto.getTask_code(); String task_code = dto.getTask_code();
TaskDto task = taskService.findByCodeFromCache(task_code); TaskDto task = taskService.findByCodeFromCache(task_code);
@@ -381,10 +384,13 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
wo.insert(json); wo.insert(json);
instructions.add(dto); instructions.add(dto);
} }
}
@Override @Override
public void create2(Instruction dto) throws Exception { public void create2(Instruction dto) throws Exception {
Class var2 = TaskInstructionLock.class;
synchronized(TaskInstructionLock.class) {
dto = foramte(dto); dto = foramte(dto);
String task_code = dto.getTask_code(); String task_code = dto.getTask_code();
TaskDto task = taskService.findByCodeFromCache(task_code); TaskDto task = taskService.findByCodeFromCache(task_code);
@@ -488,12 +494,14 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
wo.insert(json); wo.insert(json);
instructions.add(dto); instructions.add(dto);
} }
}
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void createAgain(Instruction dto) throws Exception { public void createAgain(Instruction dto) throws Exception {
Class var2 = TaskInstructionLock.class;
synchronized(TaskInstructionLock.class) {
String task_code = dto.getTask_code(); String task_code = dto.getTask_code();
TaskDto task = taskService.findByCodeFromCache(task_code); TaskDto task = taskService.findByCodeFromCache(task_code);
WQLObject instwo = WQLObject.getWQLObject("acs_instruction"); WQLObject instwo = WQLObject.getWQLObject("acs_instruction");
@@ -562,10 +570,13 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
// } // }
instructions.add(dto); instructions.add(dto);
} }
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void update(Instruction dto) { public void update(Instruction dto) {
Class var2 = TaskInstructionLock.class;
synchronized(TaskInstructionLock.class) {
String currentUsername = SecurityUtils.getCurrentUsername(); String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now(); String now = DateUtil.now();
dto.setUpdate_time(now); dto.setUpdate_time(now);
@@ -586,7 +597,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
// instructions.add(dto); // instructions.add(dto);
// } // }
this.reload(); this.reload();
}
} }
@Override @Override
@@ -724,6 +735,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void finish(Instruction dto) { public void finish(Instruction dto) {
Class var2 = TaskInstructionLock.class;
synchronized(TaskInstructionLock.class) {
String now = DateUtil.now(); String now = DateUtil.now();
dto.setInstruction_status("2"); dto.setInstruction_status("2");
WQLObject wo = WQLObject.getWQLObject("acs_instruction"); WQLObject wo = WQLObject.getWQLObject("acs_instruction");
@@ -776,6 +789,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
removeByCodeFromCache(dto.getInstruction_code()); removeByCodeFromCache(dto.getInstruction_code());
this.reload(); this.reload();
} }
}
@Override @Override
public void finishAndCreateNextInst(Instruction dto){ public void finishAndCreateNextInst(Instruction dto){
@@ -844,6 +858,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
@Override @Override
public void cancel(String id) throws Exception { public void cancel(String id) throws Exception {
Class var2 = TaskInstructionLock.class;
synchronized(TaskInstructionLock.class) {
//flag= true时取消指令 //flag= true时取消指令
boolean flag = false; boolean flag = false;
Instruction entity = this.findById(id); Instruction entity = this.findById(id);
@@ -947,10 +963,13 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
removeByCodeFromCache(entity.getInstruction_code()); removeByCodeFromCache(entity.getInstruction_code());
} }
this.reload(); this.reload();
} }
}
@Override @Override
public void forceCancel(String id) throws Exception { public void forceCancel(String id) throws Exception {
Class var2 = TaskInstructionLock.class;
synchronized(TaskInstructionLock.class) {
//flag= true时取消指令 //flag= true时取消指令
boolean flag = false; boolean flag = false;
Instruction entity = this.findById(id); Instruction entity = this.findById(id);
@@ -1003,9 +1022,13 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
removeByCodeFromCache(entity.getInstruction_code()); removeByCodeFromCache(entity.getInstruction_code());
} }
}
@Override @Override
public void cancelNOSendAgv(String id) throws Exception { public void cancelNOSendAgv(String id) throws Exception {
Class var2 = TaskInstructionLock.class;
synchronized(TaskInstructionLock.class) {
//flag= true时取消指令 //flag= true时取消指令
Instruction entity = this.findById(id); Instruction entity = this.findById(id);
if (entity == null) { if (entity == null) {
@@ -1058,7 +1081,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
} }
removeByCodeFromCache(entity.getInstruction_code()); removeByCodeFromCache(entity.getInstruction_code());
}
} }
@@ -1279,6 +1302,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
@Override @Override
public boolean createLkInst(String type, Instruction dto) { public boolean createLkInst(String type, Instruction dto) {
Class var3 = TaskInstructionLock.class;
synchronized(TaskInstructionLock.class) {
//入库 //入库
AcsToLiKuService acsToLiKuService = SpringContextHolder.getBean(AcsToLiKuService.class); AcsToLiKuService acsToLiKuService = SpringContextHolder.getBean(AcsToLiKuService.class);
Resp resp = null; Resp resp = null;
@@ -1353,10 +1378,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
dto.setRemark("ERROR"); dto.setRemark("ERROR");
return false; return false;
} }
return true; return true;
} }
}
public Instruction findByContainer(String container_code) { public Instruction findByContainer(String container_code) {