rev:优化退货入库申请任务逻辑
This commit is contained in:
@@ -500,9 +500,19 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
TaskDto dto = taskserver.findByBarcodeFromCache(barcode);
|
||||
if (ObjectUtil.isNotEmpty(dto)) {
|
||||
List list1 = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_command");
|
||||
map.put("value", mode);
|
||||
list1.add(map);
|
||||
this.writing(list1);
|
||||
this.requireSucess = true;
|
||||
} else {
|
||||
HttpResponse httpResponse = acsToWmsService.applyTwo(param);
|
||||
JSONObject jsonObject = null;
|
||||
if(ObjectUtil.isNotEmpty(httpResponse)){
|
||||
if (ObjectUtil.isNotEmpty(httpResponse)) {
|
||||
String body = httpResponse.body();
|
||||
jsonObject = JSONObject.parseObject(body);
|
||||
}
|
||||
@@ -531,6 +541,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||
message = "申请退货入库报错,返回参数:" + jsonObject;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -618,7 +629,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
HttpResponse httpResponse = acsToWmsService.applyTwo(param);
|
||||
JSONObject jsonObject = null;
|
||||
if(ObjectUtil.isNotEmpty(httpResponse)){
|
||||
if (ObjectUtil.isNotEmpty(httpResponse)) {
|
||||
String body = httpResponse.body();
|
||||
jsonObject = JSONObject.parseObject(body);
|
||||
}
|
||||
@@ -687,7 +698,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
HttpResponse httpResponse = acsToWmsService.applyTwo(param);
|
||||
JSONObject jsonObject = null;
|
||||
if(ObjectUtil.isNotEmpty(httpResponse)){
|
||||
if (ObjectUtil.isNotEmpty(httpResponse)) {
|
||||
String body = httpResponse.body();
|
||||
jsonObject = JSONObject.parseObject(body);
|
||||
}
|
||||
|
||||
@@ -199,6 +199,8 @@ public interface TaskService extends CommonService<Task> {
|
||||
*/
|
||||
TaskDto findByCode(String code);
|
||||
|
||||
TaskDto findByBarcodeFromCache(String barcode);
|
||||
|
||||
/**
|
||||
* 根据设备号查询未执行的任务
|
||||
*
|
||||
|
||||
@@ -430,6 +430,15 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
return ConvertUtil.convert(task, TaskDto.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskDto findByBarcodeFromCache(String barcode) {
|
||||
Task task = new LambdaQueryChainWrapper<>(taskMapper)
|
||||
.eq(Task::getVehicle_code, barcode)
|
||||
.eq(Task::getTask_status,TaskStatusEnum.READY.getIndex())
|
||||
.one();
|
||||
return ConvertUtil.convert(task, TaskDto.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskDto> queryTaskByDeviceCode(String device_code) {
|
||||
return Optional
|
||||
|
||||
Reference in New Issue
Block a user