|
|
@ -82,7 +82,9 @@ public class MesEquipmentRwExtService implements IMesEquipVariableRwExtService {
|
|
|
|
params.put(MesPcnExtConstWords.CLIENT_HANDLE, equipVariableRwModel.getClientHandle().toString());
|
|
|
|
params.put(MesPcnExtConstWords.CLIENT_HANDLE, equipVariableRwModel.getClientHandle().toString());
|
|
|
|
params.put(MesPcnExtConstWords.CHANNEL, equipVariableRwModel.getChannel());
|
|
|
|
params.put(MesPcnExtConstWords.CHANNEL, equipVariableRwModel.getChannel());
|
|
|
|
params.put(MesPcnExtConstWords.EQUIPMENT_ID, equipVariableRwModel.getEquipId().toString());
|
|
|
|
params.put(MesPcnExtConstWords.EQUIPMENT_ID, equipVariableRwModel.getEquipId().toString());
|
|
|
|
|
|
|
|
LOGGER.info("设备数据变量写值开始-> 地址:{}, params={}", equipVariableRwModel.getWriteRequestUrl(), params);
|
|
|
|
String data = HttpClientTool.doHttpUrl(CommonEnumUtil.HTTP_METHOD_TYPE.POST, false, equipVariableRwModel.getWriteRequestUrl(), params, null, null);
|
|
|
|
String data = HttpClientTool.doHttpUrl(CommonEnumUtil.HTTP_METHOD_TYPE.POST, false, equipVariableRwModel.getWriteRequestUrl(), params, null, null);
|
|
|
|
|
|
|
|
LOGGER.info("设备数据变量写值返回-> data:{} ", data);
|
|
|
|
if (!StringUtils.isEmpty(data)) return JsonUtilTool.decode(data, MesEquipVariableRwResult.class).obj(JSONObject.toJSONString(equipVariableRwModel));
|
|
|
|
if (!StringUtils.isEmpty(data)) return JsonUtilTool.decode(data, MesEquipVariableRwResult.class).obj(JSONObject.toJSONString(equipVariableRwModel));
|
|
|
|
else return result.noSuccessed().message(String.format("设备数据变量写值失败! CLIENT_HANDLE[%s] CHANNEL[%s] EQUIPMENT_ID[%s] VALUE[%s]",
|
|
|
|
else return result.noSuccessed().message(String.format("设备数据变量写值失败! CLIENT_HANDLE[%s] CHANNEL[%s] EQUIPMENT_ID[%s] VALUE[%s]",
|
|
|
|
equipVariableRwModel.getClientHandle(), equipVariableRwModel.getChannel(), equipVariableRwModel.getEquipId(), equipVariableRwModel.getValue())).obj(JSONObject.toJSONString(equipVariableRwModel));
|
|
|
|
equipVariableRwModel.getClientHandle(), equipVariableRwModel.getChannel(), equipVariableRwModel.getEquipId(), equipVariableRwModel.getValue())).obj(JSONObject.toJSONString(equipVariableRwModel));
|
|
|
@ -122,7 +124,6 @@ public class MesEquipmentRwExtService implements IMesEquipVariableRwExtService {
|
|
|
|
else return result.noSuccessed().message(String.format("设备数据变量读值失败! 数据信息:[%s]!", JSONObject.toJSONString(equipVariableRwModel)));
|
|
|
|
else return result.noSuccessed().message(String.format("设备数据变量读值失败! 数据信息:[%s]!", JSONObject.toJSONString(equipVariableRwModel)));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public MesEquipVariableRwResult writeVariable(MesEquipmentVariableCfg equipmentVariableCfg, MesEquipmentVariable equipmentVariable, String kepwareFlag) {
|
|
|
|
public MesEquipVariableRwResult writeVariable(MesEquipmentVariableCfg equipmentVariableCfg, MesEquipmentVariable equipmentVariable, String kepwareFlag) {
|
|
|
|
MesEquipVariableRwModel equipVariableRwModel = new MesEquipVariableRwModel();
|
|
|
|
MesEquipVariableRwModel equipVariableRwModel = new MesEquipVariableRwModel();
|
|
|
|