Browse Source

添加设备的时候,资产修改为必须绑定

jwy
review512jwy@163.com 3 weeks ago
parent
commit
8a61a9bc1f
  1. 6
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DeviceServiceImpl.java

6
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/DeviceServiceImpl.java

@ -231,6 +231,9 @@ public class DeviceServiceImpl implements IDeviceService {
if (StringUtils.isNotBlank(deviceAddParams.getDataMapping()) && !CommonUtil.isJson(deviceAddParams.getDataMapping())){ if (StringUtils.isNotBlank(deviceAddParams.getDataMapping()) && !CommonUtil.isJson(deviceAddParams.getDataMapping())){
return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "dataMappingFormatError")); return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "dataMappingFormatError"));
} }
if (null == deviceAddParams.getAssetId()){
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "assetId is null");
}
/** Some validation operations **/ /** Some validation operations **/
try { try {
List<Long> selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId); List<Long> selfAndSubCompanyList = commonOpt.getSelfAndSubCompanyId(companyId);
@ -316,6 +319,9 @@ public class DeviceServiceImpl implements IDeviceService {
if (ObjectUtils.isEmpty(deviceUpdateParams.getId())) { if (ObjectUtils.isEmpty(deviceUpdateParams.getId())) {
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "id is null"); return new SimpleDataResponse(ResponseCode.MSG_ERROR, "id is null");
} }
if (null == deviceUpdateParams.getAssetId()){
return new SimpleDataResponse(ResponseCode.MSG_ERROR, "assetId is null");
}
if (StringUtils.isNotBlank(deviceUpdateParams.getDataMapping()) && !CommonUtil.isJson(deviceUpdateParams.getDataMapping())){ if (StringUtils.isNotBlank(deviceUpdateParams.getDataMapping()) && !CommonUtil.isJson(deviceUpdateParams.getDataMapping())){
return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "dataMappingFormatError")); return new SimpleDataResponse(ResponseCode.MSG_ERROR, msgLanguageChange.getParameterMapByCode(languageType, "dataMappingFormatError"));
} }

Loading…
Cancel
Save