Commit 46f725c3 by 庄冰

提交表单记录接口

parent 11d23aab
......@@ -59,6 +59,7 @@ class Template extends APIBase {
opResult = await this.templatelinkSve.getTemplateAndLinkInfo(pobj);
break;
case "submitFormRecord"://提交表单记录
var a=0;
opResult = await this.formsubmitrecordSve.submitFormRecord(pobj);
break;
default:
......
......@@ -4,13 +4,20 @@
* @param DataTypes
* @returns {Model|void|*}
*/
const record_status = {"1":"未读", "2":"已读", "3":"无效"};
module.exports = (db, DataTypes) => {
return db.define("formsubmitrecord", {
business_code:DataTypes.STRING(100),
template_id: DataTypes.INTEGER(11),//模板id
templatelink_id: DataTypes.INTEGER(11),//模板链接id
form_id: DataTypes.INTEGER(11),//表单id
record_status: DataTypes.STRING(60),//记录状态 1未读 2已读 3无效
form_id: DataTypes.INTEGER(11),//表单id
record_status :{//记录状态 1未读 2已读 3无效
type: DataTypes.STRING(60),
set: function (val) {
this.setDataValue("record_status", val);
this.setDataValue("record_status_name",record_status[val]);
}
},
record_status_name: DataTypes.STRING(60),//记录状态名称
templatelink_snapshot:DataTypes.JSON,//模板链接快照
record_content:DataTypes.JSON,//记录内容
......
......@@ -37,10 +37,10 @@ class FormsubmitrecordService extends ServiceBase {
if(!linkInfo.template_id){
return system.getResultFail(-301,"链接模板信息错误")
}
var templateinfo = await this.templateinfoDao.model.findOne{
var templateinfo = await this.templateinfoDao.model.findOne({
where:{id:linkInfo.template_id},raw:true,
attributes:["id","business_code"]
};
});
if(!templateinfo || !templateinfo.id){
return system.getResultFail(-500,"未知模板信息");
}
......
......@@ -10,6 +10,7 @@
1. [获取表单列表](#getFormList)
1. [获取文件上传配置信息](#getOssConfig)
1. [根据链接参数获取模板链接信息](#getTemplateAndLinkInfo)
1. [提交表单记录](#submitFormRecord)
## **<a name="createTemplate"> 创建模板</a>**
[返回到目录](#menu)
......@@ -513,6 +514,7 @@
}
```
## **<a name="getTemplateAndLinkInfo"> 根据链接参数获取模板链接信息</a>**
[返回到目录](#menu)
##### URL
......@@ -595,3 +597,36 @@
}
```
## **<a name="submitFormRecord"> 提交表单记录</a>**
[返回到目录](#menu)
##### URL
[/api/action/template/springBoard]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 渠道执行的类型 actionType:submitFormRecord
``` javascript
{
"actionType": "submitFormRecord",
"actionBody": {
"link_code": "TL202008141607VdD4le",
"form_id": 79,
"contact_mobile": "13075556693",
"contact_name": "1234",
"IT202008171022jen9Ar": "test",
"IT202008171023jxT06N": "10"
}
}
```
#### 返回结果
```javascript
{
"status": 0,
"msg": "success",
"requestId": "77d3b071053c44a9b5322bb01b0a27aa"
}
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment