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
988a8dc9
Commit
988a8dc9
authored
Aug 10, 2020
by
任晓松
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
f533f3f2
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
157 additions
and
53 deletions
+157
-53
gsb-marketplat/app/base/controller/impl/configmag/formitemCtl.js
+14
-3
gsb-marketplat/app/base/controller/impl/templatemag/templatelinkCtl.js
+33
-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/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
+0
-0
gsb-marketplat/app/base/db/models/configmag/formsubmitrecord.js
+18
-31
gsb-marketplat/app/base/db/models/configmag/imginfo.js
+0
-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/puttype.js
+0
-0
gsb-marketplat/app/base/service/impl/configmag/forminfoSve.js
+1
-15
gsb-marketplat/app/base/service/impl/configmag/formitemSve.js
+87
-0
gsb-marketplat/app/base/service/impl/configmag/imginfoSve.js
+1
-1
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
No files found.
gsb-marketplat/app/base/controller/impl/configmag/formitemCtl.js
View file @
988a8dc9
...
@@ -14,9 +14,20 @@ class FormItemCtl extends CtlBase {
...
@@ -14,9 +14,20 @@ class FormItemCtl extends CtlBase {
* @param pobj
* @param pobj
* @returns {Promise<void>}
* @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
;
module
.
exports
=
FormItemCtl
;
gsb-marketplat/app/base/controller/impl/templatemag/templatelinkCtl.js
0 → 100644
View file @
988a8dc9
var
system
=
require
(
"../../../system"
)
var
settings
=
require
(
"../../../../config/settings"
);
const
CtlBase
=
require
(
"../../ctl.base"
);
var
cacheBaseComp
=
null
;
class
FormInfoCtl
extends
CtlBase
{
constructor
()
{
super
(
"templateinfomag"
,
CtlBase
.
getServiceName
(
FormInfoCtl
));
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
=
FormInfoCtl
;
gsb-marketplat/app/base/db/impl/
form
/forminfoDao.js
→
gsb-marketplat/app/base/db/impl/
configmag
/forminfoDao.js
View file @
988a8dc9
File moved
gsb-marketplat/app/base/db/impl/
form
/formitemDao.js
→
gsb-marketplat/app/base/db/impl/
configmag
/formitemDao.js
View file @
988a8dc9
File moved
gsb-marketplat/app/base/db/models/
marketconfi
g/businesstype.js
→
gsb-marketplat/app/base/db/models/
configma
g/businesstype.js
View file @
988a8dc9
File moved
gsb-marketplat/app/base/db/models/
marketconfi
g/forminfo.js
→
gsb-marketplat/app/base/db/models/
configma
g/forminfo.js
View file @
988a8dc9
File moved
gsb-marketplat/app/base/db/models/
marketconfi
g/formitem.js
→
gsb-marketplat/app/base/db/models/
configma
g/formitem.js
View file @
988a8dc9
File moved
gsb-marketplat/app/base/db/models/
marketconfi
g/formsubmitrecord.js
→
gsb-marketplat/app/base/db/models/
configma
g/formsubmitrecord.js
View file @
988a8dc9
...
@@ -4,38 +4,25 @@
...
@@ -4,38 +4,25 @@
* @param DataTypes
* @param DataTypes
* @returns {Model|void|*}
* @returns {Model|void|*}
*/
*/
const
record_status
=
{
"1"
:
"未读"
,
"2"
:
"已读"
,
"3"
:
"无效"
};
module
.
exports
=
(
db
,
DataTypes
)
=>
{
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"formsubmitrecord"
,
{
return
db
.
define
(
"formsubmitrecord"
,
{
form_id
:
DataTypes
.
INTEGER
(
11
),
//表单id
template_id
:
DataTypes
.
INTEGER
(
11
),
///模板id
template_id
:
DataTypes
.
INTEGER
(
11
),
//表单id
templatelink_id
:
DataTypes
.
INTEGER
(
11
),
//模板链接id
templatelink_id
:
DataTypes
.
INTEGER
(
11
),
//表单id
form_id
:
DataTypes
.
INTEGER
(
11
),
//表单id
record_status
:{
//记录状态 1未读 2已读 3无效
record_status
:
DataTypes
.
STRING
(
60
),
//记录状态 1未读 2已读 3无效
type
:
DataTypes
.
STRING
,
record_status_name
:
DataTypes
.
STRING
(
60
),
//记录状态名称
set
:
function
(
val
)
{
templatelink_snapshot
:
DataTypes
.
JSON
,
//模板链接快照
this
.
setDataValue
(
"record_status"
,
val
);
record_content
:
DataTypes
.
JSON
,
//记录内容
this
.
setDataValue
(
"record_status_name"
,
record_status
[
val
]);
},
{
}
paranoid
:
true
,
//假的删除
},
//
underscored
:
true
,
record_status_name
:
DataTypes
.
STRING
(
60
),
//记录状态名称
version
:
true
,
templatelink_snapshot
:
DataTypes
.
JSON
,
freezeTableName
:
true
,
form_snapshot
:
DataTypes
.
JSON
,
timestamps
:
true
,
record_content
:
DataTypes
.
JSON
,
updated_at
:
true
,
tableName
:
'c_form_submit_record'
,
},
{
validate
:
{},
paranoid
:
true
,
//假的删除
indexes
:
[]
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 @
988a8dc9
File moved
gsb-marketplat/app/base/db/models/
marketconfi
g/launchchannel.js
→
gsb-marketplat/app/base/db/models/
configma
g/launchchannel.js
View file @
988a8dc9
File moved
gsb-marketplat/app/base/db/models/
marketconfi
g/launchtype.js
→
gsb-marketplat/app/base/db/models/
configma
g/launchtype.js
View file @
988a8dc9
File moved
gsb-marketplat/app/base/db/models/
marketconfi
g/maininfo.js
→
gsb-marketplat/app/base/db/models/
configma
g/maininfo.js
View file @
988a8dc9
File moved
gsb-marketplat/app/base/db/models/
marketconfi
g/puttype.js
→
gsb-marketplat/app/base/db/models/
configma
g/puttype.js
View file @
988a8dc9
File moved
gsb-marketplat/app/base/service/impl/configmag/forminfoSve.js
View file @
988a8dc9
...
@@ -32,14 +32,6 @@ class ForminfoService extends ServiceBase {
...
@@ -32,14 +32,6 @@ class ForminfoService extends ServiceBase {
if
(
!
pobj
.
form_describe
){
if
(
!
pobj
.
form_describe
){
return
system
.
getResult
(
null
,
'form_describe can not be empty'
);
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
code
=
await
this
.
getBusUid
(
"fm"
)
let
formData
=
{
let
formData
=
{
name
:
pobj
.
name
,
name
:
pobj
.
name
,
...
@@ -50,7 +42,7 @@ class ForminfoService extends ServiceBase {
...
@@ -50,7 +42,7 @@ class ForminfoService extends ServiceBase {
user_name
:
pobj
.
username
user_name
:
pobj
.
username
}
}
let
result
=
await
this
.
create
(
formData
);
let
result
=
await
this
.
create
(
formData
);
return
system
.
getResul
(
result
);
return
system
.
getResul
t
(
result
);
}
}
/**
/**
*
*
...
@@ -58,14 +50,9 @@ class ForminfoService extends ServiceBase {
...
@@ -58,14 +50,9 @@ class ForminfoService extends ServiceBase {
* @returns {Promise<void>}
* @returns {Promise<void>}
*/
*/
async
updateForm
(
pobj
)
{
async
updateForm
(
pobj
)
{
return
null
;
return
null
;
}
}
//表单项 数据重组
async
composeItem
(
obj
){
return
system
.
getResultSuccess
();
}
}
}
module
.
exports
=
ForminfoService
;
module
.
exports
=
ForminfoService
;
\ No newline at end of file
gsb-marketplat/app/base/service/impl/configmag/formitemSve.js
0 → 100644
View file @
988a8dc9
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
type_name
=
await
this
.
getTypeName
(
pobj
.
item_type
);
let
code
=
await
this
.
getBusUid
(
'it'
);
pobj
.
item_type_name
=
type_name
;
pobj
.
is_enabled
=
pobj
.
is_enabled
?
1
:
0
;
pobj
.
is_required
=
pobj
.
is_required
?
1
:
0
;
pobj
.
code
=
code
;
console
.
log
(
pobj
)
//获取表单的表单项
let
form
=
await
this
.
forminfoSve
.
findOne
({
id
:
pobj
.
form_id
},[
'form_items'
]);
console
.
log
(
form
)
if
(
!
form
){
return
system
.
getResult
(
null
,
'获取订单信息失败'
);
}
let
form_items
=
form
.
form_items
?
form
.
form_items
+
"、"
+
type_name
:
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
=
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
updateForm
(
pobj
)
{
return
null
;
}
//根据类型获取类型名称
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/imginfoSve.js
View file @
988a8dc9
...
@@ -3,7 +3,7 @@ const ServiceBase = require("../../sve.base");
...
@@ -3,7 +3,7 @@ const ServiceBase = require("../../sve.base");
const
settings
=
require
(
"../../../../config/settings"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
ImginfoService
extends
ServiceBase
{
class
ImginfoService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"co
mmon
"
,
ServiceBase
.
getDaoName
(
ImginfoService
));
super
(
"co
nfigmag
"
,
ServiceBase
.
getDaoName
(
ImginfoService
));
}
}
async
create
(
pobj
){
async
create
(
pobj
){
...
...
gsb-marketplat/app/base/service/impl/configmag/launchchannelSve.js
View file @
988a8dc9
...
@@ -4,7 +4,7 @@ const settings = require("../../../../config/settings");
...
@@ -4,7 +4,7 @@ const settings = require("../../../../config/settings");
class
LaunchchannelService
extends
ServiceBase
{
class
LaunchchannelService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"co
mmon
"
,
ServiceBase
.
getDaoName
(
LaunchchannelService
));
super
(
"co
nfigmag
"
,
ServiceBase
.
getDaoName
(
LaunchchannelService
));
}
}
/**
/**
...
...
gsb-marketplat/app/base/service/impl/configmag/maininfoSve.js
View file @
988a8dc9
...
@@ -3,7 +3,7 @@ const ServiceBase = require("../../sve.base");
...
@@ -3,7 +3,7 @@ const ServiceBase = require("../../sve.base");
const
settings
=
require
(
"../../../../config/settings"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
MaininfoService
extends
ServiceBase
{
class
MaininfoService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"co
mmon
"
,
ServiceBase
.
getDaoName
(
MaininfoService
));
super
(
"co
nfigmag
"
,
ServiceBase
.
getDaoName
(
MaininfoService
));
}
}
async
create
(
pobj
){
async
create
(
pobj
){
...
...
gsb-marketplat/app/base/service/impl/configmag/puttypeSve.js
View file @
988a8dc9
...
@@ -3,7 +3,7 @@ const ServiceBase = require("../../sve.base");
...
@@ -3,7 +3,7 @@ const ServiceBase = require("../../sve.base");
const
settings
=
require
(
"../../../../config/settings"
);
const
settings
=
require
(
"../../../../config/settings"
);
class
PuttypeService
extends
ServiceBase
{
class
PuttypeService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"co
mmon
"
,
ServiceBase
.
getDaoName
(
PuttypeService
));
super
(
"co
nfigmag
"
,
ServiceBase
.
getDaoName
(
PuttypeService
));
}
}
async
create
(
pobj
){
async
create
(
pobj
){
...
...
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