fix: 日志更新,取消任务和指令、创建人、配置文件线程数搞大
This commit is contained in:
@@ -740,10 +740,21 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
String inst_code = requestParam.getString("task_code");
|
||||
Instruction instructionDto = instructionService.findByCodeFromCache(inst_code);
|
||||
if (ObjectUtil.isEmpty(instructionDto)) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.content("请求失败,未找到指令!" )
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
throw new BadRequestException("请求失败,未找到指令!");
|
||||
}
|
||||
String address = requestParam.getString("address");
|
||||
if (StrUtil.isBlank(address)) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(instructionDto.getCarno())
|
||||
.content("请求失败,地址为空!" )
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
throw new BadRequestException("请求失败,地址为空!");
|
||||
}
|
||||
if (address.contains("IN") || address.contains("WAIT")) {
|
||||
@@ -755,6 +766,12 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
deviceCodeNow = address.substring(0, address.length() - 5);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(deviceAppService.findDeviceByCode(deviceCodeNow))) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(instructionDto.getCarno())
|
||||
.content("设备号 " + deviceCodeNow + " 不存在!")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
throw new BadRequestException("设备号 " + deviceCodeNow + " 不存在!");
|
||||
}
|
||||
//一楼诺宝agv
|
||||
@@ -802,6 +819,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
map.put("message", "允许叉车放货!" + "点位" + newPointCode);
|
||||
log.info("允许仙工AGV放货,设备号 - {}", newPointCode);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(instructionDto.getCarno())
|
||||
.content("叉车允许放货" + "新点位:" + newPointCode + map )
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
|
||||
@@ -366,6 +366,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
this.writing(list);
|
||||
message = null;
|
||||
vehicle_code = null;
|
||||
inst_message = null;
|
||||
|
||||
}
|
||||
|
||||
@@ -420,7 +421,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
this.writing(list1);
|
||||
this.requireSucess = true;
|
||||
} else {
|
||||
this.iserror = false;
|
||||
this.iserror = true;
|
||||
message = "申请空托盘出入库出错,返回参数:" + jo;
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
|
||||
@@ -39,8 +39,6 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
||||
|
||||
|
||||
public void checkcontrol(Map<String, Object> itemValues) throws Exception {
|
||||
|
||||
CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> {
|
||||
try {
|
||||
Group group = opcServerService.getServer(this.getOpcServer());
|
||||
Map<String, Object> write = new HashMap();
|
||||
@@ -116,7 +114,7 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
||||
}
|
||||
|
||||
if (check) {
|
||||
return "";
|
||||
return ;
|
||||
}
|
||||
|
||||
if (i > 0) {
|
||||
@@ -133,20 +131,7 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
||||
Thread.currentThread().interrupt();
|
||||
throw new IllegalStateException("Interrupted", e);
|
||||
}
|
||||
});
|
||||
try {
|
||||
String result = future.get(2, TimeUnit.SECONDS); // 设置超时时间为2秒
|
||||
System.out.println(result);
|
||||
} catch (CompletionException e) {
|
||||
Throwable cause = e.getCause();
|
||||
if (cause instanceof TimeoutException) {
|
||||
System.out.println("Operation timed out");
|
||||
} else {
|
||||
throw e; // rethrow other exceptions
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -274,6 +274,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
this.writing(list);
|
||||
message=null;
|
||||
vehicle_code=null;
|
||||
inst_message = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -379,7 +380,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||
this.requireSucess = true;
|
||||
} else {
|
||||
this.iserror = false;
|
||||
this.iserror = true;
|
||||
message = "二楼到一楼输送线申请行架任务报错,返回参数:" + jo;
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
|
||||
@@ -194,7 +194,8 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
if (move != 0 && task > 0) {
|
||||
if (null!=inst) {
|
||||
inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code();
|
||||
} update_instruction_status();
|
||||
}
|
||||
update_instruction_status();
|
||||
}
|
||||
} catch (Exception var17) {
|
||||
var17.printStackTrace();
|
||||
@@ -298,6 +299,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
this.writing(list);
|
||||
message = null;
|
||||
vehicle_code = null;
|
||||
inst_message = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -390,7 +392,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
requireSucess = true;
|
||||
}else {
|
||||
message = "申请AGV任务报错,参数,接口返回:" + jo;
|
||||
this.iserror = false;
|
||||
this.iserror = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -330,6 +330,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
||||
|
||||
this.writing(list);
|
||||
message=null;
|
||||
inst_message = null;
|
||||
}
|
||||
|
||||
private void applyLaStrangulationAndLabeling(int mode) {
|
||||
@@ -368,7 +369,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
||||
packagePLCData(jo.getString("data"), mode);
|
||||
requireSucess = true;
|
||||
} else {
|
||||
this.iserror = false;
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("申请捆扎失败,接口返回:" + response)
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.nl.acs.device.service.impl.DeviceExtraServiceImpl;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.FeedLmsRealFailed;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.enums.StorageTypeEnum;
|
||||
@@ -325,6 +326,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
this.writing(list);
|
||||
message = null;
|
||||
vehicle_code = null;
|
||||
inst_message = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -418,9 +420,28 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
requireSucess = false;
|
||||
return true;
|
||||
}
|
||||
//关联站点判断
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
|
||||
if (nextDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
|
||||
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver();
|
||||
//判断对接位和关联站点光电信号
|
||||
getDeviceCodeList = beltConveyorDeviceDriver.getExtraDeviceCodes("link_device_code");
|
||||
if (CollUtil.isNotEmpty(getDeviceCodeList)) {
|
||||
String linkDeviceCode = getDeviceCodeList.get(0);
|
||||
Device linkDevice = deviceAppService.findDeviceByCode(linkDeviceCode);
|
||||
BeltConveyorDeviceDriver linkDeviceDriver;
|
||||
if (linkDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
|
||||
linkDeviceDriver = (BeltConveyorDeviceDriver) linkDevice.getDeviceDriver();
|
||||
if ((beltConveyorDeviceDriver.getMode() == 0 || beltConveyorDeviceDriver.getMove() == 1) || (linkDeviceDriver.getMode() == 0 || linkDeviceDriver.getMove() == 1)) {
|
||||
this.message = "DDJ对接位或关联输送线存在正在移动的货物或者未联机";
|
||||
requireSucess = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Device startdevice = deviceAppservice.findDeviceByCode(start_device_code);
|
||||
Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code);
|
||||
}
|
||||
}
|
||||
String next_point_code;
|
||||
if (StrUtil.equals(deviceAppservice.findDeviceTypeByCode(next_device_code), "storage")) {
|
||||
next_point_code = taskdto.getTo_x() + "-" + taskdto.getTo_y() + "-" + taskdto.getTo_z();
|
||||
@@ -457,7 +478,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
taskdto.setTask_status(TaskStatusEnum.BUSY.getIndex());
|
||||
taskserver.update(taskdto);
|
||||
requireSucess = true;
|
||||
String next_addr = nextdevice.getExtraValue().get("address").toString();
|
||||
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
@@ -610,7 +631,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
this.writing(list1);
|
||||
this.requireSucess = true;
|
||||
} else {
|
||||
this.iserror = false;
|
||||
this.iserror = true;
|
||||
message = "申请空托盘出入库报错,接口返回:" + jo;
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
|
||||
@@ -447,6 +447,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
this.writing(list2);
|
||||
requireSucess = true;
|
||||
} else {
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("申请高度等级,返回参数:" + response)
|
||||
@@ -508,6 +509,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
this.writing(list1);
|
||||
this.requireSucess = true;
|
||||
} else {
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("申请退货入库,返回参数:" + response)
|
||||
@@ -541,6 +543,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
message = null;
|
||||
vehicle_code = null;
|
||||
hand_barcode = null;
|
||||
inst_message = null;
|
||||
|
||||
}
|
||||
|
||||
@@ -618,7 +621,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
this.writing(list1);
|
||||
this.requireSucess = true;
|
||||
} else {
|
||||
this.iserror = false;
|
||||
this.iserror = true;
|
||||
message = "申请空托盘出入库报错,返回参数:" + jo;
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
@@ -683,7 +686,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
this.writing(list1);
|
||||
requireSucess = true;
|
||||
} else {
|
||||
this.iserror = false;
|
||||
this.iserror = true;
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("木箱、子卷入库申请入库任务,返回参数:" + response)
|
||||
@@ -856,6 +859,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
requireSucess = false;
|
||||
return true;
|
||||
}
|
||||
//关联站点判断
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
|
||||
if (nextDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
|
||||
|
||||
@@ -286,7 +286,7 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
|
||||
}else {
|
||||
message = "木箱开盖报错,返回参数:" + jo;
|
||||
this.iserror = false;
|
||||
this.iserror = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -164,7 +164,6 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
|
||||
@@ -136,7 +136,6 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
|
||||
@@ -152,7 +152,6 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
|
||||
@@ -147,7 +147,6 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
|
||||
@@ -167,7 +167,6 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
|
||||
@@ -632,7 +632,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
instructionService.update(instruction0);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
//异常后上个动作命令是取货完成也要下发信号
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -875,7 +876,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
//放货完成
|
||||
if (forkCargo == 0) {
|
||||
//取货中或者取货完成(分入库出库)
|
||||
if ("1".equals(instructionErro.getExecute_code()) || "2".equals(instructionErro.getExecute_code())) {
|
||||
if ("1".equals(instructionErro.getExecute_code()) ) {
|
||||
List list = new ArrayList();
|
||||
String startDeviceCode = instructionErro.getStart_device_code();
|
||||
Device startDeviceError = deviceAppService.findDeviceByCode(startDeviceCode);
|
||||
@@ -889,7 +890,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
}
|
||||
//放货中报警
|
||||
if ("3".equals(instructionErro.getExecute_code()) && forkCargo == 2) {
|
||||
if (("3".equals(instructionErro.getExecute_code()) && forkCargo == 2) || "2".equals(instructionErro.getExecute_code())) {
|
||||
List list = new ArrayList();
|
||||
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) {
|
||||
pakagePLCData(list, instructionErro.getTo_x(), instructionErro.getTo_y(), instructionErro.getTo_z(), "2", instructionErro.getInstruction_code());
|
||||
@@ -903,7 +904,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
//出库报警
|
||||
if (startDevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
//取货报警
|
||||
if ("1".equals(instructionErro.getExecute_code()) || "2".equals(instructionErro.getExecute_code())) {
|
||||
if ("1".equals(instructionErro.getExecute_code()) ) {
|
||||
List list = new ArrayList();
|
||||
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name())) {
|
||||
pakagePLCData(list, instructionErro.getFrom_x(), instructionErro.getFrom_y(), instructionErro.getFrom_z(), "1", instructionErro.getInstruction_code());
|
||||
@@ -914,7 +915,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
message = "one_message19";
|
||||
}
|
||||
//放货中报警
|
||||
if ("3".equals(instructionErro.getExecute_code()) && forkCargo == 2) {
|
||||
if (("3".equals(instructionErro.getExecute_code()) && forkCargo == 2) || "2".equals(instructionErro.getExecute_code())) {
|
||||
String next_device_code = instructionErro.getNext_device_code();
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
List list = new ArrayList();
|
||||
|
||||
@@ -421,8 +421,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
dto.setCompound_inst_data(task.getCompound_task_data());
|
||||
}
|
||||
}
|
||||
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
|
||||
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
|
||||
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : dto.getStart_device_code()+":自动创建");
|
||||
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : dto.getStart_device_code()+":自动创建");
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
dto.setStart_parent_code(task.getStart_parent_code());
|
||||
@@ -599,8 +599,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
dto.setCompound_inst_data(task.getCompound_task_data());
|
||||
}
|
||||
}
|
||||
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
|
||||
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
|
||||
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : dto.getStart_device_code()+"手动创建");
|
||||
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : dto.getStart_device_code()+"手动创建");
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
dto.setStart_parent_code(task.getStart_parent_code());
|
||||
|
||||
@@ -101,6 +101,13 @@ public class TaskController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("取消任务和指令")
|
||||
@PostMapping(value = "/cancelAndInst/{id}")
|
||||
public ResponseEntity<Object> cancelAndInst(@RequestBody String id) throws Exception {
|
||||
taskService.cancelAndInst(id);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("手动创建指令")
|
||||
@PostMapping(value = "/createInst/{id}")
|
||||
public ResponseEntity<Object> createInst(@RequestBody String id) throws Exception {
|
||||
|
||||
@@ -303,6 +303,16 @@ public interface TaskService extends CommonService<Task> {
|
||||
void cancel(String ids) throws Exception;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 取消任务和指令
|
||||
*
|
||||
* @param ids
|
||||
* @throws Exception
|
||||
*/
|
||||
void cancelAndInst(String ids) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* 手动创建指令
|
||||
*
|
||||
|
||||
@@ -881,6 +881,38 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelAndInst(String id) throws Exception {
|
||||
TaskDto entity = this.findById(id);
|
||||
if (entity == null) {
|
||||
throw new BadRequestException(LangProcess.msg("error_sysAuth"));
|
||||
}
|
||||
|
||||
InstructionDto instdto = instructionService.findByTaskid(id, "instruction_status <2 ");
|
||||
if (instdto != null) {
|
||||
instructionService.cancel(instdto.getInstruction_id());
|
||||
}
|
||||
|
||||
String currentUsername = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
entity.setUpdate_time(now);
|
||||
entity.setUpdate_by(currentUsername);
|
||||
entity.setTask_status(TaskStatusEnum.CANCEL.getIndex());
|
||||
|
||||
Task task = ConvertUtil.convert(entity, Task.class);
|
||||
taskMapper.updateById(task);
|
||||
|
||||
//移除任务缓存信息
|
||||
this.removeByCodeFromCache(entity.getTask_code());
|
||||
//反馈上位系统任务状态
|
||||
this.feedWmsTaskStatus(entity);
|
||||
//关闭仙工运单序列
|
||||
if(StrUtil.equals(task.getTask_type(),TaskTypeEnum.Standard_AGV_Task.getCode()) && (StrUtil.equals(task.getAgv_system_type(), AgvSystemTypeEnum.One_NDC_System_Type.getCode())||StrUtil.equals(task.getAgv_system_type(), AgvSystemTypeEnum.XG_System_Type.getCode()))) {
|
||||
this.markComplete(entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Instruction createInst(String ids) throws Exception {
|
||||
|
||||
@@ -51,7 +51,7 @@ spring:
|
||||
monitorInterval: 8
|
||||
tomcatTp: # tomcat webserver 线程池配置
|
||||
threadPoolAliasName: tomcat 线程池 # 线程池别名,可选
|
||||
corePoolSize: 10
|
||||
corePoolSize: 30
|
||||
maximumPoolSize: 50
|
||||
keepAliveTime: 60
|
||||
runTimeout: 10000
|
||||
@@ -60,8 +60,8 @@ spring:
|
||||
- threadPoolName: dtpExecutor1 # 线程池名称,必填
|
||||
threadPoolAliasName: core_thread # 线程池别名,可选
|
||||
executorType: common # 线程池类型 common、eager、ordered、scheduled、priority,默认 common
|
||||
corePoolSize: 10 # 核心线程数,默认1
|
||||
maximumPoolSize: 30 # 最大线程数,默认cpu核数
|
||||
corePoolSize: 30 # 核心线程数,默认1
|
||||
maximumPoolSize: 50 # 最大线程数,默认cpu核数
|
||||
queueCapacity: 1024 # 队列容量,默认1024
|
||||
queueType: VariableLinkedBlockingQueue # 任务队列,查看源码QueueTypeEnum枚举类,默认VariableLinkedBlockingQueue
|
||||
rejectedHandlerType: CallerRunsPolicy # 拒绝策略,查看RejectedTypeEnum枚举类,默认AbortPolicy
|
||||
|
||||
@@ -40,6 +40,14 @@ export function cancel(task_id) {
|
||||
})
|
||||
}
|
||||
|
||||
export function cancelAndInst(task_id) {
|
||||
return request({
|
||||
url: 'api/task/cancelAndInst/' + task_id,
|
||||
method: 'post',
|
||||
data: task_id
|
||||
})
|
||||
}
|
||||
|
||||
export function createInst(task_id) {
|
||||
return request({
|
||||
url: 'api/task/createInst/' + task_id,
|
||||
@@ -95,5 +103,5 @@ export function reload() {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, finish, cancel, createTaskByClick, deviceAskTask, ordinaryTaskCreate, specialTaskCreate, createInst, reload }
|
||||
export default { add, edit, del, finish, cancel, createTaskByClick, deviceAskTask, ordinaryTaskCreate, specialTaskCreate, createInst, reload ,cancelAndInst}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ export default {
|
||||
'In_progress': 'In Progress',
|
||||
'Completed': 'Completed',
|
||||
'Forced_Completed': 'Forced Completed',
|
||||
'Cancel_Tasks_And_Commands': 'Cancel tasks and commands',
|
||||
'Pickup_point': 'Pickup Point',
|
||||
'Delivery_point': 'Delivery Point',
|
||||
'Remark': 'Remark',
|
||||
|
||||
@@ -44,6 +44,7 @@ export default {
|
||||
'In_progress': 'Sedang Berlangsung',
|
||||
'Completed': 'Selesai',
|
||||
'Forced_Completed': 'Penyelesaian wajib',
|
||||
'Cancel_Tasks_And_Commands': 'Batalkan misi dan perintah',
|
||||
'Pickup_point': 'Titik Pengambilan',
|
||||
'Delivery_point': 'Titik Pengiriman',
|
||||
'Remark': 'Catatan',
|
||||
|
||||
@@ -44,6 +44,7 @@ export default {
|
||||
'In_progress': '执行中',
|
||||
'Completed': '完成',
|
||||
'Forced_Completed': '强制完成',
|
||||
'Cancel_Tasks_And_Commands': '取消任务和指令',
|
||||
'Pickup_point': '取货点',
|
||||
'Delivery_point': '放货点',
|
||||
'Remark': '备注',
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
style="width: 200px"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option v-for="item in dict.task_status" :key="item.id" :label="item.label" :value="item.value" />
|
||||
<el-option v-for="item in dict.task_status" :key="item.id" :label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('task.txt_box.Task_code')">
|
||||
@@ -57,7 +57,7 @@
|
||||
style="width: 200px"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option v-for="item in materialList" :key="item.id" :label="item.label" :value="item.value" />
|
||||
<el-option v-for="item in materialList" :key="item.id" :label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('task.txt_box.Task_type')">
|
||||
@@ -71,7 +71,7 @@
|
||||
style="width: 200px"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option v-for="item in dict.task_type" :key="item.id" :label="item.label" :value="item.value" />
|
||||
<el-option v-for="item in dict.task_type" :key="item.id" :label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
<el-form-item :label="$t('task.txt_box.start_or_end')">
|
||||
<el-input
|
||||
@@ -85,7 +85,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
<rrOperation/>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
@@ -118,9 +118,9 @@
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="135px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<div class="grid-content bg-purple" />
|
||||
<div class="grid-content bg-purple"/>
|
||||
<el-form-item v-if="false" label="任务标识" prop="task_id">
|
||||
<el-input v-model="form.task_id" style="width: 240px;" />
|
||||
<el-input v-model="form.task_id" style="width: 240px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('task.txt_box.Material_type')">
|
||||
<el-select
|
||||
@@ -321,11 +321,11 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="行架任务类型">
|
||||
<el-input v-model="form.truss_type" style="width: 370px;" @change="isDisabled=false" />
|
||||
<el-input v-model="form.truss_type" style="width: 370px;" @change="isDisabled=false"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="grid-content bg-purple-light" />
|
||||
<div class="grid-content bg-purple-light"/>
|
||||
<el-form-item :label="$t('task.select.Start_point2')" prop="start_point_code2">
|
||||
<el-select
|
||||
v-model="form.start_point_code2"
|
||||
@@ -424,10 +424,10 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('task.txt_box.Priority')">
|
||||
<el-input v-model="form.priority" style="width: 370px;" @change="isDisabled=false" />
|
||||
<el-input v-model="form.priority" style="width: 370px;" @change="isDisabled=false"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('task.txt_box.Vehicle_number')">
|
||||
<el-input v-model="form.vehicle_code" style="width: 370px;" @change="isDisabled=false" />
|
||||
<el-input v-model="form.vehicle_code" style="width: 370px;" @change="isDisabled=false"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('task.txt_box.empty_shaft_position')">
|
||||
<el-select
|
||||
@@ -451,14 +451,16 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('task.select.Description')" prop="description">
|
||||
<el-input v-model="form.remark" style="width: 370px;" type="textarea" @change="isDisabled=false" />
|
||||
<el-input v-model="form.remark" style="width: 370px;" type="textarea" @change="isDisabled=false"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="formDia=false">{{ $t('task.select.Cancel') }}</el-button>
|
||||
<el-button :loading="crud.cu === 2" :disabled="isDisabled" type="primary" @click="saveBtn">{{ $t('task.select.Confirm') }}</el-button>
|
||||
<el-button :loading="crud.cu === 2" :disabled="isDisabled" type="primary" @click="saveBtn">
|
||||
{{ $t('task.select.Confirm') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog :visible.sync="dialogVisible" :title="$t('task.txt_box.extension_field')" @close="closeDialog">
|
||||
@@ -475,7 +477,7 @@
|
||||
stripe
|
||||
border
|
||||
>
|
||||
<el-table-column type="index" label="序号" min-width="50" />
|
||||
<el-table-column type="index" label="序号" min-width="50"/>
|
||||
<el-table-column label="扩展字段" prop="name" min-width="115">
|
||||
<template slot-scope="scope">
|
||||
<el-select
|
||||
@@ -495,12 +497,14 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="扩展字段值" prop="value" min-width="115">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.value" style="width: 100%" />
|
||||
<el-input v-model="scope.row.value" style="width: 100%"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="115" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="danger" icon="el-icon-minus" circle @click="deleteField(scope.$index)" />
|
||||
<el-button size="mini" type="danger" icon="el-icon-minus" circle
|
||||
@click="deleteField(scope.$index)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -514,16 +518,22 @@
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="25" />
|
||||
<el-table-column v-if="false" prop="task_id" label="任务标识" />
|
||||
<el-table-column prop="task_code" :label="$t('task.txt_box.Task_code')" :min-width="flexWidth('task_code',crud.data,$t('task.txt_box.Task_code'))" />
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="25"/>
|
||||
<el-table-column v-if="false" prop="task_id" label="任务标识"/>
|
||||
<el-table-column prop="task_code" :label="$t('task.txt_box.Task_code')"
|
||||
:min-width="flexWidth('task_code',crud.data,$t('task.txt_box.Task_code'))"
|
||||
/>
|
||||
<el-table-column prop="task_type" :label="$t('task.txt_box.Task_type')" width="100px">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.task_type[scope.row.task_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="agv_action_type" :label="$t('task.txt_box.Action_type')" :min-width="flexWidth('agv_action_type',crud.data,$t('task.txt_box.Action_type'))">
|
||||
<el-table-column prop="agv_action_type" :label="$t('task.txt_box.Action_type')"
|
||||
:min-width="flexWidth('agv_action_type',crud.data,$t('task.txt_box.Action_type'))"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.agv_action_type===1 ">{{ $t('task.txt_box.ORDINARY') }}</span>
|
||||
<span v-if="scope.row.agv_action_type===2 ">{{ $t('task.txt_box.IN_STOCK') }}</span>
|
||||
@@ -532,7 +542,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="vehicle_code" :label="$t('task.txt_box.Vehicle_number')" :min-width="flexWidth('vehicle_code',crud.data,$t('task.txt_box.Vehicle_number'))" />
|
||||
<el-table-column prop="vehicle_code" :label="$t('task.txt_box.Vehicle_number')"
|
||||
:min-width="flexWidth('vehicle_code',crud.data,$t('task.txt_box.Vehicle_number'))"
|
||||
/>
|
||||
<el-table-column prop="task_status" :label="$t('task.txt_box.Task_status')" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.task_status==='0' ">{{ $t('task.select.Ready') }}</span>
|
||||
@@ -540,28 +552,52 @@
|
||||
<span v-if="scope.row.task_status==='2' ">{{ $t('task.select.Completed') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="priority" :label="$t('task.txt_box.Priority')" :min-width="flexWidth('priority',crud.data,$t('task.txt_box.Priority'))" />
|
||||
<el-table-column prop="start_point_code" :label="$t('task.select.Pickup_point')" :min-width="flexWidth('start_point_code',crud.data,$t('task.select.Pickup_point'))" />
|
||||
<el-table-column prop="next_point_code" :label="$t('task.select.Delivery_point')" :min-width="flexWidth('next_point_code',crud.data,$t('task.select.Delivery_point'))" />
|
||||
<el-table-column prop="start_point_code2" :label="$t('task.select.Start_point2')" :min-width="flexWidth('start_point_code2',crud.data,$t('task.select.Start_point2'))" />
|
||||
<el-table-column prop="next_point_code2" :label="$t('task.select.Destination2')" :min-width="flexWidth('next_point_code2',crud.data,$t('task.select.Destination2'))" />
|
||||
<el-table-column prop="interaction_json" :label="$t('task.select.Interaction_json')" show-overflow-tooltip="true" width="150px" />
|
||||
<el-table-column prop="agv_system_type" :label="$t('task.txt_box.AGV_system')" show-overflow-tooltip="true" width="150px">
|
||||
<el-table-column prop="priority" :label="$t('task.txt_box.Priority')"
|
||||
:min-width="flexWidth('priority',crud.data,$t('task.txt_box.Priority'))"
|
||||
/>
|
||||
<el-table-column prop="start_point_code" :label="$t('task.select.Pickup_point')"
|
||||
:min-width="flexWidth('start_point_code',crud.data,$t('task.select.Pickup_point'))"
|
||||
/>
|
||||
<el-table-column prop="next_point_code" :label="$t('task.select.Delivery_point')"
|
||||
:min-width="flexWidth('next_point_code',crud.data,$t('task.select.Delivery_point'))"
|
||||
/>
|
||||
<el-table-column prop="start_point_code2" :label="$t('task.select.Start_point2')"
|
||||
:min-width="flexWidth('start_point_code2',crud.data,$t('task.select.Start_point2'))"
|
||||
/>
|
||||
<el-table-column prop="next_point_code2" :label="$t('task.select.Destination2')"
|
||||
:min-width="flexWidth('next_point_code2',crud.data,$t('task.select.Destination2'))"
|
||||
/>
|
||||
<el-table-column prop="interaction_json" :label="$t('task.select.Interaction_json')"
|
||||
show-overflow-tooltip="true" width="150px"
|
||||
/>
|
||||
<el-table-column prop="agv_system_type" :label="$t('task.txt_box.AGV_system')" show-overflow-tooltip="true"
|
||||
width="150px"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ getAgvSystemLabel(scope.row.agv_system_type) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="put_point_code" :label="$t('TaskRecord.table.Transit_point')" :min-width="flexWidth('put_point_code',crud.data,$t('TaskRecord.table.Transit_point'))" />
|
||||
<el-table-column prop="remark" :label="$t('task.select.Remark')" :min-width="flexWidth('remark',crud.data,$t('task.select.Remark'))" />
|
||||
<el-table-column prop="create_by" :label="$t('task.select.Creator')" :min-width="flexWidth('create_by',crud.data,$t('task.select.Creator'))" />
|
||||
<el-table-column prop="create_time" :label="$t('task.select.Create_time')" :min-width="flexWidth('create_time',crud.data,$t('task.select.Create_time'))" />
|
||||
<el-table-column v-permission="['admin','task:edit','task:del']" :label="$t('task.select.Operation')" width="200px" align="center">
|
||||
<el-table-column prop="put_point_code" :label="$t('TaskRecord.table.Transit_point')"
|
||||
:min-width="flexWidth('put_point_code',crud.data,$t('TaskRecord.table.Transit_point'))"
|
||||
/>
|
||||
<el-table-column prop="remark" :label="$t('task.select.Remark')"
|
||||
:min-width="flexWidth('remark',crud.data,$t('task.select.Remark'))"
|
||||
/>
|
||||
<el-table-column prop="create_by" :label="$t('task.select.Creator')"
|
||||
:min-width="flexWidth('create_by',crud.data,$t('task.select.Creator'))"
|
||||
/>
|
||||
<el-table-column prop="create_time" :label="$t('task.select.Create_time')"
|
||||
:min-width="flexWidth('create_time',crud.data,$t('task.select.Create_time'))"
|
||||
/>
|
||||
<el-table-column v-permission="['admin','task:edit','task:del']" :label="$t('task.select.Operation')"
|
||||
width="200px" align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-dropdown>
|
||||
<span class="el-dropdown-link">
|
||||
<i class="el-icon-setting">More</i>
|
||||
<el-icon class="el-icon--right">
|
||||
<arrow-down />
|
||||
<arrow-down/>
|
||||
</el-icon>
|
||||
</span>
|
||||
<template #dropdown>
|
||||
@@ -602,6 +638,15 @@
|
||||
{{ $t('task.select.Forced_Completed') }}
|
||||
</el-button>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-finished"
|
||||
@click="handleCommand(scope.$index, scope.row,'e')"
|
||||
>
|
||||
{{ $t('task.select.Cancel_Tasks_And_Commands') }}
|
||||
</el-button>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
@@ -609,13 +654,13 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<pagination/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudTask from '@/api/acs/task/task'
|
||||
import crudTask, { cancelAndInst } from '@/api/acs/task/task'
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
@@ -631,7 +676,8 @@ export default {
|
||||
dicts: ['task_status', 'task_type', 'agv_system_type', 'storage_task_type', 'kezhuan', 'empty_shaft_position'],
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: i18n.t('task.txt_box.Task'), url: 'api/task', idField: 'task_id', sort: 'task_id,desc',
|
||||
return CRUD({
|
||||
title: i18n.t('task.txt_box.Task'), url: 'api/task', idField: 'task_id', sort: 'task_id,desc',
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: true,
|
||||
@@ -639,7 +685,8 @@ export default {
|
||||
reset: false,
|
||||
download: false
|
||||
},
|
||||
crudMethod: { ...crudTask }})
|
||||
crudMethod: { ...crudTask }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
const checkFromY = (rule, value, callback) => {
|
||||
@@ -809,7 +856,8 @@ export default {
|
||||
// 清空表单数据
|
||||
this.extension = [{
|
||||
name: '',
|
||||
value: '' }]
|
||||
value: ''
|
||||
}]
|
||||
this.dialogVisible = false
|
||||
},
|
||||
saveForm() {
|
||||
@@ -833,7 +881,8 @@ export default {
|
||||
})
|
||||
this.extension = [{
|
||||
name: '',
|
||||
value: '' }]
|
||||
value: ''
|
||||
}]
|
||||
// 设置定时器,等待一定时间后再次允许请求
|
||||
setTimeout(() => {
|
||||
this.isDisabled = false // 可根据具体需求进行调整
|
||||
@@ -867,6 +916,14 @@ export default {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
cancelAndInst(index, row) {
|
||||
crudTask.cancelAndInst(row.task_id).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('取消成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
createInst(index, row) {
|
||||
crudTask.createInst(row.task_id).then(res => {
|
||||
this.crud.toQuery()
|
||||
@@ -901,9 +958,12 @@ export default {
|
||||
case 'c':// 创建指令
|
||||
this.createInst(index, row)
|
||||
break
|
||||
case 'd':// 完成
|
||||
case 'd':// 强制完成
|
||||
this.finish('4', row)
|
||||
break
|
||||
case 'e':// 取消任务和指令
|
||||
this.cancelAndInst('3', row)
|
||||
break
|
||||
}
|
||||
},
|
||||
showStartStorage(val) {
|
||||
@@ -1011,6 +1071,7 @@ export default {
|
||||
cursor: pointer;
|
||||
color: #409EFF;
|
||||
}
|
||||
|
||||
.el-icon-arrow-down {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user