add: 标准检测站点驱动 mode = 3 取消货位绑定信息
This commit is contained in:
@@ -47,6 +47,11 @@
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15on</artifactId>
|
||||
<version>1.70</version> <!-- 使用存在的版本 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openscada.jinterop</groupId>
|
||||
<artifactId>org.openscada.jinterop.core</artifactId>
|
||||
|
||||
@@ -191,6 +191,12 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
case 1:
|
||||
log.debug("设备运转模式:等待工作");
|
||||
break;
|
||||
case 3:
|
||||
//载具解绑
|
||||
if(!requireSucess && task != 0){
|
||||
System.out.println("触发载具解绑" + task + mode + device_code);
|
||||
this.vehicleUnbind();
|
||||
}
|
||||
case 5:
|
||||
// 优先出窑位任务
|
||||
if (!requireSucess && task != 0) {
|
||||
@@ -292,6 +298,36 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 载具解绑
|
||||
* @return
|
||||
*/
|
||||
public synchronized boolean vehicleUnbind() {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return false;
|
||||
} else {
|
||||
this.instruction_require_time = date;
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code",device_code);
|
||||
param.put("vehicle_code", task);
|
||||
HttpResponse result = acsToWmsService.vehicleUnbind(param);
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
if (result.getStatus() == HttpStatus.OK.value()) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) {
|
||||
// Map<String, Object> map = new LinkedHashMap<>();
|
||||
// map.put("to_command",5);
|
||||
this.writing(this.mode);
|
||||
this.setRequireSucess(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 多个信号一起下发电气
|
||||
*
|
||||
|
||||
@@ -63,6 +63,13 @@ public interface AcsToWmsService {
|
||||
*/
|
||||
HttpResponse outKiln(JSONObject json);
|
||||
|
||||
/**
|
||||
* 载具解绑
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
HttpResponse vehicleUnbind(JSONObject json);
|
||||
|
||||
/**
|
||||
* 排产单确认
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,6 @@ import org.nl.modules.system.service.ParamService;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -421,6 +420,34 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public HttpResponse vehicleUnbind(JSONObject json) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
String wmsurl = acsConfigService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("vehicleUnbind");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
String url = wmsurl + methods_url;
|
||||
|
||||
|
||||
log.info("vehicleUnbind - 请求参数 {}", json.toString());
|
||||
HttpResponse result = null;
|
||||
try {
|
||||
result = HttpRequest.post(url)
|
||||
.header("Authorization", token)
|
||||
.body(String.valueOf(json))
|
||||
.execute();
|
||||
System.out.println(result);
|
||||
log.info("vehicleUnbind - 响应参数 {}", result.body());
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
return result;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -174,6 +174,13 @@ public class AcsToWmsController {
|
||||
return new ResponseEntity<>(acsToWmsService.getVehicleInfo(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/vehicleUnbind")
|
||||
@Log("载具解绑")
|
||||
@ApiOperation("载具解绑")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> vehicleUnbind(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(acsToWmsService.vehicleUnbind(whereJson), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/outKiln")
|
||||
@Log("出窑分配")
|
||||
@ApiOperation("出窑分配")
|
||||
|
||||
@@ -105,6 +105,8 @@ public interface AcsToWmsService {
|
||||
|
||||
JSONObject getVehicleInfo(JSONObject whereJson);
|
||||
|
||||
JSONObject vehicleUnbind(JSONObject whereJson);
|
||||
|
||||
JSONObject outKiln(JSONObject whereJson);
|
||||
|
||||
JSONObject inKiln(JSONObject param);
|
||||
|
||||
@@ -838,6 +838,23 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject vehicleUnbind(JSONObject whereJson) {
|
||||
String point_code = whereJson.getString("device_code");
|
||||
JSONObject point_update = new JSONObject();
|
||||
point_update.put("point_status", PointStatus.EMPTY.value());
|
||||
point_update.put("vehicle_type", "");
|
||||
point_update.put("vehicle_code", "");
|
||||
point_update.put("vd_id", null);
|
||||
TaskUtils.addCurrentUpdateColum(point_update);
|
||||
WQLObject.getWQLObject("sch_base_point").update(point_update, "point_code = '" + point_code + "'");
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "解绑成功!");
|
||||
result.put("data", null);
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public JSONObject outKiln(JSONObject whereJson) {
|
||||
String vehicle_code = TaskUtils.formatVehicleCode(whereJson.getString("vehicle_code"));
|
||||
|
||||
Reference in New Issue
Block a user