Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
549a6a39
Commit
549a6a39
authored
Aug 11, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gsb-marketplat' of gitlab.gongsibao.com:jiangyong/zhichan into gsb-marketplat
parents
3b4ab9c2
ff5c30e0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
355 additions
and
83 deletions
+355
-83
gsb-marketplat/app/base/api/impl/action/template.js
+3
-0
gsb-marketplat/app/base/api/impl/action/templateconfig.js
+19
-1
gsb-marketplat/app/base/controller/impl/configmag/formitemCtl.js
+16
-3
gsb-marketplat/app/base/controller/impl/templatemag/templateinfoCtl.js
+11
-5
gsb-marketplat/app/base/controller/impl/templatemag/templatelinkCtl.js
+33
-0
gsb-marketplat/app/base/db/impl/common/imginfoDao.js
+14
-0
gsb-marketplat/app/base/db/impl/configmag/forminfoDao.js
+0
-0
gsb-marketplat/app/base/db/impl/configmag/formitemDao.js
+0
-0
gsb-marketplat/app/base/db/impl/configmag/launchchannelDao.js
+8
-0
gsb-marketplat/app/base/db/impl/configmag/launchtypeDao.js
+8
-0
gsb-marketplat/app/base/db/impl/configmag/marketingsubjectDao.js
+8
-0
gsb-marketplat/app/base/db/models/configmag/businesstype.js
+0
-0
gsb-marketplat/app/base/db/models/configmag/forminfo.js
+0
-0
gsb-marketplat/app/base/db/models/configmag/formitem.js
+2
-2
gsb-marketplat/app/base/db/models/configmag/formsubmitrecord.js
+18
-31
gsb-marketplat/app/base/db/models/configmag/imginfo.js
+1
-0
gsb-marketplat/app/base/db/models/configmag/launchchannel.js
+0
-0
gsb-marketplat/app/base/db/models/configmag/launchtype.js
+0
-0
gsb-marketplat/app/base/db/models/configmag/maininfo.js
+0
-0
gsb-marketplat/app/base/db/models/configmag/marketingsubject.js
+33
-0
gsb-marketplat/app/base/db/models/configmag/puttype.js
+0
-0
gsb-marketplat/app/base/service/impl/configmag/forminfoSve.js
+15
-23
gsb-marketplat/app/base/service/impl/configmag/formitemSve.js
+85
-0
gsb-marketplat/app/base/service/impl/configmag/formsubmitrecordSve.js
+6
-6
gsb-marketplat/app/base/service/impl/configmag/imginfoSve.js
+14
-2
gsb-marketplat/app/base/service/impl/configmag/launchchannelSve.js
+1
-1
gsb-marketplat/app/base/service/impl/configmag/maininfoSve.js
+1
-1
gsb-marketplat/app/base/service/impl/configmag/puttypeSve.js
+1
-1
gsb-marketplat/app/base/service/impl/template/templateconfigSve.js
+19
-0
gsb-marketplat/app/base/service/impl/template/templateinfoSve.js
+4
-6
gsb-marketplat/app/base/service/impl/template/templatelinkSve.js
+35
-1
gsb-marketplat/app/front/entry/public/apidoc/customer/template.md
+0
-0
No files found.
gsb-marketplat/app/base/api/impl/action/template.js
View file @
549a6a39
...
...
@@ -39,6 +39,9 @@ class Template extends APIBase {
case
"editTemplateContent"
:
//修改模板内容
opResult
=
await
this
.
templateinfoSve
.
editTemplateContent
(
pobj
);
break
;
// case "getLinkConfigParams"://获取模板链接配置参数
// opResult = await this.templatelinkSve.getLinkConfigParams(pobj);
// break;
// case "updateSwitchStatus"://修改模板启用状态
// opResult = await this.templateinfoSve.updateSwitchStatus(pobj);
// break;
...
...
gsb-marketplat/app/base/api/impl/action/templateconfig.js
View file @
549a6a39
const
APIBase
=
require
(
"../../api.base"
);
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
var
db
=
system
.
getObject
(
"db.common.connection"
).
getCon
();
/**
* 用户端调用订单相关接口
*/
class
Templateconfig
extends
APIBase
{
constructor
()
{
super
();
// this.templateinfoSve = system.getObject("service.template.templateinfoSve");
this
.
imginfoSve
=
system
.
getObject
(
"service.configmag.imginfoSve"
);
this
.
forminfoSve
=
system
.
getObject
(
"service.configmag.forminfoSve"
)
this
.
templateinfoSve
=
system
.
getObject
(
"service.template.templateinfoSve.js"
);
// this.templatelinkSve = system.getObject("service.template.templatelinkSve");
}
/**
...
...
@@ -32,6 +37,19 @@ class Templateconfig extends APIBase {
case
"test"
:
//测试
opResult
=
system
.
getResultSuccess
(
"测试接口"
);
break
;
case
"getImgList"
:
// 查询图片
opResult
=
await
this
.
imginfoSve
.
getImgList
(
pobj
.
actionBody
);
break
;
case
"createImginfo"
:
// 添加图片
opResult
=
await
this
.
imginfoSve
.
createImginfo
(
pobj
.
actionBody
);
break
;
case
"getTemplateList"
:
// 获取模板列表
opResult
=
await
this
.
templateinfoSve
.
getTemplateList
(
pobj
.
actionBody
);
// opResult = await this.templateinfoSve.findByCompanyId(pobj.actionBody);
break
;
case
"getFormList"
:
// 获取表单列表
opResult
=
await
this
.
forminfoSve
.
getFormList
(
pobj
.
actionBody
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
gsb-marketplat/app/base/controller/impl/configmag/formitemCtl.js
View file @
549a6a39
...
...
@@ -14,9 +14,22 @@ class FormItemCtl extends CtlBase {
* @param pobj
* @returns {Promise<void>}
*/
// async create(pobj){
//
// }
async
create
(
pobj
){
let
result
=
this
.
formitemSve
.
createItem
(
pobj
);
return
result
;
}
/**
* 重写删除
* @param pobj
* @returns {Promise<void>}
*/
async
delete
(
pobj
){
let
result
=
this
.
formitemSve
.
deleteItem
(
pobj
);
return
result
;
}
}
module
.
exports
=
FormItemCtl
;
gsb-marketplat/app/base/controller/impl/templatemag/templateinfoCtl.js
View file @
549a6a39
...
...
@@ -3,12 +3,18 @@ var settings = require("../../../../config/settings");
const
CtlBase
=
require
(
"../../ctl.base"
);
var
cacheBaseComp
=
null
;
class
FormI
nfoCtl
extends
CtlBase
{
class
Templatei
nfoCtl
extends
CtlBase
{
constructor
()
{
super
(
"templateinfomag"
,
CtlBase
.
getServiceName
(
FormI
nfoCtl
));
super
(
"templateinfomag"
,
CtlBase
.
getServiceName
(
Templatei
nfoCtl
));
this
.
templateinfoSve
=
system
.
getObject
(
'service.template.templateinfoSve'
);
}
/**
* 创建模板
* @param {*} pobj
*/
async
createTemplate
(
pobj
){
return
this
.
templateinfoSve
.
createTemplate
(
pobj
);
}
/**
* 重写查询方法
* @param pobj
...
...
@@ -25,9 +31,9 @@ class FormInfoCtl extends CtlBase {
* @returns {Promise<void>}
*/
async
create
(
pobj
){
let
result
=
await
this
.
templateinfoSve
.
createTemplate
(
pobj
);
let
result
=
await
this
.
templateinfoSve
.
editTemplateTdk
(
pobj
);
return
result
;
}
}
module
.
exports
=
FormI
nfoCtl
;
module
.
exports
=
Templatei
nfoCtl
;
gsb-marketplat/app/base/controller/impl/templatemag/templatelinkCtl.js
0 → 100644
View file @
549a6a39
var
system
=
require
(
"../../../system"
)
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
var
cacheBaseComp
=
null
;
class
TemplatelinkCtl
extends
CtlBase
{
constructor
()
{
super
(
"templateinfomag"
,
CtlBase
.
getServiceName
(
TemplatelinkCtl
));
this
.
templatelinkSve
=
system
.
getObject
(
'service.template.templatelinkSve'
);
}
/**
* 重写查询方法
* @param pobj
* @returns {Promise<{msg: string, data: *, bizmsg: string, status: number}>}
*/
async
findAndCountAll
(
pobj
)
{
let
result
=
await
this
.
templatelinkSve
.
findAndCountAll
(
pobj
);
return
result
;
}
/**
* 重写保存方法
* @param pobj
* @returns {Promise<void>}
*/
async
create
(
pobj
){
let
result
=
await
this
.
templatelinkSve
.
createTemplateLink
(
pobj
);
return
result
;
}
}
module
.
exports
=
TemplatelinkCtl
;
gsb-marketplat/app/base/db/impl/common/imginfoDao.js
0 → 100644
View file @
549a6a39
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
ImginfoDao
extends
Dao
{
constructor
(){
super
(
Dao
.
getModelName
(
ImginfoDao
));
}
// extraWhere(obj,w,qc,linkAttrs){
// w["company_id"]=obj.company_id;
// return w;
// }
}
module
.
exports
=
ImginfoDao
;
\ No newline at end of file
gsb-marketplat/app/base/db/impl/
form
/forminfoDao.js
→
gsb-marketplat/app/base/db/impl/
configmag
/forminfoDao.js
View file @
549a6a39
File moved
gsb-marketplat/app/base/db/impl/
form
/formitemDao.js
→
gsb-marketplat/app/base/db/impl/
configmag
/formitemDao.js
View file @
549a6a39
File moved
gsb-marketplat/app/base/db/impl/configmag/launchchannelDao.js
0 → 100644
View file @
549a6a39
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
LaunchchannelDao
extends
Dao
{
constructor
(){
super
(
Dao
.
getModelName
(
LaunchchannelDao
));
}
}
module
.
exports
=
LaunchchannelDao
;
gsb-marketplat/app/base/db/impl/configmag/launchtypeDao.js
0 → 100644
View file @
549a6a39
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
LaunchtypeDao
extends
Dao
{
constructor
(){
super
(
Dao
.
getModelName
(
LaunchtypeDao
));
}
}
module
.
exports
=
LaunchtypeDao
;
gsb-marketplat/app/base/db/impl/configmag/marketingsubjectDao.js
0 → 100644
View file @
549a6a39
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
class
MarketingsubjectDao
extends
Dao
{
constructor
(){
super
(
Dao
.
getModelName
(
MarketingsubjectDao
));
}
}
module
.
exports
=
MarketingsubjectDao
;
gsb-marketplat/app/base/db/models/
marketconfi
g/businesstype.js
→
gsb-marketplat/app/base/db/models/
configma
g/businesstype.js
View file @
549a6a39
File moved
gsb-marketplat/app/base/db/models/
marketconfi
g/forminfo.js
→
gsb-marketplat/app/base/db/models/
configma
g/forminfo.js
View file @
549a6a39
File moved
gsb-marketplat/app/base/db/models/
marketconfi
g/formitem.js
→
gsb-marketplat/app/base/db/models/
configma
g/formitem.js
View file @
549a6a39
...
...
@@ -25,10 +25,10 @@ module.exports = (db, DataTypes) => {
type
:
DataTypes
.
JSON
},
is_enabled
:
{
//显示状态
type
:
DataTypes
.
INTEGER
type
:
DataTypes
.
BOOLEAN
},
is_required
:
{
//是否必填
type
:
DataTypes
.
INTEGER
type
:
DataTypes
.
BOOLEAN
},
sequence
:
{
//次序
type
:
DataTypes
.
INTEGER
...
...
gsb-marketplat/app/base/db/models/
marketconfi
g/formsubmitrecord.js
→
gsb-marketplat/app/base/db/models/
configma
g/formsubmitrecord.js
View file @
549a6a39
...
...
@@ -4,38 +4,25 @@
* @param DataTypes
* @returns {Model|void|*}
*/
const
record_status
=
{
"1"
:
"未读"
,
"2"
:
"已读"
,
"3"
:
"无效"
};
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"formsubmitrecord"
,
{
form_id
:
DataTypes
.
INTEGER
(
11
),
//表单id
template_id
:
DataTypes
.
INTEGER
(
11
),
//表单id
templatelink_id
:
DataTypes
.
INTEGER
(
11
),
//表单id
record_status
:{
//记录状态 1未读 2已读 3无效
type
:
DataTypes
.
STRING
,
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
,
form_snapshot
:
DataTypes
.
JSON
,
record_content
:
DataTypes
.
JSON
,
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updated_at
:
true
,
tableName
:
'c_form_submit_record'
,
validate
:
{
},
indexes
:
[
]
return
db
.
define
(
"formsubmitrecord"
,
{
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无效
record_status_name
:
DataTypes
.
STRING
(
60
),
//记录状态名称
templatelink_snapshot
:
DataTypes
.
JSON
,
//模板链接快照
record_content
:
DataTypes
.
JSON
,
//记录内容
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
timestamps
:
true
,
updated_at
:
true
,
tableName
:
'c_form_submit_record'
,
validate
:
{},
indexes
:
[]
});
}
gsb-marketplat/app/base/db/models/
marketconfi
g/imginfo.js
→
gsb-marketplat/app/base/db/models/
configma
g/imginfo.js
View file @
549a6a39
...
...
@@ -14,6 +14,7 @@ module.exports = (db, DataTypes) => {
allowNull
:
false
,
type
:
DataTypes
.
STRING
},
pic_size
:
DataTypes
.
STRING
,
company_id
:
{
allowNull
:
false
,
type
:
DataTypes
.
INTEGER
...
...
gsb-marketplat/app/base/db/models/
marketconfi
g/launchchannel.js
→
gsb-marketplat/app/base/db/models/
configma
g/launchchannel.js
View file @
549a6a39
File moved
gsb-marketplat/app/base/db/models/
marketconfi
g/launchtype.js
→
gsb-marketplat/app/base/db/models/
configma
g/launchtype.js
View file @
549a6a39
File moved
gsb-marketplat/app/base/db/models/
marketconfi
g/maininfo.js
→
gsb-marketplat/app/base/db/models/
configma
g/maininfo.js
View file @
549a6a39
File moved
gsb-marketplat/app/base/db/models/configmag/marketingsubject.js
0 → 100644
View file @
549a6a39
module
.
exports
=
(
sequelize
,
DataType
)
=>
{
return
sequelize
.
define
(
"marketingsubject"
,
{
code
:
DataType
.
STRING
(
100
),
name
:
DataType
.
STRING
(
100
),
notes
:
DataType
.
STRING
(
255
),
user_name
:
DataType
.
STRING
(
100
),
user_id
:
DataType
.
STRING
(
100
),
company_id
:
DataType
.
INTEGER
,
},
{
// 不添加时间戳属性 (updatedAt, createdAt)
timestamps
:
true
,
// 不删除数据库条目,但将新添加的属性deletedAt设置为当前日期(删除完成时)。
// paranoid 只有在启用时间戳时才能工作
paranoid
:
true
,
// 将自动设置所有属性的字段选项为下划线命名方式。
// 不会覆盖已经定义的字段选项
underscored
:
true
,
// 禁用修改表名; 默认情况下,sequelize将自动将所有传递的模型名称(define的第一个参数)转换为复数。 如果你不想这样,请设置以下内容
freezeTableName
:
true
,
// 定义表的名称
tableName
:
'c_marketing_subject'
,
// 启用乐观锁定。 启用时,sequelize将向模型添加版本计数属性,
// 并在保存过时的实例时引发OptimisticLockingError错误。
// 设置为true或具有要用于启用的属性名称的字符串。
version
:
true
});
};
\ No newline at end of file
gsb-marketplat/app/base/db/models/
marketconfi
g/puttype.js
→
gsb-marketplat/app/base/db/models/
configma
g/puttype.js
View file @
549a6a39
File moved
gsb-marketplat/app/base/service/impl/configmag/forminfoSve.js
View file @
549a6a39
...
...
@@ -26,31 +26,19 @@ class ForminfoService extends ServiceBase {
* @returns {Promise<void>}
*/
async
createForm
(
pobj
){
console
.
log
(
pobj
)
if
(
!
pobj
.
name
){
return
system
.
getResult
(
null
,
'name can not be empty'
);
}
if
(
!
pobj
.
form_describe
){
return
system
.
getResult
(
null
,
'form_describe can not be empty'
);
}
let
items
=
''
;
// if(!pobj.form_item){
// return 'form_item can not be empty';
// }
const
formItem
=
this
.
composeItem
(
items
);
if
(
formItem
.
status
!=
0
){
return
formItem
;
}
let
code
=
await
this
.
getBusUid
(
"fm"
)
let
formData
=
{
name
:
pobj
.
name
,
code
:
code
,
form_describe
:
pobj
.
form_describe
,
form_item
:
formItem
.
data
,
user_id
:
pobj
.
user_id
,
user_name
:
pobj
.
username
}
let
result
=
await
this
.
create
(
formData
);
return
system
.
getResul
(
result
);
pobj
.
code
=
code
;
pobj
.
user_id
=
pobj
.
userid
;
pobj
.
user_name
=
pobj
.
username
;
let
result
=
await
this
.
create
(
pobj
)
return
system
.
getResult
(
result
);
}
/**
*
...
...
@@ -58,13 +46,17 @@ class ForminfoService extends ServiceBase {
* @returns {Promise<void>}
*/
async
updateForm
(
pobj
)
{
return
null
;
let
upData
=
{
name
:
pobj
.
name
,
form_describe
:
pobj
.
form_describe
}
let
result
=
await
this
.
updateByWhere
(
upData
,{
id
:
pobj
.
id
})
return
system
.
getResult
(
result
);
}
//表单项 数据重组
async
composeItem
(
obj
){
return
system
.
getResult
Success
(
);
async
getFormList
(
pobj
)
{
let
res
=
await
this
.
dao
.
findAndCountAll
(
pobj
);
return
system
.
getResult
(
res
);
}
}
...
...
gsb-marketplat/app/base/service/impl/configmag/formitemSve.js
0 → 100644
View file @
549a6a39
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
FormitemService
extends
ServiceBase
{
constructor
()
{
super
(
"configmag"
,
ServiceBase
.
getDaoName
(
FormitemService
));
this
.
forminfoSve
=
system
.
getObject
(
"service.configmag.forminfoSve"
);
}
/**
* 创建表单项
* @param pobj
* @returns {Promise<void>}
*/
async
createItem
(
pobj
)
{
let
code
=
await
this
.
getBusUid
(
'it'
);
pobj
.
item_type_name
=
pobj
.
item_type_name
;
pobj
.
code
=
code
;
//获取表单的表单项
let
form
=
await
this
.
forminfoSve
.
findOne
({
id
:
pobj
.
form_id
},[
'form_items'
]);
if
(
!
form
){
return
system
.
getResult
(
null
,
'获取订单信息失败'
);
}
let
form_items
=
form
.
form_items
?
form
.
form_items
+
"、"
+
pobj
.
item_type_name
:
pobj
.
item_type_name
;
//修改表单项字段
this
.
forminfoSve
.
updateByWhere
({
form_items
:
form_items
},{
id
:
pobj
.
form_id
});
//保存表单项
let
result
=
await
this
.
create
(
pobj
);
return
system
.
getResult
(
result
)
}
/**
* 表单项删除
* @param pobj
* @returns {Promise<void>}
*/
async
deleteItem
(
pobj
){
let
item
=
await
this
.
findOne
({
id
:
pobj
.
id
},[
'form_id'
,
'item_type_name'
]);
if
(
!
item
){
return
system
.
getResult
(
null
,
'获取表单项失败'
);
}
let
form
=
await
this
.
forminfoSve
.
findOne
({
id
:
item
.
form_id
},[
'form_items'
]);
if
(
!
form
){
return
system
.
getResult
(
null
,
'获取表单失败'
);
}
let
form_items
=
''
;
if
(
form
.
form_items
){
form_items
=
form
.
form_items
.
replace
(
'、'
+
item
.
item_type_name
,
''
);
}
this
.
forminfoSve
.
updateByWhere
({
form_items
:
form_items
},{
id
:
item
.
form_id
});
let
result
=
await
this
.
delete
(
pobj
);
return
system
.
getResult
(
result
);
}
/**
* 修改表表单项
* @param pobj
* @returns {Promise<void>}
*/
async
updateItem
(
pobj
)
{
let
upResult
=
await
this
.
update
(
pobj
);
return
system
.
getResult
(
upResult
);
}
//根据类型获取类型名称
async
getTypeName
(
type
)
{
let
data
=
{
"phone"
:
"手机号"
,
"singleBtn"
:
"单选按钮"
,
"multipleBtn"
:
"多选按钮"
,
"downOptions"
:
"下拉选项"
,
"singleText"
:
"单行文本"
,
"multipleText"
:
"多行文本"
,
"dateTime"
:
"日期"
,
"area"
:
"省市"
}
return
data
[
type
];
}
}
module
.
exports
=
FormitemService
;
\ No newline at end of file
gsb-marketplat/app/base/service/impl/configmag/formsubmitrecordSve.js
View file @
549a6a39
...
...
@@ -2,13 +2,13 @@ const system = require("../../../system");
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
Form
info
Service
extends
ServiceBase
{
class
Form
submitrecord
Service
extends
ServiceBase
{
constructor
()
{
super
(
"configmag"
,
ServiceBase
.
getDaoName
(
Form
info
Service
));
super
(
"configmag"
,
ServiceBase
.
getDaoName
(
Form
submitrecord
Service
));
this
.
templateinfoDao
=
system
.
getObject
(
"db.template.templateinfoDao"
);
this
.
templatelinkDao
=
system
.
getObject
(
"db.template.templatelinkDao"
);
this
.
forminfoDao
=
system
.
getObject
(
"db.
form
.forminfoDao"
);
this
.
formitemDao
=
system
.
getObject
(
"db.
form
.formitemDao"
);
this
.
forminfoDao
=
system
.
getObject
(
"db.
configmag
.forminfoDao"
);
this
.
formitemDao
=
system
.
getObject
(
"db.
configmag
.formitemDao"
);
}
/**
...
...
@@ -129,4 +129,4 @@ class ForminfoService extends ServiceBase {
}
}
module
.
exports
=
ForminfoService
;
\ No newline at end of file
module
.
exports
=
FormsubmitrecordService
;
\ No newline at end of file
gsb-marketplat/app/base/service/impl/configmag/imginfoSve.js
View file @
549a6a39
...
...
@@ -3,9 +3,21 @@ const ServiceBase = require("../../sve.base");
const
settings
=
require
(
"../../../../config/settings"
);
class
ImginfoService
extends
ServiceBase
{
constructor
()
{
super
(
"common"
,
ServiceBase
.
getDaoName
(
ImginfoService
));
super
(
"configmag"
,
ServiceBase
.
getDaoName
(
ImginfoService
));
}
async
getImgList
(
pobj
)
{
let
res
=
await
this
.
dao
.
findAndCountAll
(
pobj
);
return
system
.
getResultSuccess
(
res
);
}
async
createImginfo
(
pobj
)
{
let
code
=
await
this
.
getBusUid
(
"img"
);
pobj
.
imginfo
.
code
=
code
;
if
(
pobj
.
imginfo
.
company_id
===
undefined
)
{
pobj
.
imginfo
.
company_id
=
10
;
}
let
res
=
await
this
.
dao
.
create
(
pobj
.
imginfo
);
return
system
.
getResultSuccess
(
res
);
}
async
create
(
pobj
){
var
code
=
await
this
.
getBusUid
(
"img"
);
pobj
.
code
=
code
;
...
...
gsb-marketplat/app/base/service/impl/configmag/launchchannelSve.js
View file @
549a6a39
...
...
@@ -4,7 +4,7 @@ const settings = require("../../../../config/settings");
class
LaunchchannelService
extends
ServiceBase
{
constructor
()
{
super
(
"co
mmon
"
,
ServiceBase
.
getDaoName
(
LaunchchannelService
));
super
(
"co
nfigmag
"
,
ServiceBase
.
getDaoName
(
LaunchchannelService
));
}
/**
...
...
gsb-marketplat/app/base/service/impl/configmag/maininfoSve.js
View file @
549a6a39
...
...
@@ -3,7 +3,7 @@ const ServiceBase = require("../../sve.base");
const
settings
=
require
(
"../../../../config/settings"
);
class
MaininfoService
extends
ServiceBase
{
constructor
()
{
super
(
"co
mmon
"
,
ServiceBase
.
getDaoName
(
MaininfoService
));
super
(
"co
nfigmag
"
,
ServiceBase
.
getDaoName
(
MaininfoService
));
}
async
create
(
pobj
){
...
...
gsb-marketplat/app/base/service/impl/configmag/puttypeSve.js
View file @
549a6a39
...
...
@@ -3,7 +3,7 @@ const ServiceBase = require("../../sve.base");
const
settings
=
require
(
"../../../../config/settings"
);
class
PuttypeService
extends
ServiceBase
{
constructor
()
{
super
(
"co
mmon
"
,
ServiceBase
.
getDaoName
(
PuttypeService
));
super
(
"co
nfigmag
"
,
ServiceBase
.
getDaoName
(
PuttypeService
));
}
async
create
(
pobj
){
...
...
gsb-marketplat/app/base/service/impl/template/templateconfigSve.js
0 → 100644
View file @
549a6a39
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../sve.base"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
System
=
require
(
"../../../system"
);
class
TemplateconfigService
extends
ServiceBase
{
constructor
()
{
super
(
"template"
,
ServiceBase
.
getDaoName
(
TemplateconfigService
));
}
async
findAndCountAll
(
obj
)
{
console
.
log
(
JSON
.
stringify
(
obj
));
let
res
=
await
this
.
dao
.
findAndCountAll
(
obj
);
return
System
.
getResultSuccess
(
res
);
}
}
module
.
exports
=
TemplateconfigService
;
\ No newline at end of file
gsb-marketplat/app/base/service/impl/template/templateinfoSve.js
View file @
549a6a39
...
...
@@ -19,14 +19,13 @@ class TemplateinfoService extends ServiceBase {
*/
async
createTemplate
(
pobj
){
var
ab
=
{};
var
xctx
=
pobj
.
xctx
;
var
code
=
await
this
.
getBusUid
(
"mt"
);
//自动生成模板编码
var
name
=
"营销模板"
;
//模板名称
ab
.
code
=
code
;
ab
.
name
=
name
;
ab
.
user_id
=
xctx
.
cred
id
;
ab
.
user_name
=
xctx
.
username
;
ab
.
company_id
=
xctx
.
company
id
;
ab
.
user_id
=
pobj
.
user
id
;
ab
.
user_name
=
pobj
.
username
;
ab
.
company_id
=
pobj
.
company_
id
;
ab
.
is_enabled
=
0
;
var
res
=
await
this
.
create
(
ab
);
return
system
.
getResultSuccess
(
res
);
...
...
@@ -112,9 +111,8 @@ class TemplateinfoService extends ServiceBase {
* @param {*} pobj
*/
async
editTemplateTdk
(
pobj
){
var
ab
=
pobj
.
actionBody
;
var
ab
=
pobj
;
var
updateObj
=
{};
var
xctx
=
pobj
.
xctx
;
if
(
!
ab
){
return
system
.
getResultFail
(
-
100
,
"参数错误"
);
}
...
...
gsb-marketplat/app/base/service/impl/template/templatelinkSve.js
View file @
549a6a39
...
...
@@ -7,8 +7,42 @@ class TemplatelinkService extends ServiceBase {
this
.
templateLinkUrl
=
settings
.
templateLinkUrl
();
this
.
templateinfoDao
=
system
.
getObject
(
"db.template.templateinfoDao"
);
this
.
browsingrecordsDao
=
system
.
getObject
(
"db.template.browsingrecordsDao"
);
this
.
launchchannelDao
=
system
.
getObject
(
"db.configmag.launchchannelDao"
);
this
.
launchtypeDao
=
system
.
getObject
(
"db.configmag.launchtypeDao"
);
this
.
marketingsubjectDao
=
system
.
getObject
(
"db.configmag.marketingsubjectDao"
);
}
/**
* 获取模板链接配置参数
* @param {*} pobj
*/
async
getLinkConfigParams
(
pobj
){
var
ab
=
pobj
.
actionBody
;
var
xctx
=
pobj
.
xctx
;
var
company_id
=
xctx
.
companyid
;
var
whereObj
=
{
company_id
:
company_id
};
//渠道主体
var
launchChannelList
=
await
this
.
launchchannelDao
.
model
.
findAll
({
attributes
:[
"id"
,
"code"
,
"name"
],
where
:
whereObj
,
raw
:
true
});
//业务参数
//投放方式
var
launchTypeList
=
await
this
.
launchtypeDao
.
model
.
findAll
({
attributes
:[
"id"
,
"code"
,
"name"
],
where
:
whereObj
,
raw
:
true
});
//营销主体
var
marketingSubjectList
=
await
this
.
marketingsubjectDao
.
model
.
findAll
({
attributes
:[
"id"
,
"code"
,
"name"
],
where
:
whereObj
,
raw
:
true
});
var
res
=
{
launchChannelList
:
launchChannelList
,
launchTypeList
:
launchTypeList
,
marketingSubjectList
:
marketingSubjectList
};
return
system
.
getResultSuccess
(
res
);
}
/**
* 链接列表
* @param {*} obj
*/
async
findAndCountAll
(
obj
){
var
res
=
await
this
.
dao
.
findAndCountAll
(
obj
);
return
system
.
getResultSuccess
(
res
);
...
...
gsb-marketplat/app/front/entry/public/apidoc/customer/template.md
View file @
549a6a39
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment