CFBIZ_BUSINESSINFO.CREDENTIAL_Area.toString().match(/[\u4e00-\u9fa5]/g).join()是什么意思?
时间: 2024-04-26 16:24:56 浏览: 11
这段代码是将 CFBIZ_BUSINESSINFO.CREDENTIAL_Area 字段的值转化为字符串类型后,提取其中的中文字符并以字符串形式返回。具体来说,match() 方法可以通过正则表达式匹配字符串中的符合条件的部分,[\u4e00-\u9fa5] 表示匹配中文字符的 Unicode 编码范围,g 表示全局匹配。join() 方法则将匹配到的中文字符数组转化为字符串并返回。
相关问题
Cannot invoke "com.pay.web.support.BusinessInfo.getId()" because the return value of "com.pay.web.support.SiteContext.getCurrentUser()" is null
这个错误提示是因为在调用`com.pay.web.support.BusinessInfo.getId()`方法之前,需要先确保`com.pay.web.support.SiteContext.getCurrentUser()`方法返回的值不为null。可以在调用`com.pay.web.support.BusinessInfo.getId()`方法之前添加一个非空判断,例如:
```
Object currentUser = com.pay.web.support.SiteContext.getCurrentUser();
if (currentUser != null) {
String businessId = com.pay.web.support.BusinessInfo.getId();
// do something with businessId
} else {
// handle null currentUser case
}
```
这里的`Object currentUser`的类型可能需要根据实际情况进行调整,以确保类型匹配。
Entity entity = this.Model.BillBusinessInfo.GetEntity("F_WWBG_Licenses"); int iCurRowIndex = this.View.Model.GetEntryCurrentRowIndex("F_WWBG_Licenses"); DynamicObject doEntity = this.View.Model.GetEntityDataObject(entity, iCurRowIndex); DynamicObjectType dotSaleOrder = doEntity.DynamicObjectType; DynamicObject LicenseType = dotSaleOrder.Properties["LicenseType"].GetValue<DynamicObject>(doEntity); string FID = LicenseType["Id"].ToString(); FormMetadata formMetadata = MetaDataServiceHelper.Load(base.Context, "WWBG_ZZLB", true) as FormMetadata; QueryBuilderParemeter queryBuilderParemeter = new QueryBuilderParemeter(); queryBuilderParemeter.BusinessInfo = formMetadata.BusinessInfo; queryBuilderParemeter.FilterClauseWihtKey = "FID =" + FID; DynamicObject[] array = BusinessDataServiceHelper.Load(base.Context, formMetadata.BusinessInfo.GetDynamicObjectType(), queryBuilderParemeter); DynamicObject dynamicObject = array[0];
根据你提供的代码,我看到你正在获取一个名为"F_WWBG_Licenses"的实体对象,并且在获取当前行索引后,通过该索引获取实体数据对象。接下来,你获取了实体数据对象的动态类型,然后从该动态类型的属性中获取名为"LicenseType"的属性值,并将其转换为DynamicObject类型。接着,你从LicenseType中获取了一个名为"FID"的属性,并将其转换为字符串类型。
然后,你加载了一个名为"WWBG_ZZLB"的表单元数据,并将其转换为FormMetadata类型。接着,你创建了一个QueryBuilderParemeter对象,并设置了其BusinessInfo属性为上述表单元数据。你还设置了FilterClauseWihtKey属性为"FID = " + FID,即以"FID"字段等于上述获取的FID值作为过滤条件。
最后,你使用BusinessDataServiceHelper.Load方法加载了数据,并将结果存储在一个DynamicObject类型的数组中,然后取出第一个元素存储在dynamicObject变量中。