This commit is contained in:
USER-20220102CG\noblelift
2023-02-22 15:54:29 +08:00
parent 7e080cc8f9
commit 0414ee3180
15 changed files with 161 additions and 855 deletions

View File

@@ -880,60 +880,11 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
if (!StrUtil.isEmpty(hasGoodStatus)) {
standardOrdinarySiteDeviceDriver.setHasGoods(Integer.parseInt(hasGoodStatus));
device.setHas_goods(Integer.parseInt(hasGoodStatus));
}
if (StrUtil.isNotEmpty(material_type)) {
standardOrdinarySiteDeviceDriver.setMaterial(material_type);
device.setMaterial_type(material_type);
} else {
standardOrdinarySiteDeviceDriver.setMaterial("");
device.setMaterial_type("");
}
if (StrUtil.isNotEmpty(quantity)) {
standardOrdinarySiteDeviceDriver.setQty(quantity);
device.setQuantity(quantity);
} else {
standardOrdinarySiteDeviceDriver.setQty("");
device.setQuantity("");
}
if (StrUtil.isNotEmpty(remark)) {
standardOrdinarySiteDeviceDriver.setRemark(remark);
device.setRemark(remark);
} else {
standardOrdinarySiteDeviceDriver.setRemark("");
device.setRemark("");
}
if (StrUtil.isNotEmpty(batch)) {
standardOrdinarySiteDeviceDriver.setBatch(batch);
device.setBatch(batch);
} else {
standardOrdinarySiteDeviceDriver.setBatch("");
device.setBatch("");
}
WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint");
JSONObject json = runpointwo.query("device_code ='" + device_code + "'").uniqueResult(0);
if (!ObjectUtil.isEmpty(json)) {
DeviceRunpointDto obj = json.toJavaObject(DeviceRunpointDto.class);
obj.setHasgoods(hasGoodStatus);
obj.setMaterial_type(material_type);
obj.setBatch(batch);
device.setHas_goods(Integer.parseInt(hasGoodStatus));
device.setMaterial_type(material_type);
device.setRemark(remark);
device.setQuantity(quantity);
device.setBatch(batch);
device.setIslock(islock);
JSONObject updatejson = (JSONObject) JSONObject.toJSON(obj);
runpointwo.update(updatejson, "device_code = '" + device_code + "'");
}
standardOrdinarySiteDeviceDriver.setDeviceStatus(form);
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
standardInspectSiteDeviceDriver.setMaterial(material_type);
standardInspectSiteDeviceDriver.setBatch(batch);
device.setMaterial_type(material_type);
device.setBatch(batch);
standardInspectSiteDeviceDriver.setDeviceStatus(form);
} else if (device.getDeviceDriver() instanceof SlitTwoManipulatorDeviceDriver) {
slitTwoManipulatorDeviceDriver = (SlitTwoManipulatorDeviceDriver) device.getDeviceDriver();
slitTwoManipulatorDeviceDriver.setDeviceStatus(form);

View File

@@ -26,6 +26,9 @@ import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.acs.task.service.impl.TaskServiceImpl;
import org.nl.modules.system.service.ParamService;
import org.nl.modules.wql.util.SpringContextHolder;
@@ -40,6 +43,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
ParamService ParamService = SpringContextHolder.getBean(ParamService.class);
InstructionService instructionService = SpringContextHolder.getBean(InstructionServiceImpl.class);
TaskService taskService = SpringContextHolder.getBean(TaskServiceImpl.class);
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
@@ -77,8 +81,10 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (carno != 0) {
agv_device = deviceAppService.findDeviceByCode(String.valueOf(carno));
}
TaskDto task = null;
if (ikey != 0) {
inst = instructionService.findByCodeFromCache(String.valueOf(ikey));
task = taskService.findByTaskCode(inst.getTask_code());
}
@@ -158,20 +164,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
if(ObjectUtil.isNotEmpty(this.device.getExtraValue().get("wait"))
&& StrUtil.equals("true",this.device.getExtraValue().get("wait").toString())){
&& StrUtil.equals("true",this.device.getExtraValue().get("wait").toString())
&& StrUtil.equals(task.getTask_type(),"1")){
//
if(standardOrdinarySiteDeviceDriver.getOption() == 1 ){
if(standardOrdinarySiteDeviceDriver.getOption() == 1){
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
log.info("等待LMS系统进行确认允许取货设备号{}", device_code);
logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号"+device.getDevice_code());
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
}
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
standardOrdinarySiteDeviceDriver.setIndex(index);
standardOrdinarySiteDeviceDriver.setInst(inst);
this.setPhase(phase);
} else if (device.getDeviceDriver() instanceof PhotoelectricInspectionSiteDeviceDriver){
photoelectricInspectionSiteDeviceDriver = (PhotoelectricInspectionSiteDeviceDriver) device.getDeviceDriver();
if(photoelectricInspectionSiteDeviceDriver.getMove() == 1)
@@ -220,7 +228,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
if(ObjectUtil.isNotEmpty(this.device.getExtraValue().get("wait"))
&& StrUtil.equals("true",this.device.getExtraValue().get("wait").toString())){
&& StrUtil.equals("true",this.device.getExtraValue().get("wait").toString())
&& StrUtil.equals(task.getTask_type(),"1")){
//
standardOrdinarySiteDeviceDriver.setOption(0);
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
@@ -229,9 +238,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
}
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
standardOrdinarySiteDeviceDriver.setIndex(index);
standardOrdinarySiteDeviceDriver.setInst(inst);
this.setPhase(phase);
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
}
@@ -271,20 +279,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
if(ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
&& StrUtil.equals("true",standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())){
&& StrUtil.equals("true",standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
&& StrUtil.equals(task.getTask_type(),"1")){
//
if(standardOrdinarySiteDeviceDriver.getOption() == 1 ){
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
log.info("等待LMS系统进行确认允许取货设备号{}", device_code);
logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号"+device.getDevice_code());
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
}
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
standardOrdinarySiteDeviceDriver.setIndex(index);
standardOrdinarySiteDeviceDriver.setInst(inst);
this.setPhase(phase);
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
}
@@ -327,7 +336,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
if(ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
&& StrUtil.equals("true",standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())){
&& StrUtil.equals("true",standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
&& StrUtil.equals(task.getTask_type(),"1")){
standardOrdinarySiteDeviceDriver.setOption(0);
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
@@ -353,6 +363,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
weight = agvaddr;
inst.setWeight(String.valueOf(weight));
instructionService.update(inst);
if(ObjectUtil.isNotEmpty(task)){
logServer.deviceExecuteLog(this.device_code, "", "", "上报满卷重量,weight:" + weight);
task.setWeight(String.valueOf(weight));
taskService.update(task);
}
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
}
}
@@ -392,18 +408,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
//请求放空 可以直接走
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
// if(ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
// && StrUtil.equals("true",standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())){
// //
// if(standardOrdinarySiteDeviceDriver.getOption() == 1 ){
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
// standardOrdinarySiteDeviceDriver.setOption(0);
// } else {
// log.info("等待LMS系统进行确认离开设备号{}", device_code);
// }
// } else {
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
// }
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
@@ -455,7 +460,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
if(ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
&& StrUtil.equals("true",standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())){
&& StrUtil.equals("true",standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
&& StrUtil.equals(task.getTask_type(),"1")){
//
if(standardOrdinarySiteDeviceDriver.getOption() == 2 ){
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
@@ -467,9 +473,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
}
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
standardOrdinarySiteDeviceDriver.setIndex(index);
standardOrdinarySiteDeviceDriver.setInst(inst);
this.setPhase(phase);
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
}
@@ -511,7 +515,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
if(ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
&& StrUtil.equals("true",standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())){
&& StrUtil.equals("true",standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
&& StrUtil.equals(task.getTask_type(),"1")){
//
if(standardOrdinarySiteDeviceDriver.getOption() == 2 ){
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
@@ -523,9 +528,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
}
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
standardOrdinarySiteDeviceDriver.setIndex(index);
standardOrdinarySiteDeviceDriver.setInst(inst);
this.setPhase(phase);
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
}
@@ -567,7 +571,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
if(ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
&& StrUtil.equals("true",standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())){
&& StrUtil.equals("true",standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
&& StrUtil.equals(task.getTask_type(),"1")){
//
if(standardOrdinarySiteDeviceDriver.getOption() == 2 ){
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
@@ -579,9 +584,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
}
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
standardOrdinarySiteDeviceDriver.setIndex(index);
standardOrdinarySiteDeviceDriver.setInst(inst);
this.setPhase(phase);
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
}

View File

@@ -231,6 +231,19 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "读取信号值时出现异常:" + var17.getMessage());
}
if("true".equals(this.device.getExtraValue().get("ship_device_update"))){
if(ObjectUtil.equal(this.getDevice().getExtraValue().get("noIdleRequest"),"true")){
if (!requiresShipDeviceUpdate && move == 0) {
this.shipDeviceUpdate();
}
} else {
if (mode ==2 && !requiresShipDeviceUpdate && move == 0) {
this.shipDeviceUpdate();
}
}
}
if (mode == 0) {
this.setIsonline(false);
message = "未联机";
@@ -247,7 +260,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
Instruction instruction = null;
List toInstructions;
switch (mode) {
case 1:
log.debug("设备运转模式:等待工作");
@@ -257,11 +269,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
if (move > 0 && !requireSucess) {
instruction_require();
}
if (!requiresShipDeviceUpdate && move == 0) {
this.shipDeviceUpdate();
} else {
this.requiresShipDeviceUpdate = true;
}
break;
case 4:
//申请捆扎

View File

@@ -1,6 +1,7 @@
package org.nl.acs.device_driver.basedriver.standard_ordinary_site;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.RequiredArgsConstructor;
@@ -229,13 +230,17 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
jo.put("error", this.getError());
jo.put("isError", this.getIserror());
jo.put("option", option);
jo.put("is_click", true);
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
String flag = data.getString("option");
if(StrUtil.isNotEmpty(flag)){
option = Integer.parseInt(flag);
}
}
}

View File

@@ -748,32 +748,64 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
JSONArray datas = JSONArray.parseArray(whereJson);
log.info("updateTask--------------:输入参数" + datas.toString());
JSONObject map = new JSONObject();
JSONArray errArr = new JSONArray();
if (datas.size() > 0) {
for (int i = 0; i < datas.size(); i++) {
JSONObject jsonObject = datas.getJSONObject(i);
String device_code = jsonObject.getString("device_code");
String task_code = jsonObject.getString("task_code");
TaskDto task= taskService.findByTaskCode(task_code);
if(ObjectUtil.isEmpty(task)){
JSONObject resultJson = new JSONObject();
resultJson.put("status", HttpStatus.BAD_REQUEST);
resultJson.put("message", "未找到对应的任务:"+task_code);
return resultJson;
}
//1-允许取放; 2-允许离开
String option = jsonObject.getString("option");
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
Device device_k = deviceAppService.findDeviceByCode(device_code+"_K");
Device device_m = deviceAppService.findDeviceByCode(device_code+"_M");
if(device_k.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device_k.getDeviceDriver();
standardOrdinarySiteDeviceDriver.setOption(Integer.parseInt(option));
}
if(device_m.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device_m.getDeviceDriver();
standardOrdinarySiteDeviceDriver.setOption(Integer.parseInt(option));
}
if(StrUtil.equals(task.getTask_type(),"1")){
Device device_k = deviceAppService.findDeviceByCode(device_code+"_K");
Device device_m = deviceAppService.findDeviceByCode(device_code+"_M");
if(device_k.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device_k.getDeviceDriver();
standardOrdinarySiteDeviceDriver.setOption(Integer.parseInt(option));
}
if(device_m.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device_m.getDeviceDriver();
standardOrdinarySiteDeviceDriver.setOption(Integer.parseInt(option));
}
} else if (StrUtil.equals(task.getTask_type(),"2")){
if(task.getStart_device_code().endsWith("K")){
Device device_k = deviceAppService.findDeviceByCode(device_code+"_K");
if(device_k.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device_k.getDeviceDriver();
standardOrdinarySiteDeviceDriver.setOption(Integer.parseInt(option));
}
} else if(task.getStart_device_code().endsWith("M")){
Device device_m = deviceAppService.findDeviceByCode(device_code+"_M");
if(device_m.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver){
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device_m.getDeviceDriver();
standardOrdinarySiteDeviceDriver.setOption(Integer.parseInt(option));
}
}
}
}
}
JSONObject resultJson = new JSONObject();
resultJson.put("status", HttpStatus.OK);
resultJson.put("message", "操作成功");
resultJson.put("data", map);
if (ObjectUtil.isEmpty(errArr)) {
resultJson.put("status", HttpStatus.OK);
} else {
resultJson.put("status", HttpStatus.BAD_REQUEST);
resultJson.put("message", "操作成功");
if(ObjectUtil.isNotEmpty(errArr)){
resultJson.put("errArr",errArr);
}
}
return resultJson;
}

View File

@@ -187,6 +187,8 @@ public class DeviceOpcProtocolRunable implements Runnable {
log.info("信号{}变更从{}->{};信号快照:{}", new Object[]{item.getId(), his, value, sb});
}
// accessor_value.setValueWithPersistence(item.getId(),accessor_value.getValue(item.getId()));
// accessor_value.getHistoryUnifiedData(item.getId());
//设置值
accessor_value.setValue(item.getId(), value);

View File

@@ -76,6 +76,15 @@ public interface TaskService {
*/
TaskDto findById(String task_id);
/**
* 根据ID查询
*
* @param task_code
* @return AcsTask
*/
TaskDto findByTaskCode(String task_code);
/**
* 查询所有未完成任务
*

View File

@@ -106,9 +106,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
// WQLObject wo = WQLObject.getWQLObject("acs_task");
// ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "task_status < 2 ", "update_time
// desc");
HashMap<String, String> map = new HashMap<>();
map.put("flag", "1");
String task_code = (String) whereJson.get("task_code");
@@ -142,9 +139,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
@Override
public Map<String, Object> queryAllByCache(Map whereJson, Pageable page) {
this.reload();
String task_code = (String) whereJson.get("task_code");
String vehicle_code = (String) whereJson.get("vehicle_code");
@@ -281,6 +275,21 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
return obj;
}
@Override
public TaskDto findByTaskCode(String task_code) {
List<TaskDto> list = new ArrayList<>();
Iterator<TaskDto> iterator = tasks.iterator();
while (iterator.hasNext()) {
TaskDto task = iterator.next();
if (StrUtil.equals(task.getTask_code(),task_code)) {
return task;
}
}
return null;
}
@Override
public List<TaskDto> queryAllUnfinished(Map whereJson) {
WQLObject wo = WQLObject.getWQLObject("acs_task");
@@ -477,49 +486,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
if (StrUtil.equals(DeviceType.conveyor.toString(), nextDeviceType)) {}
} else {
// 判断起点为输送设备
if (StrUtil.equals(DeviceType.conveyor.toString(), startDeviceType)) {}
if (StrUtil.equals(DeviceType.conveyor.toString(), nextDeviceType)) {
// if (nextdevice.getDeviceDriver() instanceof
// StandardOrdinarySiteDeviceDriver) {
// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver)
// nextdevice.getDeviceDriver();
// if (nextdevice.getHas_goods() != 0) {
// throw new Exception("任务终点需满足无货!");
// }
// }
JSONObject jo = new JSONObject();
JSONObject jo2 = new JSONObject();
if (!StrUtil.isEmpty(dto.getMaterial())) {
if (!StrUtil.equals(dto.getMaterial(), "1")) {
jo.put("hasGoodStatus", "2");
jo.put("material_type", dto.getMaterial());
} else {
jo.put("hasGoodStatus", "1");
jo.put("material_type", "1");
}
} else {
jo.put("hasGoodStatus", "1");
jo.put("material_type", "1");
}
jo.put("device_code", dto.getStart_device_code());
jo.put("quantity", dto.getQuantity());
jo.put("remark", dto.getRemark());
jo.put("batch", startdevice.getBatch());
jo.put("islock", "true");
deviceService.changeDeviceStatus(jo);
Device deviceByCode = deviceAppService.findDeviceByCode(dto.getNext_device_code());
jo2.put("device_code", dto.getNext_device_code());
jo2.put("hasGoodStatus", deviceByCode.getHas_goods());
jo2.put("quantity", deviceByCode.getQuantity());
jo2.put("remark", deviceByCode.getRemark());
jo2.put("material_type", deviceByCode.getMaterial_type());
jo2.put("batch", deviceByCode.getBatch());
jo2.put("islock", "true");
deviceService.changeDeviceStatus(jo2);
}
}
WQLObject wo = WQLObject.getWQLObject("acs_task");
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
@@ -693,6 +660,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
feed_jo.put("task_id", entity.getExt_task_id());
feed_jo.put("task_code", dto.getTask_code());
feed_jo.put("task_status", dto.getTask_status());
if(ObjectUtil.isNotEmpty(dto.getWeight())){
feed_jo.put("weight",dto.getWeight());
}
JSONArray ja = new JSONArray();
ja.add(feed_jo);
String message = null;