diff --git a/admin/app/controllers/fdd/rule/rule.controller.js b/admin/app/controllers/fdd/rule/rule.controller.js index 527c9b36..b5278d4a 100644 --- a/admin/app/controllers/fdd/rule/rule.controller.js +++ b/admin/app/controllers/fdd/rule/rule.controller.js @@ -3,12 +3,10 @@ app.controller('RuleController', function($scope, $common, $uibModal, $translate, RuleService, toaster, SweetAlert) { $scope.initExpression = [{ - "spaceid": 1, + "sample_object_id": 1, "limit": 1000.000, "recipients": [{ "user_id": "1" - }, { - "user_id": "2" }] }]; diff --git a/admin/views/fdd/rule.html b/admin/views/fdd/rule.html index 9b74e43c..5f01acb2 100644 --- a/admin/views/fdd/rule.html +++ b/admin/views/fdd/rule.html @@ -11,8 +11,8 @@ {{'SETTING.ID' | translate}} {{'SETTING.NAME' | translate}} - {{'FDD.FDD_CODE' | translate}} {{'FDD.CATEGORY' | translate}} + {{'FDD.FDD_CODE' | translate}} {{'FDD.PRIORITY' | translate}} {{'FDD.CHANNEL' | translate}} {{'FDD.IS_ENABLED' | translate}} @@ -28,8 +28,8 @@ {{ rule.id }} {{ rule.name }} - {{ rule.fdd_code }} {{ rule.category }} + {{ rule.fdd_code }} {{ rule.priority }} {{ rule.channel }} {{ rule.is_enabled==true?'SETTING.ON':'SETTING.OFF' | translate}} diff --git a/admin/views/fdd/rule.model.html b/admin/views/fdd/rule.model.html index 361bde1d..e34da038 100644 --- a/admin/views/fdd/rule.model.html +++ b/admin/views/fdd/rule.model.html @@ -6,15 +6,33 @@
-
+
{{'SETTING.INPUT_NAME' | translate}}
+
+
+ +
+ - +
+
+
-
+
- - - - - - - - - - -
- - -
-
-
-
+
diff --git a/myems-api/core/rule.py b/myems-api/core/rule.py index e1c64102..0667cf10 100644 --- a/myems-api/core/rule.py +++ b/myems-api/core/rule.py @@ -143,13 +143,13 @@ class RuleCollection: description='API.RULE_NAME_IS_ALREADY_IN_USE') add_row = (" INSERT INTO tbl_rules " - " (name, uuid, fdd_code, category, priority, " + " (name, uuid, category, fdd_code, priority, " " channel, expression, message_template, is_enabled) " " VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s) ") cursor.execute(add_row, (name, str(uuid.uuid4()), - fdd_code, category, + fdd_code, priority, channel, expression, @@ -183,7 +183,7 @@ class RuleItem: cursor = cnx.cursor(dictionary=True) query = (" SELECT id, name, uuid, " - " fdd_code, category, priority, " + " category, fdd_code, priority, " " channel, expression, message_template, " " is_enabled, last_run_datetime_utc, next_run_datetime_utc " " FROM tbl_rules " @@ -204,7 +204,7 @@ class RuleItem: next_run_datetime = row['next_run_datetime_utc'].replace(tzinfo=timezone.utc).timestamp() * 1000 result = {"id": row['id'], "name": row['name'], "uuid": row['uuid'], - "fdd_code": row['fdd_code'], "category": row['category'], "priority": row['priority'], + "category": row['category'], "fdd_code": row['fdd_code'], "priority": row['priority'], "channel": row['channel'], "expression": row['expression'], "message_template": row['message_template'].replace("
", ""), "is_enabled": bool(row['is_enabled']), @@ -342,13 +342,13 @@ class RuleItem: description='API.RULE_NAME_IS_ALREADY_IN_USE') update_row = (" UPDATE tbl_rules " - " SET name = %s, fdd_code = %s, category = %s, priority = %s, " + " SET name = %s, category = %s, fdd_code = %s, priority = %s, " " channel = %s, expression = %s, message_template = %s, " " is_enabled = %s " " WHERE id = %s ") cursor.execute(update_row, (name, - fdd_code, category, + fdd_code, priority, channel, expression,