From ead03a87bc93af8f4cf188510f80d631043c4aa1 Mon Sep 17 00:00:00 2001 From: sunhongfei01 Date: Fri, 19 Jul 2024 17:17:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=BF=BB=E8=AF=91=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../viewobject_model_designtime.en.properties | 32 ++-- .../viewobject_model_designtime.properties | 6 +- ...wobject_model_designtime.zh-CHT.properties | 8 +- .../validate/ViewModelValidator.java | 157 ++++++++---------- 4 files changed, 93 insertions(+), 110 deletions(-) diff --git a/resources/en/viewobject_model_designtime.en.properties b/resources/en/viewobject_model_designtime.en.properties index e0bf732..208a680 100644 --- a/resources/en/viewobject_model_designtime.en.properties +++ b/resources/en/viewobject_model_designtime.en.properties @@ -17,12 +17,12 @@ # view-object-manager GSP_VIEWOBJECT_MANAGER_0001=Object [{2}] not found in view object [{0}:{1}] GSP_VIEWOBJECT_MANAGER_0002=The Object [{2}] in view object [{0}:{1}] does not have a process instance field with ID [{3}] -GSP_VIEWOBJECT_MANAGER_0003=The Object [{2}] in view object [{0}:{1}] does not have a document internal code field [{3}] +GSP_VIEWOBJECT_MANAGER_0003=The Object [{2}] in view object [{0}:{1}] does not have a bill code id field [{3}] GSP_VIEWOBJECT_MANAGER_0004=When creating a workflow approval log sub table, the list of approval log fields obtained is empty! GSP_VIEWOBJECT_MANAGER_0005=The field [{0}:{1}] on the approval log sub table do not support fields of type [{2}]. GSP_VIEWOBJECT_MANAGER_0006=View object [{0}:{1}] does not support the view action type of type [{2}] -GSP_VIEWOBJECT_MANAGER_0007=Variable linked calculation action with code [{2}] not found on view object [{0}:{1}]. Please check if the parameter action code is correct -GSP_VIEWOBJECT_MANAGER_0008=Unable to obtain metadata engineering information, please create metadata engineering first +GSP_VIEWOBJECT_MANAGER_0007=Variable determination with code [{2}] not found on view object [{0}:{1}]. Please check if the parameter action code is correct +GSP_VIEWOBJECT_MANAGER_0008=Unable to obtain metadata project information, please create metadata project first GSP_VIEWOBJECT_MANAGER_0009=When saving existing component metadata, the existing component metadata was not obtained based on the current path [{0}] and file name [{1}] GSP_VIEWOBJECT_MANAGER_0010=Remote call to getVoExtendInfo method in GspVoExtendInfoRpcService interface reported error, method parameter is: [{0}] GSP_VIEWOBJECT_MANAGER_0011=There are multiple metadata for the view object with business identifier ConfigId [{0}]. Please handle redundant data to ensure that the business identifier ConfigId corresponds one-to-one with the view object @@ -34,7 +34,7 @@ GSP_VIEWOBJECT_MANAGER_0016=Remote call to getVoId method in GspVoExtendInfoRpcS GSP_VIEWOBJECT_MANAGER_0017=When saving the business identifier of view object, the view object ID of the business identifier record cannot be empty GSP_VIEWOBJECT_MANAGER_0018=When obtaining the business identification information of all view objects based on the business entity ID parameter, the business entity ID parameter cannot be empty. Please confirm and re-enter the parameter GSP_VIEWOBJECT_MANAGER_0019=When generating component action codes for view objects, the component action is empty -GSP_VIEWOBJECT_MANAGER_0020=There are duplicate parameters [{2}] on component action [{0}:{1}] when generating component action codes for view objects, +GSP_VIEWOBJECT_MANAGER_0020=There are duplicate parameters [{2}] on component action [{0}:{1}] when generating component action codes for view objects GSP_VIEWOBJECT_MANAGER_0021=The current view object operation parameter [{0}:{1}] type [{2}] is not currently supported GSP_VIEWOBJECT_MANAGER_0022=The class name attribute of custom parameter [{0}:{1}] cannot be empty. Please fill it in again and save it GSP_VIEWOBJECT_MANAGER_0023=the namespace cannot be empty when adding a reference, @@ -76,7 +76,7 @@ GSP_VIEWOBJECT_MANAGER_0060=GspAssociation serialization exception GSP_VIEWOBJECT_MANAGER_0061=Unable to find dependency relationship for current view object field dependency GSP_VIEWOBJECT_MANAGER_0062=VoElementMapping deserialization exception GSP_VIEWOBJECT_MANAGER_0063=Unable to find the business entity [{0}] field [{1}] mapped to the current view object field -GSP_VIEWOBJECT_MANAGER_0065=The field of the current view object does not match the field [1}] in the associated business entity [0}]. +GSP_VIEWOBJECT_MANAGER_0065=The field of the current view object does not match the field [{1}] in the associated business entity [{0}]. GSP_VIEWOBJECT_MANAGER_0066=The business entity [{0}] field [{1}] mapped to the current view object field is not an associated field GSP_VIEWOBJECT_MANAGER_0067=The "business entity id" parameter for the method to retrieve business entity metadata cannot be empty. GSP_VIEWOBJECT_MANAGER_0068=The metadata selected for the current operation was not obtained. Please confirm if the metadata to be selected exists @@ -106,7 +106,7 @@ GSP_VIEWOBJECT_MANAGER_0107=The field [{1}] on the object [{0}] has no mapped fi GSP_VIEWOBJECT_MANAGER_0108=The [length] of the field [{1}] on the object [{0}] cannot be greater than the length of the field on the business entity [{2}]. GSP_VIEWOBJECT_MANAGER_0109=The [precision] of the field [{1}] on the object [{0}] cannot be greater than the precision of the field on the business entity [{2}]. GSP_VIEWOBJECT_MANAGER_0110=The operation [{0}] has no mapped operation on the business entity, the ID of the custom operation on the business entity is [{1}], please check if it has been deleted. -GSP_VIEWOBJECT_MANAGER_MESSAGE_0001=View object [[{0}:{1}] synchronization code check for operation [{2}:{3}] +GSP_VIEWOBJECT_MANAGER_MESSAGE_0001=View object [{0}:{1}] synchronization code check for operation [{2}:{3}] # view-object-model GSP_VIEWOBJECT_MODEL_1001=View operations on view object are currently not supported for clone operation GSP_VIEWOBJECT_MODEL_1002=Qo type mapping, please use GspQoObject Mapping @@ -210,7 +210,7 @@ GSP_VIEWOBJECT_WEBAPI_1028=Exception occurred while generating view object GSP_VIEWOBJECT_WEBAPI_1029=Exception occurred while checking the business identity ConfigId of the verification view object GSP_VIEWOBJECT_WEBAPI_1030=Exception occurred while adding filter sorting criteria for help settings on the view object GSP_VIEWOBJECT_WEBAPI_1031=No current user information obtained -GSP_VIEWOBJECT_WEBAPI_1032=Firstly,please remove the dependency and association information of the view object object +GSP_VIEWOBJECT_WEBAPI_1032=Please first remove the dependencies and associated information of this view object. GSP_VIEWOBJECT_WEBAPI_1033=Firstly,please remove the dependency and association information of the view object field GSP_VIEWOBJECT_WEBAPI_1034=Firstly,please remove the dependency and associated information of this action GSP_VIEWOBJECT_WEBAPI_1035=Failed to retrieve the associated virtual view object. @@ -241,7 +241,7 @@ GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_NAME_DESCRIPTION=Entity Name GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_ADD_CUSTOM_ACTION=Add Custom Action GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_ADD_CUSTOM_ACTION_DESCRIPTION=Add Custom Action GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_NODIFY_CUSTOM_ACTION=Modify Custom Action -GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_NODIFY_CUSTOM_ACTION_DESCRIPTION=\u4FEE\u6539\u81EA\u5B9A\u7FA9\u52D5\u4F5C +GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_NODIFY_CUSTOM_ACTION_DESCRIPTION=Modify Custom Action GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_ADD_VARIABLE=Add Custom Variable GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_ADD_VARIABLE_DESCRIPTION=Add Custom Variable GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_MODIFY_VARIABLE=Modify Custom Variable @@ -276,7 +276,7 @@ GSP_VIEWOBJECT_MSGTEMP_VO_ACTION_CONSISTENCY_CHECK_PREFIX=In the view object [{1 GSP_VIEWOBJECT_MSGTEMP_VO_OBJECT_CONSISTENCY_CHECK_PREFIX=In the project [{0}], the object [{2}] in the view object [{1}] depends on the current business entity object. GSP_VIEWOBJECT_MSGTEMP_VO_ELEMENT_RELY_OBJECT_CONSISTENCY_CHECK_PREFIX=In the project [{0}], the field [{3}] on the object [{2}] in the view object [{1}] depends on the current business entity object. GSP_VIEWOBJECT_MSGTEMP_VO_ELEMENT_RELY_ELEMENT_CONSISTENCY_CHECK_PREFIX=In the project [{0}], the field [{3}] on the object [{2}] in the view object [{1}] depends on the current business entity field. -GSP_VIEWOBJECT_MSGTEMP_VOBEFOREHELOFILTER_COMPONENT_NAME=Support filter and selection components before VO assistance. +GSP_VIEWOBJECT_MSGTEMP_VOBEFOREHELOFILTER_COMPONENT_NAME=Support filter and selection components before VO help. GSP_VIEWOBJECT_MSGTEMP_VALIDATE_BASICINFO_CODE_ISNULL=The code of the view object [{0}] cannot be empty. GSP_VIEWOBJECT_MSGTEMP_VALIDATE_BASICINFO_CODE_FORMATE=The [Code] property of the view object [{0}] must start with an English letter or an underscore, and can only consist of English letters, numbers, and underscores (). GSP_VIEWOBJECT_MSGTEMP_VALIDATE_BASICINFO_NAME_ISNULL=The name of the view object [{0}] cannot be empty! @@ -294,7 +294,7 @@ GSP_VIEWOBJECT_MSGTEMP_VALIDATE_COMPONENT_PARAMETER_CODE_NOT_EQUAL=The code of p GSP_VIEWOBJECT_MSGTEMP_VALIDATE_COMPONENT_PARAMETER_TYPE_NOT_EQUAL=The type of parameter [{1}] for action [{0}] does not match with that of component [{2}], they are [{3}] and [{4}] respectively. GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_RETURNVALUE_TYPE_NOT_EQUAL=The return type of action [{0}] does not match with the corresponding component [{1}]. GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_RETURNVALUE_COLLECTION_TYPE_NOT_EQUAL=The collection type of the return value of action [{0}] does not match with the corresponding component [{1}]. -GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_RETURNVALUE_CLASS_ISNULL=For J version metadata engineering, the [type] of the return value in {0}[{1}] is a custom type, please complete its Java class name. +GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_RETURNVALUE_CLASS_ISNULL=The [type] of the return value in {0} [{1}] is a custom type, please complete its Java class name. GSP_VIEWOBJECT_MSGTEMP_ACTION_CHANGESETMAPPING_NAME=Internal VO Extend Action Changeset Mapping GSP_VIEWOBJECT_MSGTEMP_ACTION_CHANGESETREVERSALMAPPING_NAME=Internal Extend Action Changeset Reversal Mapping GSP_VIEWOBJECT_MSGTEMP_ACTION_CREATE_NAME=Internal VO Extend Action Create @@ -339,10 +339,10 @@ GSP_VIEWOBJECT_MSGTEMP_VALIDATE_HELP_CONFIG_PREFIX_ELEMENTID_IS_NULL=In the [Hel GSP_VIEWOBJECT_MSGTEMP_VALIDATE_HELP_CONFIG_PREFIX_HELPID_IS_NULL=In the [Help Collection], the [HelpId] property of the help information [{0}] must not be null, please check! GSP_VIEWOBJECT_MSGTEMP_VALIDATE_HELP_ACTION_PREFIX=The pre-event action in the help [{0}] of the [Help Collection] GSP_VIEWOBJECT_MSGTEMP_VALIDATE_VM_ACTION_PREFIX=View Object Action -GSP_VIEWOBJECT_MSGTEMP_VALIDATE_COMMON_OP_BASIC_CODE_IS_NULL=The [code] property of the associated calculation [{0}] in the [Variable Collection] must not be empty! -GSP_VIEWOBJECT_MSGTEMP_VALIDATE_COMMON_OP_BASIC_CODE_FORMATE=The [code] property of the associated calculation [{0}] in the [Variable Collection] must start with an English letter or underscore, and can only consist of English letters, numbers, and underscores (_)! -GSP_VIEWOBJECT_MSGTEMP_VALIDATE_COMMON_OP_BASIC_NAME_IS_NULL=The [name] property of the associated calculation [{0}] in the [Variable Collection] must not be empty! -GSP_VIEWOBJECT_MSGTEMP_VALIDATE_COMMON_OP_CODE_DUPLICATE=There are operations [{1}],[{2}] with the same code [{0}] in the associated calculations of the [Variable Collection]. +GSP_VIEWOBJECT_MSGTEMP_VALIDATE_COMMON_OP_BASIC_CODE_IS_NULL=The [code] property of the determination [{0}] in the [Variable Collection] must not be empty! +GSP_VIEWOBJECT_MSGTEMP_VALIDATE_COMMON_OP_BASIC_CODE_FORMATE=The [code] property of the determination [{0}] in the [Variable Collection] must start with an English letter or underscore, and can only consist of English letters, numbers, and underscores (_)! +GSP_VIEWOBJECT_MSGTEMP_VALIDATE_COMMON_OP_BASIC_NAME_IS_NULL=The [name] property of the determination [{0}] in the [Variable Collection] must not be empty! +GSP_VIEWOBJECT_MSGTEMP_VALIDATE_COMMON_OP_CODE_DUPLICATE=There are operations [{1}],[{2}] with the same code [{0}] in the determination of the [Variable Collection]. GSP_VIEWOBJECT_MSGTEMP_VALIDATE_OPERATION_BASIC_CODE_IS_NULL=The [code] property of {0}[{1}] must not be empty! GSP_VIEWOBJECT_MSGTEMP_VALIDATE_OPERATION_BASIC_CODE_FORMATE=The [code] property of {0}[{1}] must start with an English letter or underscore, and can only consist of English letters, numbers, and underscores (_)! GSP_VIEWOBJECT_MSGTEMP_VALIDATE_OPERATION_BASIC_NAME_IS_NULL=The [name] property of {0}[{1}] must not be empty! @@ -350,7 +350,7 @@ GSP_VIEWOBJECT_MSGTEMP_VALIDATE_OPERATION_CODE_DUPLICATE={0} [{1}],[{2}] has a d GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CODE_IS_NULL=The [code] of parameter [{2}] in {0}[{1}] must not be empty! GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CODE_FORMATE=The [code] property of parameter [{2}] in {0}[{1}] must start with an English letter or underscore, and can only consist of English letters, numbers, and underscores (_)! GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_NAME_IS_NULL=The [name] of parameter [{2}] in {0}[{1}] must not be empty! -GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CLASS_IS_NULL=For metadata engineering, the [parameter type] of parameter [{2}] in {0}[{1}] is a custom type, please complete its Java class name. +GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CLASS_IS_NULL=The [parameter type] of parameter [{2}] in {0}[{1}] is a custom type, please complete its Java class name. GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CODE_DUPLICATE=There are parameters [{3}],[{4}] with the same [code] [{2}] in {0}[{1}]. GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ELEMENT_DEFAULT_DECIMAL_NOT_FIT=The [default value] of {0} does not match the [data type], please check if it is a [floating number], and check if the [precision] matches! GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ELEMENT_DEFAULT_DATATYPE_NOT_FIT=The [default value] of {0} does not match the [data type]! @@ -364,6 +364,6 @@ GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ELEMENT_BASIC_DEFAULTVALUE_FIT_ENUM=The [default GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ELEMENT_BASIC_ENUM_REQUIRED_NOT_NO=The [required] property of {0} whose [object type] is enumeration should be No. GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ELEMENT_BASIC_DECIMAL_LENGTH_IS_ZERO=The [length] of {0} whose [data type] is [floating number] cannot be 0. GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ELEMENT_BASIC_DECIMAL_PRECISION_IS_ZERO=The [precision] of {0} whose [data type] is [floating number] cannot be 0. -GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ELEMENT_BASIC_STRING_LENGTH_IS_ZERO=The [length] of {0} whose [data type] is [text] cannot be 0. +GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ELEMENT_BASIC_STRING_LENGTH_IS_ZERO=The [length] of {0} whose [data type] is [string] cannot be 0. GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ELEMENT_PREFIX=Field [{1}] of object [{0}] GSP_VIEWOBJECT_MSGTEMP_VALIDATE_VARIABLE_PREFIX=Field [{1}] of the variable collection in model [{0}] \ No newline at end of file diff --git a/resources/viewobject_model_designtime.properties b/resources/viewobject_model_designtime.properties index 846810c..3a98f61 100644 --- a/resources/viewobject_model_designtime.properties +++ b/resources/viewobject_model_designtime.properties @@ -106,7 +106,7 @@ GSP_VIEWOBJECT_MANAGER_0107=\u5BF9\u8C61[{0}]\u4E0A\u7684\u5B57\u6BB5[{1}]\u5728 GSP_VIEWOBJECT_MANAGER_0108=\u5BF9\u8C61[{0}]\u4E0A\u7684\u5B57\u6BB5[{1}]\u7684[\u957F\u5EA6]\u4E0D\u80FD\u5927\u4E8E\u4E1A\u52A1\u5B9E\u4F53\u4E0A\u5B57\u6BB5\u957F\u5EA6[{2}]\u3002 GSP_VIEWOBJECT_MANAGER_0109=\u5BF9\u8C61[{0}]\u4E0A\u7684\u5B57\u6BB5[{1}]\u7684[\u7CBE\u5EA6]\u4E0D\u80FD\u5927\u4E8E\u4E1A\u52A1\u5B9E\u4F53\u4E0A\u5B57\u6BB5\u7CBE\u5EA6[{2}]\u3002 GSP_VIEWOBJECT_MANAGER_0110=\u64CD\u4F5C[{0}]\u5728\u4E1A\u52A1\u5B9E\u4F53\u4E0A\u65E0\u6620\u5C04\u64CD\u4F5C\uFF0C\u4E1A\u52A1\u5B9E\u4F53\u81EA\u5B9A\u4E49\u64CD\u4F5C\u7684ID=[{1}],\u8BF7\u68C0\u67E5\u662F\u5426\u5DF2\u5220\u9664\u3002 -GSP_VIEWOBJECT_MANAGER_MESSAGE_0001=\u89C6\u56FE\u5BF9\u8C61[[{0}:{1}]\u4E0A\u64CD\u4F5C[{2}:{3}]\u540C\u6B65\u4EE3\u7801\u68C0\u67E5 +GSP_VIEWOBJECT_MANAGER_MESSAGE_0001=\u89C6\u56FE\u5BF9\u8C61[{0}:{1}]\u4E0A\u64CD\u4F5C[{2}:{3}]\u540C\u6B65\u4EE3\u7801\u68C0\u67E5 # view-object-model GSP_VIEWOBJECT_MODEL_1001=\u89C6\u56FE\u5BF9\u8C61\u4E0A\u7684\u89C6\u56FE\u64CD\u4F5C\u6682\u4E0D\u652F\u6301\u62F7\u8D1D\u64CD\u4F5C GSP_VIEWOBJECT_MODEL_1002=Qo\u7C7B\u578B\u6620\u5C04\uFF0C\u8BF7\u4F7F\u7528GspQoObjectMapping @@ -294,7 +294,7 @@ GSP_VIEWOBJECT_MSGTEMP_VALIDATE_COMPONENT_PARAMETER_CODE_NOT_EQUAL=\u52A8\u4F5C[ GSP_VIEWOBJECT_MSGTEMP_VALIDATE_COMPONENT_PARAMETER_TYPE_NOT_EQUAL=\u52A8\u4F5C[{0}]\u53C2\u6570[{1}]\u4E0E\u6784\u4EF6[{2}]\u53C2\u6570[\u7C7B\u578B]\u4E0D\u4E00\u81F4\uFF0C\u5206\u522B\u4E3A[{3}],[{4}] GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_RETURNVALUE_TYPE_NOT_EQUAL=\u52A8\u4F5C[{0}]\u7684\u8FD4\u56DE\u7C7B\u578B\u4E0E\u5BF9\u5E94\u6784\u4EF6[{1}]\u4E0D\u4E00\u81F4 GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_RETURNVALUE_COLLECTION_TYPE_NOT_EQUAL=\u52A8\u4F5C[{0}]\u7684\u8FD4\u56DE\u503C\u96C6\u5408\u7C7B\u578B\u4E0E\u5BF9\u5E94\u6784\u4EF6[{1}]\u4E0D\u4E00\u81F4 -GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_RETURNVALUE_CLASS_ISNULL=J\u7248\u5143\u6570\u636E\u5DE5\u7A0B\uFF0C{0}[{1}]\u4E2D\u7684\u8FD4\u56DE\u503C\u7684 [\u7C7B\u578B] \u4E3A\u81EA\u5B9A\u4E49\u7C7B\u578B\uFF0C\u8BF7\u5B8C\u5584\u5176Java\u7C7B\u540D\u3002 +GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_RETURNVALUE_CLASS_ISNULL={0}[{1}]\u4E2D\u7684\u8FD4\u56DE\u503C\u7684 [\u7C7B\u578B] \u4E3A\u81EA\u5B9A\u4E49\u7C7B\u578B\uFF0C\u8BF7\u5B8C\u5584\u5176Java\u7C7B\u540D\u3002 GSP_VIEWOBJECT_MSGTEMP_ACTION_CHANGESETMAPPING_NAME=\u5185\u7F6E\u53D8\u66F4\u96C6Mapping\u64CD\u4F5C GSP_VIEWOBJECT_MSGTEMP_ACTION_CHANGESETREVERSALMAPPING_NAME=\u5185\u7F6E\u53D8\u66F4\u96C6\u53CD\u5411Mapping\u64CD\u4F5C GSP_VIEWOBJECT_MSGTEMP_ACTION_CREATE_NAME=\u5185\u7F6E\u65B0\u589E\u6570\u636E\u64CD\u4F5C @@ -350,7 +350,7 @@ GSP_VIEWOBJECT_MSGTEMP_VALIDATE_OPERATION_CODE_DUPLICATE={0}[{1}],[{2}]\u5B58\u5 GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CODE_IS_NULL={0}[{1}]\u53C2\u6570[{2}][\u7F16\u53F7]\u4E0D\u5141\u8BB8\u4E3A\u7A7A! GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CODE_FORMATE={0}[{1}]\u4E2D\u7684\u53C2\u6570[{2}]\u7684[\u7F16\u53F7] \u5C5E\u6027\u5FC5\u987B\u4EE5\u82F1\u6587\u5B57\u6BCD\u6216\u4E0B\u5212\u7EBF\u5F00\u5934, \u5E76\u4E14\u53EA\u80FD\u7531\u82F1\u6587\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF(_)\u7EC4\u6210! GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_NAME_IS_NULL={0}[{1}]\u4E2D\u7684\u53C2\u6570[{2}][\u540D\u79F0]\u4E0D\u5141\u8BB8\u4E3A\u7A7A! -GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CLASS_IS_NULL=\u5143\u6570\u636E\u5DE5\u7A0B\uFF0C{0}[{1}]\u4E2D\u7684\u53C2\u6570[{2}][\u53C2\u6570\u7C7B\u578B]\u4E3A\u81EA\u5B9A\u4E49\u7C7B\u578B\uFF0C\u8BF7\u5B8C\u5584\u5176Java\u7C7B\u540D\u3002 +GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CLASS_IS_NULL={0}[{1}]\u4E2D\u7684\u53C2\u6570[{2}][\u53C2\u6570\u7C7B\u578B]\u4E3A\u81EA\u5B9A\u4E49\u7C7B\u578B\uFF0C\u8BF7\u5B8C\u5584\u5176Java\u7C7B\u540D\u3002 GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CODE_DUPLICATE={0}[{1}]\u4E2D\u7684\u5B58\u5728\u591A\u4E2A[\u7F16\u53F7]\u76F8\u540C\u4E3A[{2}]\u7684\u53C2\u6570[{3}],[{4}] GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ELEMENT_DEFAULT_DECIMAL_NOT_FIT={0}\u7684[\u9ED8\u8BA4\u503C] \u4E0E[\u6570\u636E\u7C7B\u578B] \u4E0D\u5339\u914D\uFF0C\u8BF7\u68C0\u67E5\u662F\u5426\u4E3A[\u6D6E\u70B9\u6570\u5B57]\uFF0C\u8BF7\u68C0\u67E5[\u7CBE\u5EA6]\u662F\u5426\u5339\u914D! GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ELEMENT_DEFAULT_DATATYPE_NOT_FIT={0}\u7684[\u9ED8\u8BA4\u503C] \u4E0E[\u6570\u636E\u7C7B\u578B] \u4E0D\u5339\u914D! diff --git a/resources/zh-CHT/viewobject_model_designtime.zh-CHT.properties b/resources/zh-CHT/viewobject_model_designtime.zh-CHT.properties index 83dd226..7fb760d 100644 --- a/resources/zh-CHT/viewobject_model_designtime.zh-CHT.properties +++ b/resources/zh-CHT/viewobject_model_designtime.zh-CHT.properties @@ -106,7 +106,7 @@ GSP_VIEWOBJECT_MANAGER_0107=\u5C0D\u8C61[{0}]\u4E0A\u7684\u5B57\u6BB5[{1}]\u5728 GSP_VIEWOBJECT_MANAGER_0108=\u5C0D\u8C61[{0}]\u4E0A\u7684\u5B57\u6BB5[{1}]\u7684[\u9577\u5EA6]\u4E0D\u80FD\u5927\u65BC\u696D\u52D9\u5BE6\u9AD4\u4E0A\u5B57\u6BB5\u9577\u5EA6[{2}]\u3002 GSP_VIEWOBJECT_MANAGER_0109=\u5C0D\u8C61[{0}]\u4E0A\u7684\u5B57\u6BB5[{1}]\u7684[\u7CBE\u5EA6]\u4E0D\u80FD\u5927\u65BC\u696D\u52D9\u5BE6\u9AD4\u4E0A\u5B57\u6BB5\u7CBE\u5EA6[{2}]\u3002 GSP_VIEWOBJECT_MANAGER_0110=\u64CD\u4F5C[{0}]\u5728\u696D\u52D9\u5BE6\u9AD4\u4E0A\u7121\u6620\u5C04\u64CD\u4F5C\uFF0C\u696D\u52D9\u5BE6\u9AD4\u81EA\u5B9A\u7FA9\u64CD\u4F5C\u7684ID=[{1}],\u8ACB\u6AA2\u67E5\u662F\u5426\u5DF2\u522A\u9664\u3002 -GSP_VIEWOBJECT_MANAGER_MESSAGE_0001=\u8996\u5716\u5C0D\u8C61[[{0}:{1}]\u4E0A\u64CD\u4F5C[{2}:{3}]\u540C\u6B65\u4EE3\u78BC\u6AA2\u67E5 +GSP_VIEWOBJECT_MANAGER_MESSAGE_0001=\u8996\u5716\u5C0D\u8C61[{0}:{1}]\u4E0A\u64CD\u4F5C[{2}:{3}]\u540C\u6B65\u4EE3\u78BC\u6AA2\u67E5 # view-object-model GSP_VIEWOBJECT_MODEL_1001=\u8996\u5716\u5C0D\u8C61\u4E0A\u7684\u8996\u5716\u64CD\u4F5C\u66AB\u4E0D\u652F\u6301\u62F7\u8C9D\u64CD\u4F5C GSP_VIEWOBJECT_MODEL_1002=Qo\u985E\u578B\u6620\u5C04\uFF0C\u8ACB\u4F7F\u7528GspQoObjectMapping @@ -241,7 +241,7 @@ GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_NAME_DESCRIPTION=\u5BE6\u9AD4\u540D\u7A31 GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_ADD_CUSTOM_ACTION=\u65B0\u589E\u81EA\u5B9A\u7FA9\u52D5\u4F5C GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_ADD_CUSTOM_ACTION_DESCRIPTION=\u65B0\u589E\u81EA\u5B9A\u7FA9\u52D5\u4F5C GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_NODIFY_CUSTOM_ACTION=\u4FEE\u6539\u81EA\u5B9A\u7FA9\u52D5\u4F5C -GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_NODIFY_CUSTOM_ACTION_DESCRIPTION=Modify Custom Action +GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_NODIFY_CUSTOM_ACTION_DESCRIPTION=\u4FEE\u6539\u81EA\u5B9A\u7FA9\u52D5\u4F5C GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_ADD_VARIABLE=\u65B0\u589E\u81EA\u8A02\u8B8A\u6578 GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_ADD_VARIABLE_DESCRIPTION=\u65B0\u589E\u81EA\u8A02\u8B8A\u6578 GSP_VIEWOBJECT_MSGTEMP_RULE_VIEWMODEL_MODIFY_VARIABLE=\u4FEE\u6539\u81EA\u8A02\u8B8A\u6578 @@ -294,7 +294,7 @@ GSP_VIEWOBJECT_MSGTEMP_VALIDATE_COMPONENT_PARAMETER_CODE_NOT_EQUAL=\u52D5\u4F5C[ GSP_VIEWOBJECT_MSGTEMP_VALIDATE_COMPONENT_PARAMETER_TYPE_NOT_EQUAL=\u52D5\u4F5C[{0}]\u53C3\u6578[{1}]\u8207\u7D44\u4EF6[{2}]\u53C3\u6578[\u985E\u578B]\u4E0D\u4E00\u81F4\uFF0C\u5206\u5225\u70BA[{3}],[{4}] GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_RETURNVALUE_TYPE_NOT_EQUAL=\u52D5\u4F5C[{0}]\u7684\u8FD4\u56DE\u985E\u578B\u8207\u5C0D\u61C9\u7D44\u4EF6[{1}]\u4E0D\u4E00\u81F4 GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_RETURNVALUE_COLLECTION_TYPE_NOT_EQUAL=\u52D5\u4F5C[{0}]\u7684\u8FD4\u56DE\u503C\u96C6\u5408\u985E\u578B\u8207\u5C0D\u61C9\u7D44\u4EF6[{1}]\u4E0D\u4E00\u81F4 -GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_RETURNVALUE_CLASS_ISNULL=J\u7248\u5143\u6578\u64DA\u5DE5\u7A0B\uFF0C{0}[{1}]\u4E2D\u7684\u8FD4\u56DE\u503C\u7684 [\u985E\u578B] \u70BA\u81EA\u5B9A\u7FA9\u985E\u578B\uFF0C\u8ACB\u5B8C\u5584\u5176Java\u985E\u540D\u3002 +GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_RETURNVALUE_CLASS_ISNULL={0}[{1}]\u4E2D\u7684\u8FD4\u56DE\u503C\u7684 [\u985E\u578B] \u70BA\u81EA\u5B9A\u7FA9\u985E\u578B\uFF0C\u8ACB\u5B8C\u5584\u5176Java\u985E\u540D\u3002 GSP_VIEWOBJECT_MSGTEMP_ACTION_CHANGESETMAPPING_NAME=\u5167\u5EFA\u8B8A\u66F4\u96C6Mapping\u64CD\u4F5C GSP_VIEWOBJECT_MSGTEMP_ACTION_CHANGESETREVERSALMAPPING_NAME=\u5167\u5EFA\u8B8A\u66F4\u96C6\u53CD\u5411Mapping\u64CD\u4F5C GSP_VIEWOBJECT_MSGTEMP_ACTION_CREATE_NAME=\u5167\u7F6E\u65B0\u589E\u6578\u64DA\u64CD\u4F5C @@ -350,7 +350,7 @@ GSP_VIEWOBJECT_MSGTEMP_VALIDATE_OPERATION_CODE_DUPLICATE={0}[{1}],[{2}]\u5B58\u5 GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CODE_IS_NULL={0}[{1}]\u53C3\u6578[{2}][\u7DE8\u865F]\u4E0D\u5141\u8A31\u70BA\u7A7A\uFF01 GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CODE_FORMATE={0}[{1}]\u4E2D\u7684\u53C3\u6578[{2}]\u7684[\u7DE8\u865F] \u5C6C\u6027\u5FC5\u9808\u4EE5\u82F1\u6587\u5B57\u6BCD\u6216\u4E0B\u5283\u7DDA\u958B\u982D, \u4E26\u4E14\u53EA\u80FD\u7531\u82F1\u6587\u5B57\u6BCD\u3001\u6578\u5B57\u3001\u4E0B\u5283\u7DDA(_)\u7D44\u6210\uFF01 GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_NAME_IS_NULL={0}[{1}]\u4E2D\u7684\u53C3\u6578[{2}][\u540D\u7A31]\u4E0D\u5141\u8A31\u70BA\u7A7A\uFF01 -GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CLASS_IS_NULL=\u5143\u6578\u64DA\u5DE5\u7A0B\uFF0C{0}[{1}]\u4E2D\u7684\u53C3\u6578[{2}][\u53C3\u6578\u985E\u578B]\u70BA\u81EA\u5B9A\u7FA9\u985E\u578B\uFF0C\u8ACB\u5B8C\u5584\u5176Java\u985E\u540D\u3002 +GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CLASS_IS_NULL={0}[{1}]\u4E2D\u7684\u53C3\u6578[{2}][\u53C3\u6578\u985E\u578B]\u70BA\u81EA\u5B9A\u7FA9\u985E\u578B\uFF0C\u8ACB\u5B8C\u5584\u5176Java\u985E\u540D\u3002 GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ACTION_PARAM_CODE_DUPLICATE={0}[{1}]\u4E2D\u7684\u5B58\u5728\u591A\u500B[\u7DE8\u865F]\u76F8\u540C\u70BA[{2}]\u7684\u53C3\u6578[{3}],[{4}] GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ELEMENT_DEFAULT_DECIMAL_NOT_FIT={0}\u7684[\u9ED8\u8A8D\u503C] \u8207[\u6578\u64DA\u985E\u578B] \u4E0D\u5339\u914D\uFF0C\u8ACB\u6AA2\u67E5\u662F\u5426\u70BA[\u6D6E\u9EDE\u6578\u5B57]\uFF0C\u8ACB\u6AA2\u67E5[\u7CBE\u5EA6]\u662F\u5426\u5339\u914D\uFF01 GSP_VIEWOBJECT_MSGTEMP_VALIDATE_ELEMENT_DEFAULT_DATATYPE_NOT_FIT={0}\u7684[\u9ED8\u8A8D\u503C] \u8207[\u6578\u64DA\u985E\u578B] \u4E0D\u5339\u914D\uFF01 diff --git a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/validate/ViewModelValidator.java b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/validate/ViewModelValidator.java index 7c0523d..37ad6bd 100644 --- a/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/validate/ViewModelValidator.java +++ b/view-object-manager/src/main/java/com/inspur/edp/formserver/vmmanager/validate/ViewModelValidator.java @@ -96,11 +96,14 @@ public class ViewModelValidator { if (dto == null || dto.getContent() == null) { throw new ViewModelException(VoManagerErrorCodes.GSP_VIEWOBJECT_MANAGER_0105,null, vm.getMapping().getTargetMetadataId()); } - be = (GspBusinessEntity) ((dto.getContent() instanceof GspBusinessEntity) ? dto.getContent() - : null); - } - return validateModel() && validateObject() && validateElement() && validateVmActions() - && validateDataExtendInfo() && validateHelpActions(); + be = (GspBusinessEntity) ((dto.getContent() instanceof GspBusinessEntity) ? dto.getContent() : null); + } + return validateModel() + && validateObject() + && validateElement() + && validateVmActions() + && validateDataExtendInfo() + && validateHelpActions(); } @@ -121,9 +124,9 @@ public class ViewModelValidator { { continue; } - if (item.getKeys().size() == 0 || CheckInfoUtil - .checkNull(item.getKeys().get(0).getSourceElement()) || CheckInfoUtil - .checkNull(item.getKeys().get(0).getTargetElement())) { + if (item.getKeys().size() == 0 + || CheckInfoUtil.checkNull(item.getKeys().get(0).getSourceElement()) + || CheckInfoUtil.checkNull(item.getKeys().get(0).getTargetElement())) { sb.append(item.getName()).append(","); } } @@ -151,20 +154,16 @@ public class ViewModelValidator { private String validateModelBasicInfo(GspViewModel model) { StringBuilder sb = new StringBuilder(); if (CheckInfoUtil.checkNull(model.getCode())) { - sb.append( - VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_BASICINFO_CODE_ISNULL, - model.getName())); + sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_BASICINFO_CODE_ISNULL, model.getName())); } else { // 模型Code限制非法字符 if (!ConformToNaminGspecification(model.getCode())) { - sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_BASICINFO_CODE_FORMATE, - model.getName())); + sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_BASICINFO_CODE_FORMATE, model.getName())); sb.append("\n"); } } if (CheckInfoUtil.checkNull(model.getName())) { - sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_BASICINFO_NAME_ISNULL, - model.getCode())); + sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_BASICINFO_NAME_ISNULL,model.getCode())); } return sb.toString(); } @@ -173,8 +172,8 @@ public class ViewModelValidator { * 是否符合命名规范 * 字母数字下划线组成,字母下划线开头 * - * @param text - * @return + * @param text 待检查文本 + * @return 是否符合规范 */ private boolean ConformToNaminGspecification(String text) { String regex = "^[A-Za-z_][A-Za-z_0-9]*$"; @@ -184,18 +183,14 @@ public class ViewModelValidator { } private String validateVarableEntity(GspCommonModel model) { - StringBuilder sb = new StringBuilder(); //validateObjectBasicInfo(model.Variables,sb,model.Name); - sb.append(validateVariables(model)); - return sb.toString(); + return validateVariables(model); } private String validateVariables(GspCommonModel model) { - CommonVariableCollection vars = model.getVariables().getContainElements(); StringBuilder sb = new StringBuilder(); if (vars != null && vars.size() > 0) { - for (IGspCommonField variable : vars) { String errMsgPrefix = VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_VARIABLE_PREFIX, model.getVariables().getName(), variable.getName()); @@ -231,17 +226,17 @@ public class ViewModelValidator { private String validateVarDtms(CommonDtmCollection collection) { //联动计算 ArrayList dtms = (ArrayList) collection.stream() - .map(item -> (CommonOperation) item).collect( - Collectors.toList()); + .map(item -> (CommonOperation) item) + .collect(Collectors.toList()); // CommonDetermination[] dtms = (CommonDetermination[]) collection.toArray(); //①必填项 StringBuilder sb = new StringBuilder(); - sb.append(String.format(validateCommonOperationBasicInfo(dtms))); + sb.append(validateCommonOperationBasicInfo(dtms)); if (sb.length() > 0) { return sb.toString(); } //②编号重复 - sb.append(String.format(validateCommonOperationCodeRepeat(dtms))); + sb.append(validateCommonOperationCodeRepeat(dtms)); return sb.toString(); } @@ -310,7 +305,7 @@ public class ViewModelValidator { ArrayList aObjectList = vm.getAllObjectList(); for (IGspCommonObject aObject : aObjectList) { - java.util.ArrayList allElementList = aObject.getAllElementList(false); + ArrayList allElementList = aObject.getAllElementList(false); if (allElementList != null && allElementList.size() > 0) { //字段[编号][名称][标签]不允许为空 @@ -369,37 +364,34 @@ public class ViewModelValidator { private void validateElementBasicInfo(IGspCommonField element, StringBuilder sb, String errorMessage) { if (CheckInfoUtil.checkNull(element.getCode())) { - sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_CODE_IS_NULL, - errorMessage)).append("\n"); - } else { + sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_CODE_IS_NULL,errorMessage)) + .append("\n"); + } else if (!conformToNaminGspecification(element.getCode())) { // 字段Code限制非法字符 - if (!conformToNaminGspecification(element.getCode())) { - sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_CODE_FORMAT, - errorMessage)).append("\n"); - } + sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_CODE_FORMAT,errorMessage)) + .append("\n"); } if (CheckInfoUtil.checkNull(element.getName())) { - sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_NAME_IS_NULL, - errorMessage)).append("\n"); + sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_NAME_IS_NULL,errorMessage)) + .append("\n"); } - if (CheckInfoUtil.checkNull(element.getLabelID()) || CheckInfoUtil - .checkNull(element.getLabelID().trim())) { - sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_LABEL_IS_NULL, - errorMessage)).append("\n"); + if (CheckInfoUtil.checkNull(element.getLabelID()) || CheckInfoUtil.checkNull(element.getLabelID().trim())) { + sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_LABEL_IS_NULL,errorMessage)) + .append("\n"); } else { // LabelID在表单和报表中用作XML的标签,要限制非法字符 String re = "^[A-Za-z_][A-Za-z_\\d-.]*$"; if (!getRegx(re, element.getLabelID().trim())) { - sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_LABEL_FORMAT, - errorMessage)).append("\n"); + sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_LABEL_FORMAT,errorMessage)) + .append("\n"); } } if (element.getObjectType() == GspElementObjectType.Enum) { if (element.getContainEnumValues().size() == 0) { - sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_ENUM_IS_EMPTY, - errorMessage)).append("\n"); + sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_ENUM_IS_EMPTY,errorMessage)) + .append("\n"); } // 枚举类型字段,校验默认值为枚举编号 @@ -413,14 +405,13 @@ public class ViewModelValidator { } } if (!isEnumKey) { - sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_DEFAULTVALUE_FIT_ENUM, - errorMessage)); + sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_DEFAULTVALUE_FIT_ENUM,errorMessage)); } } // 枚举类型字段,非必填 if (element.getIsRequire()) { - sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_ENUM_REQUIRED_NOT_NO, - errorMessage)).append("\n"); + sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_ENUM_REQUIRED_NOT_NO, errorMessage)) + .append("\n"); } } @@ -428,7 +419,8 @@ public class ViewModelValidator { if (element.getMDataType() == GspElementDataType.Decimal) { if (element.getLength() == 0) { sb.append(VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_ELEMENT_BASIC_DECIMAL_LENGTH_IS_ZERO, - errorMessage)).append("\n"); + errorMessage)) + .append("\n"); } if (element.getPrecision() == 0) { @@ -447,7 +439,7 @@ public class ViewModelValidator { // 默认值类型校验 String message = validateElementDefaultValue(element, errorMessage); if (!StringUtils.isEmpty(message)) { - sb.append(String.format(message)); + sb.append(message); sb.append("\n"); } } @@ -464,8 +456,7 @@ public class ViewModelValidator { private String validateElementDefaultValue(IGspCommonField ele, String errorMessage) { StringBuilder sb = new StringBuilder(); String reInt = "^-?\\d+$"; //判断整数,负值也是整数 - String reDecimalString = String - .format("^(([0-9]+\\.[0-9]{0,%1$s})|([0-9]*\\.[0-9]{0,%1$s})|([1-9][0-9]+)|([0-9]))$", + String reDecimalString = String.format("^(([0-9]+\\.[0-9]{0,%1$s})|([0-9]*\\.[0-9]{0,%1$s})|([1-9][0-9]+)|([0-9]))$", ele.getPrecision()); // 20190523-整型枚举可设置枚举编号为默认值;关联/udt默认值暂不支持; @@ -536,10 +527,9 @@ public class ViewModelValidator { * 结合bizObject检查 */ private void checkWithBeObject(GspViewObject aObject, - java.util.ArrayList allElementList) { + ArrayList allElementList) { // 虚拟对象无映射bizObj - if (aObject.getIsVirtual() - || aObject.getMapping().getSourceType() != GspVoObjectSourceType.BeObject) { + if (aObject.getIsVirtual() || aObject.getMapping().getSourceType() != GspVoObjectSourceType.BeObject) { return; } @@ -548,15 +538,15 @@ public class ViewModelValidator { return; } - IGspCommonObject beObject = be.getAllObjectList().stream().filter( - item -> item.getID().equals(aObject.getMapping().getTargetObjId())) - .findFirst().orElse( - null);//.FirstOrDefault(item => String.equals(item.ID, ((GspViewObject)aObject).getMapping().TargetObjId)); + IGspCommonObject beObject = be.getAllObjectList().stream() + .filter(item -> item.getID().equals(aObject.getMapping().getTargetObjId())) + .findFirst().orElse(null); + //.FirstOrDefault(item => String.equals(item.ID, ((GspViewObject)aObject).getMapping().TargetObjId)); if (beObject == null) { throw new ViewModelException(VoManagerErrorCodes.GSP_VIEWOBJECT_MANAGER_0104, null, aObject.getName(), aObject.getMapping().getTargetObjId()); } - java.util.ArrayList beElementList = beObject.getAllElementList(false); + ArrayList beElementList = beObject.getAllElementList(false); // vm字段长度不得大于映射的be字段长度 for (IGspCommonElement element : allElementList) { @@ -568,21 +558,19 @@ public class ViewModelValidator { continue; } - GspBizEntityElement beEle = (GspBizEntityElement) beElementList.stream().filter( - item -> item.getID() - .equals(((GspViewModelElement) element).getMapping().getTargetObjId())).findFirst() + GspBizEntityElement beEle = (GspBizEntityElement) beElementList.stream() + .filter(item -> item.getID().equals(((GspViewModelElement) element).getMapping().getTargetObjId())) + .findFirst() .orElse(null); if (beEle == null) { - - GspBizEntityElement beEle2 = (GspBizEntityElement) be - .findElementById(((GspViewModelElement) element).getMapping().getTargetObjId()); + GspBizEntityElement beEle2 = (GspBizEntityElement) be.findElementById(((GspViewModelElement) element).getMapping().getTargetObjId()); // 当前字段不是当前bizObj引入,不抛异常 if (beEle2 != null) { continue; } throw new ViewModelException(VoManagerErrorCodes.GSP_VIEWOBJECT_MANAGER_0107,null, aObject.getName(), element.getName(), - ((GspViewModelElement) element).getMapping().getTargetObjectId()); + ((GspViewModelElement) element).getMapping().getTargetObjectId()); } else { if (element.getLength() > beEle.getLength()) { throw new ViewModelException(VoManagerErrorCodes.GSP_VIEWOBJECT_MANAGER_0108,null, @@ -596,10 +584,6 @@ public class ViewModelValidator { } } - ///#endregion - - ///#region 操作 - /** * [操作]视图对象操作 */ @@ -619,7 +603,8 @@ public class ViewModelValidator { if (vmAction.getType() == ViewModelActionType.BEAction) { BizMgrAction mgrAction = (BizMgrAction) mgrActions.stream() .filter(item -> item.getID().equals(vmAction.getMapping().getTargetObjId())) - .findFirst().orElse(null);//Find(item => item.ID == vmAction.Mapping.TargetObjId); + .findFirst() + .orElse(null);//Find(item => item.ID == vmAction.Mapping.TargetObjId); if (mgrAction == null) { throw new ViewModelException(VoManagerErrorCodes.GSP_VIEWOBJECT_MANAGER_0110, null, vmAction.getName(), vmAction.getMapping().getTargetObjId()); @@ -718,24 +703,24 @@ public class ViewModelValidator { return sb.toString(); } - private boolean validateActionsBasicInfo(java.util.ArrayList actions, + private boolean validateActionsBasicInfo(ArrayList actions, String errorMessage, StringBuilder sb) { boolean validateRez = true; //①必填项 - sb.append(String.format(validateOperationBasicInfo(errorMessage, actions))); + sb.append(validateOperationBasicInfo(errorMessage, actions)); if (sb.length() > 0) { throwValidateException(sb.toString()); validateRez = false; } //②编号重复 - sb.append(String.format(validateOperationCodeRepeat(errorMessage, actions))); + sb.append(validateOperationCodeRepeat(errorMessage, actions)); if (sb.length() > 0) { throwValidateException(sb.toString()); validateRez = false; } //③参数及返回值校验 - sb.append(String.format(validateActionParas(errorMessage, actions))); + sb.append(validateActionParas(errorMessage, actions)); if (sb.length() > 0) { throwValidateException(sb.toString()); validateRez = false; @@ -759,13 +744,13 @@ public class ViewModelValidator { } String errorMessage = VMI8nResourceUtil.getMessage(VoResourceKeyNames.VALIDATE_VM_ACTION_PREFIX); //①必填项 - sb.append(String.format(validateOperationBasicInfo(errorMessage, actions))); + sb.append(validateOperationBasicInfo(errorMessage, actions)); if (sb.length() > 0) { throwValidateException(sb.toString()); validateRez = false; } //②编号重复 - sb.append(String.format(validateOperationCodeRepeat(errorMessage, actions))); + sb.append(validateOperationCodeRepeat(errorMessage, actions)); if (sb.length() > 0) { throwValidateException(sb.toString()); validateRez = false; @@ -777,8 +762,7 @@ public class ViewModelValidator { /** * [操作]编号重复 */ - private String validateOperationCodeRepeat(String errorMessage, - java.util.ArrayList operations) { + private String validateOperationCodeRepeat(String errorMessage, ArrayList operations) { String sb = ""; if (CollectionUtils.isEmpty(operations)) { return sb; @@ -797,8 +781,7 @@ public class ViewModelValidator { /** * [操作]编号名称为空 */ - private String validateOperationBasicInfo(String errorMessage, - ArrayList oprs) { + private String validateOperationBasicInfo(String errorMessage, ArrayList oprs) { if (oprs == null || oprs.isEmpty()) { return ""; } @@ -898,13 +881,13 @@ public class ViewModelValidator { * 校验动作参数及返回值 */ private String validateActionParas(String errorMessage, - java.util.ArrayList actions) { + ArrayList actions) { StringBuilder sb = new StringBuilder(); if (!CollectionUtils.isEmpty(actions)) { for (ViewModelAction action : actions) { - sb.append(String.format(validateActionParas(action, errorMessage))); - sb.append(String.format(validateActionReturnValue(action, errorMessage))); - sb.append(String.format(validateActionComponent(action))); + sb.append(validateActionParas(action, errorMessage)); + sb.append(validateActionReturnValue(action, errorMessage)); + sb.append(validateActionComponent(action)); } } return sb.toString(); @@ -965,7 +948,7 @@ public class ViewModelValidator { //参数编号不可重复 if (opr.getParameterCollection() != null && opr.getParameterCollection().getCount() > 0) { - Map codeSet = new HashMap(); + Map codeSet = new HashMap<>(); for (int i = 0; i < opr.getParameterCollection().getCount() - 1; i++) { IViewModelParameter para = opr.getParameterCollection().getItem(i); String originName = codeSet.put(para.getParamCode(), para.getParamName()); -- Gitee