更新日志
This commit is contained in:
@@ -901,6 +901,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
message = "指令号"+task+"未找到对应指令";
|
message = "指令号"+task+"未找到对应指令";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(StrUtil.isEmpty(instruction.getVehicle_code())){
|
||||||
|
message = "指令号"+task+"未找到对应木箱号";
|
||||||
|
return;
|
||||||
|
}
|
||||||
message = "申请AGV搬运任务中...";
|
message = "申请AGV搬运任务中...";
|
||||||
JSONObject apply = new JSONObject();
|
JSONObject apply = new JSONObject();
|
||||||
apply.put("device_code", device_code);
|
apply.put("device_code", device_code);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.nl.acs.ext.wms.liKuData.*;
|
import org.nl.acs.ext.wms.liKuData.*;
|
||||||
import org.nl.acs.ext.wms.service.AcsToLiKuService;
|
import org.nl.acs.ext.wms.service.AcsToLiKuService;
|
||||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||||
|
import org.nl.modules.logging.InterfaceLogType;
|
||||||
import org.nl.modules.logging.annotation.Log;
|
import org.nl.modules.logging.annotation.Log;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -34,77 +35,77 @@ public class AcsToLiKuController {
|
|||||||
private final AcsToLiKuService acsToLiKuService;
|
private final AcsToLiKuService acsToLiKuService;
|
||||||
|
|
||||||
@PostMapping("/inStore")
|
@PostMapping("/inStore")
|
||||||
@Log("向立库wcs下发入库任务")
|
@Log(value = "下发立库入库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||||
@ApiOperation("向立库wcs下发入库任务")
|
@ApiOperation("下发立库物料入库任务")
|
||||||
public ResponseEntity<Object> inStore(@RequestBody InStoreRequest requestParam) {
|
public ResponseEntity<Object> inStore(@RequestBody InStoreRequest requestParam) {
|
||||||
return new ResponseEntity<>(acsToLiKuService.inStore(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(acsToLiKuService.inStore(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/outStore")
|
@PostMapping("/outStore")
|
||||||
@Log("向立库wcs下发出库任务")
|
@Log(value = "下发立库出库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||||
@ApiOperation("向立库wcs下发出库任务")
|
@ApiOperation("下发立库出库任务")
|
||||||
public ResponseEntity<Object> outStore(@RequestBody OutStoreRequest requestParam) {
|
public ResponseEntity<Object> outStore(@RequestBody OutStoreRequest requestParam) {
|
||||||
return new ResponseEntity<>(acsToLiKuService.outStore(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(acsToLiKuService.outStore(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/emptyVehicleOutStore")
|
@PostMapping("/emptyVehicleOutStore")
|
||||||
@Log("向立库wcs下发空托盘出库任务")
|
@Log(value = "下发立库空盘出库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||||
@ApiOperation("向立库wcs下发空托盘出库任务")
|
@ApiOperation("下发立库空盘出库任务")
|
||||||
public ResponseEntity<Object> emptyVehicleOutStore(@RequestBody EmptyVehicleOutStoreRequest requestParam) {
|
public ResponseEntity<Object> emptyVehicleOutStore(@RequestBody EmptyVehicleOutStoreRequest requestParam) {
|
||||||
return new ResponseEntity<>(acsToLiKuService.emptyVehicleOutStore(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(acsToLiKuService.emptyVehicleOutStore(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/moveStore")
|
@PostMapping("/moveStore")
|
||||||
@Log("向立库wcs下发移库任务")
|
@Log(value = "下发立库移库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||||
@ApiOperation("向立库wcs下发移库任务")
|
@ApiOperation("下发立库移库任务")
|
||||||
public ResponseEntity<Object> moveStore(@RequestBody MoveStoreRequest requestParam) {
|
public ResponseEntity<Object> moveStore(@RequestBody MoveStoreRequest requestParam) {
|
||||||
return new ResponseEntity<>(acsToLiKuService.moveStore(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(acsToLiKuService.moveStore(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/inStoreReset")
|
@PostMapping("/inStoreReset")
|
||||||
@Log("向立库wcs下发入库任务调整")
|
@Log(value = "下发立库入库任务调整",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||||
@ApiOperation("向立库wcs下发入库任务调整")
|
@ApiOperation("下发立库入库任务调整")
|
||||||
public ResponseEntity<Object> inStoreReset(@RequestBody InStoreResetRequest requestParam) {
|
public ResponseEntity<Object> inStoreReset(@RequestBody InStoreResetRequest requestParam) {
|
||||||
return new ResponseEntity<>(acsToLiKuService.inStoreReset(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(acsToLiKuService.inStoreReset(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/moveStoreReset")
|
@PostMapping("/moveStoreReset")
|
||||||
@Log("向立库wcs下发移库任务调整")
|
@Log(value = "下发立库移库任务调整",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||||
@ApiOperation("向立库wcs下发移库任务调整")
|
@ApiOperation("下发立库移库任务调整")
|
||||||
public ResponseEntity<Object> moveStoreReset(@RequestBody MoveStoreResetRequest requestParam) {
|
public ResponseEntity<Object> moveStoreReset(@RequestBody MoveStoreResetRequest requestParam) {
|
||||||
return new ResponseEntity<>(acsToLiKuService.moveStoreReset(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(acsToLiKuService.moveStoreReset(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/roadWayIsLock")
|
@PostMapping("/roadWayIsLock")
|
||||||
@Log("向立库下发巷道锁定或解锁")
|
@Log(value = "下发立库巷道锁定或解锁",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||||
@ApiOperation("向立库下发巷道锁定或解锁")
|
@ApiOperation("向立库下发巷道锁定或解锁")
|
||||||
public ResponseEntity<Object> roadWayIsLock(@RequestBody RoadWayIsLockRequest requestParam) {
|
public ResponseEntity<Object> roadWayIsLock(@RequestBody RoadWayIsLockRequest requestParam) {
|
||||||
return new ResponseEntity<>(acsToLiKuService.roadWayIsLock(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(acsToLiKuService.roadWayIsLock(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/cancelTask")
|
@PostMapping("/cancelTask")
|
||||||
@Log("向立库下发任务取消")
|
@Log(value = "取消立库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||||
@ApiOperation("向立库下发任务取消")
|
@ApiOperation("取消立库任务")
|
||||||
public ResponseEntity<Object> cancelTask(@RequestBody CancelTaskRequest requestParam) {
|
public ResponseEntity<Object> cancelTask(@RequestBody CancelTaskRequest requestParam) {
|
||||||
return new ResponseEntity<>(acsToLiKuService.cancelTask(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(acsToLiKuService.cancelTask(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/queryCarStatus")
|
@PostMapping("/queryCarStatus")
|
||||||
@Log("查询四向车状态")
|
@Log(value = "查询四向车状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||||
@ApiOperation("查询四向车状态")
|
@ApiOperation("查询四向车状态")
|
||||||
public ResponseEntity<Object> queryCarStatus(@RequestBody DeviceStatusRequest requestParam) {
|
public ResponseEntity<Object> queryCarStatus(@RequestBody DeviceStatusRequest requestParam) {
|
||||||
return new ResponseEntity<>(acsToLiKuService.queryCarDeviceStatus(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(acsToLiKuService.queryCarDeviceStatus(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/queryTsjStatus")
|
@PostMapping("/queryTsjStatus")
|
||||||
@Log("查询提升机状态")
|
@Log(value = "查询提升机状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||||
@ApiOperation("查询提升机状态")
|
@ApiOperation("查询提升机状态")
|
||||||
public ResponseEntity<Object> queryTsjStatus(@RequestBody DeviceStatusRequest requestParam) {
|
public ResponseEntity<Object> queryTsjStatus(@RequestBody DeviceStatusRequest requestParam) {
|
||||||
return new ResponseEntity<>(acsToLiKuService.queryTsjDeviceStatus(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(acsToLiKuService.queryTsjDeviceStatus(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/querySsxStatus")
|
@PostMapping("/querySsxStatus")
|
||||||
@Log("查询输送线状态")
|
@Log(value = "查询提升机状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||||
@ApiOperation("查询提升机状态")
|
@ApiOperation("查询提升机状态")
|
||||||
public ResponseEntity<Object> querySsxStatus(@RequestBody DeviceStatusRequest requestParam) {
|
public ResponseEntity<Object> querySsxStatus(@RequestBody DeviceStatusRequest requestParam) {
|
||||||
return new ResponseEntity<>(acsToLiKuService.queryTsjDeviceStatus(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(acsToLiKuService.queryTsjDeviceStatus(requestParam), HttpStatus.OK);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest;
|
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest;
|
||||||
import org.nl.acs.ext.wms.data.LiKuApplyTaskRequest;
|
import org.nl.acs.ext.wms.data.LiKuApplyTaskRequest;
|
||||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||||
|
import org.nl.modules.logging.InterfaceLogType;
|
||||||
import org.nl.modules.logging.annotation.Log;
|
import org.nl.modules.logging.annotation.Log;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -34,43 +35,43 @@ public class AcsToWmsController {
|
|||||||
private final AcsToWmsService acstowmsService;
|
private final AcsToWmsService acstowmsService;
|
||||||
|
|
||||||
@PostMapping("/applyTask")
|
@PostMapping("/applyTask")
|
||||||
@Log("向WMS申请任务")
|
@Log(value = "ACS向WMS申请任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("向WMS申请任务")
|
@ApiOperation("ACS向WMS申请任务")
|
||||||
public ResponseEntity<Object> applyTaskToWms(@RequestBody JSONObject jo) {
|
public ResponseEntity<Object> applyTaskToWms(@RequestBody JSONObject jo) {
|
||||||
return new ResponseEntity<>(acstowmsService.applyTaskToWms(jo), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.applyTaskToWms(jo), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/taskStatusFeedback")
|
@PostMapping("/taskStatusFeedback")
|
||||||
@Log("向WMS反馈任务状态")
|
@Log(value = "ACS向WMS反馈任务状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("向WMS反馈任务状态")
|
@ApiOperation("ACS向WMS反馈任务状态")
|
||||||
public ResponseEntity<Object> feedbackTaskStatusToWms(@RequestBody Map whereJson) {
|
public ResponseEntity<Object> feedbackTaskStatusToWms(@RequestBody Map whereJson) {
|
||||||
JSONArray data = JSONArray.parseArray(String.valueOf(whereJson));
|
JSONArray data = JSONArray.parseArray(String.valueOf(whereJson));
|
||||||
return new ResponseEntity<>(acstowmsService.feedbackTaskStatusToWms(data), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.feedbackTaskStatusToWms(data), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/feedbackAgvStatus")
|
@PostMapping("/feedbackAgvStatus")
|
||||||
@Log("反馈AGV设备状态")
|
@Log(value = "反馈AGV设备状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("反馈AGV设备状态")
|
@ApiOperation("反馈AGV设备状态")
|
||||||
public ResponseEntity<Object> feedbackAgvStatus(@RequestBody String device_code, String error, String error_message) {
|
public ResponseEntity<Object> feedbackAgvStatus(@RequestBody String device_code, String error, String error_message) {
|
||||||
return new ResponseEntity<>(acstowmsService.feedbackAgvStatus(device_code, error, error_message), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.feedbackAgvStatus(device_code, error, error_message), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/feedbackAgv")
|
@PostMapping("/feedbackAgv")
|
||||||
@Log("反馈AGV设备信息")
|
@Log(value = "反馈AGV设备信息",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("反馈AGV设备信息")
|
@ApiOperation("反馈AGV设备信息")
|
||||||
public ResponseEntity<Object> feedbackAgv(@RequestBody JSONArray from) {
|
public ResponseEntity<Object> feedbackAgv(@RequestBody JSONArray from) {
|
||||||
return new ResponseEntity<>(acstowmsService.feedbackAgv(from), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.feedbackAgv(from), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/feedbackDeviceStatus")
|
@PostMapping("/feedbackDeviceStatus")
|
||||||
@Log("反馈设备状态")
|
@Log(value = "反馈设备状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("反馈设备状态")
|
@ApiOperation("反馈设备状态")
|
||||||
public ResponseEntity<Object> feedbackDeviceStatus(@RequestBody String device_code, String code, String value) {
|
public ResponseEntity<Object> feedbackDeviceStatus(@RequestBody String device_code, String code, String value) {
|
||||||
return new ResponseEntity<>(acstowmsService.feedbackDeviceStatus(device_code, code, value), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.feedbackDeviceStatus(device_code, code, value), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/feedbackOrderStatus")
|
@PostMapping("/feedbackOrderStatus")
|
||||||
@Log("acs强制完成向wms反馈")
|
@Log(value = "ACS强制完成向WMS反馈",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("acs强制完成向wms反馈")
|
@ApiOperation("acs强制完成向wms反馈")
|
||||||
public ResponseEntity<Object> feedbackOrderStatus(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> feedbackOrderStatus(@RequestBody JSONObject param) {
|
||||||
return new ResponseEntity<>(acstowmsService.feedbackOrderStatus(param), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.feedbackOrderStatus(param), HttpStatus.OK);
|
||||||
@@ -78,28 +79,28 @@ public class AcsToWmsController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/applyInCacheLineTask")
|
@PostMapping("/applyInCacheLineTask")
|
||||||
@Log("ACS申请缓存线入库任务")
|
@Log(value = "ACS申请缓存线入库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("ACS申请缓存线入库任务")
|
@ApiOperation("ACS申请缓存线入库任务")
|
||||||
public ResponseEntity<Object> applyInCacheLineTask(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> applyInCacheLineTask(@RequestBody JSONObject param) {
|
||||||
return new ResponseEntity<>(acstowmsService.applyInCacheLineTask(param), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.applyInCacheLineTask(param), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/applyOutCacheLineTask")
|
@PostMapping("/applyOutCacheLineTask")
|
||||||
@Log("ACS系统申请出库任务")
|
@Log(value = "ACS系统申请出库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("ACS系统申请出库任务")
|
@ApiOperation("ACS系统申请出库任务")
|
||||||
public ResponseEntity<Object> applyOutCacheLineTask(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> applyOutCacheLineTask(@RequestBody JSONObject param) {
|
||||||
return new ResponseEntity<>(acstowmsService.applyOutCacheLineTask(param), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.applyOutCacheLineTask(param), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/applyLabelingAndBindingRequest")
|
@PostMapping("/applyLabelingAndBindingRequest")
|
||||||
@Log("ACS系统申请贴标、捆扎")
|
@Log(value = "ACS系统申请贴标、捆扎",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("ACS系统申请贴标、捆扎")
|
@ApiOperation("ACS系统申请贴标、捆扎")
|
||||||
public ResponseEntity<Object> applyLabelingAndBindingRequest(@RequestBody ApplyLabelingAndBindingRequest param) {
|
public ResponseEntity<Object> applyLabelingAndBindingRequest(@RequestBody ApplyLabelingAndBindingRequest param) {
|
||||||
return new ResponseEntity<>(acstowmsService.applyLabelingAndBindingRequest(param), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.applyLabelingAndBindingRequest(param), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/liKuApplyTaskRequest")
|
@PostMapping("/liKuApplyTaskRequest")
|
||||||
@Log("立库申请任务")
|
@Log(value = "立库申请任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||||
@ApiOperation("立库申请任务")
|
@ApiOperation("立库申请任务")
|
||||||
public ResponseEntity<Object> liKuApplyTaskRequest(@RequestBody LiKuApplyTaskRequest param) {
|
public ResponseEntity<Object> liKuApplyTaskRequest(@RequestBody LiKuApplyTaskRequest param) {
|
||||||
return new ResponseEntity<>(acstowmsService.liKuApplyTaskRequest(param), HttpStatus.OK);
|
return new ResponseEntity<>(acstowmsService.liKuApplyTaskRequest(param), HttpStatus.OK);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.nl.acs.ext.wms.liKuData.*;
|
import org.nl.acs.ext.wms.liKuData.*;
|
||||||
import org.nl.acs.ext.wms.service.AcsToLiKuService;
|
import org.nl.acs.ext.wms.service.AcsToLiKuService;
|
||||||
import org.nl.acs.ext.wms.service.LiKuToAcsService;
|
import org.nl.acs.ext.wms.service.LiKuToAcsService;
|
||||||
|
import org.nl.modules.logging.InterfaceLogType;
|
||||||
import org.nl.modules.logging.annotation.Log;
|
import org.nl.modules.logging.annotation.Log;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -33,32 +34,32 @@ public class LiKuToACSController {
|
|||||||
|
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
@PostMapping("/inStoreReport")
|
@PostMapping("/inStoreReport")
|
||||||
@Log("入库任务上报")
|
@Log(value = "立库反馈入库任务状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS)
|
||||||
@ApiOperation("向立库下发入库任务上报")
|
@ApiOperation("立库反馈入库任务状态")
|
||||||
public ResponseEntity<Object> inStoreReport(@RequestBody InStoreReportRequest requestParam) throws Exception {
|
public ResponseEntity<Object> inStoreReport(@RequestBody InStoreReportRequest requestParam) throws Exception {
|
||||||
return new ResponseEntity<>(liKuToAcsService.inStoreReport(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(liKuToAcsService.inStoreReport(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
@PostMapping("/outStoreReport")
|
@PostMapping("/outStoreReport")
|
||||||
@Log("出库任务上报")
|
@Log(value = "立库反馈出库任务状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS)
|
||||||
@ApiOperation("向立库下发出库任务上报")
|
@ApiOperation("立库反馈出库任务状态")
|
||||||
public ResponseEntity<Object> outStoreReport(@RequestBody OutStoreReportRequest requestParam) throws Exception {
|
public ResponseEntity<Object> outStoreReport(@RequestBody OutStoreReportRequest requestParam) throws Exception {
|
||||||
return new ResponseEntity<>(liKuToAcsService.outStoreReport(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(liKuToAcsService.outStoreReport(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
@PostMapping("/moveStoreReport")
|
@PostMapping("/moveStoreReport")
|
||||||
@Log("移库任务上报")
|
@Log(value = "立库反馈移库任务状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS)
|
||||||
@ApiOperation("向立库下发移库任务上报")
|
@ApiOperation("立库反馈移库任务状态")
|
||||||
public ResponseEntity<Object> moveStoreReport(@RequestBody MoveStoreReportRequest requestParam) throws Exception {
|
public ResponseEntity<Object> moveStoreReport(@RequestBody MoveStoreReportRequest requestParam) throws Exception {
|
||||||
return new ResponseEntity<>(liKuToAcsService.moveStoreReport(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(liKuToAcsService.moveStoreReport(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
@PostMapping("/putEmptyPallet")
|
@PostMapping("/putEmptyPallet")
|
||||||
@Log("请求放空盘")
|
@Log(value = "立库请求放空盘",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS)
|
||||||
@ApiOperation("请求放空盘")
|
@ApiOperation("立库请求放空盘")
|
||||||
public ResponseEntity<Object> putEmptyPallet(@RequestBody putEmptyPalletRequest requestParam) throws Exception {
|
public ResponseEntity<Object> putEmptyPallet(@RequestBody putEmptyPalletRequest requestParam) throws Exception {
|
||||||
return new ResponseEntity<>(liKuToAcsService.putEmptyPallet(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(liKuToAcsService.putEmptyPallet(requestParam), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.acs.ext.wms.data.CreateTaskResponse;
|
import org.nl.acs.ext.wms.data.CreateTaskResponse;
|
||||||
import org.nl.acs.ext.wms.service.WmsToAcsService;
|
import org.nl.acs.ext.wms.service.WmsToAcsService;
|
||||||
|
import org.nl.modules.logging.InterfaceLogType;
|
||||||
import org.nl.modules.logging.annotation.Log;
|
import org.nl.modules.logging.annotation.Log;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -31,7 +32,7 @@ public class WmsToAcsController {
|
|||||||
private final WmsToAcsService wmstoacsService;
|
private final WmsToAcsService wmstoacsService;
|
||||||
|
|
||||||
@PostMapping("/task")
|
@PostMapping("/task")
|
||||||
@Log("接收WMS任务")
|
@Log(value = "ACS接收WMS任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||||
@ApiOperation("接收WMS任务")
|
@ApiOperation("接收WMS任务")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> createFromWms(@RequestBody String whereJson) {
|
public ResponseEntity<Object> createFromWms(@RequestBody String whereJson) {
|
||||||
@@ -39,7 +40,7 @@ public class WmsToAcsController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/cancelTask")
|
@PostMapping("/cancelTask")
|
||||||
@Log("WMS取消任务")
|
@Log(value = "WMS取消任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||||
@ApiOperation("WMS取消任务")
|
@ApiOperation("WMS取消任务")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> cancelFromWms(@RequestBody String whereJson) throws Exception {
|
public ResponseEntity<Object> cancelFromWms(@RequestBody String whereJson) throws Exception {
|
||||||
@@ -47,38 +48,38 @@ public class WmsToAcsController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/updateDeviceGoodsFromWms")
|
@PostMapping("/updateDeviceGoodsFromWms")
|
||||||
@Log("WMS修改点位状态")
|
@Log(value = "WMS修改点位状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||||
@ApiOperation("WMS修改点位状态")
|
@ApiOperation("WMS修改点位状态")
|
||||||
public ResponseEntity<Object> updateDeviceGoodsFromWms(@RequestBody String whereJson) {
|
public ResponseEntity<Object> updateDeviceGoodsFromWms(@RequestBody String whereJson) {
|
||||||
return new ResponseEntity<>(wmstoacsService.updateDeviceGoodsFromWms(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(wmstoacsService.updateDeviceGoodsFromWms(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/areaControl")
|
@PostMapping("/areaControl")
|
||||||
@Log("区域控制")
|
@Log(value = "区域控制",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||||
@ApiOperation("区域控制")
|
@ApiOperation("区域控制")
|
||||||
public ResponseEntity<Object> areaControl(@RequestBody JSONObject whereJson) {
|
public ResponseEntity<Object> areaControl(@RequestBody JSONObject whereJson) {
|
||||||
return new ResponseEntity<>(wmstoacsService.areaControl(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(wmstoacsService.areaControl(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/action")
|
@PostMapping("/action")
|
||||||
@Log("下发动作")
|
@Log(value = "WMS下发点位信号",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||||
@ApiOperation("WMS修改点位状态")
|
@ApiOperation("WMS下发点位信号")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> putAction(@RequestBody String whereJson) throws Exception {
|
public ResponseEntity<Object> putAction(@RequestBody String whereJson) throws Exception {
|
||||||
return new ResponseEntity<>(wmstoacsService.putAction(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(wmstoacsService.putAction(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/querydevice")
|
@PostMapping("/querydevice")
|
||||||
@Log("查询设备状态")
|
@Log(value = "WMS查询设备状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||||
@ApiOperation("查询设备状态")
|
@ApiOperation("WMS查询设备状态")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> queryDevice(@RequestBody String whereJson) throws Exception {
|
public ResponseEntity<Object> queryDevice(@RequestBody String whereJson) throws Exception {
|
||||||
return new ResponseEntity<>(wmstoacsService.queryDevice(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(wmstoacsService.queryDevice(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/queryDeviceDBValue")
|
@PostMapping("/queryDeviceDBValue")
|
||||||
@Log("查询设备DB值")
|
@Log(value = "WMS查询设备DB值",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||||
@ApiOperation("查询设备DB值")
|
@ApiOperation("WMS查询设备DB值")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> queryDeviceDBValue(@RequestBody String whereJson){
|
public ResponseEntity<Object> queryDeviceDBValue(@RequestBody String whereJson){
|
||||||
return new ResponseEntity<>(wmstoacsService.queryDeviceDBValue(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(wmstoacsService.queryDeviceDBValue(whereJson), HttpStatus.OK);
|
||||||
@@ -86,8 +87,8 @@ public class WmsToAcsController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping("/putPlusPullAction")
|
@PostMapping("/putPlusPullAction")
|
||||||
@Log("下发插拔轴动作")
|
@Log(value = "WMS下发插拔轴动作",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||||
@ApiOperation("下发插拔轴动作")
|
@ApiOperation("WMS下发插拔轴动作")
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
public ResponseEntity<Object> putPlusPullAction(@RequestBody String whereJson){
|
public ResponseEntity<Object> putPlusPullAction(@RequestBody String whereJson){
|
||||||
return new ResponseEntity<>(wmstoacsService.putPlusPullAction(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(wmstoacsService.putPlusPullAction(whereJson), HttpStatus.OK);
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package org.nl.common.utils;
|
||||||
|
|
||||||
|
public class IdUtil {
|
||||||
|
public static Long getLongId() {
|
||||||
|
return cn.hutool.core.util.IdUtil.getSnowflake(1, 1).nextId();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getStringId() {
|
||||||
|
return String.valueOf(IdUtil.getLongId());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package org.nl.modules.logging;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author: lyd
|
||||||
|
* @description:
|
||||||
|
* @Date: 2022/10/11
|
||||||
|
*/
|
||||||
|
public enum InterfaceLogType {
|
||||||
|
DEFAULT("默认"),
|
||||||
|
LMS_TO_ACS("LMS请求ACS"),
|
||||||
|
ACS_TO_LMS("ACS请求LMS"),
|
||||||
|
ACS_TO_LK("ACS请求LMS"),
|
||||||
|
LK_TO_ACS("ACS请求LMS");
|
||||||
|
|
||||||
|
private String desc;
|
||||||
|
|
||||||
|
InterfaceLogType(String desc) {
|
||||||
|
this.desc=desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,6 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.nl.modules.logging.annotation;
|
package org.nl.modules.logging.annotation;
|
||||||
|
|
||||||
|
import org.nl.modules.logging.InterfaceLogType;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
@@ -28,4 +30,33 @@ import java.lang.annotation.Target;
|
|||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface Log {
|
public @interface Log {
|
||||||
String value() default "";
|
String value() default "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否打印到日志文件
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean isPrintToLogFile() default false;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否插入操作日志表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean isAddLogTable() default true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否接口日志
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean isInterfaceLog() default false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接口日志类型
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
InterfaceLogType interfaceLogType() default InterfaceLogType.DEFAULT;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.nl.modules.logging.aspect;
|
package org.nl.modules.logging.aspect;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.aspectj.lang.JoinPoint;
|
import org.aspectj.lang.JoinPoint;
|
||||||
import org.aspectj.lang.ProceedingJoinPoint;
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
@@ -25,12 +28,14 @@ import org.aspectj.lang.annotation.Around;
|
|||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.aspectj.lang.annotation.Pointcut;
|
import org.aspectj.lang.annotation.Pointcut;
|
||||||
import org.aspectj.lang.reflect.MethodSignature;
|
import org.aspectj.lang.reflect.MethodSignature;
|
||||||
|
import org.nl.common.utils.IdUtil;
|
||||||
import org.nl.modules.common.utils.RequestHolder;
|
import org.nl.modules.common.utils.RequestHolder;
|
||||||
import org.nl.modules.common.utils.SecurityUtils;
|
import org.nl.modules.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.common.utils.StringUtils;
|
import org.nl.modules.common.utils.StringUtils;
|
||||||
import org.nl.modules.common.utils.ThrowableUtil;
|
import org.nl.modules.common.utils.ThrowableUtil;
|
||||||
import org.nl.modules.logging.domain.Log;
|
import org.nl.modules.logging.domain.Log;
|
||||||
import org.nl.modules.logging.service.LogService;
|
import org.nl.modules.logging.service.LogService;
|
||||||
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
@@ -38,10 +43,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.Parameter;
|
import java.lang.reflect.Parameter;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Zheng Jie
|
* @author Zheng Jie
|
||||||
@@ -75,21 +77,62 @@ public class LogAspect {
|
|||||||
*/
|
*/
|
||||||
@Around("logPointcut()")
|
@Around("logPointcut()")
|
||||||
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
|
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||||
|
String trackId = UUID.randomUUID().toString();
|
||||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||||
Method method = signature.getMethod();
|
Method method = signature.getMethod();
|
||||||
// 方法路径
|
// 方法路径
|
||||||
String methodName = joinPoint.getTarget().getClass().getName() + "." + signature.getName() + "()";
|
String methodName = joinPoint.getTarget().getClass().getName() + "." + signature.getName() + "()";
|
||||||
String params=getParameter(method, joinPoint.getArgs());
|
String params = getParameter(method, joinPoint.getArgs());
|
||||||
log.info("请求方法:{}",methodName);
|
|
||||||
log.info("请求方法参数:{}",params);
|
|
||||||
|
|
||||||
|
org.nl.modules.logging.annotation.Log logInfo = method.getAnnotation(org.nl.modules.logging.annotation.Log.class);
|
||||||
|
|
||||||
|
//是否输出到日志文件
|
||||||
|
if (logInfo.isPrintToLogFile()) {
|
||||||
|
log.info("track_id:{},请求方法:{},请求方法参数:{}",trackId,methodName,params);
|
||||||
|
}
|
||||||
|
HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
||||||
|
String requestIp = StringUtils.getIp(request);
|
||||||
Object result;
|
Object result;
|
||||||
currentTime.set(System.currentTimeMillis());
|
currentTime.set(System.currentTimeMillis());
|
||||||
|
try {
|
||||||
result = joinPoint.proceed();
|
result = joinPoint.proceed();
|
||||||
Log log = new Log("INFO",System.currentTimeMillis() - currentTime.get());
|
//是否把日志存到日志表
|
||||||
|
if (logInfo.isAddLogTable()) {
|
||||||
|
Log log = new Log("INFO", System.currentTimeMillis() - currentTime.get());
|
||||||
currentTime.remove();
|
currentTime.remove();
|
||||||
HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
logService.save(getUsername(), StringUtils.getBrowser(request), requestIp, joinPoint, log);
|
||||||
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request),joinPoint, log);
|
}
|
||||||
|
if (logInfo.isInterfaceLog()) {
|
||||||
|
try {
|
||||||
|
WQLObject interfaceLog = WQLObject.getWQLObject("sys_interface_log");
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("log_id", IdUtil.getStringId());
|
||||||
|
json.put("description", logInfo.value());
|
||||||
|
json.put("log_type", logInfo.interfaceLogType().getDesc());
|
||||||
|
json.put("log_level", "1");
|
||||||
|
json.put("method", methodName);
|
||||||
|
json.put("params", getParameter(method, joinPoint.getArgs()));
|
||||||
|
json.put("request_ip", StringUtils.getIp(request));
|
||||||
|
// json.put("time", System.currentTimeMillis() - currentTime.get());
|
||||||
|
json.put("username", getUsername());
|
||||||
|
json.put("address", StringUtils.getCityInfo(requestIp));
|
||||||
|
json.put("browser", StringUtils.getBrowser(request));
|
||||||
|
json.put("exception_detail", IdUtil.getStringId());
|
||||||
|
json.put("create_time", DateUtil.now());
|
||||||
|
json.put("return_result", result.toString());
|
||||||
|
interfaceLog.insert(json);
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception ex){
|
||||||
|
log.error("track_id:{},error:{}",trackId,ex.getMessage());
|
||||||
|
Log log = new Log("ERROR", System.currentTimeMillis() - currentTime.get());
|
||||||
|
currentTime.remove();
|
||||||
|
log.setExceptionDetail(ThrowableUtil.getStackTrace(ex).getBytes());
|
||||||
|
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint) joinPoint, log);
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package org.nl.modules.logging.rest;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.nl.modules.logging.annotation.Log;
|
||||||
|
import org.nl.modules.logging.service.InterfaceLogService;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ldjun
|
||||||
|
* @version 1.0
|
||||||
|
* @date 2023年01月29日 18:55
|
||||||
|
* @desc desc
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("/api/interfaceLog")
|
||||||
|
@Api(tags = "系统:接口日志管理")
|
||||||
|
public class InterfaceLogController {
|
||||||
|
private final InterfaceLogService interfaceLogService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询接口日志")
|
||||||
|
@ApiOperation("查询接口日志")
|
||||||
|
//@SaCheckPermission("point:list")
|
||||||
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||||
|
return new ResponseEntity<>(interfaceLogService.queryAll(whereJson, page), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping(value = "/delLogs")
|
||||||
|
@Log("删除所有接口日志")
|
||||||
|
@ApiOperation("删除所有接口日志")
|
||||||
|
public ResponseEntity<Object> delLogs(){
|
||||||
|
interfaceLogService.delLogs();
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/logTypeList")
|
||||||
|
@Log("查询接口日志类型下拉框")
|
||||||
|
@ApiOperation("查询接口日志类型下拉框")
|
||||||
|
public ResponseEntity<Object> logTypeList() {
|
||||||
|
return new ResponseEntity<>(interfaceLogService.logTypeList(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.nl.modules.logging.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Zheng Jie
|
||||||
|
* @date 2018-11-24
|
||||||
|
*/
|
||||||
|
public interface InterfaceLogService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param page 分页参数
|
||||||
|
* @return Map<String,Object>
|
||||||
|
*/
|
||||||
|
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除所有日志
|
||||||
|
*/
|
||||||
|
void delLogs();
|
||||||
|
|
||||||
|
JSONArray logTypeList();
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 Zheng Jie
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.nl.modules.logging.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.modules.logging.InterfaceLogType;
|
||||||
|
import org.nl.modules.logging.service.InterfaceLogService;
|
||||||
|
import org.nl.modules.wql.WQL;
|
||||||
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.modules.wql.util.WqlUtil;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Zheng Jie
|
||||||
|
* @date 2018-11-24
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class InterfaceLogServiceImpl implements InterfaceLogService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> queryAll(Map whereJson, Pageable pageable) {
|
||||||
|
HashMap map = new HashMap();
|
||||||
|
map.put("flag", "1");
|
||||||
|
map.put("blurry", whereJson.get("blurry"));
|
||||||
|
map.put("logType", whereJson.get("logType"));
|
||||||
|
map.put("begin_time", whereJson.get("begin_time"));
|
||||||
|
map.put("end_time", whereJson.get("end_time"));
|
||||||
|
JSONObject json = WQL.getWO("QSCH_INTERFACE_LOGS").addParamMap(map).pageQuery(WqlUtil.getHttpContext(pageable), "create_time desc");
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delLogs() {
|
||||||
|
WQLObject logTab = WQLObject.getWQLObject("sys_interface_log");
|
||||||
|
logTab.delete("log_id is not null");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray logTypeList() {
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
InterfaceLogType[] values = InterfaceLogType.values();
|
||||||
|
for (InterfaceLogType value : values) {
|
||||||
|
jsonArray.add(value.getDesc());
|
||||||
|
}
|
||||||
|
return jsonArray;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
[交易说明]
|
||||||
|
交易名: 接口日志分页查询
|
||||||
|
所属模块:
|
||||||
|
功能简述:
|
||||||
|
版权所有:
|
||||||
|
表引用:
|
||||||
|
版本经历:
|
||||||
|
|
||||||
|
[数据库]
|
||||||
|
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||||
|
|
||||||
|
[IO定义]
|
||||||
|
#################################################
|
||||||
|
## 表字段对应输入参数
|
||||||
|
#################################################
|
||||||
|
输入.flag TYPEAS s_string
|
||||||
|
输入.blurry TYPEAS s_string
|
||||||
|
输入.logType TYPEAS s_string
|
||||||
|
输入.begin_time TYPEAS s_string
|
||||||
|
输入.end_time TYPEAS s_string
|
||||||
|
|
||||||
|
|
||||||
|
[临时表]
|
||||||
|
--这边列出来的临时表就会在运行期动态创建
|
||||||
|
|
||||||
|
[临时变量]
|
||||||
|
--所有中间过程变量均可在此处定义
|
||||||
|
|
||||||
|
[业务过程]
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 1、输入输出检查 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 2、主过程前处理 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# 3、业务主过程 #
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
IF 输入.flag = "1"
|
||||||
|
PAGEQUERY
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
sys_interface_log
|
||||||
|
WHERE
|
||||||
|
1=1
|
||||||
|
OPTION 输入.blurry <> ""
|
||||||
|
description like "%" 输入.blurry "%"
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.logType <> ""
|
||||||
|
log_type = 输入.logType
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.begin_time <> ""
|
||||||
|
create_time >= 输入.begin_time
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.end_time <> ""
|
||||||
|
create_time <= 输入.end_time
|
||||||
|
ENDOPTION
|
||||||
|
ENDSELECT
|
||||||
|
ENDPAGEQUERY
|
||||||
|
ENDIF
|
||||||
|
|
||||||
Binary file not shown.
@@ -97,21 +97,21 @@ https://juejin.cn/post/6844903775631572999
|
|||||||
<springProfile name="dev">
|
<springProfile name="dev">
|
||||||
<root level="info">
|
<root level="info">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
<appender-ref ref="lokiAppender" />
|
|
||||||
<appender-ref ref="asyncFileAppender"/>
|
<appender-ref ref="asyncFileAppender"/>
|
||||||
</root>
|
</root>
|
||||||
<!--logmanage -->
|
<!--logmanage -->
|
||||||
<logger name="org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl" level="info" additivity="false">
|
<logger name="org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl" level="info" additivity="false">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
<appender-ref ref="lokiAppender" />
|
|
||||||
</logger>
|
</logger>
|
||||||
<logger name="jdbc.resultsettable" level="ERROR" additivity="false">
|
<logger name="jdbc.resultsettable" level="ERROR" additivity="false">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
<appender-ref ref="lokiAppender" />
|
|
||||||
</logger>
|
</logger>
|
||||||
<logger name="org.openscada.opc.lib.da.Server" level="ERROR" additivity="false">
|
<logger name="org.openscada.opc.lib.da.Server" level="ERROR" additivity="false">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
<appender-ref ref="lokiAppender" />
|
|
||||||
</logger>
|
</logger>
|
||||||
<!--logmanage -->
|
<!--logmanage -->
|
||||||
|
|
||||||
@@ -143,27 +143,27 @@ https://juejin.cn/post/6844903775631572999
|
|||||||
</logger>
|
</logger>
|
||||||
<root level="info">
|
<root level="info">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
<appender-ref ref="lokiAppender" />
|
|
||||||
</root>
|
</root>
|
||||||
</springProfile>
|
</springProfile>
|
||||||
|
|
||||||
<!--生产环境:打印控制台和输出到文件-->
|
<!--生产环境:打印控制台和输出到文件-->
|
||||||
<springProfile name="prod">
|
<springProfile name="prod">
|
||||||
<root level="info">
|
<root level="info">
|
||||||
<appender-ref ref="lokiAppender" />
|
|
||||||
<appender-ref ref="asyncFileAppender"/>
|
<appender-ref ref="asyncFileAppender"/>
|
||||||
</root>
|
</root>
|
||||||
<!--logmanage -->
|
<!--logmanage -->
|
||||||
<logger name="org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl" level="info" additivity="false">
|
<logger name="org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl" level="info" additivity="false">
|
||||||
<appender-ref ref="lokiAppender" />
|
|
||||||
</logger>
|
</logger>
|
||||||
<logger name="jdbc.resultsettable" level="ERROR" additivity="false">
|
<logger name="jdbc.resultsettable" level="ERROR" additivity="false">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
<appender-ref ref="lokiAppender" />
|
|
||||||
</logger>
|
</logger>
|
||||||
<logger name="org.openscada.opc.lib.da.Server" level="ERROR" additivity="false">
|
<logger name="org.openscada.opc.lib.da.Server" level="ERROR" additivity="false">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
<appender-ref ref="lokiAppender" />
|
|
||||||
</logger>
|
</logger>
|
||||||
<!--logmanage -->
|
<!--logmanage -->
|
||||||
|
|
||||||
|
|||||||
120
acs/nladmin-ui/src/views/monitor/interfaceLog/index.vue
Normal file
120
acs/nladmin-ui/src/views/monitor/interfaceLog/index.vue
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="head-container">
|
||||||
|
<Search />
|
||||||
|
<crudOperation>
|
||||||
|
<el-button
|
||||||
|
slot="left"
|
||||||
|
class="filter-item"
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:loading="crud.delAllLoading"
|
||||||
|
@click="confirmDelAll()"
|
||||||
|
>
|
||||||
|
清空
|
||||||
|
</el-button>
|
||||||
|
</crudOperation>
|
||||||
|
</div>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||||
|
<el-table-column type="expand">
|
||||||
|
<template slot-scope="props">
|
||||||
|
<el-form label-position="left" inline class="demo-table-expand">
|
||||||
|
<el-form-item label="请求方法">
|
||||||
|
<span>{{ props.row.method }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="请求参数">
|
||||||
|
<span>{{ props.row.params }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="username" label="用户名" />
|
||||||
|
<el-table-column prop="request_ip" label="IP" />
|
||||||
|
<el-table-column prop="log_type" label="日志类型" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="address" label="IP来源" />
|
||||||
|
<el-table-column prop="description" label="描述" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="browser" label="浏览器" min-width="120" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="return_result" label="返回结果" min-width="120" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="time" label="请求耗时" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
|
||||||
|
<el-tag v-else-if="scope.row.time <= 1000" type="warning">{{ scope.row.time }}ms</el-tag>
|
||||||
|
<el-tag v-else type="danger">{{ scope.row.time }}ms</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="create_time" label="创建日期" width="180px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.create_time) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Search from './search'
|
||||||
|
import crudInterfaceLog from './interfaceLog'
|
||||||
|
import CRUD, { presenter } from '@crud/crud'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'InterfaceLog',
|
||||||
|
components: { Search, crudOperation, pagination },
|
||||||
|
cruds() {
|
||||||
|
return CRUD({ title: '日志', url: 'api/interfaceLog' })
|
||||||
|
},
|
||||||
|
mixins: [presenter()],
|
||||||
|
created() {
|
||||||
|
this.crud.optShow = {
|
||||||
|
add: false,
|
||||||
|
edit: false,
|
||||||
|
del: false,
|
||||||
|
download: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
confirmDelAll() {
|
||||||
|
this.$confirm(`确认清空所有操作日志吗?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.crud.delAllLoading = true
|
||||||
|
crudInterfaceLog.delLogs().then(res => {
|
||||||
|
this.crud.delAllLoading = false
|
||||||
|
this.crud.dleChangePage(1)
|
||||||
|
this.crud.delSuccessNotify()
|
||||||
|
this.crud.toQuery()
|
||||||
|
}).catch(err => {
|
||||||
|
this.crud.delAllLoading = false
|
||||||
|
console.log(err.response.data.message)
|
||||||
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.demo-table-expand {
|
||||||
|
font-size: 0;
|
||||||
|
}
|
||||||
|
.demo-table-expand label {
|
||||||
|
width: 70px;
|
||||||
|
color: #99a9bf;
|
||||||
|
}
|
||||||
|
.demo-table-expand .el-form-item {
|
||||||
|
margin-right: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.demo-table-expand .el-form-item__content {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/interfaceLog',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function delLogs() {
|
||||||
|
return request({
|
||||||
|
url: 'api/interfaceLog/delLogs',
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getLogTypeList() {
|
||||||
|
return request({
|
||||||
|
url: 'api/interfaceLog/logTypeList',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export default { add, delLogs, getLogTypeList }
|
||||||
49
acs/nladmin-ui/src/views/monitor/interfaceLog/search.vue
Normal file
49
acs/nladmin-ui/src/views/monitor/interfaceLog/search.vue
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<template>
|
||||||
|
<div v-if="crud.props.searchToggle">
|
||||||
|
<el-input
|
||||||
|
v-model="query.blurry"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="请输入你要搜索的内容"
|
||||||
|
style="width: 200px;"
|
||||||
|
class="filter-item"
|
||||||
|
/>
|
||||||
|
<el-select
|
||||||
|
v-model="query.logType"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
size="mini"
|
||||||
|
placeholder="日志类型"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in logTypeList"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||||
|
<rrOperation />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { header } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import DateRangePicker from '@/components/DateRangePicker'
|
||||||
|
import { getLogTypeList } from '@/views/monitor/interfaceLog/interfaceLog'
|
||||||
|
export default {
|
||||||
|
components: { rrOperation, DateRangePicker },
|
||||||
|
mixins: [header()],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
logTypeList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
getLogTypeList().then(res => {
|
||||||
|
this.logTypeList = res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user