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
2a61bb8a
Commit
2a61bb8a
authored
Jan 13, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
5a6751c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
50 deletions
+50
-50
igirl-channel/app/base/service/impl/dbapp/appproductSve.js
+50
-50
No files found.
igirl-channel/app/base/service/impl/dbapp/appproductSve.js
View file @
2a61bb8a
...
@@ -7,91 +7,91 @@ class AppProductService extends ServiceBase {
...
@@ -7,91 +7,91 @@ class AppProductService extends ServiceBase {
super
(
"dbapp"
,
ServiceBase
.
getDaoName
(
AppProductService
));
super
(
"dbapp"
,
ServiceBase
.
getDaoName
(
AppProductService
));
}
}
//根据渠道产品码获取产品详情
//根据渠道产品码获取产品详情
async
findByChannelItemCode
(
obj
){
async
findByChannelItemCode
(
obj
)
{
// var user = obj.user;
// var user = obj.user;
var
app
=
obj
.
app
;
var
app
=
obj
.
app
;
// if(!user){
// if(!user){
// return system.getResultFail(-101, "未知用户");
// return system.getResultFail(-101, "未知用户");
// }
// }
if
(
!
app
)
{
if
(
!
app
)
{
return
system
.
getResultFail
(
-
102
,
"未知渠道"
);
return
system
.
getResultFail
(
-
102
,
"未知渠道"
);
}
}
var
channelItemCode
=
obj
.
channelItemCode
;
var
channelItemCode
=
obj
.
channelItemCode
;
if
(
!
channelItemCode
)
{
if
(
!
channelItemCode
)
{
return
system
.
getResultFail
(
-
103
,
"渠道产品编码不能为空"
);
return
system
.
getResultFail
(
-
103
,
"渠道产品编码不能为空"
);
}
}
var
product
=
await
this
.
dao
.
model
.
findOne
({
var
product
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
channelItemCode
:
channelItemCode
,
app_id
:
app
.
id
,
status
:
1
},
where
:
{
channelItemCode
:
channelItemCode
,
app_id
:
app
.
id
,
status
:
1
},
attributes
:
[
"id"
,
"app_id"
,
"itemCode"
,
"itemName"
,
"picUrl"
,
"channelItemCode"
,
"channelItemName"
,
attributes
:
[
"id"
,
"app_id"
,
"itemCode"
,
"itemName"
,
"picUrl"
,
"descUrl"
,
"channelItemCode"
,
"channelItemName"
,
"serviceItemCode"
,
"proPrice"
,
"serviceCharge"
,
"publicExpense"
,
"rateConfig"
,
"discountsRateConfig"
],
"serviceItemCode"
,
"proPrice"
,
"serviceCharge"
,
"publicExpense"
,
"rateConfig"
,
"discountsRateConfig"
],
raw
:
true
raw
:
true
});
});
if
(
!
product
)
{
if
(
!
product
)
{
return
system
.
getResultFail
(
-
104
,
"未知产品"
);
return
system
.
getResultFail
(
-
104
,
"未知产品"
);
}
}
return
system
.
getResultSuccess
(
product
);
return
system
.
getResultSuccess
(
product
);
}
}
//获取产品列表(根据父类产品编码获取)
//获取产品列表(根据父类产品编码获取)
async
findByProductTypeCode
(
obj
){
async
findByProductTypeCode
(
obj
)
{
// var user = obj.user;
// var user = obj.user;
var
app
=
obj
.
app
;
var
app
=
obj
.
app
;
// if(!user){
// if(!user){
// return system.getResultFail(-101, "未知用户");
// return system.getResultFail(-101, "未知用户");
// }
// }
if
(
!
app
)
{
if
(
!
app
)
{
return
system
.
getResultFail
(
-
102
,
"未知渠道"
);
return
system
.
getResultFail
(
-
102
,
"未知渠道"
);
}
}
var
itemCode
=
obj
.
itemCode
;
var
itemCode
=
obj
.
itemCode
;
if
(
!
itemCode
)
{
if
(
!
itemCode
)
{
return
system
.
getResultFail
(
-
103
,
"渠道产品编码不能为空"
);
return
system
.
getResultFail
(
-
103
,
"渠道产品编码不能为空"
);
}
}
var
pProduct
=
await
this
.
dao
.
model
.
findOne
({
var
pProduct
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
itemCode
:
itemCode
,
app_id
:
app
.
id
,
status
:
1
},
where
:
{
itemCode
:
itemCode
,
app_id
:
app
.
id
,
status
:
1
},
attributes
:
[
"id"
,
"app_id"
,
"itemCode"
,
"itemName"
],
attributes
:
[
"id"
,
"app_id"
,
"itemCode"
,
"itemName"
],
raw
:
true
raw
:
true
});
});
if
(
!
pProduct
||
!
pProduct
.
id
)
{
if
(
!
pProduct
||
!
pProduct
.
id
)
{
return
system
.
getResultFail
(
-
104
,
"未知产品"
);
return
system
.
getResultFail
(
-
104
,
"未知产品"
);
}
}
var
pList
=
await
this
.
dao
.
model
.
findAll
({
var
pList
=
await
this
.
dao
.
model
.
findAll
({
where
:
{
productType_id
:
pProduct
.
id
,
app_id
:
app
.
id
,
status
:
1
},
where
:
{
productType_id
:
pProduct
.
id
,
app_id
:
app
.
id
,
status
:
1
},
attributes
:
[
"id"
,
"app_id"
,
"itemCode"
,
"itemName"
,
"picUrl"
,
"channelItemCode"
,
"channelItemName"
,
attributes
:
[
"id"
,
"app_id"
,
"itemCode"
,
"itemName"
,
"picUrl"
,
"channelItemCode"
,
"channelItemName"
,
"serviceItemCode"
,
"proPrice"
,
"serviceCharge"
,
"publicExpense"
,
"rateConfig"
,
"discountsRateConfig"
,
"serviceItemCode"
,
"proPrice"
,
"serviceCharge"
,
"publicExpense"
,
"rateConfig"
,
"discountsRateConfig"
,
"productLogo"
,
"productDesc"
"productLogo"
,
"productDesc"
],
],
raw
:
true
raw
:
true
});
});
return
system
.
getResultSuccess
(
pList
);
return
system
.
getResultSuccess
(
pList
);
}
}
//获取产品列表(根据产品一类编码获取)
//获取产品列表(根据产品一类编码获取)
async
findByProductOneTypeCode
(
obj
){
async
findByProductOneTypeCode
(
obj
)
{
// var user = obj.user;
// var user = obj.user;
var
app
=
obj
.
app
;
var
app
=
obj
.
app
;
// if(!user){
// if(!user){
// return system.getResultFail(-101, "未知用户");
// return system.getResultFail(-101, "未知用户");
// }
// }
if
(
!
app
)
{
if
(
!
app
)
{
return
system
.
getResultFail
(
-
102
,
"未知渠道"
);
return
system
.
getResultFail
(
-
102
,
"未知渠道"
);
}
}
var
itemCode
=
obj
.
itemCode
;
var
itemCode
=
obj
.
itemCode
;
if
(
!
itemCode
)
{
if
(
!
itemCode
)
{
return
system
.
getResultFail
(
-
103
,
"渠道产品编码不能为空"
);
return
system
.
getResultFail
(
-
103
,
"渠道产品编码不能为空"
);
}
}
var
pProduct
=
await
this
.
dao
.
model
.
findOne
({
var
pProduct
=
await
this
.
dao
.
model
.
findOne
({
where
:
{
itemCode
:
itemCode
,
app_id
:
app
.
id
,
status
:
1
},
where
:
{
itemCode
:
itemCode
,
app_id
:
app
.
id
,
status
:
1
},
attributes
:
[
"id"
,
"app_id"
,
"itemCode"
,
"itemName"
],
attributes
:
[
"id"
,
"app_id"
,
"itemCode"
,
"itemName"
],
raw
:
true
raw
:
true
});
});
if
(
!
pProduct
||
!
pProduct
.
id
)
{
if
(
!
pProduct
||
!
pProduct
.
id
)
{
return
system
.
getResultFail
(
-
104
,
"未知产品"
);
return
system
.
getResultFail
(
-
104
,
"未知产品"
);
}
}
var
pList
=
await
this
.
dao
.
model
.
findAll
({
var
pList
=
await
this
.
dao
.
model
.
findAll
({
where
:
{
productOneType_id
:
pProduct
.
id
,
productType_id
:{
[
this
.
db
.
Op
.
ne
]:
0
},
app_id
:
app
.
id
,
status
:
1
},
where
:
{
productOneType_id
:
pProduct
.
id
,
productType_id
:
{
[
this
.
db
.
Op
.
ne
]:
0
},
app_id
:
app
.
id
,
status
:
1
},
attributes
:
[
"id"
,
"app_id"
,
"itemCode"
,
"itemName"
,
"picUrl"
,
"channelItemCode"
,
"channelItemName"
,
attributes
:
[
"id"
,
"app_id"
,
"itemCode"
,
"itemName"
,
"picUrl"
,
"channelItemCode"
,
"channelItemName"
,
"serviceItemCode"
,
"proPrice"
,
"serviceCharge"
,
"publicExpense"
,
"rateConfig"
,
"discountsRateConfig"
,
"serviceItemCode"
,
"proPrice"
,
"serviceCharge"
,
"publicExpense"
,
"rateConfig"
,
"discountsRateConfig"
,
"productLogo"
,
"productDesc"
"productLogo"
,
"productDesc"
],
],
raw
:
true
raw
:
true
});
});
return
system
.
getResultSuccess
(
pList
);
return
system
.
getResultSuccess
(
pList
);
}
}
...
@@ -101,20 +101,20 @@ class AppProductService extends ServiceBase {
...
@@ -101,20 +101,20 @@ class AppProductService extends ServiceBase {
* 根据产品类型码获取产品列表
* 根据产品类型码获取产品列表
* @param {*} obj
* @param {*} obj
*/
*/
async
findByTypeCode
(
obj
){
async
findByTypeCode
(
obj
)
{
var
app
=
obj
.
app
;
var
app
=
obj
.
app
;
if
(
!
app
||
!
app
.
uapp_id
)
{
if
(
!
app
||
!
app
.
uapp_id
)
{
return
system
.
getResultFail
(
-
100
,
"渠道信息有误"
);
return
system
.
getResultFail
(
-
100
,
"渠道信息有误"
);
}
}
obj
[
"uapp_id"
]
=
app
.
uapp_id
;
obj
[
"uapp_id"
]
=
app
.
uapp_id
;
obj
[
"actionType"
]
=
"findByTypeCode"
;
obj
[
"actionType"
]
=
"findByTypeCode"
;
// var typeCode = obj.typeCode;
// var typeCode = obj.typeCode;
// if(!typeCode){
// if(!typeCode){
// return system.getResultFail(-101, "产品类型编码有误");
// return system.getResultFail(-101, "产品类型编码有误");
// }
// }
var
rc
=
system
.
getObject
(
"util.restClient"
);
var
rc
=
system
.
getObject
(
"util.restClient"
);
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
rtn
=
await
rc
.
execPost
(
obj
,
url
);
var
rtn
=
await
rc
.
execPost
(
obj
,
url
);
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
return
result
;
return
result
;
}
}
...
@@ -122,20 +122,20 @@ class AppProductService extends ServiceBase {
...
@@ -122,20 +122,20 @@ class AppProductService extends ServiceBase {
* 根据产品类型码获取产品列表
* 根据产品类型码获取产品列表
* @param {*} obj
* @param {*} obj
*/
*/
async
findByTypeOneCode
(
obj
){
async
findByTypeOneCode
(
obj
)
{
var
app
=
obj
.
app
;
var
app
=
obj
.
app
;
if
(
!
app
||
!
app
.
uapp_id
)
{
if
(
!
app
||
!
app
.
uapp_id
)
{
return
system
.
getResultFail
(
-
100
,
"渠道信息有误"
);
return
system
.
getResultFail
(
-
100
,
"渠道信息有误"
);
}
}
obj
[
"uapp_id"
]
=
app
.
uapp_id
;
obj
[
"uapp_id"
]
=
app
.
uapp_id
;
obj
[
"actionType"
]
=
"findByTypeOneCode"
;
obj
[
"actionType"
]
=
"findByTypeOneCode"
;
// var typeCode = obj.typeCode;
// var typeCode = obj.typeCode;
// if(!typeCode){
// if(!typeCode){
// return system.getResultFail(-101, "产品类型编码有误");
// return system.getResultFail(-101, "产品类型编码有误");
// }
// }
var
rc
=
system
.
getObject
(
"util.restClient"
);
var
rc
=
system
.
getObject
(
"util.restClient"
);
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
rtn
=
await
rc
.
execPost
(
obj
,
url
);
var
rtn
=
await
rc
.
execPost
(
obj
,
url
);
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
return
result
;
return
result
;
}
}
...
@@ -143,16 +143,16 @@ class AppProductService extends ServiceBase {
...
@@ -143,16 +143,16 @@ class AppProductService extends ServiceBase {
* 获取产品详情
* 获取产品详情
* @param {*} obj
* @param {*} obj
*/
*/
async
getProductDetailByCode
(
obj
){
async
getProductDetailByCode
(
obj
)
{
var
app
=
obj
.
app
;
var
app
=
obj
.
app
;
if
(
!
app
||
!
app
.
uapp_id
)
{
if
(
!
app
||
!
app
.
uapp_id
)
{
return
system
.
getResultFail
(
-
100
,
"渠道信息有误"
);
return
system
.
getResultFail
(
-
100
,
"渠道信息有误"
);
}
}
obj
[
"uapp_id"
]
=
app
.
uapp_id
;
obj
[
"uapp_id"
]
=
app
.
uapp_id
;
obj
[
"actionType"
]
=
"getProductDetailByCode"
;
obj
[
"actionType"
]
=
"getProductDetailByCode"
;
var
rc
=
system
.
getObject
(
"util.restClient"
);
var
rc
=
system
.
getObject
(
"util.restClient"
);
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
url
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
rtn
=
await
rc
.
execPost
(
obj
,
url
);
var
rtn
=
await
rc
.
execPost
(
obj
,
url
);
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
return
result
;
return
result
;
}
}
...
...
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