Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -32,6 +32,29 @@
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>elasticsearch-rest-high-level-client</artifactId>
|
||||
<version>7.6.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>elasticsearch-rest-client</artifactId>
|
||||
<version>7.6.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch</groupId>
|
||||
<artifactId>elasticsearch</artifactId>
|
||||
<version>7.6.1</version>
|
||||
</dependency>
|
||||
<!-- logback appender日志-->
|
||||
<dependency>
|
||||
<groupId>com.internetitem</groupId>
|
||||
<artifactId>logback-elasticsearch-appender</artifactId>
|
||||
<version>1.6</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
|
||||
104
lms/nladmin-system/src/main/java/org/nl/ElasticSearchTest.java
Normal file
104
lms/nladmin-system/src/main/java/org/nl/ElasticSearchTest.java
Normal file
@@ -0,0 +1,104 @@
|
||||
package org.nl;
|
||||
|
||||
|
||||
import org.apache.http.HttpHost;
|
||||
import org.elasticsearch.action.get.GetRequest;
|
||||
import org.elasticsearch.action.get.GetResponse;
|
||||
import org.elasticsearch.action.search.SearchRequest;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.client.RequestOptions;
|
||||
import org.elasticsearch.client.RestClient;
|
||||
import org.elasticsearch.client.RestHighLevelClient;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.index.query.BoolQueryBuilder;
|
||||
import org.elasticsearch.index.query.MatchQueryBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilders;
|
||||
import org.elasticsearch.index.query.RangeQueryBuilder;
|
||||
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class ElasticSearchTest {
|
||||
|
||||
public final String ES_URL = "127.0.0.1";
|
||||
|
||||
public final int ES_PORT = 9200;
|
||||
|
||||
|
||||
public static RestHighLevelClient getClientConnection() {
|
||||
|
||||
RestHighLevelClient client = new RestHighLevelClient(
|
||||
RestClient.builder(
|
||||
new HttpHost("localhost", 9200, "http")
|
||||
)
|
||||
);
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
public static void searchById() throws IOException {
|
||||
RestHighLevelClient client = getClientConnection();
|
||||
GetRequest getRequest = new GetRequest("gateway_log", "DceJqGwBqlIig5BB05Z-");
|
||||
GetResponse getResponse = client.get(getRequest, RequestOptions.DEFAULT);
|
||||
System.out.println(getResponse.getSourceAsString());
|
||||
client.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-search.html
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void paginationSearch() throws IOException {
|
||||
|
||||
SearchRequest searchRequest = new SearchRequest();
|
||||
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
|
||||
sourceBuilder.query(QueryBuilders.matchPhraseQuery("eventType", "WAN_ONOFF"));
|
||||
sourceBuilder.from(0);
|
||||
sourceBuilder.size(1);
|
||||
sourceBuilder.timeout(new TimeValue(1000));
|
||||
sourceBuilder.trackTotalHits(true);
|
||||
searchRequest.source(sourceBuilder);
|
||||
|
||||
|
||||
RestHighLevelClient client = getClientConnection();
|
||||
SearchResponse response = client.search(new SearchRequest("gateway_log")
|
||||
.source(sourceBuilder), RequestOptions.DEFAULT);
|
||||
|
||||
System.out.println(response.toString());
|
||||
client.close();
|
||||
}
|
||||
|
||||
public static void paginationSearch2() throws IOException {
|
||||
RestHighLevelClient client = getClientConnection();
|
||||
|
||||
|
||||
BoolQueryBuilder boolQuery = new BoolQueryBuilder();
|
||||
|
||||
RangeQueryBuilder rangeQuery= QueryBuilders.rangeQuery("count").gte(8);
|
||||
boolQuery.filter(rangeQuery);
|
||||
|
||||
MatchQueryBuilder matchQuery = new MatchQueryBuilder("eventType", "WAN_ONOFF");
|
||||
boolQuery.must(matchQuery);
|
||||
|
||||
SearchResponse response = client.search(new SearchRequest("gateway_log")
|
||||
.source(new SearchSourceBuilder()
|
||||
.query(boolQuery)
|
||||
.from(0)
|
||||
.size(2)
|
||||
.trackTotalHits(true)
|
||||
), RequestOptions.DEFAULT);
|
||||
|
||||
System.out.println(response.getHits().getTotalHits());
|
||||
System.out.println(response.toString());
|
||||
client.close();
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
//searchById();
|
||||
//paginationSearch();
|
||||
paginationSearch2();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package org.nl.modules.logging.rest;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.logging.service.EsLogService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @version 1.0
|
||||
* @date 2023年01月29日 18:55
|
||||
* @desc desc
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/esLog")
|
||||
public class EsLogController {
|
||||
private final EsLogService esLogService;
|
||||
|
||||
@GetMapping("/labels")
|
||||
@ApiOperation("获取标签")
|
||||
public ResponseEntity<Object> labelsValues() {
|
||||
return new ResponseEntity<>(esLogService.getLabelsValues(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.nl.modules.logging.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @version 1.0
|
||||
* @date 2023年02月07日 14:34
|
||||
* @desc desc
|
||||
*/
|
||||
public interface EsLogService {
|
||||
/**
|
||||
* 获取labels和values树
|
||||
* @return
|
||||
*/
|
||||
JSONArray getLabelsValues();
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package org.nl.modules.logging.service.impl;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.logging.service.EsLogService;
|
||||
import org.nl.wms.ext.acs.service.impl.AcsToWmsServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @version 1.0
|
||||
* @date 2023年02月07日 14:35
|
||||
* @desc desc
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class EsLogServiceImpl implements EsLogService {
|
||||
@Override
|
||||
public JSONArray getLabelsValues() {
|
||||
/**
|
||||
* [{
|
||||
* label:
|
||||
* value:
|
||||
* children:[{
|
||||
* label
|
||||
* value
|
||||
* }]
|
||||
* }]
|
||||
*/
|
||||
//获取所有索引
|
||||
// String url = "http://47.111.78.178:27017/_cat/indices";
|
||||
|
||||
String url = "http://47.111.78.178:27017/_aliases";
|
||||
String resultMsg = HttpRequest.get(url)
|
||||
.execute().body();
|
||||
|
||||
JSONObject jsonObject = JSON.parseObject(resultMsg);
|
||||
|
||||
JSONArray arr = new JSONArray();
|
||||
|
||||
for (Map.Entry entry : jsonObject.entrySet()) {
|
||||
System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue());
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("label", entry.getKey());
|
||||
json.put("Value", entry.getValue());
|
||||
arr.add(json);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// String url = "http://47.111.78.178:27017/_cat/indices";
|
||||
String url = "http://47.111.78.178:27017/_aliases";
|
||||
String resultMsg = HttpRequest.get(url)
|
||||
.execute().body();
|
||||
|
||||
JSONObject jsonObject = JSON.parseObject(resultMsg);
|
||||
|
||||
JSONArray arr = new JSONArray();
|
||||
|
||||
for (Map.Entry entry : jsonObject.entrySet()) {
|
||||
System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue());
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("label", entry.getKey());
|
||||
json.put("Value", entry.getValue());
|
||||
arr.add(json);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public class WebSocketServer {
|
||||
* @param message 客户端发送过来的消息*/
|
||||
@OnMessage
|
||||
public void onMessage(String message, Session session) {
|
||||
log.info("收到来"+sid+"的信息:"+message);
|
||||
// log.info("收到来"+sid+"的信息:"+message);
|
||||
//群发消息
|
||||
for (WebSocketServer item : webSocketSet) {
|
||||
try {
|
||||
@@ -106,7 +106,7 @@ public class WebSocketServer {
|
||||
* */
|
||||
public static void sendInfo(SocketMsg socketMsg,@PathParam("sid") String sid) throws IOException {
|
||||
String message = JSONObject.toJSONString(socketMsg);
|
||||
log.info("推送消息到"+sid+",推送内容:"+message);
|
||||
// log.info("推送消息到"+sid+",推送内容:"+message);
|
||||
for (WebSocketServer item : webSocketSet) {
|
||||
try {
|
||||
//这里可以设定只推送给这个sid的,为null则全部推送
|
||||
|
||||
@@ -50,7 +50,6 @@ public class AcsToWmsController {
|
||||
@PostMapping("/apply")
|
||||
@Log(value = "申请任务", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("申请任务")
|
||||
@SaCheckPermission("menu:list")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> apply(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(acsToWmsService.apply(whereJson), HttpStatus.OK);
|
||||
@@ -59,7 +58,7 @@ public class AcsToWmsController {
|
||||
@PostMapping("/againApply")
|
||||
@Log(value = "二次申请任务", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("二次申请任务")
|
||||
@SaCheckPermission("menu:list")
|
||||
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> againApply(@RequestBody String task_id) {
|
||||
return new ResponseEntity<>(acsToWmsService.againApply(task_id), HttpStatus.OK);
|
||||
@@ -92,7 +91,7 @@ public class AcsToWmsController {
|
||||
@Log(value = "仓位初始化", isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("仓位初始化")
|
||||
@SaIgnore
|
||||
@SaCheckPermission("menu:list")
|
||||
|
||||
public ResponseEntity<Object> initialize(@RequestBody JSONObject json) {
|
||||
acsToWmsService.initialize(json);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
|
||||
@@ -399,7 +399,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if (ObjectUtil.isEmpty(point_jo)) {
|
||||
throw new BadRequestException("未查询到相同销售订单的放货区点位或空的一排!");
|
||||
} else {
|
||||
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' order by out_order_seq ASC").uniqueResult(0);
|
||||
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' order by out_order_seq ASC").uniqueResult(0);
|
||||
point_code = jsonNewRow.getString("point_code");
|
||||
}
|
||||
} else {
|
||||
@@ -430,7 +430,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if (ObjectUtil.isEmpty(point_jo)) {
|
||||
throw new BadRequestException("未查询到相同销售订单的放货区点位或空的一排!");
|
||||
} else {
|
||||
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' order by out_order_seq ASC").uniqueResult(0);
|
||||
JSONObject jsonNewRow = WQLObject.getWQLObject("sch_base_point").query("row_num = '" + point_jo.getString("row_num") + "' AND point_type ='9' AND is_delete = '0' and lock_type = '1' order by out_order_seq ASC").uniqueResult(0);
|
||||
point_code = jsonNewRow.getString("point_code");
|
||||
}
|
||||
}
|
||||
@@ -443,6 +443,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
task_jo.put("task_type", "010506");
|
||||
SendOutTask sendOutTask = new SendOutTask();
|
||||
sendOutTask.createTask(task_jo);
|
||||
|
||||
// 锁住点位
|
||||
JSONObject jsonPoint = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||
jsonPoint.put("lock_type", "99");
|
||||
WQLObject.getWQLObject("sch_base_point").update(jsonPoint);
|
||||
}
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "下发成功!");
|
||||
|
||||
@@ -12,8 +12,6 @@ import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.wms.ext.crm.service.CrmToLmsService;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.log.LokiLog;
|
||||
import org.nl.wms.log.LokiLogType;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -23,7 +21,7 @@ import java.util.HashMap;
|
||||
@Slf4j
|
||||
public class CrmToLmsServiceImpl implements CrmToLmsService {
|
||||
|
||||
@LokiLog(type = LokiLogType.CRM_TO_LMS)
|
||||
|
||||
@Override
|
||||
public JSONObject getCustomerInfo(JSONObject row) {
|
||||
|
||||
@@ -94,7 +92,7 @@ public class CrmToLmsServiceImpl implements CrmToLmsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@LokiLog(type = LokiLogType.CRM_TO_LMS)
|
||||
|
||||
@Override
|
||||
public JSONObject getCPIvtInfo(JSONObject jo) {
|
||||
log.info("getCPIvtInfo输入参数为:----------------------" + jo.toString());
|
||||
|
||||
@@ -8,12 +8,9 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||
import org.nl.wms.log.LokiLog;
|
||||
import org.nl.wms.log.LokiLogType;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -32,7 +29,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@LokiLog(type = LokiLogType.LMS_TO_MES)
|
||||
|
||||
@Override
|
||||
public JSONObject momRollFoilWeighing(JSONObject param) {
|
||||
log.info("momRollFoilWeighing接口输入参数为:-------------------" + param);
|
||||
@@ -50,8 +47,8 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String Password = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
|
||||
param.put("UserName",UserName);
|
||||
param.put("Password",Password);
|
||||
param.put("UserName", UserName);
|
||||
param.put("Password", Password);
|
||||
|
||||
// String url = acsUrl + api;
|
||||
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||
@@ -65,13 +62,13 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
log.info("momRollFoilWeighing接口输出参数为:-------------------" + result.toString());
|
||||
|
||||
String RTYPE = result.getString("RTYPE");
|
||||
if (RTYPE.equals("E")){
|
||||
if (RTYPE.equals("E")) {
|
||||
throw new BadRequestException(result.getString("RTMSG"));
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("MES提示错误:"+e.getMessage());
|
||||
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -81,7 +78,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@LokiLog(type = LokiLogType.LMS_TO_MES)
|
||||
|
||||
@Override
|
||||
public JSONObject momRollBakeInBound(JSONObject param) {
|
||||
log.info("momRollBakeInBound接口输入参数为:-------------------" + param.toString());
|
||||
@@ -108,13 +105,13 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
log.info("momRollBakeInBound接口输出参数为:-------------------" + result.toString());
|
||||
|
||||
String RTYPE = result.getString("RTYPE");
|
||||
if (RTYPE.equals("E")){
|
||||
if (RTYPE.equals("E")) {
|
||||
throw new BadRequestException(result.getString("RTMSG"));
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("MES提示错误:"+e.getMessage());
|
||||
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -124,7 +121,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@LokiLog(type = LokiLogType.LMS_TO_MES)
|
||||
|
||||
@Override
|
||||
public JSONObject momRollBakeOutBound(JSONObject param) {
|
||||
log.info("momRollBakeOutBound接口输入参数为:-------------------" + param.toString());
|
||||
@@ -140,8 +137,8 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
|
||||
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String Password = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
param.put("UserName",UserName);
|
||||
param.put("Password",Password);
|
||||
param.put("UserName", UserName);
|
||||
param.put("Password", Password);
|
||||
|
||||
// String url = acsUrl + api;
|
||||
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||
@@ -155,13 +152,13 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
log.info("momRollBakeOutBound接口输出参数为:-------------------" + result.toString());
|
||||
|
||||
String RTYPE = result.getString("RTYPE");
|
||||
if (RTYPE.equals("E")){
|
||||
if (RTYPE.equals("E")) {
|
||||
throw new BadRequestException(result.getString("RTMSG"));
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("MES提示错误:"+e.getMessage());
|
||||
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -171,7 +168,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@LokiLog(type = LokiLogType.LMS_TO_MES)
|
||||
|
||||
@Override
|
||||
public JSONObject momRollSemiFGInboundComplete(JSONObject param) {
|
||||
log.info("momRollSemiFGInboundComplete接口输入参数为:-------------------" + param.toString());
|
||||
@@ -199,13 +196,13 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
|
||||
|
||||
String RTYPE = result.getString("RTYPE");
|
||||
if (RTYPE.equals("E")){
|
||||
if (RTYPE.equals("E")) {
|
||||
throw new BadRequestException(result.getString("RTMSG"));
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("MES提示错误:"+e.getMessage());
|
||||
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -215,7 +212,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@LokiLog(type = LokiLogType.LMS_TO_MES)
|
||||
|
||||
@Override
|
||||
public JSONObject airSwellWithPaperTubeAssComplete(JSONObject param) {
|
||||
log.info("airSwellWithPaperTubeAssComplete接口输入参数为:-------------------" + param.toString());
|
||||
@@ -249,13 +246,13 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
log.info("airSwellWithPaperTubeAssComplete接口输出参数为:-------------------" + result.toString());
|
||||
|
||||
String RTYPE = result.getString("RTYPE");
|
||||
if (RTYPE.equals("E")){
|
||||
if (RTYPE.equals("E")) {
|
||||
throw new BadRequestException(result.getString("RTMSG"));
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("MES提示错误:"+e.getMessage());
|
||||
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -265,7 +262,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@LokiLog(type = LokiLogType.LMS_TO_MES)
|
||||
|
||||
@Override
|
||||
public JSONObject cutPlanMomRollDeliveryComplete(JSONObject param) {
|
||||
log.info("cutPlanMomRollDeliveryComplete接口输入参数为:-------------------" + param.toString());
|
||||
@@ -283,19 +280,18 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
String warehouse = param.getString("warehouse");
|
||||
|
||||
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("iContainerName",container_name);
|
||||
jo.put("iisSourceRollDeliveryComplete",1);
|
||||
jo.put("PackageBoxSN",package_box_sn);
|
||||
jo.put("iWarehouse",warehouse);
|
||||
jo.put("iisAirSwellAssComplete","");
|
||||
jo.put("iisAirSwellDeliveryComplete","");
|
||||
jo.put("iContainerName", container_name);
|
||||
jo.put("iisSourceRollDeliveryComplete", 1);
|
||||
jo.put("PackageBoxSN", package_box_sn);
|
||||
jo.put("iWarehouse", warehouse);
|
||||
jo.put("iisAirSwellAssComplete", "");
|
||||
jo.put("iisAirSwellDeliveryComplete", "");
|
||||
|
||||
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String Password = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
jo.put("UserName",UserName);
|
||||
jo.put("Password",Password);
|
||||
jo.put("UserName", UserName);
|
||||
jo.put("Password", Password);
|
||||
|
||||
// String url = acsUrl + api;
|
||||
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||
@@ -310,13 +306,13 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
|
||||
|
||||
String RTYPE = result.getString("RTYPE");
|
||||
if (RTYPE.equals("E")){
|
||||
if (RTYPE.equals("E")) {
|
||||
throw new BadRequestException(result.getString("RTMSG"));
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("MES提示错误:"+e.getMessage());
|
||||
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -326,7 +322,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@LokiLog(type = LokiLogType.LMS_TO_MES)
|
||||
|
||||
@Override
|
||||
public JSONObject airSwellWithPaperTubeAssArrival(JSONObject param) {
|
||||
log.info("airSwellWithPaperTubeAssArrival接口输入参数为:-------------------" + param.toString());
|
||||
@@ -361,13 +357,13 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
|
||||
|
||||
String RTYPE = result.getString("RTYPE");
|
||||
if (RTYPE.equals("E")){
|
||||
if (RTYPE.equals("E")) {
|
||||
throw new BadRequestException(result.getString("RTMSG"));
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("MES提示错误:"+e.getMessage());
|
||||
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -377,7 +373,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@LokiLog(type = LokiLogType.LMS_TO_MES)
|
||||
|
||||
@Override
|
||||
public JSONObject childRollFGInboundComplete(JSONObject param) {
|
||||
log.info("childRollFGInboundComplete接口输入参数为:-------------------" + param.toString());
|
||||
@@ -401,8 +397,8 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
|
||||
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String Password = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
jo.put("UserName",UserName);
|
||||
jo.put("Password",Password);
|
||||
jo.put("UserName", UserName);
|
||||
jo.put("Password", Password);
|
||||
|
||||
// String url = acsUrl + api;
|
||||
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
|
||||
@@ -417,13 +413,13 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
|
||||
|
||||
String RTYPE = result.getString("RTYPE");
|
||||
if (RTYPE.equals("E")){
|
||||
if (RTYPE.equals("E")) {
|
||||
throw new BadRequestException(result.getString("RTMSG"));
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("MES提示错误:"+e.getMessage());
|
||||
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -433,7 +429,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@LokiLog(type = LokiLogType.LMS_TO_MES)
|
||||
|
||||
@Override
|
||||
public JSONObject childRollFGOutboundComplete(JSONObject param) {
|
||||
log.info("childRollFGOutboundComplete接口输入参数为:-------------------" + param.toString());
|
||||
@@ -460,13 +456,13 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
|
||||
|
||||
String RTYPE = result.getString("RTYPE");
|
||||
if (RTYPE.equals("E")){
|
||||
if (RTYPE.equals("E")) {
|
||||
throw new BadRequestException(result.getString("RTMSG"));
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("MES提示错误:"+e.getMessage());
|
||||
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -476,7 +472,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@LokiLog(type = LokiLogType.LMS_TO_MES)
|
||||
|
||||
@Override
|
||||
public JSONObject lmsUnPackage(JSONObject param) {
|
||||
log.info("LMSUnPackakge接口输入参数为:-------------------" + param.toString());
|
||||
@@ -496,8 +492,8 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
|
||||
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String Password = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
param.put("UserName",UserName);
|
||||
param.put("Password",Password);
|
||||
param.put("UserName", UserName);
|
||||
param.put("Password", Password);
|
||||
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
@@ -508,13 +504,13 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
|
||||
|
||||
String RTYPE = result.getString("RTYPE");
|
||||
if (RTYPE.equals("E")){
|
||||
if (RTYPE.equals("E")) {
|
||||
throw new BadRequestException(result.getString("RTMSG"));
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("MES提示错误:"+e.getMessage());
|
||||
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -524,7 +520,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@LokiLog(type = LokiLogType.LMS_TO_MES)
|
||||
|
||||
@Override
|
||||
public JSONObject lmsPackage(JSONObject param) {
|
||||
log.info("LMSPackakge接口输入参数为:-------------------" + param.toString());
|
||||
@@ -544,8 +540,8 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
|
||||
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
|
||||
String Password = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
|
||||
param.put("UserName",UserName);
|
||||
param.put("Password",Password);
|
||||
param.put("UserName", UserName);
|
||||
param.put("Password", Password);
|
||||
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url)
|
||||
@@ -556,13 +552,13 @@ public class LmsToMesServiceImpl implements LmsToMesService {
|
||||
|
||||
|
||||
String RTYPE = result.getString("RTYPE");
|
||||
if (RTYPE.equals("E")){
|
||||
if (RTYPE.equals("E")) {
|
||||
throw new BadRequestException(result.getString("RTMSG"));
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("MES提示错误:"+e.getMessage());
|
||||
throw new BadRequestException("MES提示错误:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,6 @@ import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||
import org.nl.wms.ext.mes.service.MesToLmsService;
|
||||
import org.nl.wms.log.LokiLog;
|
||||
import org.nl.wms.log.LokiLogType;
|
||||
import org.nl.wms.pda.mps.service.InService;
|
||||
import org.nl.wms.pda.mps.service.OutService;
|
||||
import org.nl.wms.pda.mps.service.impl.BakingServiceImpl;
|
||||
@@ -30,7 +28,6 @@ import org.nl.wms.st.inbill.service.CheckOutBillService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
|
||||
@Service
|
||||
|
||||
@@ -7,12 +7,9 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.ext.sap.service.LmsToSapService;
|
||||
import org.nl.wms.log.LokiLog;
|
||||
import org.nl.wms.log.LokiLogType;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -21,7 +18,7 @@ import org.springframework.stereotype.Service;
|
||||
@Slf4j
|
||||
public class LmsToSapServiceImpl implements LmsToSapService {
|
||||
|
||||
@LokiLog(type = LokiLogType.LMS_TO_SAP)
|
||||
|
||||
@Override
|
||||
public JSONObject returnDelivery(JSONObject jo) {
|
||||
/*
|
||||
@@ -58,8 +55,8 @@ public class LmsToSapServiceImpl implements LmsToSapService {
|
||||
String api = "";
|
||||
url = url + "/sap/center/wms/004";
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url).header("TOKEN",token)
|
||||
.header("sap-client",sap_client)
|
||||
String resultMsg = HttpRequest.post(url).header("TOKEN", token)
|
||||
.header("sap-client", sap_client)
|
||||
.body(String.valueOf(jo))
|
||||
.execute().body();
|
||||
result = JSONObject.parseObject(resultMsg);
|
||||
@@ -72,13 +69,13 @@ public class LmsToSapServiceImpl implements LmsToSapService {
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("SAP提示错误:"+e.getMessage());
|
||||
throw new BadRequestException("SAP提示错误:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@LokiLog(type = LokiLogType.LMS_TO_SAP)
|
||||
|
||||
@Override
|
||||
public JSONObject returnMoveDtl(JSONObject jo) {
|
||||
/*
|
||||
@@ -123,8 +120,8 @@ public class LmsToSapServiceImpl implements LmsToSapService {
|
||||
String api = "/sap/center/wms/005";
|
||||
url = url + api;
|
||||
try {
|
||||
String resultMsg = HttpRequest.post(url).header("TOKEN",token)
|
||||
.header("sap-client",sap_client)
|
||||
String resultMsg = HttpRequest.post(url).header("TOKEN", token)
|
||||
.header("sap-client", sap_client)
|
||||
.body(String.valueOf(jo))
|
||||
.execute().body();
|
||||
result = JSONObject.parseObject(resultMsg);
|
||||
@@ -136,7 +133,7 @@ public class LmsToSapServiceImpl implements LmsToSapService {
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("SAP提示错误:"+e.getMessage());
|
||||
throw new BadRequestException("SAP提示错误:" + e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.ext.sap.service.SapToLmsService;
|
||||
import org.nl.wms.log.LokiLog;
|
||||
import org.nl.wms.log.LokiLogType;
|
||||
import org.nl.wms.st.inbill.service.CheckOutBillService;
|
||||
import org.nl.wms.st.inbill.service.RawAssistIStorService;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -29,7 +27,7 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
|
||||
private final RawAssistIStorService rawAssistIStorService;
|
||||
|
||||
@LokiLog(type = LokiLogType.SAP_TO_LMS)
|
||||
|
||||
@Override
|
||||
public JSONObject getMaterialInfo(JSONObject jo) {
|
||||
JSONArray rows = jo.getJSONArray("DATAS");
|
||||
@@ -51,33 +49,33 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
WQLObject.getWQLObject("md_me_materialbaseext").update(row);
|
||||
}
|
||||
|
||||
JSONObject base_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '"+MATNR+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(base_jo)){
|
||||
JSONObject base_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + MATNR + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(base_jo)) {
|
||||
JSONObject mater_base_jo = new JSONObject();
|
||||
mater_base_jo.put("material_id",IdUtil.getSnowflake(1,1).nextId());
|
||||
mater_base_jo.put("material_code",MATNR);
|
||||
mater_base_jo.put("material_name",MATNR01);
|
||||
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("unit_code = '"+MEINS+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(unit)){
|
||||
mater_base_jo.put("material_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
mater_base_jo.put("material_code", MATNR);
|
||||
mater_base_jo.put("material_name", MATNR01);
|
||||
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("unit_code = '" + MEINS + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(unit)) {
|
||||
throw new BadRequestException("未查询到相关计量单位,请进行维护!");
|
||||
}
|
||||
mater_base_jo.put("base_unit_id",unit.getString("measure_unit_id"));
|
||||
mater_base_jo.put("base_unit_id", unit.getString("measure_unit_id"));
|
||||
mater_base_jo.put("create_id", "1");
|
||||
mater_base_jo.put("create_name", "管理员");
|
||||
mater_base_jo.put("create_time", DateUtil.now());
|
||||
mater_base_jo.put("update_optid", "1");
|
||||
mater_base_jo.put("update_optname", "管理员");
|
||||
mater_base_jo.put("update_time", DateUtil.now());
|
||||
mater_base_jo.put("is_used","1");
|
||||
mater_base_jo.put("is_delete","0");
|
||||
mater_base_jo.put("is_used", "1");
|
||||
mater_base_jo.put("is_delete", "0");
|
||||
WQLObject.getWQLObject("md_me_materialbase").insert(mater_base_jo);
|
||||
}else {
|
||||
base_jo.put("material_name",MATNR01);
|
||||
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("unit_code = '"+MEINS+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(unit)){
|
||||
} else {
|
||||
base_jo.put("material_name", MATNR01);
|
||||
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("unit_code = '" + MEINS + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(unit)) {
|
||||
throw new BadRequestException("未查询到相关计量单位,请进行维护!");
|
||||
}
|
||||
base_jo.put("base_unit_id",unit.getString("measure_unit_id"));
|
||||
base_jo.put("base_unit_id", unit.getString("measure_unit_id"));
|
||||
base_jo.put("update_optid", "1");
|
||||
base_jo.put("update_optname", "管理员");
|
||||
base_jo.put("update_time", DateUtil.now());
|
||||
@@ -96,7 +94,7 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@LokiLog(type = LokiLogType.SAP_TO_LMS)
|
||||
|
||||
@Override
|
||||
public JSONObject getDeliveryInfo(JSONObject jo) {
|
||||
log.info("getDeliveryInfo的输入参数为:------------------------" + jo.toString());
|
||||
@@ -168,7 +166,7 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
jsonMst.put("consignee", json.getString("NAMEM")); // 收货单位
|
||||
jsonMst.put("receiptaddress", json.getString("ADRNRS")); // 收货地址
|
||||
/*jsonMst.put("remark",json.getString("LGORT"));//库位*/
|
||||
|
||||
|
||||
|
||||
// 明细
|
||||
JSONObject jsonMater = materTab.query("material_code = '" + json.getString("MATNR") + "'").uniqueResult(0);
|
||||
@@ -298,7 +296,7 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@LokiLog(type = LokiLogType.SAP_TO_LMS)
|
||||
|
||||
@Override
|
||||
public JSONObject getReturnDeliveryInfo(JSONObject jo) {
|
||||
/**
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package org.nl.wms.log;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author: lyd
|
||||
* @description: 自定义日志注解,用作LOKI日志分类
|
||||
* @Date: 2022/10/10
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ ElementType.METHOD})
|
||||
@Documented
|
||||
public @interface LokiLog {
|
||||
LokiLogType type() default LokiLogType.DEFAULT;
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package org.nl.wms.log;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.Signature;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
|
||||
/**
|
||||
* @author: lyd
|
||||
* @description: 自定义日志切面:https://cloud.tencent.com/developer/article/1655923
|
||||
* @Date: 2022/10/10
|
||||
*/
|
||||
@Aspect
|
||||
@Slf4j
|
||||
@Component
|
||||
public class LokiLogAspect {
|
||||
/**
|
||||
* 切到所有OperatorLog注解修饰的方法
|
||||
*/
|
||||
@Pointcut("@annotation(org.nl.wms.log.LokiLog)")
|
||||
public void operatorLog() {
|
||||
// 空方法
|
||||
}
|
||||
|
||||
/**
|
||||
* 利用@Around环绕增强
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Around("operatorLog()")
|
||||
public synchronized Object around(ProceedingJoinPoint pjp) throws Throwable {
|
||||
// ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
// HttpServletRequest request = attributes.getRequest();
|
||||
// HttpServletResponse response = attributes.getResponse();
|
||||
|
||||
Signature signature = pjp.getSignature();
|
||||
MethodSignature methodSignature = (MethodSignature) signature;
|
||||
Method method = methodSignature.getMethod();
|
||||
LokiLog lokiLog = method.getAnnotation(LokiLog.class);
|
||||
|
||||
// 获取描述信息
|
||||
LokiLogType logType = lokiLog.type();
|
||||
|
||||
MDC.put("log_file_type", logType.getDesc());
|
||||
log.info("输入参数:" + JSONObject.toJSONString(pjp.getArgs()));
|
||||
|
||||
Object proceed = pjp.proceed();
|
||||
|
||||
log.info("返回参数:" + JSONObject.toJSONString(proceed));
|
||||
MDC.remove("log_file_type");
|
||||
return proceed;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package org.nl.wms.log;
|
||||
|
||||
/**
|
||||
* @author: lyd
|
||||
* @description:
|
||||
* @Date: 2022/10/11
|
||||
*/
|
||||
public enum LokiLogType {
|
||||
DEFAULT("默认"),
|
||||
LMS_TO_MES("LMS请求MES"),
|
||||
MES_TO_LMS("MES请求LMS"),
|
||||
LMS_TO_CRM("LMS请求CRM"),
|
||||
CRM_TO_LMS("CRM请求LMS"),
|
||||
LMS_TO_SAP("LMS请求SAP"),
|
||||
SAP_TO_LMS("SAP请求LMS"),
|
||||
LMS_TO_ACS("LMS请求ACS"),
|
||||
ACS_TO_LMS("ACS请求LMS");
|
||||
|
||||
private String desc;
|
||||
|
||||
LokiLogType(String desc) {
|
||||
this.desc=desc;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,10 @@ public class SlittingproductionplanServiceImpl implements Slittingproductionplan
|
||||
String resource_name = MapUtil.getStr(whereJson, "resource_name");
|
||||
String parent_container_name = MapUtil.getStr(whereJson, "parent_container_name");
|
||||
String container_name = MapUtil.getStr(whereJson, "container_name");
|
||||
String qzzno = MapUtil.getStr(whereJson, "qzzno");
|
||||
String is_parent_ok = MapUtil.getStr(whereJson, "is_parent_ok");
|
||||
String is_child_tz_ok = MapUtil.getStr(whereJson, "is_child_tz_ok");
|
||||
String is_child_ps_ok = MapUtil.getStr(whereJson, "is_child_ps_ok");
|
||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
|
||||
@@ -61,9 +65,13 @@ public class SlittingproductionplanServiceImpl implements Slittingproductionplan
|
||||
map.put("status", status);
|
||||
map.put("begin_time", begin_time);
|
||||
map.put("end_time", end_time);
|
||||
map.put("is_parent_ok", is_parent_ok);
|
||||
map.put("is_child_tz_ok", is_child_tz_ok);
|
||||
map.put("is_child_ps_ok", is_child_ps_ok);
|
||||
if (ObjectUtil.isNotEmpty(resource_name)) map.put("resource_name","%"+resource_name+"%");
|
||||
if (ObjectUtil.isNotEmpty(parent_container_name)) map.put("parent_container_name","%"+parent_container_name+"%");
|
||||
if (ObjectUtil.isNotEmpty(container_name)) map.put("container_name","%"+container_name+"%");
|
||||
if (ObjectUtil.isNotEmpty(qzzno)) map.put("qzzno","%"+qzzno+"%");
|
||||
|
||||
JSONObject json = WQL.getWO("PDM_BI_SLIDTTINGPLAN_01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "plan.container_name");
|
||||
return json;
|
||||
@@ -190,7 +198,7 @@ public class SlittingproductionplanServiceImpl implements Slittingproductionplan
|
||||
}
|
||||
|
||||
//判断该接口是否需要回传
|
||||
JSONObject back_jo = WQLObject.getWQLObject("MD_PB_InterfaceBack").query("interface_name = 'momRollSemiFGInboundComplete'").uniqueResult(0);
|
||||
JSONObject back_jo = WQLObject.getWQLObject("MD_PB_InterfaceBack").query("interface_name = 'airSwellWithPaperTubeAssArrival'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(back_jo) && back_jo.getString("is_back").equals("1")){
|
||||
lmsToMesService.cutPlanMomRollDeliveryComplete(mom_jo);
|
||||
}
|
||||
@@ -243,12 +251,21 @@ public class SlittingproductionplanServiceImpl implements Slittingproductionplan
|
||||
throw new BadRequestException("还未绑定气涨轴!");
|
||||
}
|
||||
HashMap map = new HashMap();
|
||||
map.put("is_child_ps_ok","1");
|
||||
map.put("status","03");
|
||||
map.put("update_optid",currentUserId);
|
||||
map.put("update_optname",currentUsername);
|
||||
map.put("update_time",DateUtil.now());
|
||||
tab.update(map,"qzzno = '"+jsonObject.getString("qzzno")+"'");
|
||||
jsonObject.put("is_child_ps_ok","1");
|
||||
jsonObject.put("status","03");
|
||||
jsonObject.put("update_optid",currentUserId);
|
||||
jsonObject.put("update_optname",currentUsername);
|
||||
jsonObject.put("update_time",DateUtil.now());
|
||||
tab.update(jsonObject);
|
||||
|
||||
//调用MES接口,通知MES已经套轴完成
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("container_name", jsonObject.getString("container_name"));
|
||||
//判断该接口是否需要回传
|
||||
JSONObject back_jo = WQLObject.getWQLObject("MD_PB_InterfaceBack").query("interface_name = 'airSwellWithPaperTubeAssComplete'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(back_jo) && back_jo.getString("is_back").equals("1")) {
|
||||
lmsToMesService.airSwellWithPaperTubeAssArrival(jo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
输入.container_name TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.qzzno TYPEAS s_string
|
||||
输入.is_child_ps_ok TYPEAS s_string
|
||||
输入.is_child_tz_ok TYPEAS s_string
|
||||
输入.is_parent_ok TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -82,6 +86,22 @@
|
||||
plan.container_name like 输入.container_name
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.qzzno <> ""
|
||||
plan.qzzno like 输入.qzzno
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.is_parent_ok <> ""
|
||||
plan.is_parent_ok = 输入.is_parent_ok
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.is_child_tz_ok <> ""
|
||||
plan.is_child_tz_ok = 输入.is_child_tz_ok
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.is_child_ps_ok <> ""
|
||||
plan.is_child_ps_ok = 输入.is_child_ps_ok
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
plan.manufacture_date >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
@@ -113,6 +113,7 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
String sort_seq = jsonIvt.getString("sort_seq");
|
||||
JSONObject right_point = WQL.getWO("PDA_02")
|
||||
.addParam("point_location", point_location)
|
||||
.addParam("point_code", point_code1)
|
||||
.addParam("product_area", product_area)
|
||||
.addParam("sort_seq", sort_seq)
|
||||
.addParam("find_type", "1")
|
||||
@@ -158,14 +159,14 @@ public class CutConveyorTask extends AbstractAcsTask {
|
||||
|
||||
LmsToMesService lmsToMesService = SpringContextHolder.getBean(LmsToMesService.class);
|
||||
//调用MES配送完成接口
|
||||
JSONArray rows = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '0' AND is_delete ='0' AND status = '02'").getResultJSONArray(0);
|
||||
JSONArray rows = WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").query("qzzno = '" + jsonTask.getString("vehicle_code") + "' AND is_child_tz_ok = '1' AND is_child_ps_ok = '1' AND is_delete ='0' AND status = '03'").getResultJSONArray(0);
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
String ContainerName = row.getString("container_name");
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("ContainerName", ContainerName);
|
||||
//判断该接口是否需要回传
|
||||
JSONObject back_jo = WQLObject.getWQLObject("MD_PB_InterfaceBack").query("interface_name = 'momRollSemiFGInboundComplete'").uniqueResult(0);
|
||||
JSONObject back_jo = WQLObject.getWQLObject("MD_PB_InterfaceBack").query("interface_name = 'airSwellWithPaperTubeAssArrival'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(back_jo) && back_jo.getString("is_back").equals("1")) {
|
||||
lmsToMesService.airSwellWithPaperTubeAssArrival(row);
|
||||
}
|
||||
|
||||
@@ -51,10 +51,6 @@ public class InTask extends AbstractAcsTask {
|
||||
JSONObject struct_jo = WQLObject.getWQLObject("ST_IVT_StructAttr").query("struct_code = '"+point_code2+"'").uniqueResult(0);
|
||||
String row_num = struct_jo.getString("row_num");
|
||||
String block_num = struct_jo.getString("block_num");
|
||||
JSONObject task_jo = WQLObject.getWQLObject("ST_IVT_StructAttr").query("block_num = '"+block_num+"' AND row_num = '"+row_num+"' AND lock_type in ('3','6')").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(task_jo)){
|
||||
continue;
|
||||
}
|
||||
|
||||
char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length()-1);
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
|
||||
@@ -70,6 +70,10 @@ public class SendOutTask extends AbstractAcsTask {
|
||||
jsonTask.put("is_delete","1");
|
||||
jsonTask.put("update_time", DateUtil.now());
|
||||
taskTab.update(jsonTask);
|
||||
|
||||
JSONObject jsonPoint2 = pointTab.query("point_code = '" + jsonTask.getString("point_code2") + "'").uniqueResult(0);
|
||||
jsonPoint2.put("lock_type", "1");
|
||||
pointTab.update(jsonPoint2);
|
||||
}
|
||||
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
@@ -94,6 +98,7 @@ public class SendOutTask extends AbstractAcsTask {
|
||||
// 更新暂存区点位状态
|
||||
JSONObject jsonPoint2 = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + jsonTask.getString("point_code2") + "'").uniqueResult(0);
|
||||
jsonPoint2.put("point_status", "2");
|
||||
jsonPoint2.put("lock_type", "1");
|
||||
jsonPoint2.put("vehicle_code", jsonTask.getString("vehicle_code"));
|
||||
pointTab.update(jsonPoint2);
|
||||
}
|
||||
|
||||
@@ -1197,7 +1197,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
task_map.put("update_optname", nickName);
|
||||
task_map.put("update_time", now);
|
||||
//修改分配表起点,任务表起点
|
||||
/* task_wql.update(task_map, "task_id = '" + task_id + "'");*/
|
||||
task_wql.update(task_map, "task_id = '" + whereJson.get("task_id") + "'");
|
||||
|
||||
//解锁原货位点位
|
||||
HashMap unlock_map = new HashMap();
|
||||
|
||||
@@ -70,6 +70,8 @@
|
||||
IFNULL( po.vehicle_code, '' ) = ''
|
||||
AND
|
||||
po.point_type = '9'
|
||||
AND
|
||||
po.lock_type = '1'
|
||||
OPTION 输入.row_num <> ""
|
||||
po.row_num = 输入.row_num
|
||||
ENDOPTION
|
||||
|
||||
@@ -2545,6 +2545,17 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
|
||||
|
||||
if (ObjectUtil.isEmpty(allRowArr)) throw new BadRequestException("当前没有可设置的分配明细");
|
||||
|
||||
// 判断当前排是否有其他任务正在执行
|
||||
for (int i = 0; i < allRowArr.size(); i++) {
|
||||
JSONObject jsonRow = allRowArr.getJSONObject(i);
|
||||
JSONArray structArr = attrTab.query("block_num = '" + jsonRow.getString("block_num")
|
||||
+ "' and row_num = '" + jsonRow.getString("row_num") + "' and is_used = '1' and is_delete = '0' and lock_type not in ('1','6','3')").getResultJSONArray(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(structArr)) {
|
||||
throw new BadRequestException(jsonRow.getString("block_num")+"区-"+jsonRow.getString("row_num")+"排有未完成的任务的入库任务!");
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < allRowArr.size(); i++) {
|
||||
// 调用当前排处理方法
|
||||
JSONObject jsonRow = allRowArr.getJSONObject(i);
|
||||
|
||||
@@ -117,5 +117,7 @@ mybatis-plus:
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: INPUT
|
||||
|
||||
|
||||
management:
|
||||
health:
|
||||
elasticsearch:
|
||||
enabled: false #取消对elasticsearch的检查 https://www.codeleading.com/article/60643988608/
|
||||
|
||||
@@ -47,6 +47,60 @@ https://juejin.cn/post/6844903775631572999
|
||||
|
||||
</appender>
|
||||
|
||||
|
||||
<appender name="esLogAppender" class="com.internetitem.logback.elasticsearch.ElasticsearchAppender">
|
||||
<url>http://47.111.78.178:27017/_bulk</url>
|
||||
<index>logs-%date{yyyy-MM-dd}</index>
|
||||
<type>tester</type>
|
||||
<loggerName>es-logger</loggerName> <!-- optional -->
|
||||
<errorLoggerName>es-error-logger</errorLoggerName> <!-- optional -->
|
||||
<connectTimeout>30000</connectTimeout> <!-- optional (in ms, default 30000) -->
|
||||
<errorsToStderr>false</errorsToStderr> <!-- optional (default false) -->
|
||||
<includeCallerData>false</includeCallerData> <!-- optional (default false) -->
|
||||
<logsToStderr>false</logsToStderr> <!-- optional (default false) -->
|
||||
<maxQueueSize>104857600</maxQueueSize> <!-- optional (default 104857600) -->
|
||||
<maxRetries>3</maxRetries> <!-- optional (default 3) -->
|
||||
<readTimeout>30000</readTimeout> <!-- optional (in ms, default 30000) -->
|
||||
<sleepTime>250</sleepTime> <!-- optional (in ms, default 250) -->
|
||||
<rawJsonMessage>false</rawJsonMessage> <!-- optional (default false) -->
|
||||
<includeMdc>false</includeMdc> <!-- optional (default false) -->
|
||||
<maxMessageSize>20000</maxMessageSize> <!-- optional (default -1 -->
|
||||
<!-- <authentication class="com.internetitem.logback.elasticsearch.config.BasicAuthentication" /> <!– optional –>-->
|
||||
<properties>
|
||||
<property>
|
||||
<name>host</name>
|
||||
<value>${HOSTNAME}</value>
|
||||
<allowEmpty>false</allowEmpty>
|
||||
</property>
|
||||
<property>
|
||||
<name>severity</name>
|
||||
<value>%level</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>thread</name>
|
||||
<value>%thread</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>stacktrace</name>
|
||||
<value>%ex</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>logger</name>
|
||||
<value>%logger</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>traceId</name>
|
||||
<value>%X{traceId}</value>
|
||||
</property>
|
||||
</properties>
|
||||
<headers>
|
||||
<header>
|
||||
<name>Content-Type</name>
|
||||
<value>application/json</value>
|
||||
</header>
|
||||
</headers>
|
||||
</appender>
|
||||
|
||||
<appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>error</level>
|
||||
@@ -80,6 +134,7 @@ https://juejin.cn/post/6844903775631572999
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="ERROR" />
|
||||
<appender-ref ref="esLogAppender" />
|
||||
</root>
|
||||
<logger name="org.springframework" level="ERROR" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
@@ -123,9 +178,9 @@ https://juejin.cn/post/6844903775631572999
|
||||
<!--生产环境:打印控制台和输出到文件-->
|
||||
<springProfile name="prod">
|
||||
<root level="debug">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="ERROR" />
|
||||
<appender-ref ref="esLogAppender" />
|
||||
</root>
|
||||
<logger name="org.springframework" level="ERROR" additivity="false">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
|
||||
Reference in New Issue
Block a user