add:新增从密集库出气胀轴行架任务

This commit is contained in:
2024-07-21 11:28:33 +08:00
parent 6babb1980c
commit ccfb246c98
17 changed files with 722 additions and 507 deletions

View File

@@ -38,6 +38,7 @@ import org.nl.config.lucene.service.dto.LuceneLogDto;
import org.nl.system.service.param.ISysParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.util.*;
@@ -52,7 +53,8 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
private final DeviceAppService deviceAppService;
private final ISysParamService paramService;
@Autowired
private final AcsToWmsService acsToWmsService;
@Lazy
private AcsToWmsService acsToWmsService;
@Autowired
private IAcsPointAngleService acsPointAngleService;

View File

@@ -11,10 +11,6 @@ import org.openscada.opc.lib.da.ItemState;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements OpcDeviceDriver {
UnifiedDataAccessor opcUdw;
@@ -39,7 +35,6 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
public void checkcontrol(Map<String, Object> itemValues) throws Exception {
try {
Group group = opcServerService.getServer(this.getOpcServer());
Map<String, Object> write = new HashMap();
Map<String, Item> readitems = new LinkedHashMap();
@@ -58,7 +53,6 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
int i = 0;
while (true) {
//下发信号
try {
if (i == 0) {
control(itemValues);
@@ -69,6 +63,7 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
} catch (Exception e) {
e.printStackTrace();
}
// ThreadUtl.sleep(1000L);
Map<String, Object> read = new HashMap();
Map<Item, ItemState> itemStatus = null;
boolean check = true;
@@ -127,11 +122,6 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
}
++i;
}
} catch (Exception e) {
Thread.currentThread().interrupt();
throw new IllegalStateException("Interrupted", e);
}
}

View File

@@ -47,7 +47,7 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_qty);
}
public int getItem_type(){
return this.getItem_type();
return this.getOpcIntegerValue(item_type);
}

View File

@@ -79,7 +79,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
@Autowired
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
final Executor EXECUTOR = ThreadPoolExecutorUtil.getPoll();
// final Executor EXECUTOR = ThreadPoolExecutorUtil.getPoll();
//工作模式
int mode = 0;
@@ -856,9 +856,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver();
EXECUTOR.execute(() -> {
// EXECUTOR.execute(() -> {
toOpenDoor(device);
});
// });
int mode = hongXiangConveyorDeviceDriver.getMode();
int door = hongXiangConveyorDeviceDriver.getDoor();
int action = hongXiangConveyorDeviceDriver.getAction();
@@ -922,9 +922,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver();
EXECUTOR.execute(() -> {
// EXECUTOR.execute(() -> {
toCloseDoor(device);
});
// });
int mode = hongXiangConveyorDeviceDriver.getMode();
int door = hongXiangConveyorDeviceDriver.getDoor();
int action = hongXiangConveyorDeviceDriver.getAction();
@@ -1058,9 +1058,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
LampThreecolorDeviceDriver lampThreecolorDeviceDriver;
if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver();
EXECUTOR.execute(() -> {
// EXECUTOR.execute(() -> {
toCloseDoor(nextDevice);
});
// });
if (StrUtil.isNotEmpty(taskDto.getOven_time())) {
//下发烘箱时间
int time = Integer.parseInt(taskDto.getOven_time());

View File

@@ -2,6 +2,7 @@ package org.nl.acs.device_driver.two_conveyor.plug_pull_device_site;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
@@ -264,6 +265,15 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
applyTask(mode);
}
break;
case 10:
if (!requireSucess) {
//请求密集库出气胀轴,申请行架任务
boolean b =applyQzz(mode);
if(b){
requireSucess = true;
}
}
break;
default:
log.info("未知模式");
break;
@@ -346,7 +356,15 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
String to_spec2 = data.get("rightSpec");
Map<String, Object> map = new LinkedHashMap<>();
//下发纸管信息
if (ObjectUtil.isEmpty(to_material1) && ObjectUtil.isNotEmpty(to_material2)) {
map.put("to_material1", to_material2);
if (StrUtil.isNotEmpty(rightSize)) {
map.put("to_size1", rightSize);
}
if (ObjectUtil.isNotEmpty(to_spec2)) {
map.put("to_spec1", to_spec2);
}
} else {
map.put("to_material1", to_material1);
map.put("to_material2", to_material2);
@@ -360,6 +378,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
if (ObjectUtil.isNotEmpty(to_spec2)) {
map.put("to_spec2", to_spec2);
}
}
map.put("to_command", mode);
map.put("to_qty1", number);
this.writing(map);
@@ -576,6 +595,15 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
Object to_spec4 = data.get("currentRightSpec");
Object to_qty2 = data.get("pullCount");
Map<String, Object> map = new LinkedHashMap<>();
if (ObjectUtil.isEmpty(to_material3) && ObjectUtil.isNotEmpty(to_material4)) {
map.put("to_material3", to_material4);
if (ObjectUtil.isNotEmpty(to_size4)) {
map.put("to_size3", to_size4);
}
if (ObjectUtil.isNotEmpty(to_spec4)) {
map.put("to_spec3", to_spec4);
}
} else {
map.put("to_material3", to_material3);
if (ObjectUtil.isNotEmpty(to_material4)) {
map.put("to_material4", to_material4);
@@ -588,6 +616,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
if (ObjectUtil.isNotEmpty(to_spec4)) {
map.put("to_spec4", to_spec4);
}
}
map.put("to_qty2", to_qty2);
map.put("to_qzz_type", size);
map.put("to_command", mode);
@@ -674,6 +703,64 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
}
}
/**
* 请求密集库出气胀轴,申请行架任务
*/
private boolean applyQzz(int mode) throws Exception {
Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return false;
} else {
JSONObject jo = new JSONObject();
jo.put("device_code",this.getDevice_code());
jo.put("size",this.getSize());
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("请求密集库出气胀轴,请求参数:" + jo)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
logServer.deviceExecuteLog(this.device_code, "", "", "请求密集库出气胀轴,参数:" + jo);
HttpResponse httpResponse = acsToWmsService.callShaftFromCache(jo);
JSONObject jsonObject = null;
if(ObjectUtil.isNotEmpty(httpResponse)){
String body = httpResponse.body();
jsonObject = JSONObject.parseObject(body);
}
if(ObjectUtil.isNotNull(jsonObject) && jsonObject.getInteger("status") == 200){
Map map = new HashMap();
map.put("to_command", 10);
try {
this.writing(map);
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(device_code)
.content("请求密集库出气胀轴,返回参数" + jsonObject)
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
} catch (Exception e) {
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(device_code)
.content("请求密集库出气胀轴" + map)
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
}
return true;
}else{
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("请求密集库出气胀轴" + httpResponse.body())
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
return false;
}
}
}
/**
* 下发电气信号
*

View File

@@ -48,6 +48,36 @@ public class ItemProtocol {
public static String item_to_barcode = "to_barcode";
//下发套管纸管1编号
public static String item_to_material1 = "to_material1";
//下发套管纸管2编号
public static String item_to_material2 = "to_material2";
//下发套管纸管1规格
public static String item_to_spec1 = "to_spec1";
//下发套管纸管2规格
public static String item_to_spec2 = "to_spec2";
//套管纸管数量
public static String item_to_qty1 = "to_qty1";
//套管纸管1尺寸
public static String item_to_size1 = "to_size1";
//套管纸管2尺寸
public static String item_to_size2 = "to_size2";
//下发拔轴纸管1编号
public static String item_to_material3 = "to_material3";
//下发拔轴纸管2编号
public static String item_to_material4 = "to_material4";
//下发拔轴纸管1规格
public static String item_to_spec3 = "to_spec3";
//下发拔轴纸管2规格
public static String item_to_spec4 = "to_spec4";
//拔轴纸管数量
public static String item_to_qty2 = "to_qty2";
//拔轴纸管1尺寸
public static String item_to_size3 = "to_size3";
//套拔轴纸管2尺寸
public static String item_to_size4 = "to_size4";
private PullHeadManipulatorDeviceDriver driver;
@@ -194,6 +224,20 @@ public class ItemProtocol {
list.add(new ItemDto(item_to_pull, "是否拔轴", "DB12.W8"));
list.add(new ItemDto(item_to_sleeve, "是否套轴", "DB12.W10"));
list.add(new ItemDto(item_to_size, "气涨轴尺寸", "DB12.W12"));
list.add(new ItemDto(item_to_material1, "下发套管纸管1编号", "DB12.String603.60"));
list.add(new ItemDto(item_to_material2, "下发套管纸管2编号", "DB12.String604.60"));
list.add(new ItemDto(item_to_spec1, "套管纸管1规格", "DB12.String605.60"));
list.add(new ItemDto(item_to_spec2, "套管纸管2规格", "DB12.String606.60"));
list.add(new ItemDto(item_to_qty1, "套管纸管数量", "DB12.W14"));
list.add(new ItemDto(item_to_size1, "套管纸管1尺寸", "DB12.W16"));
list.add(new ItemDto(item_to_size2, "套管纸管2尺寸", "DB12.W18"));
list.add(new ItemDto(item_to_material3, "下发套管纸管1编号", "DB12.String607.60"));
list.add(new ItemDto(item_to_material4, "下发套管纸管2编号", "DB12.String608.60"));
list.add(new ItemDto(item_to_spec3, "拔轴纸管1规格", "DB12.String609.60"));
list.add(new ItemDto(item_to_spec4, "拔轴纸管2规格", "DB12.String610.60"));
list.add(new ItemDto(item_to_qty2, "拔轴纸管数量", "DB12.W20"));
list.add(new ItemDto(item_to_size3, "拔轴纸管1尺寸", "DB12.W22"));
list.add(new ItemDto(item_to_size4, "拔轴纸管2尺寸", "DB12.W24"));
return list;
}

View File

@@ -127,7 +127,6 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
String lastToBarcode = null;
Boolean isonline = true;
int hasGoods = 0;
String message = null;
@@ -248,7 +247,6 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
}
} catch (Exception var17) {
var17.printStackTrace();
// feedMessage = var17.getMessage();
@@ -400,23 +398,17 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
taskDtosReady.add(taskDto1);
}
}
//按照优先级排序 优先级相等按照创建时间排序
taskDtosReady = this.sortTask(taskDtosReady);
task = taskDtosReady.get(0);
}
if (ObjectUtil.isNotEmpty(task)) {
break;
}
}
}
if (!ObjectUtil.isEmpty(task)) {
// task = taskDtosReady.get(0);
List<TaskDto> readyTaskDtos = new ArrayList<>();
for (int j = 0; j < taskDtosReady.size(); j++) {
task = taskDtosReady.get(j);
String firstDeviceCode = task.getStart_device_code();
Device start_device = deviceAppService.findDeviceByCode(firstDeviceCode);
if (start_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) start_device.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getAction() != 1) {
notCreateInstMessage = "universal_notCreateInstMessage12";
return false;
continue;
}
}
String nextDeviceCode = task.getNext_device_code();
@@ -427,19 +419,31 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
if (plugPullDeviceSiteDeviceDriver.getMode() != 2) {
remark = "universal_notCreateInstMessage9";
notCreateInstMessage = remark;
return false;
continue;
}
if (plugPullDeviceSiteDeviceDriver.getMove() != 0) {
remark = "universal_notCreateInstMessage9";
notCreateInstMessage = remark;
return false;
continue;
}
if (plugPullDeviceSiteDeviceDriver.getAction() != 2) {
remark = "universal_notCreateInstMessage11";
notCreateInstMessage = remark;
return false;
continue;
}
}
readyTaskDtos.add(task);
}
//按照优先级排序 优先级相等按照创建时间排序
readyTaskDtos = this.sortTask(readyTaskDtos);
task = readyTaskDtos.get(0);
}
if (ObjectUtil.isNotEmpty(task)) {
break;
}
}
}
if (!ObjectUtil.isEmpty(task)) {
String taskId = task.getTask_id();
String taskCode = task.getTask_code();
String vehicleCode = task.getVehicle_code();
@@ -447,6 +451,8 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
String startPointCode = task.getStart_point_code();
String routePlanCode = task.getRoute_plan_code();
String nextPointCode = task.getNext_point_code();
String firstDeviceCode = task.getStart_device_code();
String nextDeviceCode = task.getNext_device_code();
Instruction instdto = new Instruction();
instdto.setInstruction_id(IdUtil.simpleUUID());
@@ -556,6 +562,15 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
map.put("to_task", instdto.getInstruction_code());
map.put("to_target", nextAddr);
//toTranscription(taskDto,map);
if (ObjectUtil.isEmpty(to_material1) && ObjectUtil.isNotEmpty(to_material2)) {
map.put("to_material1", to_material2);
if (ObjectUtil.isNotEmpty(to_spec2)) {
map.put("to_spec1", to_spec2);
}
if (ObjectUtil.isNotEmpty(to_size2)) {
map.put("to_size1", to_size2);
}
} else {
map.put("to_material1", to_material1);
if (ObjectUtil.isNotEmpty(to_material2)) {
map.put("to_material2", to_material2);
@@ -568,6 +583,16 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
if (ObjectUtil.isNotEmpty(to_size2)) {
map.put("to_size2", to_size2);
}
}
if (ObjectUtil.isEmpty(to_material3) && ObjectUtil.isNotEmpty(to_material4)) {
map.put("to_material3", to_material4);
if (ObjectUtil.isNotEmpty(to_size4)) {
map.put("to_size3", to_size4);
}
if (ObjectUtil.isNotEmpty(to_spec4)) {
map.put("to_spec3", to_spec4);
}
}
map.put("to_material3", to_material3);
if (ObjectUtil.isNotEmpty(to_material4)) {
map.put("to_material4", to_material4);

View File

@@ -769,8 +769,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
@Override
public JSONObject getDeviceStatusName() {
Map<String, Object> map = new LinkedHashMap<>();
// Map<String, Object> map = new LinkedHashMap<>();
JSONObject jo = new JSONObject();
String move_1 = "";
String move_2 = "";
String action = "";
@@ -841,26 +841,25 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
iserror = false;
}
}
map.put("device_name", this.getDevice().getDevice_name());
map.put("mode", mode);
map.put("action", action);
map.put("walk_y", walk_y);
map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
map.put("task", this.getTask());
map.put("isOnline", this.getIsonline());
map.put("isError", this.getIserror());
map.put("is_disable1", this.getIs_disable());
map.put("is_disable", is_disable);
map.put("is_click", true);
map.put("driver_type", "slit_two_manipulator");
map.put("requireSucess", requireSucess);
map.put("move_1", move_1);
map.put("move_2", move_2);
map.put("message", message);
map.put("notCreateTaskMessage", LangProcess.msg(notCreateTaskMessage));
map.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage));
map.put("feedMessage", LangProcess.msg(feedMessage));
JSONObject jo = new JSONObject(map);
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("action", action);
jo.put("walk_y", walk_y);
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
jo.put("task", this.getTask());
jo.put("isOnline", this.getIsonline());
jo.put("isError", this.getIserror());
jo.put("is_disable1", this.getIs_disable());
jo.put("is_disable", is_disable);
jo.put("is_click", true);
jo.put("driver_type", "slit_two_manipulator");
jo.put("requireSucess", requireSucess);
jo.put("move_1", move_1);
jo.put("move_2", move_2);
jo.put("message", message);
jo.put("notCreateTaskMessage", LangProcess.msg(notCreateTaskMessage));
jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage));
jo.put("feedMessage", LangProcess.msg(feedMessage));
return jo;
}

View File

@@ -111,7 +111,7 @@ public class WmsToAcsController {
}
@PostMapping("/getTubeMsg")
@Log("wms下发废箔重量")
@Log("下发管芯信息")
@SaIgnore
public ResponseEntity<Object> getTubeMes(@RequestBody String whereJson) throws Exception {
return new ResponseEntity<>(wmstoacsService.getTubeMes(whereJson), HttpStatus.OK);

View File

@@ -200,6 +200,13 @@ public interface AcsToWmsService {
*/
HttpResponse feedbackDies(JSONObject param);
/**
* 请求密集库出气胀轴,申请行架任务
* @param param
* @return
*/
HttpResponse callShaftFromCache(JSONObject param);
String secondaryAllocationPoint(JSONObject param);
/**

View File

@@ -746,6 +746,40 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
@Override
public HttpResponse callShaftFromCache(JSONObject param) {
HttpResponse result2 = null;
try {
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("callShaftFromCache");
String url = wmsurl + addressDto.getMethods_url();
log.info("callShaftFromCache - 请求密集库出气胀轴,申请行架任务请求路径{}", param);
try {
result2 = HttpRequest.post(url)
.header("Authorization", token)
.body(String.valueOf(param))
.execute();
} catch (Exception e) {
String msg = e.getMessage();
log.info("callShaftFromCache-----请求密集库出气胀轴,申请行架任务输出参数{}", msg);
//网络不通
}
log.info("callShaftFromCache - 请求密集库出气胀轴,申请行架任务{}", result2.body());
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"callShaftFromCache", String.valueOf(result2.getStatus()),
String.valueOf(param),
String.valueOf(result2.body()), "请求密集库出气胀轴,申请行架任务");
luceneLogService.interfaceExecuteLog(luceneLogDto);
return result2;
} catch (Exception e) {
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"callShaftFromCache", String.valueOf(result2.getStatus()),
JSON.toJSONString(result2.body()),
String.valueOf(result2.body()), "请求密集库出气胀轴,申请行架任务报错");
luceneLogService.interfaceExecuteLog(luceneLogDto);
return null;
}
}
@Override
public JSONObject queryStationState(Instruction inst) {
try {

View File

@@ -94,9 +94,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
public CreateTaskResponse crateTask(String param) {
try {
MDC.put(log_file_type, log_type);
log.info("crateTask-----输入参数{}", param);
LuceneLogDto luceneLogDto = new LuceneLogDto(4, param, "acs接收lms任务");
luceneLogService.interfaceExecuteLog(luceneLogDto);
log.info("ACS接收WMS任务-----输入参数{}", param);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("ACS接收WMS任务")
.content("ACS接收WMS任务-----输入参数:" + param)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
JSONArray datas = JSONArray.parseArray(param);
CreateTaskResponse response = new CreateTaskResponse();
// ParamService paramService = SpringContextHolder.getBean(ParamService.class);
@@ -391,7 +395,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
}
response.setErrArr(errArr);
}
log.info("createFromWms--------------:输出参数:" + JSON.toJSONString(response));
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code("ACS接收WMS任务")
.content("ACS接收WMS任务-----返回参数:" + JSON.toJSONString(response))
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
log.info("ACS接收WMS任务--------------:输出参数:" + JSON.toJSONString(response));
return response;
} finally {
@@ -407,7 +417,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
@Override
public Map<String, Object> updateTask(String whereJson) {
JSONArray datas = JSONArray.parseArray(whereJson);
log.info("updateTask--------------:输入参数" + datas.toString());
log.info("WMS更新任务点位状态--------------:输入参数" + datas.toString());
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("WMS更新任务点位状态")
.content("WMS更新任务点位状态-----输入参数:" + whereJson)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
JSONArray errArr = new JSONArray();
if (datas.size() > 0) {
for (int i = 0; i < datas.size(); i++) {
@@ -475,6 +491,12 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
resultJson.put("errArr", errArr);
}
}
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code("WMS更新任务点位状态")
.content("WMS更新任务点位状态-----返回参数:" + resultJson)
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
return resultJson;
}
@@ -495,10 +517,14 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
@Override
public PutActionResponse putAction(String jsonObject) throws Exception {
log.info("putAction--------------:输入参数" + jsonObject);
log.info("WMS下发点位信号--------------:输入参数" + jsonObject);
String date = new Date().toString();
LuceneLogDto luceneLogDto = new LuceneLogDto(4, jsonObject, date + "LMS反馈ACS动作信号");
luceneLogService.interfaceExecuteLog(luceneLogDto);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("WMS下发点位信号")
.content("WMS下发点位信号-----输入参数:" + jsonObject)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
JSONArray datas = JSONArray.parseArray(jsonObject);
PutActionResponse response = new PutActionResponse();
JSONArray errArr = new JSONArray();
@@ -555,19 +581,26 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
}
response.setStatus(200);
response.setMessage("success");
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4, "putAction", String.valueOf(response.getCode()),
jsonObject, String.valueOf(response), "LMS下发动作");
luceneExecuteLogService.interfaceExecuteLog(luceneLogDto);
log.info("putAction--------------:输出参数:" + response);
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code("WMS下发点位信号")
.content("WMS下发点位信号-----返回参数:" + JSON.toJSONString(response))
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
log.info("WMS下发点位信号--------------:输出参数:" + JSON.toJSONString(response));
return response;
}
@Override
public Map<String, Object> putWeightAction(String jsonObject) throws Exception {
log.info("putWeightAction--------------:输入参数" + jsonObject);
log.info("wms下发废箔重量--------------:输入参数" + jsonObject);
String date = new Date().toString();
LuceneLogDto luceneLogDto = new LuceneLogDto(4, jsonObject, date + "LMS反馈ACS废箔重量");
luceneLogService.interfaceExecuteLog(luceneLogDto);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("wms下发废箔重量")
.content("wms下发废箔重量-----输入参数:" + jsonObject)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
JSONArray datas = JSONArray.parseArray(jsonObject);
JSONObject jo = new JSONObject();
for (int i = 0; i < datas.size(); i++) {
@@ -619,17 +652,25 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
resultJson.put("status", HttpStatus.OK.value());
resultJson.put("message", "操作成功");
resultJson.put("data", jo);
log.info("putWeightAction--------------:输出参数" + resultJson.toString());
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code("wms下发废箔重量")
.content("wms下发废箔重量-----返回参数:" + resultJson)
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
log.info("wms下发废箔重量--------------:输出参数" + resultJson.toString());
return resultJson;
}
@Override
public Map<String, Object> getTubeMes(String jsonObject) throws Exception {
log.info("getTubeMes--------------:输入参数" + jsonObject);
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "getTubeMes", "",
String.valueOf(jsonObject),
"", "下发管芯信息");
luceneLogService.interfaceExecuteLog(luceneLogDto);
log.info("下发管芯信息--------------:输入参数" + jsonObject);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("下发管芯信息")
.content("下发管芯信息-----输入参数:" + jsonObject)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
JSONArray datas = JSONArray.parseArray(jsonObject);
Map map = new HashMap();
for (int i = 0; i < datas.size(); i++) {
@@ -660,6 +701,12 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
JSONObject resultJson = new JSONObject();
resultJson.put("status", HttpStatus.OK.value());
resultJson.put("message", "操作成功");
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code("下发管芯信息")
.content("下发管芯信息-----返回参数:" + resultJson)
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
return resultJson;
}
@@ -667,6 +714,12 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
public Map<String, Object> queryDevice(String jsonObject) throws Exception {
try {
MDC.put(log_file_type, log_type);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("WMS查询设备状态")
.content("WMS查询设备状态-----输入参数:" + jsonObject)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
JSONArray backja = new JSONArray();
JSONArray datas = JSONArray.parseArray(jsonObject);
//表处下料行架机械手
@@ -859,9 +912,12 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
resultJson.put("status", HttpStatus.OK.value());
resultJson.put("message", "操作成功");
resultJson.put("data", backja);
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "queryDevice", String.valueOf(resultJson.get("status")),
jsonObject, String.valueOf(resultJson), "LMS查询设备状态");
luceneExecuteLogService.interfaceExecuteLog(luceneLogDto);
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code("WMS查询设备状态")
.content("WMS查询设备状态-----返回参数:" + resultJson)
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
return resultJson;
} finally {
MDC.remove(log_file_type);

View File

@@ -29,7 +29,11 @@ public class SecurityUtils {
return json.toBean(CurrentUser.class);
}
} catch (Exception e) {
return new CurrentUser();
CurrentUser currentUser = new CurrentUser();
currentUser.setId("2");
currentUser.setPresonName("外部系统用户");
currentUser.setUsername("default");
return currentUser;
}
return null;
}

View File

@@ -65,7 +65,6 @@ public class UserController {
}
@Log("新增用户")
@PostMapping
// @SaCheckPermission("user:add")
public ResponseEntity<Object> create(@RequestBody Map user){
@@ -74,7 +73,6 @@ public class UserController {
}
@Log("修改用户")
@PutMapping
// @SaCheckPermission("user:edit")
public ResponseEntity<Object> update( @RequestBody Map resources) throws Exception {
@@ -83,7 +81,6 @@ public class UserController {
}
@Log("修改用户:个人中心")
public ResponseEntity<Object> center(@RequestBody SysUser resources){
if(!resources.getUser_id().equals(StpUtil.getLoginIdAsLong())){
throw new BadRequestException(LangProcess.msg("error_sysAuth"));
@@ -93,7 +90,6 @@ public class UserController {
}
@Log("删除用户")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
userService.removeByIds(ids);

View File

@@ -207,6 +207,7 @@ public class AutoCreateInst {
}
//创建指令后修改任务状态
acsTask.setTask_status(TaskStatusEnum.BUSY.getIndex());
acsTask.setUpdate_time(DateUtil.now());
taskserver.update(acsTask);
}

View File

@@ -78,6 +78,17 @@ public class ISysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> imp
@SneakyThrows
public void create(Map userDetail) {
SysUser sysUser = new SysUser();
//userDetail 中 createTime是string类型BeanUtils.populate不支持解析或者使用MapStruct
ConvertUtils.register((m, o) -> {
try {
if (o == null) {
return null;
}
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(o.toString());
} catch (Exception ex) {
return new Date();
}
}, Date.class);
BeanUtils.populate(sysUser,userDetail);
// 默认密码 123456
if (ObjectUtil.isEmpty(sysUser.getPassword())) {

View File

@@ -577,78 +577,37 @@
{{ 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 prop="update_by" :label="$t('Inst.table.update_by')" :min-width="flexWidth('update_by',crud.data,$t('Inst.table.update_by'))" />
<el-table-column prop="update_time" :label="$t('Inst.table.update_time')" :min-width="flexWidth('update_time',crud.data,$t('Inst.table.update_time'))" />
<el-table-column v-permission="['admin','task:edit','task:del']" :label="$t('task.select.Operation')" width="150px" align="center" fixed="right">
<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/>
</el-icon>
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item>
<el-button
type="text"
icon="el-icon-finished"
@click="handleCommand(scope.$index, scope.row,'a')"
>
{{ $t('task.select.Completed') }}
{{ $t('Inst.table.Finish') }}
</el-button>
<el-dropdown size="mini">
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">{{ $t('user.other.More') }}</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item icon="el-icon-circle-close"><span @click="handleCommand(scope.$index, scope.row,'b')">
{{ $t('auto.common.Cancel') }}</span>
</el-dropdown-item>
<el-dropdown-item>
<el-button
type="text"
icon="el-icon-circle-close"
@click="handleCommand(scope.$index, scope.row,'b')"
>
{{ $t('task.select.Cancel') }}
</el-button>
<el-dropdown-item icon="el-icon-folder-add"><span @click="handleCommand(scope.$index, scope.row,'c')">
{{ $t('task.select.Create_command') }}</span>
</el-dropdown-item>
<el-dropdown-item>
<el-button
type="text"
icon="el-icon-folder-add"
@click="handleCommand(scope.$index, scope.row,'c')"
>
{{ $t('task.select.Create_command') }}
</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button
type="text"
icon="el-icon-finished"
@click="handleCommand(scope.$index, scope.row,'d')"
>
<el-dropdown-item icon="el-icon-finished"><span @click="handleCommand(scope.$index, scope.row,'d')">
{{ $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')"
>
</span></el-dropdown-item>
<el-dropdown-item icon="el-icon-circle-close"><span @click="handleCommand(scope.$index, scope.row,'e')">
{{ $t('task.select.Cancel_Tasks_And_Commands') }}
</el-button>
</el-dropdown-item>
</span></el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</el-table-column>