mirror of
				https://github.com/getrebuild/rebuild.git
				synced 2025-11-04 09:06:07 +08:00 
			
		
		
		
	Merge branch 'master' into develop
This commit is contained in:
		
						commit
						64f2d1168b
					
				
					 9 changed files with 28 additions and 12 deletions
				
			
		
							
								
								
									
										2
									
								
								@rbv
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								@rbv
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1 +1 @@
 | 
			
		|||
Subproject commit 031039036ba44f47b61a2b81bcaa70922ef3656a
 | 
			
		||||
Subproject commit 94c40c80ab261ef0c5f3255421992543f2c0cc80
 | 
			
		||||
| 
						 | 
				
			
			@ -65,7 +65,7 @@ public class FieldAggregation extends TriggerAction {
 | 
			
		|||
     * @see ConfigurationItem#TriggerMaxDepth
 | 
			
		||||
     */
 | 
			
		||||
    public static final int MAX_TRIGGER_DEPTH = ObjectUtils.toInt(
 | 
			
		||||
            BootEnvironmentPostProcessor.getProperty(ConfigurationItem.TriggerMaxDepth.name(), "128"));
 | 
			
		||||
            BootEnvironmentPostProcessor.getProperty(ConfigurationItem.TriggerMaxDepth.name(), "256"));
 | 
			
		||||
 | 
			
		||||
    // 此触发器可能产生连锁反应
 | 
			
		||||
    // 如触发器 A 调用 B,而 B 又调用了 C ... 以此类推。此处记录其深度
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -436,15 +436,20 @@ public class FieldWriteback extends FieldAggregation {
 | 
			
		|||
 | 
			
		||||
                        Object value = useSourceData.getObjectValue(fieldName);
 | 
			
		||||
 | 
			
		||||
                        // fix: 3.5.4
 | 
			
		||||
                        Field varField = MetadataHelper.getLastJoinField(sourceEntity, fieldName);
 | 
			
		||||
                        EasyField easyVarField = varField == null ? null : EasyMetaFactory.valueOf(varField);
 | 
			
		||||
                        boolean isMultiField = easyVarField != null && (easyVarField.getDisplayType() == DisplayType.MULTISELECT
 | 
			
		||||
                                || easyVarField.getDisplayType() == DisplayType.TAG || easyVarField.getDisplayType() == DisplayType.N2NREFERENCE);
 | 
			
		||||
 | 
			
		||||
                        if (value instanceof Date) {
 | 
			
		||||
                            value = CalendarUtils.getUTCDateTimeFormat().format(value);
 | 
			
		||||
                        } else if (value == null) {
 | 
			
		||||
                            // 数字字段置 `0`
 | 
			
		||||
                            Field isNumberField = MetadataHelper.getLastJoinField(sourceEntity, fieldName);
 | 
			
		||||
                            // N2N 保持 `NULL`
 | 
			
		||||
                            Field isN2NField = sourceEntity.containsField(fieldName) ? sourceEntity.getField(fieldName) : null;
 | 
			
		||||
                            if (isNumberField != null
 | 
			
		||||
                                    && (isNumberField.getType() == FieldType.LONG || isNumberField.getType() == FieldType.DECIMAL)) {
 | 
			
		||||
                            // 数字字段置 `0`
 | 
			
		||||
                            if (varField != null
 | 
			
		||||
                                    && (varField.getType() == FieldType.LONG || varField.getType() == FieldType.DECIMAL)) {
 | 
			
		||||
                                value = 0;
 | 
			
		||||
                            } else if (fieldVarsN2NPath.contains(fieldName)
 | 
			
		||||
                                    || (isN2NField != null && isN2NField.getType() == FieldType.REFERENCE_LIST)) {
 | 
			
		||||
| 
						 | 
				
			
			@ -452,6 +457,10 @@ public class FieldWriteback extends FieldAggregation {
 | 
			
		|||
                            } else {
 | 
			
		||||
                                value = StringUtils.EMPTY;
 | 
			
		||||
                            }
 | 
			
		||||
                        } else if (isMultiField) {
 | 
			
		||||
                            // force `TEXT`
 | 
			
		||||
                            EasyField fakeTextField = EasyMetaFactory.valueOf(MetadataHelper.getField("User", "fullName"));
 | 
			
		||||
                            value = easyVarField.convertCompatibleValue(value, fakeTextField);
 | 
			
		||||
                        } else if (value instanceof ID || forceUseQuote) {
 | 
			
		||||
                            value = value.toString();
 | 
			
		||||
                        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,6 +18,7 @@ import com.alibaba.fastjson.JSONObject;
 | 
			
		|||
import com.rebuild.core.Application;
 | 
			
		||||
import com.rebuild.core.metadata.EntityHelper;
 | 
			
		||||
import com.rebuild.core.metadata.MetadataHelper;
 | 
			
		||||
import com.rebuild.core.metadata.easymeta.EasyField;
 | 
			
		||||
import com.rebuild.core.metadata.easymeta.EasyMetaFactory;
 | 
			
		||||
import com.rebuild.core.privileges.UserFilters;
 | 
			
		||||
import com.rebuild.core.privileges.UserService;
 | 
			
		||||
| 
						 | 
				
			
			@ -114,13 +115,20 @@ public class DataListBuilderImpl implements DataListBuilder {
 | 
			
		|||
                        label = String.format("%s (%s)", Language.L(field), FormatCalc.valueOf(calc).getLabel());
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    EasyField easyField = EasyMetaFactory.valueOf(field);
 | 
			
		||||
 | 
			
		||||
                    Object value = count[i];
 | 
			
		||||
                    if (ChartsHelper.isZero(value)) {
 | 
			
		||||
                        value = ChartsHelper.VALUE_ZERO;
 | 
			
		||||
                    } else if (field.getType() == FieldType.LONG) {
 | 
			
		||||
                        value = ObjectUtils.toLong(value);
 | 
			
		||||
                    } else {
 | 
			
		||||
                        value = EasyMetaFactory.valueOf(field).wrapValue(value);
 | 
			
		||||
                        value = easyField.wrapValue(value);
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    // fix: 3.5.4
 | 
			
		||||
                    if (FieldValueHelper.isUseDesensitized(easyField, this.user)) {
 | 
			
		||||
                        value = FieldValueHelper.desensitized(easyField, value);
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    stats.add(JSONUtils.toJSONObject(new String[] { "label", "value" }, new Object[] {label,value} ));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -240,8 +240,6 @@ public class QueryParser {
 | 
			
		|||
 | 
			
		||||
        int pageNo = NumberUtils.toInt(queryExpr.getString("pageNo"), 1);
 | 
			
		||||
        int pageSize = NumberUtils.toInt(queryExpr.getString("pageSize"), 40);
 | 
			
		||||
        pageNo = Math.max(pageNo, 1);
 | 
			
		||||
        pageSize = Math.max(Math.min(pageSize, 1000), 1);
 | 
			
		||||
        this.limit = new int[] { pageSize, pageNo * pageSize - pageSize };
 | 
			
		||||
 | 
			
		||||
        this.reload = limit[1] == 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,5 @@
 | 
			
		|||
[
 | 
			
		||||
  ".baidu.com",
 | 
			
		||||
  ".google.com",
 | 
			
		||||
  "qq.com"
 | 
			
		||||
]
 | 
			
		||||
| 
						 | 
				
			
			@ -23229,7 +23229,7 @@ div.table-responsive > div.dataTables_wrapper > div.row > div[class^='col-']:las
 | 
			
		|||
 | 
			
		||||
/* EXT */
 | 
			
		||||
 | 
			
		||||
.rb-error .error-container {
 | 
			
		||||
.rb-error.v35 .error-container {
 | 
			
		||||
  background: #fff url(../img/browser-bar.png) 0 0 no-repeat;
 | 
			
		||||
  max-width: 888px;
 | 
			
		||||
  margin: 60px auto;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -49,7 +49,7 @@
 | 
			
		|||
          <div class="error-container mt-0">
 | 
			
		||||
            <div class="safe-tips">
 | 
			
		||||
              <h3>[[${bundle.L('即将跳转到外部网站')}]]</h3>
 | 
			
		||||
              <p><i class="mdi mdi-shield-alert-outline"></i> [[${bundle.L('请注意你的账户安全')}]]</p>
 | 
			
		||||
              <p class="text-warning"><i class="mdi mdi-shield-alert-outline"></i> [[${bundle.L('请注意你的账户安全')}]]</p>
 | 
			
		||||
              <div class="url">
 | 
			
		||||
                <span class="icon"><i class="zmdi zmdi-link"></i></span>
 | 
			
		||||
                <span class="text" th:utext="${outerUrl}"></span>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,7 +40,7 @@
 | 
			
		|||
    </style>
 | 
			
		||||
  </head>
 | 
			
		||||
  <body class="rb-splash-screen">
 | 
			
		||||
    <div class="rb-wrapper rb-error">
 | 
			
		||||
    <div class="rb-wrapper rb-error v35">
 | 
			
		||||
      <div class="rb-content m-0">
 | 
			
		||||
        <div class="main-content container">
 | 
			
		||||
          <div class="error-container">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue