Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -188,7 +188,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
||||
}
|
||||
|
||||
if (move != 0 && task > 0) {
|
||||
if (move != 0 && task > 0 ) {
|
||||
// logServer.deviceExecuteLog(device_code, "", "", "输送线任务开始反馈任务状态,指令号:" + task);
|
||||
//inst_message
|
||||
inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
@@ -781,18 +781,21 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
if(ObjectUtil.isEmpty(instruction)){
|
||||
message = "申请捆扎电气设备任务号:" + task + "未找到对应指令";
|
||||
throw new RuntimeException("该电气任务号未找到对应指令!");
|
||||
return ;
|
||||
// throw new RuntimeException("该电气任务号未找到对应指令!");
|
||||
}
|
||||
vehicle_code = instruction.getVehicle_code();
|
||||
} else {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:" + task + "异常");
|
||||
message = "申请捆扎电气设备任务号:" + task + "异常";
|
||||
throw new RuntimeException("任务号为空!");
|
||||
return ;
|
||||
// throw new RuntimeException("任务号为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:" + task + "未找到载具号");
|
||||
message = "申请捆扎电气设备任务号:" + task + "未找到载具号";
|
||||
throw new RuntimeException("载具号为空!");
|
||||
return ;
|
||||
// throw new RuntimeException("载具号为空!");
|
||||
}
|
||||
ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest =
|
||||
new ApplyLabelingAndBindingRequest();
|
||||
@@ -901,6 +904,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
message = "指令号"+task+"未找到对应指令";
|
||||
return;
|
||||
}
|
||||
if(StrUtil.isEmpty(instruction.getVehicle_code())){
|
||||
message = "指令号"+task+"未找到对应木箱号";
|
||||
return;
|
||||
}
|
||||
message = "申请AGV搬运任务中...";
|
||||
JSONObject apply = new JSONObject();
|
||||
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.service.AcsToLiKuService;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.modules.logging.InterfaceLogType;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -34,77 +35,77 @@ public class AcsToLiKuController {
|
||||
private final AcsToLiKuService acsToLiKuService;
|
||||
|
||||
@PostMapping("/inStore")
|
||||
@Log("向立库wcs下发入库任务")
|
||||
@ApiOperation("向立库wcs下发入库任务")
|
||||
@Log(value = "下发立库入库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||
@ApiOperation("下发立库物料入库任务")
|
||||
public ResponseEntity<Object> inStore(@RequestBody InStoreRequest requestParam) {
|
||||
return new ResponseEntity<>(acsToLiKuService.inStore(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/outStore")
|
||||
@Log("向立库wcs下发出库任务")
|
||||
@ApiOperation("向立库wcs下发出库任务")
|
||||
@Log(value = "下发立库出库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||
@ApiOperation("下发立库出库任务")
|
||||
public ResponseEntity<Object> outStore(@RequestBody OutStoreRequest requestParam) {
|
||||
return new ResponseEntity<>(acsToLiKuService.outStore(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/emptyVehicleOutStore")
|
||||
@Log("向立库wcs下发空托盘出库任务")
|
||||
@ApiOperation("向立库wcs下发空托盘出库任务")
|
||||
@Log(value = "下发立库空盘出库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||
@ApiOperation("下发立库空盘出库任务")
|
||||
public ResponseEntity<Object> emptyVehicleOutStore(@RequestBody EmptyVehicleOutStoreRequest requestParam) {
|
||||
return new ResponseEntity<>(acsToLiKuService.emptyVehicleOutStore(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/moveStore")
|
||||
@Log("向立库wcs下发移库任务")
|
||||
@ApiOperation("向立库wcs下发移库任务")
|
||||
@Log(value = "下发立库移库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||
@ApiOperation("下发立库移库任务")
|
||||
public ResponseEntity<Object> moveStore(@RequestBody MoveStoreRequest requestParam) {
|
||||
return new ResponseEntity<>(acsToLiKuService.moveStore(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/inStoreReset")
|
||||
@Log("向立库wcs下发入库任务调整")
|
||||
@ApiOperation("向立库wcs下发入库任务调整")
|
||||
@Log(value = "下发立库入库任务调整",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||
@ApiOperation("下发立库入库任务调整")
|
||||
public ResponseEntity<Object> inStoreReset(@RequestBody InStoreResetRequest requestParam) {
|
||||
return new ResponseEntity<>(acsToLiKuService.inStoreReset(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/moveStoreReset")
|
||||
@Log("向立库wcs下发移库任务调整")
|
||||
@ApiOperation("向立库wcs下发移库任务调整")
|
||||
@Log(value = "下发立库移库任务调整",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||
@ApiOperation("下发立库移库任务调整")
|
||||
public ResponseEntity<Object> moveStoreReset(@RequestBody MoveStoreResetRequest requestParam) {
|
||||
return new ResponseEntity<>(acsToLiKuService.moveStoreReset(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/roadWayIsLock")
|
||||
@Log("向立库下发巷道锁定或解锁")
|
||||
@Log(value = "下发立库巷道锁定或解锁",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||
@ApiOperation("向立库下发巷道锁定或解锁")
|
||||
public ResponseEntity<Object> roadWayIsLock(@RequestBody RoadWayIsLockRequest requestParam) {
|
||||
return new ResponseEntity<>(acsToLiKuService.roadWayIsLock(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/cancelTask")
|
||||
@Log("向立库下发任务取消")
|
||||
@ApiOperation("向立库下发任务取消")
|
||||
@Log(value = "取消立库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||
@ApiOperation("取消立库任务")
|
||||
public ResponseEntity<Object> cancelTask(@RequestBody CancelTaskRequest requestParam) {
|
||||
return new ResponseEntity<>(acsToLiKuService.cancelTask(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryCarStatus")
|
||||
@Log("查询四向车状态")
|
||||
@Log(value = "查询四向车状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||
@ApiOperation("查询四向车状态")
|
||||
public ResponseEntity<Object> queryCarStatus(@RequestBody DeviceStatusRequest requestParam) {
|
||||
return new ResponseEntity<>(acsToLiKuService.queryCarDeviceStatus(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryTsjStatus")
|
||||
@Log("查询提升机状态")
|
||||
@Log(value = "查询提升机状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||
@ApiOperation("查询提升机状态")
|
||||
public ResponseEntity<Object> queryTsjStatus(@RequestBody DeviceStatusRequest requestParam) {
|
||||
return new ResponseEntity<>(acsToLiKuService.queryTsjDeviceStatus(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/querySsxStatus")
|
||||
@Log("查询输送线状态")
|
||||
@Log(value = "查询提升机状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LK)
|
||||
@ApiOperation("查询提升机状态")
|
||||
public ResponseEntity<Object> querySsxStatus(@RequestBody DeviceStatusRequest requestParam) {
|
||||
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.LiKuApplyTaskRequest;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.modules.logging.InterfaceLogType;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -34,43 +35,43 @@ public class AcsToWmsController {
|
||||
private final AcsToWmsService acstowmsService;
|
||||
|
||||
@PostMapping("/applyTask")
|
||||
@Log("向WMS申请任务")
|
||||
@ApiOperation("向WMS申请任务")
|
||||
@Log(value = "ACS向WMS申请任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("ACS向WMS申请任务")
|
||||
public ResponseEntity<Object> applyTaskToWms(@RequestBody JSONObject jo) {
|
||||
return new ResponseEntity<>(acstowmsService.applyTaskToWms(jo), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/taskStatusFeedback")
|
||||
@Log("向WMS反馈任务状态")
|
||||
@ApiOperation("向WMS反馈任务状态")
|
||||
@Log(value = "ACS向WMS反馈任务状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("ACS向WMS反馈任务状态")
|
||||
public ResponseEntity<Object> feedbackTaskStatusToWms(@RequestBody Map whereJson) {
|
||||
JSONArray data = JSONArray.parseArray(String.valueOf(whereJson));
|
||||
return new ResponseEntity<>(acstowmsService.feedbackTaskStatusToWms(data), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/feedbackAgvStatus")
|
||||
@Log("反馈AGV设备状态")
|
||||
@Log(value = "反馈AGV设备状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("反馈AGV设备状态")
|
||||
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);
|
||||
}
|
||||
|
||||
@PostMapping("/feedbackAgv")
|
||||
@Log("反馈AGV设备信息")
|
||||
@Log(value = "反馈AGV设备信息",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("反馈AGV设备信息")
|
||||
public ResponseEntity<Object> feedbackAgv(@RequestBody JSONArray from) {
|
||||
return new ResponseEntity<>(acstowmsService.feedbackAgv(from), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/feedbackDeviceStatus")
|
||||
@Log("反馈设备状态")
|
||||
@Log(value = "反馈设备状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("反馈设备状态")
|
||||
public ResponseEntity<Object> feedbackDeviceStatus(@RequestBody String device_code, String code, String value) {
|
||||
return new ResponseEntity<>(acstowmsService.feedbackDeviceStatus(device_code, code, value), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/feedbackOrderStatus")
|
||||
@Log("acs强制完成向wms反馈")
|
||||
@Log(value = "ACS强制完成向WMS反馈",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("acs强制完成向wms反馈")
|
||||
public ResponseEntity<Object> feedbackOrderStatus(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(acstowmsService.feedbackOrderStatus(param), HttpStatus.OK);
|
||||
@@ -78,28 +79,28 @@ public class AcsToWmsController {
|
||||
|
||||
|
||||
@PostMapping("/applyInCacheLineTask")
|
||||
@Log("ACS申请缓存线入库任务")
|
||||
@Log(value = "ACS申请缓存线入库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("ACS申请缓存线入库任务")
|
||||
public ResponseEntity<Object> applyInCacheLineTask(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(acstowmsService.applyInCacheLineTask(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/applyOutCacheLineTask")
|
||||
@Log("ACS系统申请出库任务")
|
||||
@Log(value = "ACS系统申请出库任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("ACS系统申请出库任务")
|
||||
public ResponseEntity<Object> applyOutCacheLineTask(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(acstowmsService.applyOutCacheLineTask(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/applyLabelingAndBindingRequest")
|
||||
@Log("ACS系统申请贴标、捆扎")
|
||||
@Log(value = "ACS系统申请贴标、捆扎",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("ACS系统申请贴标、捆扎")
|
||||
public ResponseEntity<Object> applyLabelingAndBindingRequest(@RequestBody ApplyLabelingAndBindingRequest param) {
|
||||
return new ResponseEntity<>(acstowmsService.applyLabelingAndBindingRequest(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/liKuApplyTaskRequest")
|
||||
@Log("立库申请任务")
|
||||
@Log(value = "立库申请任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.ACS_TO_LMS)
|
||||
@ApiOperation("立库申请任务")
|
||||
public ResponseEntity<Object> liKuApplyTaskRequest(@RequestBody LiKuApplyTaskRequest param) {
|
||||
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.service.AcsToLiKuService;
|
||||
import org.nl.acs.ext.wms.service.LiKuToAcsService;
|
||||
import org.nl.modules.logging.InterfaceLogType;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -33,32 +34,32 @@ public class LiKuToACSController {
|
||||
|
||||
@SaIgnore
|
||||
@PostMapping("/inStoreReport")
|
||||
@Log("入库任务上报")
|
||||
@ApiOperation("向立库下发入库任务上报")
|
||||
@Log(value = "立库反馈入库任务状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS)
|
||||
@ApiOperation("立库反馈入库任务状态")
|
||||
public ResponseEntity<Object> inStoreReport(@RequestBody InStoreReportRequest requestParam) throws Exception {
|
||||
return new ResponseEntity<>(liKuToAcsService.inStoreReport(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@SaIgnore
|
||||
@PostMapping("/outStoreReport")
|
||||
@Log("出库任务上报")
|
||||
@ApiOperation("向立库下发出库任务上报")
|
||||
@Log(value = "立库反馈出库任务状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS)
|
||||
@ApiOperation("立库反馈出库任务状态")
|
||||
public ResponseEntity<Object> outStoreReport(@RequestBody OutStoreReportRequest requestParam) throws Exception {
|
||||
return new ResponseEntity<>(liKuToAcsService.outStoreReport(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@SaIgnore
|
||||
@PostMapping("/moveStoreReport")
|
||||
@Log("移库任务上报")
|
||||
@ApiOperation("向立库下发移库任务上报")
|
||||
@Log(value = "立库反馈移库任务状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS)
|
||||
@ApiOperation("立库反馈移库任务状态")
|
||||
public ResponseEntity<Object> moveStoreReport(@RequestBody MoveStoreReportRequest requestParam) throws Exception {
|
||||
return new ResponseEntity<>(liKuToAcsService.moveStoreReport(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@SaIgnore
|
||||
@PostMapping("/putEmptyPallet")
|
||||
@Log("请求放空盘")
|
||||
@ApiOperation("请求放空盘")
|
||||
@Log(value = "立库请求放空盘",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LK_TO_ACS)
|
||||
@ApiOperation("立库请求放空盘")
|
||||
public ResponseEntity<Object> putEmptyPallet(@RequestBody putEmptyPalletRequest requestParam) throws Exception {
|
||||
return new ResponseEntity<>(liKuToAcsService.putEmptyPallet(requestParam), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.ext.wms.data.CreateTaskResponse;
|
||||
import org.nl.acs.ext.wms.service.WmsToAcsService;
|
||||
import org.nl.modules.logging.InterfaceLogType;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -31,7 +32,7 @@ public class WmsToAcsController {
|
||||
private final WmsToAcsService wmstoacsService;
|
||||
|
||||
@PostMapping("/task")
|
||||
@Log("接收WMS任务")
|
||||
@Log(value = "ACS接收WMS任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||
@ApiOperation("接收WMS任务")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> createFromWms(@RequestBody String whereJson) {
|
||||
@@ -39,7 +40,7 @@ public class WmsToAcsController {
|
||||
}
|
||||
|
||||
@PostMapping("/cancelTask")
|
||||
@Log("WMS取消任务")
|
||||
@Log(value = "WMS取消任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||
@ApiOperation("WMS取消任务")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> cancelFromWms(@RequestBody String whereJson) throws Exception {
|
||||
@@ -47,38 +48,38 @@ public class WmsToAcsController {
|
||||
}
|
||||
|
||||
@PostMapping("/updateDeviceGoodsFromWms")
|
||||
@Log("WMS修改点位状态")
|
||||
@Log(value = "WMS修改点位状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||
@ApiOperation("WMS修改点位状态")
|
||||
public ResponseEntity<Object> updateDeviceGoodsFromWms(@RequestBody String whereJson) {
|
||||
return new ResponseEntity<>(wmstoacsService.updateDeviceGoodsFromWms(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/areaControl")
|
||||
@Log("区域控制")
|
||||
@Log(value = "区域控制",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||
@ApiOperation("区域控制")
|
||||
public ResponseEntity<Object> areaControl(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(wmstoacsService.areaControl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/action")
|
||||
@Log("下发动作")
|
||||
@ApiOperation("WMS修改点位状态")
|
||||
@Log(value = "WMS下发点位信号",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||
@ApiOperation("WMS下发点位信号")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> putAction(@RequestBody String whereJson) throws Exception {
|
||||
return new ResponseEntity<>(wmstoacsService.putAction(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/querydevice")
|
||||
@Log("查询设备状态")
|
||||
@ApiOperation("查询设备状态")
|
||||
@Log(value = "WMS查询设备状态",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||
@ApiOperation("WMS查询设备状态")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryDevice(@RequestBody String whereJson) throws Exception {
|
||||
return new ResponseEntity<>(wmstoacsService.queryDevice(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryDeviceDBValue")
|
||||
@Log("查询设备DB值")
|
||||
@ApiOperation("查询设备DB值")
|
||||
@Log(value = "WMS查询设备DB值",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||
@ApiOperation("WMS查询设备DB值")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> queryDeviceDBValue(@RequestBody String whereJson){
|
||||
return new ResponseEntity<>(wmstoacsService.queryDeviceDBValue(whereJson), HttpStatus.OK);
|
||||
@@ -86,8 +87,8 @@ public class WmsToAcsController {
|
||||
|
||||
|
||||
@PostMapping("/putPlusPullAction")
|
||||
@Log("下发插拔轴动作")
|
||||
@ApiOperation("下发插拔轴动作")
|
||||
@Log(value = "WMS下发插拔轴动作",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
|
||||
@ApiOperation("WMS下发插拔轴动作")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> putPlusPullAction(@RequestBody String whereJson){
|
||||
return new ResponseEntity<>(wmstoacsService.putPlusPullAction(whereJson), HttpStatus.OK);
|
||||
|
||||
@@ -56,8 +56,7 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
||||
//入库任务状态反馈
|
||||
@Override
|
||||
public Resp<InStoreReportResponse> inStoreReport(InStoreReportRequest requestParam) throws Exception {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
|
||||
log.info("入库任务状态反馈-----输入参数{}", JSON.toJSONString(requestParam));
|
||||
String inst_code = requestParam.getOrderId();
|
||||
String status = requestParam.getState();
|
||||
@@ -91,10 +90,6 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
||||
result.put("data", inStoreReportResponse );
|
||||
log.info("入库任务状态反馈-----输出参数{}", result);
|
||||
return RespUtil.getResp(result.toString(), new InStoreReportResponse());
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -691,6 +691,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
json.put("code", resp.code);
|
||||
json.put("data", data);
|
||||
errArr.add(json);
|
||||
continue;
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -703,6 +704,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
json.put("ext_task_id", ext_task_id);
|
||||
json.put("message", e.getMessage());
|
||||
errArr.add(json);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isEmpty(errArr)) {
|
||||
|
||||
@@ -53,6 +53,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -68,12 +69,18 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
List<Instruction> instructions = new CopyOnWriteArrayList();
|
||||
|
||||
@Autowired DeviceAppService deviceAppService;
|
||||
@Autowired NDCAgvService ndcAgvService;
|
||||
@Autowired ParamService paramService;
|
||||
@Autowired RouteLineService routeLineService;
|
||||
@Autowired TaskService taskService;
|
||||
@Autowired AcsToLiKuService acsToLiKuService;
|
||||
@Autowired
|
||||
DeviceAppService deviceAppService;
|
||||
@Autowired
|
||||
NDCAgvService ndcAgvService;
|
||||
@Autowired
|
||||
ParamService paramService;
|
||||
@Autowired
|
||||
RouteLineService routeLineService;
|
||||
@Autowired
|
||||
TaskService taskService;
|
||||
@Autowired
|
||||
AcsToLiKuService acsToLiKuService;
|
||||
|
||||
@Override
|
||||
public void autoInitial() {
|
||||
@@ -82,9 +89,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public synchronized void reload() {
|
||||
synchronized (TaskInstructionLock.class) {
|
||||
this.instructions = this.queryAll("instruction_status <2 and is_delete =0");
|
||||
}
|
||||
List list = this.queryAll("instruction_status <2 and is_delete =0");
|
||||
this.instructions = new CopyOnWriteArrayList<>(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -244,7 +250,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public Instruction findByTaskcodeAndStatus(String code) {
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
Iterator var3 = instructions.iterator();
|
||||
while (var3.hasNext()) {
|
||||
Instruction instruction = (Instruction) var3.next();
|
||||
@@ -255,7 +260,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instruction findByTaskid(String id, String wherecaluse) {
|
||||
@@ -1092,7 +1096,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public Instruction findByLinkNumSend(String code) {
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
Instruction inst = it.next();
|
||||
@@ -1100,14 +1103,12 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
return inst;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Instruction> findByLinkNum(String code) {
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
List<Instruction> list = new ArrayList<>();
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
@@ -1118,11 +1119,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instruction findByLinkNumNoSend(String code) {
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
Instruction inst = it.next();
|
||||
@@ -1133,11 +1132,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instruction findByCodeFromCache(String code) {
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
Instruction inst = it.next();
|
||||
@@ -1147,11 +1144,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instruction findByBarcodeFromCache(String barcode) {
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
Instruction inst = it.next();
|
||||
@@ -1161,11 +1156,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instruction findByIdFromCache(String id) {
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
Instruction inst = it.next();
|
||||
@@ -1175,7 +1168,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instruction foramte(Instruction inst) {
|
||||
@@ -1250,7 +1242,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public Instruction findByDeviceCodeFromCache(String devicecode) {
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
List<Instruction> instructionList = instructions;
|
||||
ListUtil.sort(
|
||||
instructionList,
|
||||
@@ -1268,7 +1259,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
return inst;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -1280,7 +1270,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public Integer querySameDestinationInst(String devicecode) {
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
int num = 0;
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
@@ -1297,11 +1286,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer querySameInstType(String inst_type) {
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
int num = 0;
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
@@ -1312,11 +1299,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer querySameOriginInst(String devicecode) {
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
int num = 0;
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
@@ -1332,21 +1317,22 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeByCodeFromCache(String code) {
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
Iterator<Instruction> iterator = instructions.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Instruction instruction = iterator.next();
|
||||
if (instruction.getInstruction_code().equals(code)) {
|
||||
iterator.remove();
|
||||
CopyOnWriteArrayList<Instruction> instructions = (CopyOnWriteArrayList<Instruction>) this.instructions;
|
||||
instructions.removeIf((instruction) -> {
|
||||
instruction.getInstruction_code().equals(code);
|
||||
return true;
|
||||
});
|
||||
// while (iterator.hasNext()) {
|
||||
// Instruction instruction = iterator.next();
|
||||
// if (instruction.getInstruction_code().equals(code)) {
|
||||
// iterator.remove();
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,7 +37,7 @@ public class LokiLogAspect {
|
||||
* @return
|
||||
*/
|
||||
@Around("operatorLog()")
|
||||
public synchronized Object around(ProceedingJoinPoint pjp) throws Throwable {
|
||||
public Object around(ProceedingJoinPoint pjp) throws Throwable {
|
||||
// ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
// HttpServletRequest request = attributes.getRequest();
|
||||
// HttpServletResponse response = attributes.getResponse();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
package org.nl.acs.task.rest;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -46,6 +47,7 @@ public class TaskController {
|
||||
@GetMapping("/reload")
|
||||
@Log("数据同步")
|
||||
@ApiOperation("数据同步")
|
||||
@SaIgnore
|
||||
//@PreAuthorize("@el.check('task:list')")
|
||||
public ResponseEntity<Object> reload() {
|
||||
taskService.reload();
|
||||
@@ -146,4 +148,13 @@ public class TaskController {
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@SaIgnore
|
||||
@Log("查询缓存所有任务")
|
||||
@ApiOperation("查询缓存任务")
|
||||
@PostMapping(value = "/findAllTaskFromCache")
|
||||
public ResponseEntity<Object> findAllTaskFromCache() {
|
||||
return new ResponseEntity<>(taskService.findAllTaskFromCache(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -313,4 +313,6 @@ public interface TaskService {
|
||||
* @return
|
||||
*/
|
||||
Integer querySameDeviceReadyTask(String start_device,String next_device,String status);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Synchronized;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.AcsConfig;
|
||||
import org.nl.acs.agv.server.XianGongAgvService;
|
||||
@@ -88,7 +89,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
}
|
||||
|
||||
public synchronized void reload() {
|
||||
this.tasks = this.queryAll("task_status <2 and is_delete =0 order by create_time");
|
||||
List list = this.queryAll("task_status <2 and is_delete =0 order by create_time");
|
||||
|
||||
tasks = new CopyOnWriteArrayList<>(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -295,7 +298,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
@Override
|
||||
public List<TaskDto> queryTaskByDeviceCode(String device_code) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
List<TaskDto> list = new ArrayList<>();
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -307,11 +309,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskDto> queryTaskByStartDeviceCode(String start_device_code) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
List<TaskDto> list = new ArrayList<>();
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -327,11 +327,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskDto> queryTaskByBackDeviceCode(String back_start_device_code) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
List<TaskDto> list = new ArrayList<>();
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -346,11 +344,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskDto> queryTaskByDeviceCodeAndStatus(String device_code) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
List<TaskDto> list = new ArrayList<>();
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -365,10 +361,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
public List<TaskDto> queryTaskByStartAndIntStatus(String head_start_device_code) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
List<TaskDto> list = new ArrayList<>();
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -387,10 +381,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
public List<TaskDto> queryTaskByNextAndIntStatus(String back_start_device_code) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
List<TaskDto> list = new ArrayList<>();
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -408,7 +400,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskDto queryTaskByLinkNum(String link_num) {
|
||||
@@ -533,8 +524,10 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
|
||||
|
||||
wo.insert(json);
|
||||
synchronized(TaskServiceImpl.class){
|
||||
tasks.add(dto);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 常规任务保存
|
||||
@@ -672,18 +665,20 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
wo.update(json);
|
||||
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
TaskDto task = iterator.next();
|
||||
if (task.getTask_code().equals(dto.getTask_code())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
// while (iterator.hasNext()) {
|
||||
// TaskDto task = iterator.next();
|
||||
// if (task.getTask_code().equals(dto.getTask_code())) {
|
||||
// iterator.remove();
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
removeByCodeFromCache(entity.getTask_code());
|
||||
|
||||
if (StrUtil.equals(dto.getTask_status(), "0") || StrUtil.equals(dto.getTask_status(), "1")) {
|
||||
tasks.add(dto);
|
||||
}
|
||||
}
|
||||
// 判断是否为WMS下发的任务,如果是反馈任务状态给WMS
|
||||
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
||||
if (!StrUtil.startWith(dto.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
||||
@@ -804,6 +799,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
||||
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
||||
TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code());
|
||||
System.out.println(feefbackdto == null);
|
||||
JSONObject feed_jo = new JSONObject();
|
||||
feed_jo.put("task_id", entity.getTask_id());
|
||||
feed_jo.put("task_code", entity.getTask_code());
|
||||
@@ -921,15 +917,17 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(entity);
|
||||
wo.update(json);
|
||||
|
||||
synchronized (TaskServiceImpl.class){
|
||||
Iterator<TaskDto> it = tasks.iterator();
|
||||
// 清理缓存
|
||||
while (it.hasNext()) {
|
||||
TaskDto taskDto = it.next();
|
||||
if (taskDto.getTask_id().equals(id)) {
|
||||
tasks.remove(taskDto);
|
||||
}
|
||||
}}
|
||||
// synchronized (TaskServiceImpl.class){
|
||||
// Iterator<TaskDto> it = tasks.iterator();
|
||||
// // 清理缓存
|
||||
// while (it.hasNext()) {
|
||||
// TaskDto taskDto = it.next();
|
||||
// if (taskDto.getTask_id().equals(id)) {
|
||||
// tasks.remove(taskDto);
|
||||
// }
|
||||
// }}
|
||||
|
||||
removeByCodeFromCache(entity.getTask_code());
|
||||
|
||||
// 判断是否为WMS下发的任务,如果是反馈任务状态给WMS
|
||||
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
||||
@@ -1271,18 +1269,13 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
@Override
|
||||
public boolean removeByCodeFromCache(String code) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
TaskDto task = iterator.next();
|
||||
if (task.getTask_code().equals(code)) {
|
||||
iterator.remove();
|
||||
CopyOnWriteArrayList<TaskDto> taskDtos = (CopyOnWriteArrayList<TaskDto>) this.tasks;
|
||||
taskDtos.removeIf((task) -> {
|
||||
task.getTask_code().equals(code);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskDto> findAllTaskFromCache() {
|
||||
@@ -1290,7 +1283,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
}
|
||||
|
||||
public TaskDto findByContainer(String container_code) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
Iterator var3 = tasks.iterator();
|
||||
|
||||
while (var3.hasNext()) {
|
||||
@@ -1302,10 +1294,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public TaskDto findByCodeFromCache(String task_code) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
Iterator var3 = tasks.iterator();
|
||||
|
||||
while (var3.hasNext()) {
|
||||
@@ -1316,11 +1306,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskDto findByNextCode(String device_code) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
Iterator var3 = tasks.iterator();
|
||||
|
||||
while (var3.hasNext()) {
|
||||
@@ -1331,7 +1319,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskDto> findAllByNextCode(String device_code) {
|
||||
@@ -1345,7 +1332,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
@Override
|
||||
public TaskDto findByStartCodeAndReady(String device_code) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
Iterator var3 = tasks.iterator();
|
||||
|
||||
while (var3.hasNext()) {
|
||||
@@ -1360,11 +1346,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskDto findByStartCode(String device_code) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
Iterator var3 = tasks.iterator();
|
||||
|
||||
while (var3.hasNext()) {
|
||||
@@ -1375,7 +1359,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskDto foramte(TaskDto task) {
|
||||
@@ -1516,17 +1499,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
@Override
|
||||
public void updateByCodeFromCache(TaskDto dto) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
TaskDto task = iterator.next();
|
||||
if (task.getTask_code().equals(dto.getTask_code())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
removeByCodeFromCache(dto.getTask_code());
|
||||
tasks.add(dto);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String queryAssignedByDevice(String device_code, String task_nextdeice_code) {
|
||||
@@ -1571,7 +1546,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
@Override
|
||||
public Integer querySameDeviceReadyTask(String start_device, String next_device, String status) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
int num = 0;
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1585,11 +1559,10 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Integer querySameTaskByType(String taskType) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
int num = 0;
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1601,11 +1574,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer querySameOriginTask(String code) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
int num = 0;
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1617,11 +1588,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
return num;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer querySameDestinationTask(String code) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
int num = 0;
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1633,5 +1602,4 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
return num;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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请求立库"),
|
||||
LK_TO_ACS("立库请求ACS");
|
||||
|
||||
private String desc;
|
||||
|
||||
InterfaceLogType(String desc) {
|
||||
this.desc=desc;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.nl.modules.logging.annotation;
|
||||
|
||||
import org.nl.modules.logging.InterfaceLogType;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@@ -28,4 +30,33 @@ import java.lang.annotation.Target;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Log {
|
||||
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,22 +15,23 @@
|
||||
*/
|
||||
package org.nl.modules.logging.aspect;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterThrowing;
|
||||
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.nl.common.utils.IdUtil;
|
||||
import org.nl.modules.common.utils.RequestHolder;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.utils.StringUtils;
|
||||
import org.nl.modules.common.utils.ThrowableUtil;
|
||||
import org.nl.modules.logging.domain.Log;
|
||||
import org.nl.modules.logging.service.LogService;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -38,10 +39,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Parameter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Zheng Jie
|
||||
@@ -54,8 +52,6 @@ public class LogAspect {
|
||||
|
||||
private final LogService logService;
|
||||
|
||||
ThreadLocal<Long> currentTime = new ThreadLocal<>();
|
||||
|
||||
public LogAspect(LogService logService) {
|
||||
this.logService = logService;
|
||||
}
|
||||
@@ -75,21 +71,60 @@ public class LogAspect {
|
||||
*/
|
||||
@Around("logPointcut()")
|
||||
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
String trackId = UUID.randomUUID().toString();
|
||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||
Method method = signature.getMethod();
|
||||
// 方法路径
|
||||
String methodName = joinPoint.getTarget().getClass().getName() + "." + signature.getName() + "()";
|
||||
String params=getParameter(method, joinPoint.getArgs());
|
||||
log.info("请求方法:{}",methodName);
|
||||
log.info("请求方法参数:{}",params);
|
||||
String params = getParameter(method, joinPoint.getArgs());
|
||||
|
||||
Object result;
|
||||
currentTime.set(System.currentTimeMillis());
|
||||
result = joinPoint.proceed();
|
||||
Log log = new Log("INFO",System.currentTimeMillis() - currentTime.get());
|
||||
currentTime.remove();
|
||||
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();
|
||||
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request),joinPoint, log);
|
||||
String requestIp = StringUtils.getIp(request);
|
||||
Object result;
|
||||
long startTime = System.currentTimeMillis();
|
||||
try {
|
||||
result = joinPoint.proceed();
|
||||
//是否把日志存到日志表
|
||||
if (logInfo.isAddLogTable()) {
|
||||
Log log = new Log("INFO", System.currentTimeMillis() - startTime);
|
||||
logService.save("", StringUtils.getBrowser(request), requestIp, 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() - startTime);
|
||||
json.put("username", "");
|
||||
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", JSONObject.parse(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() - startTime);
|
||||
log.setExceptionDetail(ThrowableUtil.getStackTrace(ex).getBytes());
|
||||
logService.save("", StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint) joinPoint, log);
|
||||
throw ex;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -123,26 +158,11 @@ public class LogAspect {
|
||||
return argList.size() == 1 ? JSONUtil.toJsonStr(argList.get(0)) : JSONUtil.toJsonStr(argList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置异常通知
|
||||
*
|
||||
* @param joinPoint join point for advice
|
||||
* @param e exception
|
||||
*/
|
||||
@AfterThrowing(pointcut = "logPointcut()", throwing = "e")
|
||||
public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
|
||||
Log log = new Log("ERROR",System.currentTimeMillis() - currentTime.get());
|
||||
currentTime.remove();
|
||||
log.setExceptionDetail(ThrowableUtil.getStackTrace(e).getBytes());
|
||||
HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
||||
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log);
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
try {
|
||||
return SecurityUtils.getCurrentUsername();
|
||||
}catch (Exception e){
|
||||
return "";
|
||||
}
|
||||
}
|
||||
// public String getUsername() {
|
||||
// try {
|
||||
// return SecurityUtils.getCurrentUsername();
|
||||
// } catch (Exception e) {
|
||||
// return "";
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -77,7 +77,6 @@ public class WebSocketServer {
|
||||
* @param message 客户端发送过来的消息*/
|
||||
@OnMessage
|
||||
public void onMessage(String message, Session session) {
|
||||
log.info("收到来"+sid+"的信息:"+message);
|
||||
//群发消息
|
||||
for (WebSocketServer item : webSocketSet) {
|
||||
try {
|
||||
@@ -106,7 +105,6 @@ public class WebSocketServer {
|
||||
* */
|
||||
public static void sendInfo(SocketMsg socketMsg,@PathParam("sid") String sid) throws IOException {
|
||||
String message = JSONObject.toJSONString(socketMsg);
|
||||
log.info("推送消息到"+sid+",推送内容:"+message);
|
||||
for (WebSocketServer item : webSocketSet) {
|
||||
try {
|
||||
//这里可以设定只推送给这个sid的,为null则全部推送
|
||||
|
||||
Binary file not shown.
@@ -1,18 +1,23 @@
|
||||
server:
|
||||
port: 8010
|
||||
tomcat:
|
||||
accept-count: 1000
|
||||
max-connections: 10000
|
||||
max-threads: 800
|
||||
min-spare-threads: 100
|
||||
#配置数据源
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:10.1.3.91}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_one_wcs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:10.1.3.91}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:P@ssw0rd}
|
||||
# password: ${DB_PWD:Root.123456}
|
||||
password: ${DB_PWD:password}
|
||||
password: ${DB_PWD:123456}
|
||||
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
server:
|
||||
port: 8011
|
||||
tomcat:
|
||||
accept-count: 1000
|
||||
max-connections: 10000
|
||||
max-threads: 800
|
||||
min-spare-threads: 100
|
||||
#配置数据源
|
||||
spring:
|
||||
datasource:
|
||||
|
||||
@@ -92,26 +92,46 @@ https://juejin.cn/post/6844903775631572999
|
||||
</format>
|
||||
</appender>
|
||||
|
||||
<appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>error</level>
|
||||
</filter>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名-->
|
||||
<FileNamePattern>${LOG_HOME}/ERROR/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||
<!--日志文件保留天数-->
|
||||
<maxHistory>15</maxHistory>
|
||||
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||
<maxFileSize>200MB</maxFileSize>
|
||||
<!--所有日志最多占多大容量-->
|
||||
<totalSizeCap>20GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>${log.charset}</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<!--开发环境:打印控制台-->
|
||||
<springProfile name="dev">
|
||||
<root level="info">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="lokiAppender" />
|
||||
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</root>
|
||||
<!--logmanage -->
|
||||
<logger name="org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl" level="info" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="lokiAppender" />
|
||||
|
||||
</logger>
|
||||
<logger name="jdbc.resultsettable" level="ERROR" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="lokiAppender" />
|
||||
|
||||
</logger>
|
||||
<logger name="org.openscada.opc.lib.da.Server" level="ERROR" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="lokiAppender" />
|
||||
|
||||
</logger>
|
||||
<!--logmanage -->
|
||||
|
||||
@@ -143,27 +163,27 @@ https://juejin.cn/post/6844903775631572999
|
||||
</logger>
|
||||
<root level="info">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="lokiAppender" />
|
||||
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
<!--生产环境:打印控制台和输出到文件-->
|
||||
<springProfile name="prod">
|
||||
<root level="info">
|
||||
<appender-ref ref="lokiAppender" />
|
||||
<appender-ref ref="ERROR"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</root>
|
||||
<!--logmanage -->
|
||||
<logger name="org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl" level="info" additivity="false">
|
||||
<appender-ref ref="lokiAppender" />
|
||||
|
||||
</logger>
|
||||
<logger name="jdbc.resultsettable" level="ERROR" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="lokiAppender" />
|
||||
|
||||
</logger>
|
||||
<logger name="org.openscada.opc.lib.da.Server" level="ERROR" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="lokiAppender" />
|
||||
|
||||
</logger>
|
||||
<!--logmanage -->
|
||||
|
||||
|
||||
@@ -222,6 +222,14 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbr_value2">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbw_value">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
|
||||
@@ -433,6 +441,15 @@ export default {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_read2() {
|
||||
testRead(this.data2, this.opc_id).then(data => {
|
||||
this.data2 = data
|
||||
console.log(this.data2)
|
||||
this.notify('操作成功!', 'success')
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_write1() {
|
||||
testwrite(this.data2, this.opc_id).then(data => {
|
||||
this.notify('操作成功!', 'success')
|
||||
|
||||
@@ -221,6 +221,14 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbr_value2">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbw_value">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
|
||||
@@ -432,6 +440,15 @@ export default {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_read2() {
|
||||
testRead(this.data2, this.opc_id).then(data => {
|
||||
this.data2 = data
|
||||
console.log(this.data2)
|
||||
this.notify('操作成功!', 'success')
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_write1() {
|
||||
testwrite(this.data2, this.opc_id).then(data => {
|
||||
this.notify('操作成功!', 'success')
|
||||
|
||||
@@ -259,6 +259,14 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbr_value2">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbw_value">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
|
||||
@@ -472,6 +480,15 @@ export default {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_read2() {
|
||||
testRead(this.data2, this.opc_id).then(data => {
|
||||
this.data2 = data
|
||||
console.log(this.data2)
|
||||
this.notify('操作成功!', 'success')
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_write1() {
|
||||
testwrite(this.data2, this.opc_id).then(data => {
|
||||
this.notify('操作成功!', 'success')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<!--检测站点-->
|
||||
<!--插拔轴站点-->
|
||||
<div>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
@@ -222,6 +222,14 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbr_value2">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbw_value">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
|
||||
@@ -433,6 +441,15 @@ export default {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_read2() {
|
||||
testRead(this.data2, this.opc_id).then(data => {
|
||||
this.data2 = data
|
||||
console.log(this.data2)
|
||||
this.notify('操作成功!', 'success')
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_write1() {
|
||||
testwrite(this.data2, this.opc_id).then(data => {
|
||||
this.notify('操作成功!', 'success')
|
||||
|
||||
@@ -221,6 +221,14 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbr_value2">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbw_value">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
|
||||
@@ -451,6 +459,7 @@ export default {
|
||||
test_read1() {
|
||||
testRead(this.data1, this.opc_id).then(data => {
|
||||
this.data1 = data
|
||||
console.log(this.data1 )
|
||||
this.notify('操作成功!', 'success')
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
@@ -463,6 +472,15 @@ export default {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_read2() {
|
||||
testRead(this.data2, this.opc_id).then(data => {
|
||||
this.data2 = data
|
||||
console.log(this.data2)
|
||||
this.notify('操作成功!', 'success')
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
doSubmit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
@@ -221,6 +221,14 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbr_value2">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbw_value">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
|
||||
@@ -456,6 +464,15 @@ export default {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_read2() {
|
||||
testRead(this.data2, this.opc_id).then(data => {
|
||||
this.data2 = data
|
||||
console.log(this.data2)
|
||||
this.notify('操作成功!', 'success')
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_write1() {
|
||||
testwrite(this.data2, this.opc_id).then(data => {
|
||||
this.notify('操作成功!', 'success')
|
||||
|
||||
@@ -221,6 +221,14 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbr_value2">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbw_value">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
|
||||
@@ -456,6 +464,15 @@ export default {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_read2() {
|
||||
testRead(this.data2, this.opc_id).then(data => {
|
||||
this.data2 = data
|
||||
console.log(this.data2)
|
||||
this.notify('操作成功!', 'success')
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_write1() {
|
||||
testwrite(this.data2, this.opc_id).then(data => {
|
||||
this.notify('操作成功!', 'success')
|
||||
|
||||
@@ -369,6 +369,14 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbr_value2">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbw_value">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
|
||||
@@ -588,6 +596,15 @@ export default {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_read2() {
|
||||
testRead(this.data2, this.opc_id).then(data => {
|
||||
this.data2 = data
|
||||
console.log(this.data2)
|
||||
this.notify('操作成功!', 'success')
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_write1() {
|
||||
testwrite(this.data2, this.opc_id).then(data => {
|
||||
this.notify('操作成功!', 'success')
|
||||
|
||||
@@ -274,6 +274,14 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbr_value2">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbw_value">
|
||||
<template slot="header">
|
||||
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
|
||||
@@ -490,6 +498,15 @@ export default {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_read2() {
|
||||
testRead(this.data2, this.opc_id).then(data => {
|
||||
this.data2 = data
|
||||
console.log(this.data2)
|
||||
this.notify('操作成功!', 'success')
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
test_write1() {
|
||||
testwrite(this.data2, this.opc_id).then(data => {
|
||||
this.notify('操作成功!', 'success')
|
||||
|
||||
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>
|
||||
@@ -189,11 +189,6 @@
|
||||
<artifactId>sa-token-dao-redis</artifactId>
|
||||
<version>1.31.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
<version>2.5.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
@@ -270,11 +265,6 @@
|
||||
<artifactId>UserAgentUtils</artifactId>
|
||||
<version>1.21</version>
|
||||
</dependency>
|
||||
<!-- redis -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--WQL-->
|
||||
<dependency>
|
||||
@@ -340,17 +330,11 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.redisson</groupId>-->
|
||||
<!-- <artifactId>redisson-spring-boot-starter</artifactId>-->
|
||||
<!-- <version>3.12.3</version>-->
|
||||
<!-- <exclusions>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <artifactId>spring-boot-starter-actuator</artifactId>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- </exclusions>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.redisson</groupId>
|
||||
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||
<version>3.16.4</version>
|
||||
</dependency>
|
||||
<!-- jwt -->
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
@@ -385,6 +369,12 @@
|
||||
<artifactId>jsch</artifactId>
|
||||
<version>0.1.55</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpasyncclient -->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpasyncclient</artifactId>
|
||||
<version>4.1.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 获取系统信息 -->
|
||||
<dependency>
|
||||
@@ -406,12 +396,6 @@
|
||||
<version>4.5.13</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>2.1.6</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml-schemas</artifactId>
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package org.nl.common.utils;
|
||||
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.client.methods.HttpRequestBase;
|
||||
import org.apache.http.concurrent.FutureCallback;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.nio.client.CloseableHttpAsyncClient;
|
||||
import org.apache.http.impl.nio.client.HttpAsyncClients;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
/*
|
||||
* HTtp异步调用
|
||||
*/
|
||||
public class AsyncHttpRequest {
|
||||
|
||||
private StringEntity entity;
|
||||
public HttpRequestBase httpbase;
|
||||
private String url;
|
||||
|
||||
public AsyncHttpRequest(String url) {
|
||||
this.url=url;
|
||||
}
|
||||
|
||||
public static AsyncHttpRequest post(String url,String body){
|
||||
return new AsyncHttpRequest(url).body(body);
|
||||
};
|
||||
|
||||
public static AsyncHttpRequest get(String url){
|
||||
return new AsyncHttpRequest(url).getEntity();
|
||||
};
|
||||
private AsyncHttpRequest getEntity(){
|
||||
HttpGet httpGet = new HttpGet(this.url);
|
||||
this.httpbase = httpGet;
|
||||
return this;
|
||||
};
|
||||
private AsyncHttpRequest body(String body){
|
||||
this.entity = new StringEntity(body, "UTF-8");
|
||||
this.entity.setContentType("application/json");
|
||||
HttpPost httpPost = new HttpPost(this.url);
|
||||
httpPost.setEntity(entity);
|
||||
this.httpbase = httpPost;
|
||||
return this;
|
||||
};
|
||||
public Future<HttpResponse> execute(FutureCallback<HttpResponse> callback){
|
||||
CloseableHttpAsyncClient client = SpringContextHolder.getBean(CloseableHttpAsyncClient.class);
|
||||
Future<HttpResponse> execute = client.execute(httpbase, callback);
|
||||
return execute;
|
||||
};
|
||||
}
|
||||
@Component
|
||||
class HttpAsyncClientInit{
|
||||
|
||||
@Bean
|
||||
public CloseableHttpAsyncClient closeableHttpAsyncClient(){
|
||||
CloseableHttpAsyncClient aDefault = HttpAsyncClients.createDefault();
|
||||
aDefault.start();
|
||||
return aDefault;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -28,6 +28,8 @@ import org.nl.wms.sch.tasks.EmptyVehicleTask;
|
||||
import org.nl.wms.sch.tasks.SendOutTask;
|
||||
import org.nl.wms.st.inbill.service.RawAssistIStorService;
|
||||
import org.nl.wms.st.inbill.service.StorPublicService;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -44,7 +46,7 @@ import java.util.concurrent.TimeUnit;
|
||||
@Slf4j
|
||||
public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
private static Interner<String> lock = Interners.newWeakInterner();
|
||||
private static Interner<String> Heap_Lock = Interners.newWeakInterner();
|
||||
|
||||
|
||||
private final PrintService printService;
|
||||
@@ -55,7 +57,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
private final CutConveyorTask cutConveyorTask;
|
||||
|
||||
// private final RedissonClient redissonClient;
|
||||
private final RedissonClient redissonClient;
|
||||
|
||||
/**
|
||||
* task_id:任务标识
|
||||
@@ -191,11 +193,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@SneakyThrows
|
||||
public JSONObject apply(JSONObject whereJson) {
|
||||
log.info("apply请求参数:---------------------------------------------"+whereJson.toString());
|
||||
log.info("apply请求参数:---------------------------------------------" + whereJson.toString());
|
||||
String type = whereJson.getString("type");
|
||||
JSONObject result = new JSONObject();
|
||||
synchronized (lock.intern(type)){
|
||||
{
|
||||
RLock lock = redissonClient.getLock("acs_to_wms:" + type);
|
||||
boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
String device_code = whereJson.getString("device_code");
|
||||
String vehicle_code = whereJson.getString("vehicle_code");
|
||||
WQLObject point_table = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
@@ -216,27 +220,27 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
boolean auto_div = false;
|
||||
if (ObjectUtil.isEmpty(vehicle_code)) throw new BadRequestException("ACS申请任务失败!载具不能为空");
|
||||
//通过该木箱码查询对应的分配明细
|
||||
JSONArray dis_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("box_no",vehicle_code).addParam("flag","28").process().getResultJSONArray(0);
|
||||
JSONArray dis_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("box_no", vehicle_code).addParam("flag", "28").process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(dis_rows)) {
|
||||
throw new BadRequestException("未查询到木箱:" + vehicle_code + "相关入库分配明细记录!");
|
||||
}
|
||||
ArrayList<HashMap> dis_list = new ArrayList<>();
|
||||
for (int i = 0; i < dis_rows.size(); i++) {
|
||||
HashMap<String,String> dis_map = new HashMap<>();
|
||||
HashMap<String, String> dis_map = new HashMap<>();
|
||||
JSONObject dis_row = dis_rows.getJSONObject(i);
|
||||
dis_map.put("box_no",dis_row.getString("box_no"));
|
||||
dis_map.put("point_code",device_code);
|
||||
dis_map.put("sect_id",dis_row.getString("sect_id"));
|
||||
dis_map.put("sect_code",dis_row.getString("sect_code"));
|
||||
dis_map.put("sect_name",dis_row.getString("sect_name"));
|
||||
dis_map.put("struct_id",dis_row.getString("struct_id"));
|
||||
dis_map.put("struct_code",dis_row.getString("struct_code"));
|
||||
if (StrUtil.isNotEmpty(dis_row.getString("struct_code"))){
|
||||
dis_map.put("box_no", dis_row.getString("box_no"));
|
||||
dis_map.put("point_code", device_code);
|
||||
dis_map.put("sect_id", dis_row.getString("sect_id"));
|
||||
dis_map.put("sect_code", dis_row.getString("sect_code"));
|
||||
dis_map.put("sect_name", dis_row.getString("sect_name"));
|
||||
dis_map.put("struct_id", dis_row.getString("struct_id"));
|
||||
dis_map.put("struct_code", dis_row.getString("struct_code"));
|
||||
if (StrUtil.isNotEmpty(dis_row.getString("struct_code"))) {
|
||||
auto_div = true;
|
||||
checked = false;
|
||||
}
|
||||
dis_map.put("struct_name",dis_row.getString("struct_name"));
|
||||
dis_map.put("iostorinv_id",dis_row.getString("iostorinv_id"));
|
||||
dis_map.put("struct_name", dis_row.getString("struct_name"));
|
||||
dis_map.put("iostorinv_id", dis_row.getString("iostorinv_id"));
|
||||
dis_list.add(dis_map);
|
||||
}
|
||||
Map map = new HashMap();
|
||||
@@ -293,7 +297,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
String out_order_seq2 = jsonAscBox.getString("out_order_seq");
|
||||
// 上一个货位顺序号
|
||||
String out_order_seq_asc = String.valueOf(NumberUtil.sub(out_order_seq2, "1"));
|
||||
JSONObject jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '"+out_order_seq_asc+"'").uniqueResult(0);
|
||||
JSONObject jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '" + out_order_seq_asc + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonAscStruct)) {
|
||||
struct_jo = jsonAscStruct;
|
||||
@@ -444,8 +448,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
result.put("message", "下发成功!");
|
||||
return result;
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
}
|
||||
result.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
result.put("message", "申请任务超时!" + type);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -808,7 +808,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
/*
|
||||
* 分配逻辑:
|
||||
* 1、先查找该木箱内属于什么物料、订单,定位到具体的块、排,查看是否存在空位
|
||||
* a、存在的话,优先放在这一块这一排中
|
||||
* a、存在的话,优先放在这一块这一排中(遍历)
|
||||
* b、不存在则根据该订单物料大概数量、选择数量相近的一个空巷道
|
||||
* 1)存在空巷道
|
||||
* 2)不存在,则找一个双通有空位置、数量相近的巷道
|
||||
@@ -832,34 +832,49 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
row_map.put("sect_id", sect_id);
|
||||
row_map.put("flag", "11");
|
||||
//查询到当前可用的巷道
|
||||
JSONObject row_jo = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().uniqueResult(0);
|
||||
JSONArray rowArr = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().getResultJSONArray(0);
|
||||
|
||||
for (int i = 0; i < rowArr.size(); i++) {
|
||||
JSONObject row_jo = rowArr.getJSONObject(i);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(row_jo)) {
|
||||
String block_num = row_jo.getString("block_num");
|
||||
String row_num = row_jo.getString("row_num");
|
||||
String placement_type = row_jo.getString("placement_type");
|
||||
|
||||
// 判断此排是否有除:入库锁、移入锁以外的锁
|
||||
JSONArray isLock = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type not in ('1','2','7') AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(isLock)) {
|
||||
if (placement_type.equals("02")) {
|
||||
// 左通
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq ASC").uniqueResult(0);
|
||||
} else if(placement_type.equals("03")) {
|
||||
break;
|
||||
} else if (placement_type.equals("03")) {
|
||||
// 右通
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq DESC").uniqueResult(0);
|
||||
break;
|
||||
} else {
|
||||
// 双通
|
||||
|
||||
// 先倒序找到第一个木箱、判断上一个是否有货位
|
||||
JSONObject jsonDescBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq DESC").uniqueResult(0);
|
||||
|
||||
JSONObject jsonDescStruct = new JSONObject();
|
||||
if (ObjectUtil.isNotEmpty(jsonDescBox)) {
|
||||
String out_order_seq = jsonDescBox.getString("out_order_seq");
|
||||
// 上一个货位顺序号
|
||||
String out_order_seq_desc = String.valueOf(NumberUtil.add(out_order_seq, "1"));
|
||||
jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '" + out_order_seq_desc + "'").uniqueResult(0);
|
||||
jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq > '" + out_order_seq + "' order by out_order_seq ASC").uniqueResult(0);
|
||||
} else {
|
||||
// 先倒序找到第一个入库锁或者移库锁、判断上一个是否有货位
|
||||
JSONObject jsonDescEmpStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type in ('2','7') AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq DESC").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonDescEmpStruct)) {
|
||||
String out_order_seq = jsonDescEmpStruct.getString("out_order_seq");
|
||||
jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq > '" + out_order_seq + "' order by out_order_seq ASC").uniqueResult(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonDescStruct)) {
|
||||
struct_jo = jsonDescStruct;
|
||||
break;
|
||||
} else {
|
||||
// 没有就正序找到第一个物料、判断上一个是否有货位
|
||||
JSONObject jsonAscBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq ASC").uniqueResult(0);
|
||||
@@ -868,12 +883,19 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
if (ObjectUtil.isNotEmpty(jsonAscBox)) {
|
||||
String out_order_seq2 = jsonAscBox.getString("out_order_seq");
|
||||
// 上一个货位顺序号
|
||||
String out_order_seq_asc = String.valueOf(NumberUtil.sub(out_order_seq2, "1"));
|
||||
jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '"+out_order_seq_asc+"'").uniqueResult(0);
|
||||
jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq < '" + out_order_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
|
||||
} else {
|
||||
JSONObject jsonAscEmpStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type in ('2','7') AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq ASC").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonAscEmpStruct)) {
|
||||
String out_order_seq2 = jsonAscEmpStruct.getString("out_order_seq");
|
||||
jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq < '" + out_order_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
|
||||
}
|
||||
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(jsonAscStruct)) {
|
||||
struct_jo = jsonAscStruct;
|
||||
break;
|
||||
} else {
|
||||
// 说明这排有任务在执行,新开一排
|
||||
//根据分切计划查询该订单物料大概还有多少未入
|
||||
@@ -899,11 +921,12 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
|
||||
if (placement_type.equals("02")) {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num2 + "' AND row_num = '" + row_num2 + "' AND placement_type = '" + placement_type2 + "' AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq ASC").uniqueResult(0);
|
||||
break;
|
||||
} else {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num2 + "' AND row_num = '" + row_num2 + "' AND placement_type = '" + placement_type2 + "'AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq DESC").uniqueResult(0);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
//如果查询不到空的一排,则查询有空位双通的一排
|
||||
JSONObject have_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("sect_id", sect_id).addParam("flag", "14").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num)").process().uniqueResult(0);
|
||||
|
||||
@@ -916,35 +939,35 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
JSONObject left_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' order by out_order_seq desc").uniqueResult(0);
|
||||
if (StrUtil.isNotEmpty(right_str.getString("storagevehicle_code")) || !right_str.getString("lock_type").equals("1")) {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0);
|
||||
break;
|
||||
}
|
||||
if (StrUtil.isNotEmpty(left_str.getString("storagevehicle_code")) || !left_str.getString("lock_type").equals("1")) {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq desc").uniqueResult(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//如果不存在相同订单物料的巷道
|
||||
/*//查询是否存在未完成的相同订单物流的入库单,如果存在则查询该排是否存在可用的仓位
|
||||
HashMap<String,String> io_map = new HashMap<>();
|
||||
io_map.put("flag","12");
|
||||
io_map.put("material_code",material_code);
|
||||
io_map.put("sale_order_name",sale_order_name);
|
||||
JSONArray io_rows = WQL.getWO("").addParamMap(io_map).process().getResultJSONArray(0);*/
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(rowArr) || ObjectUtil.isEmpty(struct_jo)) {
|
||||
//如果不存在相同订单物料的巷道 或者未找到相同物料订单号巷道中的货位 则
|
||||
|
||||
//根据分切计划查询该订单物料大概还有多少未入
|
||||
row_map.put("flag", "12");
|
||||
JSONArray plan_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_rows)){
|
||||
if (ObjectUtil.isEmpty(plan_rows)) {
|
||||
plan_rows = new JSONArray();
|
||||
}
|
||||
//查询该销售订单及行号有多少个生成状态的箱子
|
||||
row_map.put("flag", "27");
|
||||
JSONArray box_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(box_rows)){
|
||||
if (ObjectUtil.isEmpty(box_rows)) {
|
||||
box_rows = new JSONArray();
|
||||
}
|
||||
int box_num = (int) Math.ceil(plan_rows.size() / 2) + box_rows.size();
|
||||
@@ -982,6 +1005,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(struct_jo)) {
|
||||
throw new BadRequestException("未查询到可用的仓位!");
|
||||
}
|
||||
|
||||
@@ -60,7 +60,15 @@ spring:
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PWD:}
|
||||
redisson:
|
||||
config: classpath:/config/redisson.yml
|
||||
config: |
|
||||
threads: 4
|
||||
nettyThreads: 4
|
||||
singleServerConfig:
|
||||
connectionMinimumIdleSize: 8
|
||||
connectionPoolSize: 8
|
||||
address: redis://127.0.0.1:6379
|
||||
idleConnectionTimeout: 10000
|
||||
timeout: 3000
|
||||
|
||||
# 登录相关配置
|
||||
login:
|
||||
|
||||
@@ -2,7 +2,7 @@ spring:
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: prod
|
||||
active: dev
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
singleServerConfig:
|
||||
connectionMinimumIdleSize: 8
|
||||
connectionPoolSize: 8
|
||||
address: redis://127.0.0.1:6379
|
||||
idleConnectionTimeout: 10000
|
||||
timeout: 3000
|
||||
threads: 8
|
||||
nettyThreads: 8
|
||||
Reference in New Issue
Block a user