fix 压机叫料

This commit is contained in:
张江玮
2023-09-27 09:35:02 +08:00
parent f9e58f9c36
commit c3b3a24f60
6 changed files with 48 additions and 0 deletions

View File

@@ -192,6 +192,9 @@ public class HfStationDeviceDriver extends AbstractOpcDeviceDriver implements De
order = this.itemProtocol.getOrder();
if (mode != last_mode) {
if ("true".equals(this.getExtraValue().get("ignore_release_check"))) {
acsToWmsService.deactivatePoint(this.device_code, mode != 0);
}
if (mode == 3) {
this.setRequireSucess(false);
}

View File

@@ -69,4 +69,6 @@ public interface AcsToWmsService {
*/
JSONObject findVehicle(JSONObject param);
void deactivatePoint(String deviceCode, boolean isUsed);
}

View File

@@ -16,6 +16,7 @@ import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.task.service.TaskService;
import org.nl.modules.system.service.ParamService;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -247,4 +248,26 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
}
@Override
public void deactivatePoint(String deviceCode, boolean isUsed) {
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
JSONObject param = new JSONObject();
param.put("device_code", deviceCode);
param.put("is_used", isUsed);
log.info("deactivatePoint - 请求参数 {}", param);
AddressDto addressDto = addressService.findByCode("deactivatePoint");
String methods_url = addressDto.getMethods_url();
try {
HttpResponse response = HttpRequest
.post(wmsurl + methods_url)
.timeout(2000)
.body(param.toJSONString())
.execute();
log.info("deactivatePoint - 响应参数 {}", response.body());
} catch (Exception e) {
log.error("deactivatePoint - 请求错误!", e);
}
}
}