|
@@ -134,15 +134,16 @@ public class DeviceSetupMethodService extends ServiceImpl<DeviceSetupMethodMappe
|
|
|
//查询到操作方法后执行操作
|
|
|
if (deviceSetupMethodEntities.size() > 0) {
|
|
|
//查询设备型号
|
|
|
- DeviceTypeEntity deviceTypeEntity = deviceTypeService.findDeviceTypeById(Long.valueOf(deviceEntity.getDeviceTypeId()));
|
|
|
+ //DeviceTypeEntity deviceTypeEntity = deviceTypeService.findDeviceTypeById(Long.valueOf(deviceEntity.getDeviceTypeId()));
|
|
|
String method = deviceSetupMethodEntities.get(0).getMethod();
|
|
|
methodParms = deviceSetupMethodEntities.get(0).getParams();
|
|
|
SetupMethod setupMethod = new SetupMethod();
|
|
|
setupMethod.setMethod(method);
|
|
|
+ setupMethod.setDeviceId("912cf9e7-8557-4792-a2f9-27ba72bbcb89");
|
|
|
setupMethod.setUnitIdentifier(deviceEntity.getDeviceCode());
|
|
|
- setupMethod.setDeviceMode(deviceTypeEntity.getDeviceMode());
|
|
|
- setupMethod.setDeviceType(deviceTypeEntity.getDeviceType());
|
|
|
- setupMethod.setManufacturer(deviceTypeEntity.getManufacturerId());
|
|
|
+ //setupMethod.setDeviceMode(deviceTypeEntity.getDeviceMode());
|
|
|
+ //setupMethod.setDeviceType(deviceTypeEntity.getDeviceType());
|
|
|
+ //setupMethod.setManufacturer(deviceTypeEntity.getManufacturerId());
|
|
|
setupMethod.setReceiveTime(new Date());
|
|
|
//封装指令
|
|
|
String[] parm = parms.split(",");
|
|
@@ -177,7 +178,7 @@ public class DeviceSetupMethodService extends ServiceImpl<DeviceSetupMethodMappe
|
|
|
if (resultNode.get("status").toString().equals("0")) {
|
|
|
deviceSetupRecordEntity.setState(1);
|
|
|
} else {
|
|
|
- deviceSetupRecordEntity.setState(1);
|
|
|
+ deviceSetupRecordEntity.setState(2);
|
|
|
}
|
|
|
} catch (IOException e) {
|
|
|
return false;
|
|
@@ -205,7 +206,9 @@ public class DeviceSetupMethodService extends ServiceImpl<DeviceSetupMethodMappe
|
|
|
ParmSettingEntity parmSettingEntity = new ParmSettingEntity();
|
|
|
parmSettingEntity.setEnableState(1);
|
|
|
parmSettingEntity.setParmType(1);
|
|
|
- parmSettingEntity.setCompanyOrgId(Long.valueOf(currentUser.getCompanyId()));
|
|
|
+ if(currentUser!=null&¤tUser.getCompanyId()!=null) {
|
|
|
+ parmSettingEntity.setCompanyOrgId(Long.valueOf(currentUser.getCompanyId()));
|
|
|
+ }
|
|
|
parmSettingEntity.setTenantId(currentUser.getTenantId());
|
|
|
List<ParmSettingEntity> parmSettingEntities = parmSettingService.findList(parmSettingEntity);
|
|
|
if (parmSettingEntities.size() == 0) {
|