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
1279b1f1
Commit
1279b1f1
authored
Nov 24, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
needinfo-sub_status
parent
f5e8b9b0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
14 deletions
+63
-14
gsb-marketplat/app/base/api/api.base.js
+1
-1
gsb-marketplat/app/base/api/impl/action/template.js
+1
-1
gsb-marketplat/app/base/db/models/media/needinfo.js
+3
-1
gsb-marketplat/app/base/service/impl/media/needinfoSve.js
+57
-10
gsb-marketplat/app/base/service/impl/template/templatelinkSve.js
+1
-1
No files found.
gsb-marketplat/app/base/api/api.base.js
View file @
1279b1f1
...
@@ -59,7 +59,7 @@ class APIBase {
...
@@ -59,7 +59,7 @@ class APIBase {
this
.
logClient
.
log
(
pobj
,
req
,
rtn
);
this
.
logClient
.
log
(
pobj
,
req
,
rtn
);
if
(
rtn
&&
rtn
.
status
===
0
){
if
(
rtn
&&
rtn
.
status
===
0
){
//保存缓存
//保存缓存
await
this
.
redisClient
.
setWithEx
(
shaStr
,
JSON
.
stringify
(
rtn
),
30
);
//
await this.redisClient.setWithEx(shaStr, JSON.stringify(rtn), 30);
}
}
return
rtn
;
return
rtn
;
}
catch
(
e
)
{
}
catch
(
e
)
{
...
...
gsb-marketplat/app/base/api/impl/action/template.js
View file @
1279b1f1
...
@@ -77,7 +77,7 @@ class Template extends APIBase {
...
@@ -77,7 +77,7 @@ class Template extends APIBase {
let
result
=
await
this
.
forminfoSve
.
findOne
({
id
:
pobj
.
id
},[]);
let
result
=
await
this
.
forminfoSve
.
findOne
({
id
:
pobj
.
id
},[]);
// 将数据保存到redis中
// 将数据保存到redis中
await
this
.
redisClient
.
set
(
shaStr
,
JSON
.
stringify
(
result
));
await
this
.
redisClient
.
set
(
shaStr
,
JSON
.
stringify
(
result
));
this
.
formCache
[
shaStr
]
=
JSON
.
stringify
(
result
);
//
this.formCache[shaStr] = JSON.stringify(result);
return
system
.
getResult
(
result
);
return
system
.
getResult
(
result
);
}
}
}
}
...
...
gsb-marketplat/app/base/db/models/media/needinfo.js
View file @
1279b1f1
...
@@ -28,7 +28,9 @@ module.exports = (db, DataTypes) => {
...
@@ -28,7 +28,9 @@ module.exports = (db, DataTypes) => {
region
:
DataTypes
.
STRING
,
//地区
region
:
DataTypes
.
STRING
,
//地区
business_id
:
DataTypes
.
STRING
,
//云服产品id
business_id
:
DataTypes
.
STRING
,
//云服产品id
push_status
:
DataTypes
.
INTEGER
,
push_status
:
DataTypes
.
INTEGER
,
notes
:
DataTypes
.
STRING
sub_status
:
DataTypes
.
INTEGER
,
notes
:
DataTypes
.
STRING
,
sub_notes
:
DataTypes
.
STRING
},
{
},
{
paranoid
:
true
,
//假的删除
paranoid
:
true
,
//假的删除
underscored
:
true
,
underscored
:
true
,
...
...
gsb-marketplat/app/base/service/impl/media/needinfoSve.js
View file @
1279b1f1
...
@@ -20,42 +20,89 @@ class NeedinfoService extends ServiceBase {
...
@@ -20,42 +20,89 @@ class NeedinfoService extends ServiceBase {
return
res
;
return
res
;
}
}
var
createRes
=
await
this
.
dao
.
create
(
res
);
var
createRes
=
await
this
.
dao
.
create
(
res
);
this
.
pushMediaNeed2Queue
(
createRes
.
id
);
//
this.pushMediaNeed2Queue(createRes.id);
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
}
// //校验封装参数
// async checkAndPackageSubmitParams(ab){
// if(!ab.submit_type){
// return system.getResultFail(-101,"提交方式不能为空!")
// }else if(ab.submit_type!="1" && ab.submit_type!="2"){
// return system.getResultFail(-102,"提交方式参数错误!")
// }
// if(!ab.channel_code){
// return system.getResultFail(-103,"渠道编码不能为空!")
// }
// if(!ab.page_code){
// return system.getResultFail(-104,"页面编码不能为空!")
// }
// if(!ab.page_name){
// return system.getResultFail(-105,"页面名称不能为空!")
// }
// if(!ab.original_need){
// return system.getResultFail(-106,"需求信息不能为空!")
// }
// if(!ab.contact_mobile){
// return system.getResultFail(-107,"联系电话不能为空!")
// }
// var reg =/^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(14[0-9]{1})|)+\d{8})$/;
// if(ab.contact_mobile.length!=11){
// return system.getResultFail(-108,"联系电话格式错误!")
// }
// var channel = await this.launchchannelDao.model.findOne({
// attributes:["code","name","only_code"],
// where:{code:ab.channel_code},raw:true
// });
// if(!channel || !channel.code){
// return system.getResultFail(-300,"渠道信息不存在")
// }
// ab["channel_name"] = channel.name;
// ab["channel_only_code"] = channel.only_code || "";
// return ab;
// }
//校验封装参数
//校验封装参数
async
checkAndPackageSubmitParams
(
ab
){
async
checkAndPackageSubmitParams
(
ab
){
ab
.
sub_status
=
1
;
if
(
!
ab
.
submit_type
){
if
(
!
ab
.
submit_type
){
return
system
.
getResultFail
(
-
101
,
"提交方式不能为空!"
)
ab
.
sub_status
=
2
;
ab
.
sub_notes
=
"提交方式不能为空!"
;
}
else
if
(
ab
.
submit_type
!=
"1"
&&
ab
.
submit_type
!=
"2"
){
}
else
if
(
ab
.
submit_type
!=
"1"
&&
ab
.
submit_type
!=
"2"
){
return
system
.
getResultFail
(
-
102
,
"提交方式参数错误!"
)
ab
.
sub_status
=
2
;
ab
.
sub_notes
=
"提交方式参数错误!submit_type="
+
ab
.
submit_type
;
}
}
if
(
!
ab
.
channel_code
){
if
(
!
ab
.
channel_code
){
return
system
.
getResultFail
(
-
103
,
"渠道编码不能为空!"
)
ab
.
sub_status
=
2
;
ab
.
sub_notes
=
"渠道编码不能为空!"
;
}
}
if
(
!
ab
.
page_code
){
if
(
!
ab
.
page_code
){
return
system
.
getResultFail
(
-
104
,
"页面编码不能为空!"
)
ab
.
sub_status
=
2
;
ab
.
sub_notes
=
"页面编码不能为空!"
;
}
}
if
(
!
ab
.
page_name
){
if
(
!
ab
.
page_name
){
return
system
.
getResultFail
(
-
105
,
"页面名称不能为空!"
)
ab
.
sub_status
=
2
;
ab
.
sub_notes
=
"页面名称不能为空!"
;
}
}
if
(
!
ab
.
original_need
){
if
(
!
ab
.
original_need
){
return
system
.
getResultFail
(
-
106
,
"需求信息不能为空!"
)
ab
.
sub_status
=
2
;
ab
.
sub_notes
=
"需求信息不能为空!"
;
}
}
if
(
!
ab
.
contact_mobile
){
if
(
!
ab
.
contact_mobile
){
return
system
.
getResultFail
(
-
107
,
"联系电话不能为空!"
)
ab
.
sub_status
=
2
;
ab
.
sub_notes
=
"联系电话不能为空!"
;
}
}
var
reg
=
/^
(((
13
[
0-9
]{1})
|
(
15
[
0-9
]{1})
|
(
18
[
0-9
]{1})
|
(
14
[
0-9
]{1})
|
)
+
\d{8})
$/
;
var
reg
=
/^
(((
13
[
0-9
]{1})
|
(
15
[
0-9
]{1})
|
(
18
[
0-9
]{1})
|
(
14
[
0-9
]{1})
|
)
+
\d{8})
$/
;
if
(
ab
.
contact_mobile
.
length
!=
11
){
if
(
ab
.
contact_mobile
.
length
!=
11
){
return
system
.
getResultFail
(
-
108
,
"联系电话格式错误!"
)
ab
.
sub_status
=
2
;
ab
.
sub_notes
=
"联系电话格式错误!contact_mobile="
+
ab
.
contact_mobile
;
}
}
var
channel
=
await
this
.
launchchannelDao
.
model
.
findOne
({
var
channel
=
await
this
.
launchchannelDao
.
model
.
findOne
({
attributes
:[
"code"
,
"name"
,
"only_code"
],
attributes
:[
"code"
,
"name"
,
"only_code"
],
where
:{
code
:
ab
.
channel_code
},
raw
:
true
where
:{
code
:
ab
.
channel_code
},
raw
:
true
});
});
if
(
!
channel
||
!
channel
.
code
){
if
(
!
channel
||
!
channel
.
code
){
return
system
.
getResultFail
(
-
300
,
"渠道信息不存在"
)
ab
.
sub_status
=
2
;
ab
.
sub_notes
=
"渠道信息不存在"
;
}
}
ab
[
"channel_name"
]
=
channel
.
name
;
ab
[
"channel_name"
]
=
channel
.
name
;
ab
[
"channel_only_code"
]
=
channel
.
only_code
||
""
;
ab
[
"channel_only_code"
]
=
channel
.
only_code
||
""
;
...
...
gsb-marketplat/app/base/service/impl/template/templatelinkSve.js
View file @
1279b1f1
...
@@ -475,7 +475,7 @@ class TemplatelinkService extends ServiceBase {
...
@@ -475,7 +475,7 @@ class TemplatelinkService extends ServiceBase {
linkinfo
linkinfo
};
};
//将数据保存
//将数据保存
this
.
templateLinkInfoCache
[
shaStr
]
=
JSON
.
stringify
(
rtnObj
);
//
this.templateLinkInfoCache[shaStr] = JSON.stringify(rtnObj);
// 将数据保存到redis中
// 将数据保存到redis中
await
this
.
redisClient
.
set
(
shaStr
,
JSON
.
stringify
(
rtnObj
));
await
this
.
redisClient
.
set
(
shaStr
,
JSON
.
stringify
(
rtnObj
));
// await this.redisClient.setWithEx(shaStr, JSON.stringify(rtnObj), 60); // 保存的同时设置过期时间
// await this.redisClient.setWithEx(shaStr, JSON.stringify(rtnObj), 60); // 保存的同时设置过期时间
...
...
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