Merge remote-tracking branch 'origin/master'

This commit is contained in:
2024-07-06 16:20:53 +08:00
9 changed files with 573 additions and 627 deletions

View File

@@ -252,10 +252,10 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
e.printStackTrace();
}
if (standardAutodoorDeviceDriver.getOpen() == 1 && standardAutodoorDeviceDriver.getToOpen() == 1) {
log.info("下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose());
log.info("下发开门信号值为:{},读取开门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getOpen());
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
log.info("未下发NDC信号原因: 下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose());
log.info("未下发NDC信号原因: 下发开门信号值为:{},读取开门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose());
}
}
// }

View File

@@ -236,11 +236,11 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
String move = "";
String option = "";
if (this.getOption() == 0) {
action = LangProcess.msg("universal_actionMessage1");
option = LangProcess.msg("universal_actionMessage1");
} else if (this.getOption() == 1) {
action = LangProcess.msg("universal_actionMessage2");
option = LangProcess.msg("universal_actionMessage2");
} else if (this.getOption() == 2) {
action = LangProcess.msg("universal_actionMessage3");
option = LangProcess.msg("universal_actionMessage3");
}
if (this.getMode() == 0) {
mode = LangProcess.msg("universal_off-line");

View File

@@ -128,7 +128,7 @@ ItemProtocol {
list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4"));
list.add(new ItemDto(item_error, "报警信号", "DB1.B5"));
list.add(new ItemDto(item_task, "任务号", "DB1.D6"));
list.add(new ItemDto(item_barcode, "任务", "DB1.B7"));
list.add(new ItemDto(item_barcode, "气胀轴编", "DB1.B7"));
return list;
}

View File

@@ -151,7 +151,7 @@ public interface AcsToWmsService {
HttpResponse applyBlankButtonTask(JSONObject param);
/**
* 向lms申请反馈
* RGV工位上有货申请行架任务
* @param param
* @return
*/

View File

@@ -347,6 +347,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
.header("Authorization", token).body(String.valueOf(data))
.execute();
// //System.out.println(result2);
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedbackTaskStatusToWms", String.valueOf(result2.getStatus()),
String.valueOf(data), String.valueOf(result2.body()), "ACS向WMS反馈任务状态");
luceneLogService.interfaceExecuteLog(luceneLogDto);
} catch (Exception e) {
String msg = e.getMessage();
//网络不通
@@ -364,6 +367,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
type = "info";
JSONObject jo = JSONObject.parseObject(result2.body());
log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString());
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedbackTaskStatusToWms", String.valueOf(result2.getStatus()),
String.valueOf(data), String.valueOf(result2.body()), "ACS向WMS反馈任务状态");
luceneLogService.interfaceExecuteLog(luceneLogDto);
return result2;
} else {
type = "error";
@@ -445,7 +451,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
public ApplyPlugPullSitResponse applyPlugPullSiteRequest(ApplyPlugPullSiteRequest param) {
log.info("LMS申请反馈,请求参数{}",param);
log.info("lms申请套管工位请求,请求参数{}",param);
String result = "";
try {
MDC.put(log_file_type, log_type);
@@ -455,14 +461,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
AddressDto addressDto = addressService.findByCode("applyPlugPullSiteRequest");
String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url;
log.info("ApplyPlugPullSiteRequest----请求参数:{}", JSONObject.toJSONString(param));
log.info("A向lms申请套管工位请求----请求参数:{}", JSONObject.toJSONString(param));
try {
//
result = HttpRequest.post(url)
.body(JSON.toJSONString(param))
.execute().body();
JSONObject jsonObject = JSONObject.parseObject(result);
log.info("ApplyPlugPullSitResponse----返回参数{}", result);
log.info("向lms申请套管工位请求----返回参数{}", ("1".equals(param.getType()) ? "套轴" : "2".equals(param.getType()) ? "套轴完成" : "3".equals(param.getType()) ? "拔轴完成" :
"4".equals(param.getType()) ? "拔轴" : "缓存线已满,生成行架任务"));
applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class);
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getstatus()),
JSON.toJSONString(param), String.valueOf(result), "ACS向LMS申请"
@@ -471,7 +478,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
luceneLogService.interfaceExecuteLog(luceneLogDto);
} catch (Exception e) {
JSONObject jsonObject = JSONObject.parseObject(result);
log.info("ApplyPlugPullSitResponse----返回参数{}", result);
log.info("向lms申请套管工位请求----返回参数{}", result);
applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class);
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getstatus()),
JSON.toJSONString(param), String.valueOf(result), "ACS向LMS申请失败");
@@ -491,7 +498,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
public ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeight(ApplyfeedbackSubVolumeWeightRequest param) {
log.info("向LMS申请反馈,请求参数{}", param);
log.info("向LMS反馈子卷重量,请求参数{}", param);
String result = "";
ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeightResponse = new ApplyfeedbackSubVolumeWeightResponse();
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
@@ -499,18 +506,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
AddressDto addressDto = addressService.findByCode("applyfeedbackSubVolumeWeightRequest");
String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url;
log.info("applyfeedbackSubVolumeWeightRequest----请求参数:{}", JSONObject.toJSONString(param));
log.info("向LMS反馈子卷重量----请求参数:{}", JSONObject.toJSONString(param));
try {
//
result = HttpRequest.post(url)
.body(JSON.toJSONString(param))
.execute().body();
JSONObject jsonObject = JSONObject.parseObject(result);
log.info("applyfeedbackSubVolumeWeightRequest----返回参数{}", result);
log.info("向LMS反馈子卷重量----返回参数{}", result);
applyfeedbackSubVolumeWeightResponse = JSONObject.toJavaObject(jsonObject, ApplyfeedbackSubVolumeWeightResponse.class);
} catch (Exception e) {
JSONObject jsonObject = JSONObject.parseObject(result);
log.info("applyfeedbackSubVolumeWeightRequest----返回参数{}", result);
log.info("向LMS反馈子卷重量----返回参数{}", result);
JSONObject map = new JSONObject();
map.put("status", 400);
map.put("message", e.getMessage());
@@ -525,7 +532,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
public ApplyManipulatorActionResponse applyManipulatorActionRequest(ApplyManipulatorActionRequest param) {
log.info("向LMS申请反馈,请求参数{}", param);
log.info("RGV工位上有货申请行架任务,请求参数{}", param);
String result = "";
ApplyManipulatorActionResponse applyManipulatorActionResponse = new ApplyManipulatorActionResponse();
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
@@ -533,17 +540,17 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
AddressDto addressDto = addressService.findByCode("applyManipulatorAction");
String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url;
log.info("ApplyManipulatorActionRequest----请求参数:{}", JSONObject.toJSONString(param));
log.info("RGV工位上有货申请行架任务----请求参数:{}", JSONObject.toJSONString(param));
try {
result = HttpRequest.post(url)
.body(JSON.toJSONString(param))
.execute().body();
JSONObject jsonObject = JSONObject.parseObject(result);
log.info("ApplyManipulatorActionResponse----返回参数{}", result);
log.info("RGV工位上有货申请行架任务----返回参数{}", result);
applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class);
} catch (Exception e) {
JSONObject jsonObject = JSONObject.parseObject(result);
log.info("ApplyManipulatorActionResponse----返回参数{}", result);
log.info("RGV工位上有货申请行架任务----返回参数{}", result);
applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class);
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyManipulatorActionRequest", String.valueOf(applyManipulatorActionResponse.getCode()),
JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "ACS向LMS申请反馈子卷重量失败");
@@ -554,7 +561,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return JSONObject.toJavaObject(map, ApplyManipulatorActionResponse.class);
}
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyManipulatorActionRequest", String.valueOf(applyManipulatorActionResponse.getCode()),
JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "ACS向LMS申请反馈子卷重量成功");
JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "RGV工位上有货申请行架任务");
luceneLogService.interfaceExecuteLog(luceneLogDto);
}
return applyManipulatorActionResponse;
@@ -783,6 +790,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
.body(param.toString())
.execute();
log.info("sendDeviceStatus - 返回参数 {}", response.body());
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedbackDie", String.valueOf(response.getStatus()),
String.valueOf(param),
String.valueOf(response.body()), "向LMS发送设备状态");
luceneLogService.interfaceExecuteLog(luceneLogDto);
}
} catch (Throwable ignored) {

View File

@@ -626,46 +626,40 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
@Override
public Map<String, Object> getTubeMes(String jsonObject) throws Exception {
log.info("getTubeMes--------------:输入参数" + jsonObject);
String date = new Date().toString();
LuceneLogDto luceneLogDto = new LuceneLogDto(4, jsonObject, date + "获取管芯信息");
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "getTubeMes", "",
String.valueOf(jsonObject),
"", "下发管芯信息");
luceneLogService.interfaceExecuteLog(luceneLogDto);
JSONArray datas = JSONArray.parseArray(jsonObject);
JSONObject jo = new JSONObject();
Map map = new HashMap();
for (int i = 0; i < datas.size(); i++) {
JSONObject data = (JSONObject) datas.get(i);
String device_code = data.getString("device_code");
String to_material = data.getString("to_material");
String to_spec = data.getString("to_spec");
String to_qty = data.getString("to_qty");
Device device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device)) {
throw new Exception("未找到对应设备:" + device_code);
}
PaperTubePickSiteDeviceDriver paperTubePickSiteDeviceDriver;
if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
try {
//反馈管芯信息
Thread.sleep(1000); //休眠1秒
while (true) {
if (paperTubePickSiteDeviceDriver.getMode() == 2 && paperTubePickSiteDeviceDriver.getFlag() == 3) {
jo.put("to_material", to_material);//当前重量
jo.put("to_spec", to_spec);//上一次重量
jo.put("to_qty", to_qty);//重量差
break;
}
}
} catch (InterruptedException e) {
e.printStackTrace();
if (ObjectUtil.isEmpty(to_material)){
map.put("to_material", "0");
map.put("to_spec", "0");
map.put("to_qty", "0");
}else {
map.put("to_material", to_material);
map.put("to_spec", to_spec);
map.put("to_qty", to_qty);
}
paperTubePickSiteDeviceDriver.writing(map);
}
}
JSONObject resultJson = new JSONObject();
resultJson.put("status", HttpStatus.OK.value());
resultJson.put("message", "操作成功");
resultJson.put("data", jo);
log.info("putWeightAction--------------:输出参数" + resultJson.toString());
return resultJson;
}

View File

@@ -2,6 +2,7 @@ package org.nl.config.lucene.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -162,31 +163,10 @@ public class LuceneServiceImpl implements LuceneService {
}
TermRangeQuery termRangeQuery = new TermRangeQuery("logTime", new BytesRef(startDate), new BytesRef(endDate), true, true);
booleanQueryBuilder.add(termRangeQuery, BooleanClause.Occur.MUST);
if (whereJson.get("device_code") != null){
Query termQuery = new TermQuery(new Term("device_code", (String) whereJson.get("device_code")));
booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST);
}
if (whereJson.get("method") != null){
Query termQuery = new TermQuery(new Term("method", (String) whereJson.get("method")));
booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST);
}
if (whereJson.get("status_code") != null){
Query termQuery = new TermQuery(new Term("status_code", (String) whereJson.get("status_code")));
booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST);
}
if (whereJson.get("requestparam") != null){
WildcardQuery query = new WildcardQuery(new Term("requestparam", "*"+(String) whereJson.get("requestparam")+"*"));
booleanQueryBuilder.add(query,BooleanClause.Occur.MUST);
}
if (whereJson.get("responseparam") != null){
WildcardQuery query = new WildcardQuery(new Term("responseparam", "*"+(String) whereJson.get("responseparam")+"*"));
booleanQueryBuilder.add(query,BooleanClause.Occur.MUST);
}
if (whereJson.get("blurry") != null) {
WildcardQuery query = new WildcardQuery(new Term("fieldContent", "*"+(String) whereJson.get("blurry")+"*"));
booleanQueryBuilder.add(query, BooleanClause.Occur.MUST);
}
TopFieldCollector collector = TopFieldCollector.create(new Sort(new SortField("logTime", SortField.Type.LONG,true)), 20000, 0);
searcher.search(booleanQueryBuilder.build(), collector);
TopDocs topDocs = collector.topDocs(pageNum*pageSize, pageSize);
@@ -197,15 +177,17 @@ public class LuceneServiceImpl implements LuceneService {
for (ScoreDoc scoreDoc : scoreDocs) {
Document doc = open.document(scoreDoc.doc);
JSONObject object = new JSONObject();
object.put("content",doc.get("fieldContent"));
object.put("device_code",doc.get("device_code"));
object.put("logTime",doc.get("logTime"));
object.put("method",doc.get("method"));
object.put("status_code",doc.get("status_code"));
object.put("requestparam",doc.get("requestparam"));
object.put("responseparam",doc.get("responseparam"));
if(doc.get("fieldContent") != null) {
list.add(object);
if (ObjectUtil.isNotEmpty(doc.get("method"))) {
object.put("content", doc.get("fieldContent"));
object.put("logTime", doc.get("logTime") );
object.put("method", doc.get("method"));
object.put("requestparam", doc.get("requestparam"));
object.put("responseparam", doc.get("responseparam"));
if (doc.get("fieldContent") != null) {
list.add(object);
}
}
}
open.close();

View File

@@ -155,6 +155,14 @@
/>
</template>
</el-table-column>
<el-table-column prop="dbr_value2">
<template slot="header">
<el-link type="primary" :underline="false" @click.native="test_read1()">测试读</el-link>
</template>
<template slot-scope="scope">
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
</template>
</el-table-column>
<el-table-column prop="dbw_value">
<template slot="header">
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>