@@ -95,6 +95,9 @@ class YuthonWillTask(http.Controller):
|
||||
field_string = fields_info[field_name].get('string', field_name)
|
||||
if field_string in other_fields_list:
|
||||
continue
|
||||
if isinstance(field_value, float):
|
||||
# 使用格式化字符串保留两位小数
|
||||
field_value = f"{field_value:.2f}"
|
||||
data[field_string] = field_value
|
||||
return json.dumps({'data': data, 'code': 200, 'message': ''})
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ class WeComApps(models.Model):
|
||||
"btntxt": btntxt
|
||||
},
|
||||
}
|
||||
elif category in ['task', 'att_ok']:
|
||||
elif category in ['task', 'att_ok', 'salary']:
|
||||
data = {
|
||||
'touser': user_id,
|
||||
'msgtype': 'textcard',
|
||||
|
||||
@@ -29,6 +29,7 @@ class WecomAppsConfig(models.Model):
|
||||
('att', '出勤类型'),
|
||||
('task', '日程类型'),
|
||||
('att_ok', '考勤确认类型'),
|
||||
('salary', '薪资消息通知'),
|
||||
], default="default")
|
||||
wecom_apps_id = fields.Many2one("wecom.apps", string="企业微信的应用")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user