|
|
|
@ -33,13 +33,12 @@ import com.zznode.itms.api.InventoryManager; |
|
|
|
|
import com.zznode.itms.api.NBIManager; |
|
|
|
|
import com.zznode.itms.api.OAMManager; |
|
|
|
|
import com.zznode.itms.api.Utils; |
|
|
|
|
import com.zznode.itms.idl.device.DOperTask2DetailStruct; |
|
|
|
|
import com.zznode.itms.idl.device.DOperTask2DetailStructHolder; |
|
|
|
|
import com.zznode.itms.idl.device.DOperTask2Struct; |
|
|
|
|
import com.zznode.itms.idl.device.DOperTaskArgsStruct; |
|
|
|
|
import com.zznode.itms.idl.device.*; |
|
|
|
|
import com.zznode.itms.idl.order.OrderInfoStructListHolder; |
|
|
|
|
import com.zznode.itms.idl.order.OrderStatus; |
|
|
|
|
import com.zznode.itms.idl.order.OrderType; |
|
|
|
|
import com.zznode.itms.idl.resourcedefinition.RDeviceDetailListHolder; |
|
|
|
|
import com.zznode.itms.idl.resourcedefinition.RDeviceStaticStruct; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
@ -876,4 +875,57 @@ public class DeviceStaticServiceImpl implements DeviceStaticService { |
|
|
|
|
} |
|
|
|
|
return detailStructHolder.value.operTask.operTaskId; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Long setAccountPassword(Long devId) { |
|
|
|
|
DOperResultDetailStructHolder detailStructHolder = sendDeviceOper2TR069(devId, RemoteOperateMsgEnum.SET_TELEPHONE_COM_ACCOUNT_PASSWORD.getValue(),"",""); |
|
|
|
|
DOperResult2Struct operResult2Struct = detailStructHolder.value.operResult; |
|
|
|
|
int result = operResult2Struct.resultState.value(); |
|
|
|
|
if (result!=DOperResultState._OPER_RUN_SUCC){ |
|
|
|
|
throw new BusinessException(ResultCode.OAM_INTERFACE_ERROR); |
|
|
|
|
}else { |
|
|
|
|
//根据一个设备的id来查找这个设备信息
|
|
|
|
|
RDeviceDetailListHolder holder=new RDeviceDetailListHolder(); |
|
|
|
|
result = InventoryManager.getDeviceByDevID(devId,holder); |
|
|
|
|
if (result != 0) { |
|
|
|
|
throw new BusinessException(ResultCode.NOT_GET_DEVICE); |
|
|
|
|
} |
|
|
|
|
RDeviceStaticStruct deviceStaticStruct = holder.value[0].devStatic; |
|
|
|
|
DOperResultArgsStruct[] dOperResultArgsStruct = detailStructHolder.value.operResultArgsList; |
|
|
|
|
if (dOperResultArgsStruct != null && dOperResultArgsStruct.length > 0){ |
|
|
|
|
for(int i=0; i<detailStructHolder.value.operResultArgsList.length; i++){ |
|
|
|
|
if((dOperResultArgsStruct[0].argsName).equals("TelComAccountPassword")){ |
|
|
|
|
deviceStaticStruct.devRemark1 = dOperResultArgsStruct[0].argsValue; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
result = InventoryManager.updateDeviceStatic(deviceStaticStruct); |
|
|
|
|
if (result != 0 ){ |
|
|
|
|
throw new BusinessException(ResultCode.UPDATE_ACCOUNT_PWD_ERROR); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return detailStructHolder.value.operResult.operTaskId; |
|
|
|
|
} |
|
|
|
|
private DOperResultDetailStructHolder sendDeviceOper2TR069(Long deviceId,String operationName,String argsName,String argsValue){ |
|
|
|
|
DOperTask2DetailStruct detailStruct = new DOperTask2DetailStruct(); |
|
|
|
|
DOperTask2Struct operTask2Struct = new DOperTask2Struct(); |
|
|
|
|
operTask2Struct.devId = deviceId ; |
|
|
|
|
operTask2Struct.operName = operationName; |
|
|
|
|
operTask2Struct.operTaskCreateTime = 0; |
|
|
|
|
operTask2Struct.operTaskDesc = RemoteOperateMsgEnum.SET_TELEPHONE_COM_ACCOUNT_PASSWORD.getLabel(); |
|
|
|
|
operTask2Struct.operTaskId = Utils.LONG_NULL; |
|
|
|
|
operTask2Struct.userName = ""; |
|
|
|
|
detailStruct.operTask = operTask2Struct; |
|
|
|
|
DOperTaskArgsStruct[] argsStructs = new DOperTaskArgsStruct[1]; |
|
|
|
|
argsStructs[0] = new DOperTaskArgsStruct(); |
|
|
|
|
argsStructs[0].argsName = argsName; |
|
|
|
|
argsStructs[0].argsValue = argsValue; |
|
|
|
|
argsStructs[0].operTaskId = Utils.LONG_NULL; |
|
|
|
|
detailStruct.operTaskArgsList = argsStructs; |
|
|
|
|
DOperTask2DetailStructHolder task2DetailStructHolder = new DOperTask2DetailStructHolder(detailStruct); |
|
|
|
|
DOperResultDetailStructHolder detailStructHolder = new DOperResultDetailStructHolder(); |
|
|
|
|
OAMManager.sendDeviceOper2TR069(task2DetailStructHolder,detailStructHolder); |
|
|
|
|
return detailStructHolder; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|