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
892b06ad
Commit
892b06ad
authored
Sep 18, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
laolan
parent
d8252066
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
159 additions
and
70 deletions
+159
-70
gsb-marketplat-mag/app/base/controller/impl/aggregation/producttypeCtl.js
+5
-0
gsb-marketplat-mag/app/base/service/impl/aggregation/bottommenuconfigSve.js
+42
-40
gsb-marketplat-mag/app/base/service/impl/aggregation/cycleproductSve.js
+8
-0
gsb-marketplat-mag/app/base/service/impl/aggregation/popularrecommendationSve.js
+9
-1
gsb-marketplat-mag/app/base/service/impl/aggregation/productSve.js
+14
-6
gsb-marketplat-mag/app/base/service/impl/aggregation/producttypeSve.js
+51
-23
gsb-marketplat-mag/app/base/service/impl/aggregation/rotationchartSve.js
+16
-0
gsb-marketplat-mag/app/base/service/impl/aggregation/secondlevelneedconfigSve.js
+14
-0
No files found.
gsb-marketplat-mag/app/base/controller/impl/aggregation/producttypeCtl.js
View file @
892b06ad
...
...
@@ -25,5 +25,10 @@ class ProductTypeCtl extends CtlBase {
const
res
=
await
this
.
service
.
getProductTypeInfo
(
pobj
);
return
res
;
}
async
delete
(
pobj
,
qobj
,
req
)
{
const
up
=
await
this
.
service
.
delete
(
pobj
);
return
up
;
}
}
module
.
exports
=
ProductTypeCtl
;
gsb-marketplat-mag/app/base/service/impl/aggregation/bottommenuconfigSve.js
View file @
892b06ad
...
...
@@ -6,52 +6,54 @@ class BottommenuconfigService extends ServiceBase {
super
(
"aggregation"
,
ServiceBase
.
getDaoName
(
BottommenuconfigService
));
}
async
create
(
pobj
)
{
if
(
!
pobj
.
button_name
)
{
return
system
.
getResultFail
(
-
101
,
"按钮文案不能为空"
);
}
if
(
!
pobj
.
is_distinguishtime
)
{
return
system
.
getResultFail
(
-
102
,
"分时策略不能为空"
);
}
if
(
!
pobj
.
strategy_date
)
{
return
system
.
getResultFail
(
-
103
,
"策略日期不能为空"
);
}
if
(
!
pobj
.
strategy_time
)
{
return
system
.
getResultFail
(
-
104
,
"策略时段不能为空"
);
}
if
(
!
pobj
.
button_type
)
{
return
system
.
getResultFail
(
-
105
,
"按钮形式不能为空"
);
}
if
(
!
pobj
.
button_name
)
{
return
system
.
getResultFail
(
-
106
,
"按钮文案不能为空"
);
}
if
(
!
pobj
.
button_name
)
{
return
system
.
getResultFail
(
-
101
,
"按钮文案不能为空"
);
}
if
(
!
pobj
.
is_distinguishtime
)
{
return
system
.
getResultFail
(
-
102
,
"分时策略不能为空"
);
}
if
(
!
pobj
.
strategy_date
)
{
return
system
.
getResultFail
(
-
103
,
"策略日期不能为空"
);
}
if
(
!
pobj
.
strategy_time
)
{
return
system
.
getResultFail
(
-
104
,
"策略时段不能为空"
);
}
if
(
!
pobj
.
button_type
)
{
return
system
.
getResultFail
(
-
105
,
"按钮形式不能为空"
);
}
if
(
!
pobj
.
button_name
)
{
return
system
.
getResultFail
(
-
106
,
"按钮文案不能为空"
);
}
if
(
!
pobj
.
call_number
)
{
return
system
.
getResultFail
(
-
107
,
"呼叫号码不能为空"
);
}
if
(
!
pobj
.
else_button_type
)
{
return
system
.
getResultFail
(
-
108
,
"其他按钮形式不能为空"
);
}
if
(
!
pobj
.
else_button_name
)
{
return
system
.
getResultFail
(
-
109
,
"其他按钮文案不能为空"
);
}
if
(
!
pobj
.
else_call_number
)
{
return
system
.
getResultFail
(
-
110
,
"其他呼叫号码不能为空"
);
}
if
(
!
pobj
.
call_number
)
{
return
system
.
getResultFail
(
-
107
,
"呼叫号码不能为空"
);
}
if
(
!
pobj
.
else_button_type
)
{
return
system
.
getResultFail
(
-
108
,
"其他按钮形式不能为空"
);
}
if
(
!
pobj
.
else_button_name
)
{
return
system
.
getResultFail
(
-
109
,
"其他按钮文案不能为空"
);
}
if
(
!
pobj
.
else_call_number
)
{
return
system
.
getResultFail
(
-
110
,
"其他呼叫号码不能为空"
);
}
return
system
.
getResultSuccess
(
this
.
dao
.
create
(
pobj
));
}
async
update
(
pobj
)
{
var
functionName
=
"bottomMenuConfig"
;
await
this
.
redisdel
.
redisInfo
(
functionName
);
return
system
.
getResultSuccess
(
this
.
dao
.
update
(
pobj
));
}
}
...
...
gsb-marketplat-mag/app/base/service/impl/aggregation/cycleproductSve.js
View file @
892b06ad
...
...
@@ -20,6 +20,14 @@ class CycleproductService extends ServiceBase {
try
{
var
functionName
=
"cycleProduct"
;
await
this
.
redisdel
.
redisInfo
(
functionName
);
var
functionName1
=
"productTypeFirst"
;
await
this
.
redisdel
.
redisInfo
(
functionName1
);
var
functionName2
=
"productTypeSecend"
;
await
this
.
redisdel
.
redisInfo
(
functionName2
);
var
functionName3
=
"productList"
;
await
this
.
redisdel
.
redisInfo
(
functionName3
);
var
functionName4
=
"productDetail"
;
await
this
.
redisdel
.
redisInfo
(
functionName4
);
}
catch
(
error
)
{
console
.
log
(
error
)
}
...
...
gsb-marketplat-mag/app/base/service/impl/aggregation/popularrecommendationSve.js
View file @
892b06ad
...
...
@@ -18,9 +18,17 @@ class PopularrecommendationService extends ServiceBase {
if
(
pobj
.
pic_describe
&&
pobj
.
pic_describe
.
length
>
19
)
{
return
system
.
getResultFail
(
-
105
,
"图片描述最多20位字符"
);
}
var
functionName
=
"popularRecommendationList"
;
await
this
.
redisdel
.
redisInfo
(
functionName
);
var
functionName1
=
"productTypeFirst"
;
await
this
.
redisdel
.
redisInfo
(
functionName1
);
var
functionName2
=
"productTypeSecend"
;
await
this
.
redisdel
.
redisInfo
(
functionName2
);
var
functionName3
=
"productList"
;
await
this
.
redisdel
.
redisInfo
(
functionName3
);
var
functionName4
=
"productDetail"
;
await
this
.
redisdel
.
redisInfo
(
functionName4
);
return
system
.
getResultSuccess
(
this
.
dao
.
update
(
pobj
));
}
}
...
...
gsb-marketplat-mag/app/base/service/impl/aggregation/productSve.js
View file @
892b06ad
...
...
@@ -15,6 +15,14 @@ class ProductService extends ServiceBase {
async
update
(
pobj
)
{
var
functionName1
=
"productTypeFirst"
;
await
this
.
redisdel
.
redisInfo
(
functionName1
);
var
functionName2
=
"productTypeSecend"
;
await
this
.
redisdel
.
redisInfo
(
functionName2
);
var
functionName3
=
"productList"
;
await
this
.
redisdel
.
redisInfo
(
functionName3
);
var
functionName4
=
"productDetail"
;
await
this
.
redisdel
.
redisInfo
(
functionName4
);
return
system
.
getResultSuccess
(
this
.
dao
.
update
(
pobj
));
}
...
...
@@ -24,14 +32,14 @@ class ProductService extends ServiceBase {
* @param pobj
* @returns {Promise<void>}
*/
async
getProductsByType
(
pobj
){
const
type
=
await
this
.
producttypeDao
.
findOne
({
code
:
pobj
.
typeName
},
[]);
if
(
!
type
)
{
return
system
.
getResultFail
(
-
1
,
'获取产品类型数据失败'
);
async
getProductsByType
(
pobj
)
{
const
type
=
await
this
.
producttypeDao
.
findOne
({
code
:
pobj
.
typeName
},
[]);
if
(
!
type
)
{
return
system
.
getResultFail
(
-
1
,
'获取产品类型数据失败'
);
}
let
products
=
await
this
.
dao
.
model
.
findAll
({
attributes
:
[
"code"
,
"name"
],
where
:
{
product_type_id
:
type
.
id
,
is_enabled
:
1
},
raw
:
true
attributes
:
[
"code"
,
"name"
],
where
:
{
product_type_id
:
type
.
id
,
is_enabled
:
1
},
raw
:
true
});
return
system
.
getResult
(
products
)
}
...
...
gsb-marketplat-mag/app/base/service/impl/aggregation/producttypeSve.js
View file @
892b06ad
...
...
@@ -5,12 +5,12 @@ class ProducttypeService extends ServiceBase {
constructor
()
{
super
(
"aggregation"
,
ServiceBase
.
getDaoName
(
ProducttypeService
));
}
async
findAndCountAll
(
obj
)
{
async
findAndCountAll
(
obj
)
{
let
res
=
await
this
.
dao
.
findAndCountAll
(
obj
);
if
(
obj
&&
obj
.
search
&&
obj
.
search
.
p_id
===
0
&&
res
&&
res
.
results
&&
res
.
results
.
rows
&&
res
.
results
.
rows
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
res
.
results
.
rows
.
length
;
i
++
)
{
if
(
res
.
results
.
rows
[
i
].
id
)
{
var
count
=
await
this
.
dao
.
findCount
({
where
:
{
p_id
:
res
.
results
.
rows
[
i
].
id
}
});
if
(
obj
&&
obj
.
search
&&
obj
.
search
.
p_id
===
0
&&
res
&&
res
.
results
&&
res
.
results
.
rows
&&
res
.
results
.
rows
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
res
.
results
.
rows
.
length
;
i
++
)
{
if
(
res
.
results
.
rows
[
i
].
id
)
{
var
count
=
await
this
.
dao
.
findCount
({
where
:
{
p_id
:
res
.
results
.
rows
[
i
].
id
}
});
res
.
results
.
rows
[
i
].
dataValues
.
childCount
=
count
;
}
}
...
...
@@ -30,7 +30,7 @@ class ProducttypeService extends ServiceBase {
if
(
!
pobj
.
sequence
)
{
return
system
.
getResultFail
(
-
103
,
"排序不能为空"
);
}
if
(
!
pobj
.
name
)
{
return
system
.
getResultFail
(
-
105
,
"名称不能为空"
);
}
...
...
@@ -39,19 +39,19 @@ class ProducttypeService extends ServiceBase {
// return system.getResultFail(-106, "名称最多4位字符");
// }
// }
if
(
pobj
.
p_code
)
{
if
(
pobj
.
p_code
)
{
// if (pobj.name && pobj.name.length > 5) {
// return system.getResultFail(-106, "请输入5字以内名称");
// }
var
p_type
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
code
:
pobj
.
p_code
,
p_id
:
0
},
raw
:
true
where
:
{
code
:
pobj
.
p_code
,
p_id
:
0
},
raw
:
true
});
if
(
!
p_type
)
{
return
system
.
getResultFail
(
-
300
,
"产品一类不存在"
);
if
(
!
p_type
)
{
return
system
.
getResultFail
(
-
300
,
"产品一类不存在"
);
}
pobj
.
p_id
=
p_type
.
id
;
pobj
.
p_name
=
p_type
.
name
;
}
else
if
(
!
pobj
.
jump_link_type
||
!
pobj
.
jump_link
)
{
}
else
if
(
!
pobj
.
jump_link_type
||
!
pobj
.
jump_link
)
{
return
system
.
getResultFail
(
-
104
,
"连接不能为空"
);
}
return
system
.
getResultSuccess
(
this
.
dao
.
create
(
pobj
));
...
...
@@ -60,7 +60,7 @@ class ProducttypeService extends ServiceBase {
if
(
!
pobj
.
pic_url
)
{
return
system
.
getResultFail
(
-
101
,
"图标不能为空"
);
}
if
(
!
pobj
.
sequence
&&
pobj
.
sequence
!==
0
)
{
if
(
!
pobj
.
sequence
&&
pobj
.
sequence
!==
0
)
{
return
system
.
getResultFail
(
-
102
,
"排序不能为空"
);
}
// if (!pobj.jump_link_type || !pobj.jump_link) {
...
...
@@ -72,30 +72,58 @@ class ProducttypeService extends ServiceBase {
// if (pobj.name && pobj.name.length > 4) {
// return system.getResultFail(-106, "名称最多4位字符");
// }
try
{
var
functionName1
=
"productTypeFirst"
;
await
this
.
redisdel
.
redisInfo
(
functionName1
);
var
functionName2
=
"productTypeSecend"
;
await
this
.
redisdel
.
redisInfo
(
functionName2
);
var
functionName3
=
"productList"
;
await
this
.
redisdel
.
redisInfo
(
functionName3
);
var
functionName4
=
"productDetail"
;
await
this
.
redisdel
.
redisInfo
(
functionName4
);
}
catch
(
error
)
{
console
.
log
(
error
)
}
return
system
.
getResultSuccess
(
this
.
dao
.
update
(
pobj
));
}
//获取产品类型信息-用于后台管理页面
async
getProductTypeInfo
(
obj
){
async
getProductTypeInfo
(
obj
)
{
// if(!obj || !obj.company_id){
// return system.getResultFail();
// }
var
typeones
=
await
this
.
dao
.
model
.
findAll
({
attributes
:
[
"id"
,
"code"
,
"name"
,
"pic_url"
,
"jump_link_type"
,
"jump_link"
],
where
:
{
p_id
:
0
},
raw
:
true
,
order
:
[[
"sequence"
,
"desc"
]]
attributes
:
[
"id"
,
"code"
,
"name"
,
"pic_url"
,
"jump_link_type"
,
"jump_link"
],
where
:
{
p_id
:
0
},
raw
:
true
,
order
:
[[
"sequence"
,
"desc"
]]
});
for
(
var
i
=
0
;
i
<
typeones
.
length
;
i
++
)
{
if
(
typeones
[
i
]
&&
typeones
[
i
].
id
)
var
typetwos
=
await
this
.
dao
.
model
.
findAll
({
attributes
:[
"id"
,
"code"
,
"name"
,
"pic_url"
],
where
:{
p_id
:
typeones
[
i
].
id
},
raw
:
true
,
order
:[[
"sequence"
,
"desc"
]]
});
for
(
var
i
=
0
;
i
<
typeones
.
length
;
i
++
)
{
if
(
typeones
[
i
]
&&
typeones
[
i
].
id
)
var
typetwos
=
await
this
.
dao
.
model
.
findAll
({
attributes
:
[
"id"
,
"code"
,
"name"
,
"pic_url"
],
where
:
{
p_id
:
typeones
[
i
].
id
},
raw
:
true
,
order
:
[[
"sequence"
,
"desc"
]]
});
typeones
[
i
][
"children"
]
=
typetwos
}
return
system
.
getResultSuccess
(
typeones
);
}
async
delete
(
pobj
){
try
{
var
functionName1
=
"productTypeFirst"
;
await
this
.
redisdel
.
redisInfo
(
functionName1
);
var
functionName2
=
"productTypeSecend"
;
await
this
.
redisdel
.
redisInfo
(
functionName2
);
var
functionName3
=
"productList"
;
await
this
.
redisdel
.
redisInfo
(
functionName3
);
var
functionName4
=
"productDetail"
;
await
this
.
redisdel
.
redisInfo
(
functionName4
);
}
catch
(
error
)
{
console
.
log
(
error
)
}
return
system
.
getResultSuccess
(
this
.
dao
.
delete
(
pobj
));
}
}
module
.
exports
=
ProducttypeService
;
// var task = new ProducttypeService();
...
...
gsb-marketplat-mag/app/base/service/impl/aggregation/rotationchartSve.js
View file @
892b06ad
...
...
@@ -56,6 +56,14 @@ class RotationchartService extends ServiceBase {
try
{
var
functionName
=
"rotationChartList"
;
await
this
.
redisdel
.
redisInfo
(
functionName
);
var
functionName1
=
"productTypeFirst"
;
await
this
.
redisdel
.
redisInfo
(
functionName1
);
var
functionName2
=
"productTypeSecend"
;
await
this
.
redisdel
.
redisInfo
(
functionName2
);
var
functionName3
=
"productList"
;
await
this
.
redisdel
.
redisInfo
(
functionName3
);
var
functionName4
=
"productDetail"
;
await
this
.
redisdel
.
redisInfo
(
functionName4
);
}
catch
(
error
)
{
console
.
log
(
error
)
}
...
...
@@ -66,6 +74,14 @@ class RotationchartService extends ServiceBase {
try
{
var
functionName
=
"rotationChartList"
;
await
this
.
redisdel
.
redisInfo
(
functionName
);
var
functionName1
=
"productTypeFirst"
;
await
this
.
redisdel
.
redisInfo
(
functionName1
);
var
functionName2
=
"productTypeSecend"
;
await
this
.
redisdel
.
redisInfo
(
functionName2
);
var
functionName3
=
"productList"
;
await
this
.
redisdel
.
redisInfo
(
functionName3
);
var
functionName4
=
"productDetail"
;
await
this
.
redisdel
.
redisInfo
(
functionName4
);
}
catch
(
error
)
{
console
.
log
(
error
)
}
...
...
gsb-marketplat-mag/app/base/service/impl/aggregation/secondlevelneedconfigSve.js
View file @
892b06ad
...
...
@@ -16,6 +16,20 @@ class SecondlevelneedconfigService extends ServiceBase {
if
(
!
pobj
.
recommend_product_quantity
)
{
return
system
.
getResultFail
(
-
103
,
"推荐产品数量不能为空"
);
}
try
{
var
functionName
=
"popularRecommendationList"
;
await
this
.
redisdel
.
redisInfo
(
functionName
);
var
functionName1
=
"productTypeFirst"
;
await
this
.
redisdel
.
redisInfo
(
functionName1
);
var
functionName2
=
"productTypeSecend"
;
await
this
.
redisdel
.
redisInfo
(
functionName2
);
var
functionName3
=
"productList"
;
await
this
.
redisdel
.
redisInfo
(
functionName3
);
var
functionName4
=
"productDetail"
;
await
this
.
redisdel
.
redisInfo
(
functionName4
);
}
catch
(
error
)
{
console
.
log
(
error
)
}
return
system
.
getResultSuccess
(
this
.
dao
.
update
(
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